/* ==========================================================================
   gm_digital_delivery — Green Musicians
   1. ligne de livraison des paniers 100 % logiciels
   2. ordre de l'ecran de paiement (uniquement si cette ligne est presente)
   3. harmonisation des fonds gris du recapitulatif (tous les paniers)
   ========================================================================== */

/* --- 1. Ligne de livraison ---------------------------------------------
   N'est plus affichee : on garde la vraie ligne transporteur du module,
   qui porte la coche de selection. Le noeud reste dans le DOM car toutes
   les regles ci-dessous sont conditionnees par body:has(.gmdd-line).      */
.gmdd-line {
  display: none !important;
}
.gmdd-line.gmdd-hidden {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #e6dff0;
  border-radius: 8px;
  background: #fbfafd;
  font-size: 0.95rem;
  font-weight: 700;
  color: #350665;
  line-height: 1.4;
}

/* --- 2. Regles reservees aux paniers 100 % logiciels -------------------
   Tout est conditionne par body:has(.gmdd-line) : sans cette ligne, aucune
   de ces regles ne s'applique, donc paniers mixtes et instruments sont
   strictement inchanges.                                                 */

/* Le radio « Einmalzahlung oder Ratenzahlung » n'offre aucun choix.
   ATTENTION : display:none ne decoche pas — le champ reste soumis.        */
body:has(.gmdd-line) #checkout-payment-step .payment-options .payment-option:only-of-type > .custom-radio,
body:has(.gmdd-line) .wkonepagecheckout .payment-option-title .custom-radio,
body:has(.gmdd-line) .wk-payment-option .custom-radio {
  display: none !important;
}
body:has(.gmdd-line) .wkonepagecheckout .payment-options > .payment-option:only-of-type > label,
body:has(.gmdd-line) #checkout-payment-step .payment-options > .payment-option:only-of-type > label {
  display: none !important;
}

/* Message « Disponible des que vous etes identifie » : masque UNIQUEMENT
   quand un transporteur est reellement selectionnable (.wk-shipping-list).
   Sans transporteur dans le DOM, ce message est la seule information qui
   explique au client qu'il doit s'identifier : le masquer bloquait l'achat
   (« Veuillez choisir un mode de livraison » sans aucun choix possible).   */
body:has(.gmdd-line) .wk-shipping-carriers:has(.wk-shipping-list) .alert-danger {
  display: none !important;
}

/* Bloc « Mode de paiement » vide quand aucun moyen reel n'est proposé */
body:has(.gmdd-line) .wk-payment-method:not(:has(.wk-payment-select)):not(:has(.gm-pay-preview)) {
  display: none !important;
}

/* Ordre : livraison > (paiement masque) > CGV > modes > bouton.
   On ne touche qu'a l'ordre visuel, jamais au DOM soumis.                 */
body:has(.gmdd-line) #checkout-payment-step,
body:has(.gmdd-line) .wkonepagecheckout .checkout-step-content {
  display: flex;
  flex-direction: column;
}
body:has(.gmdd-line) #checkout-payment-step > .gmdd-line,
body:has(.gmdd-line) .wkonepagecheckout .gmdd-line { order: 1; }
body:has(.gmdd-line) #checkout-payment-step > .payment-options,
body:has(.gmdd-line) .wkonepagecheckout .payment-options { order: 2; }
body:has(.gmdd-line) #checkout-payment-step > .conditions-to-approve,
body:has(.gmdd-line) #checkout-payment-step > #conditions-to-approve,
body:has(.gmdd-line) .wkonepagecheckout .conditions-to-approve { order: 3; }
body:has(.gmdd-line) #checkout-payment-step > .payment-methods,
body:has(.gmdd-line) .wkonepagecheckout .payment-methods { order: 4; }
body:has(.gmdd-line) #checkout-payment-step > .place-order,
body:has(.gmdd-line) .wkonepagecheckout .place-order { order: 5; }

/* --- 3. Harmonisation des fonds gris — TOUS les paniers ----------------
   Reference : le bloc « Telechargement » (fond gris clair, texte violet).
   Applique au recapitulatif de commande, quel que soit le contenu.        */
#wk-order-summary-ajax table thead,
#wk-order-summary-ajax table thead th,
#wk-order-summary-ajax table thead td,
.wk-order-total .wk-box,
.wk-order-total .total-highlight,
.wk-order-total .promo-highlighted,
.wk-order-total .block-promo,
.wk-product-total-col {
  color: #350665 !important;
}
.wk-order-total .total-highlight strong,
.wk-order-total .total-highlight .value {
  color: #350665 !important;
  font-weight: 400;
}

/* --- 4. Tout le wording du tunnel en violet (charte GM) -----------------
   Texte violet #350665 sur l'ensemble du recapitulatif, des totaux, du
   mode de livraison et des conditions. Les boutons sont exclus pour ne pas
   casser le contraste blanc sur violet.                                   */
#wk-order-summary-ajax,
#wk-order-summary-ajax p,
#wk-order-summary-ajax span,
#wk-order-summary-ajax div,
#wk-order-summary-ajax td,
#wk-order-summary-ajax th,
#wk-order-summary-ajax a,
.wk-order-total,
.wk-order-total p,
.wk-order-total span,
.wk-order-total div,
.wk-order-total a,
.wk-shipping-carriers,
.wk-shipping-carriers p,
.wk-shipping-carriers span,
.wk-shipping-carriers div,
.conditions-to-approve,
.conditions-to-approve p,
.conditions-to-approve span,
.conditions-to-approve div,
.conditions-to-approve a,
.wk-heading-img h4 {
  color: #350665 !important;
}
/* Les boutons gardent leur propre contraste */
#wk-order-summary-ajax .btn,
.wk-order-total .btn,
.wk-shipping-carriers .btn,
.conditions-to-approve .btn,
.btn-primary,
button.btn {
  color: #ffffff !important;
}

/* --- 5. Tous les fonds gris passent en violet clair ---------------------
   En-tete du tableau, lignes produit, bloc total : meme fond violet tres
   clair partout, pour supprimer le gris neutre du theme.                  */
#wk-order-summary-ajax table thead,
#wk-order-summary-ajax table thead th,
#wk-order-summary-ajax table thead td,
#wk-order-summary-ajax .product-line-grid,
#wk-order-summary-ajax .product-line-grid-body,
#wk-order-summary-ajax .product-line-grid-left,
#wk-order-summary-ajax .wk-order-product,
#wk-order-summary-ajax .wk-cart-items > li,
#wk-order-summary-ajax .wk-product-info,
#wk-order-summary-ajax .cart-item,
#wk-order-summary-ajax .row,
.wk-order-total .wk-box,
.wk-order-total .total-highlight,
.wk-order-total .promo-highlighted,
.wk-order-total .block-promo {
  background-color: #ffffff !important;
}
/* La ligne de livraison de notre module suit la meme teinte */
.gmdd-line {
  background-color: #ffffff !important;
  border-color: #ddd0f0 !important;
}

/* --- 6. Ligne transporteur reelle : sans bulle ------------------------- */
.wk-shipping-carriers .wk-shipping-list,
.wk-shipping-carriers .wk-selected-shipping-42 {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  color: #350665 !important;
  font-weight: 400 !important;
}
.wk-shipping-carriers .wk-shipping-list .carrier-name,
.wk-shipping-carriers .wk-shipping-list .carrier-delay,
.wk-shipping-carriers .wk-shipping-list .carrier-price,
.wk-shipping-carriers .wk-selected-shipping-42 .carrier-name,
.wk-shipping-carriers .wk-selected-shipping-42 .carrier-price {
  color: #350665 !important;
  font-weight: 400;
}
/* ============================================================================
   TUNNEL DE COMMANDE — bloc « mode de paiement »
   ----------------------------------------------------------------------------
   Un seul rendu pour les deux états. Le cadre est porté par un seul élément
   dans chaque état :
     · déconnecté → l'alerte native du module (.alert-danger), qui peint déjà
                    son fond et sa bordure ; on ne la surcharge pas.
     · connecté   → .payment-options, qui existe seul dans cet état.
   Règle absolue : ne JAMAIS déplacer un <input>. Ils portent le clic.
   Seuls les conteneurs et la <div class="gm-radio"> décorative bougent.
   ============================================================================ */

/* --- 1. Cadre du bloc en état connecté ------------------------------------ */
/* .payment-options porte le cadre uniquement quand l'aperçu déconnecté est
   absent — sinon deux cadres se superposent. */
html body .payment-options:not(:has(.gm-pay-preview)) {
  background: #f7f4fb !important;
  border: 1px solid #e2d8f2 !important;
  border-radius: 10px !important;
  padding: 16px 14px !important;
  position: relative !important;
  left: 34px !important;
  width: fit-content !important;
  max-width: 100% !important;
  text-align: center !important;
}
/* en état déconnecté le cadre vient de l'alerte : le conteneur reste nu */
html body .payment-options,
html body .payment-options .col-md-12,
html body .payment-options .wk-payment-method,
html body .payment-options .gm-pay-preview,
html body .wk-payment-method {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
html body .payment-options {
  position: relative !important;
  left: 34px !important;
  width: fit-content !important;
  max-width: 100% !important;
  text-align: center !important;
}

/* --- 2. Aucun descendant ne peint de fond ni de pseudo-élément ------------ */
/* Le thème ajoute un cadenas et des puces ; ils n'appartiennent pas au
   mockup. On neutralise tout, sauf la pastille verte de la coche. */
html body .payment-options *:not(.gm-radio):not(.alert) {
  background-color: transparent !important;
  background-image: none !important;
}
html body .payment-options *:not(.gm-radio)::before,
html body .payment-options *:not(.gm-radio)::after {
  content: none !important;
  display: none !important;
  background-image: none !important;
}
/* l'icône par défaut du module (cadenas) n'apporte rien */
html body .payment-options .wk-custom-payment-icon,
html body .payment-options img[src*="wk-icon-money"],
html body .payment-options i:not(.checkbox-checked) {
  display: none !important;
}

/* --- 3. La coche du paiement : dehors, cochée, au gabarit des autres ------ */
/* 16 px, anneau 2 px, point plein de 6 px — même modèle que les boutons
   radio du thème (livraison, CGV) mais en vert maison. */
html body .payment-options .gm-radio {
  position: absolute !important;
  left: -28px !important;
  top: 16px !important;
  width: 16px !important;
  height: 16px !important;
  border: 2px solid #00c98f !important;
  border-radius: 50% !important;
  background: #fff !important;
  z-index: 10 !important;
}
html body .payment-options .gm-radio::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  width: 6px !important;
  height: 6px !important;
  top: 50% !important;
  left: 50% !important;
  margin: -3px 0 0 -3px !important;
  border-radius: 50% !important;
  background: #00c98f !important;
}

/* --- 4. Le signe de coche des cases PrestaShop : violet, partout ---------- */
/* C'est une icône Material (<i class="material-icons checkbox-checked">),
   sa couleur est portée par `color` — pas par un SVG. */
html body i.material-icons.checkbox-checked,
html body .checkbox-checked {
  color: #350665 !important;
}
/* variante SVG du thème (cases Bootstrap), même teinte */
html body .custom-checkbox .custom-control-input:checked ~ .custom-control-indicator,
html body .custom-radio .custom-control-input:checked ~ .custom-control-indicator {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23350665' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E") !important;
}

/* --- 5. Contenu : logos et libellé alignés sur le premier logo ------------ */
/* La grille Bootstrap du module décale le libellé : on la neutralise. */
html body .payment-options .row {
  margin: 0 !important;
  display: block !important;
}
html body .payment-options [class*="col-"] {
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  max-width: none !important;
  float: none !important;
}
html body .payment-options p:not(.gm-pay-secure) {
  margin: 0 0 12px -94px !important;
  padding: 0 !important;
  text-align: left !important;
}
html body .payment-options .gm-pay-label {
  font-weight: 400 !important;
  text-align: left !important;
}
html body .payment-options p.gm-pay-secure {
  margin: 12px 0 0 0 !important;
  padding: 0 !important;
  text-align: center !important;
}
html body .payment-options .gm-pay-logos {
  background: none !important;
  justify-content: center !important;
  margin: 0 0 10px 0 !important;
  padding: 0 !important;
}

/* ============================================================================
   6. MOBILE (< 768 px) — cadre pleine largeur, coche dans le flux
   ----------------------------------------------------------------------------
   En mobile le cadre restait en `fit-content` (318 px pour une colonne de
   372 px) : il paraissait plus petit que les autres blocs. Il prend toute la
   largeur, et la coche passe DANS le cadre, en flux, à gauche du libellé —
   sinon elle chevauche la bordure (plus d'absolu).
   ========================================================================== */
@media (max-width: 767px) {
  html body .payment-options,
  html body .payment-options:not(:has(.gm-pay-preview)) {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 0 14px 0 !important;
    padding: 16px 14px !important;
    left: 0 !important;
  }
  html body .payment-options .gm-opt {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
  }
  html body .payment-options .gm-radio {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    flex: 0 0 16px !important;
    margin: 0 !important;
  }
  html body .payment-options img {
    max-height: 22px !important;
    width: auto !important;
  }
}

/* ============================================================================
   7. COCHE « LICENCE ENVOYÉE IMMÉDIATEMENT PAR EMAIL » (panier 100 % logiciels)
   ----------------------------------------------------------------------------
   Ce bloc est écrit à la main dans wkshippingmethod.tpl : l'<input> natif n'est
   stylé par personne (radio navigateur bleu, 13 px) et la <span class="gm-radio">
   voisine a une largeur nulle. On redessine donc l'<input> lui-même — jamais
   déplacé, il porte le clic.
   ⚠️ Portée limitée à .wk-shipping-list : le bloc paiement (.gm-pay-preview)
   utilise la MÊME structure .gm-opt > .gm-radio + input ; sans ce scope la
   coche du paiement passe en display:none.
   ============================================================================ */
html body .wk-shipping-list .gm-opt {
  display: flex !important;
  align-items: flex-start !important;
  gap: 9px !important;
}
html body .wk-shipping-list .gm-opt input.wk_selected_shipping[type="radio"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  flex: 0 0 16px !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  margin: 3px 0 0 0 !important;
  padding: 0 !important;
  border: 2px solid #00c98f !important;
  border-radius: 50% !important;
  background-color: #fff !important;
  background-image: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
}
html body .wk-shipping-list .gm-opt input.wk_selected_shipping[type="radio"]:checked {
  background-image: radial-gradient(circle at 50% 50%, #00c98f 0 3px, #fff 3.5px) !important;
}
html body .wk-shipping-list .gm-opt input.wk_selected_shipping[type="radio"]:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(0, 201, 143, 0.25) !important;
}
/* la pastille span du même bloc reste vide : on la neutralise */
html body .wk-shipping-list .gm-opt .gm-radio.gm-radio--on {
  display: none !important;
}

/* Alignement : le tpl décale son bloc de 48 px en dur (style inline) ; on le
   ramène sur la colonne des coches paiement / CGV (x = 469 desktop, 33 mobile). */
html body .wk-shipping-list[style*="translateX(48px)"] {
  transform: translateX(20px) !important;
}
@media (max-width: 767px) {
  /* le décalage de 24 px poussait le bloc 15 px hors de l'écran (source de
     dézoom iOS) : on retire la largeur correspondante. */
  html body .wk-shipping-list[style*="translateX(48px)"] {
    transform: translateX(24px) !important;
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
  }
}

/* ============================================================================
   8. ADRESSE DU TUNNEL EN MOBILE — colonnes réellement pleine largeur
   ----------------------------------------------------------------------------
   Sous 992 px les deux colonnes du tunnel empilent mais gardent une largeur
   calculée : la colonne d'adresse mesurait 380 px pour un conteneur de 412 px
   -> champs et mention TVA n'arrivaient pas au bord droit. On force 100 % : les
   champs occupent toute la largeur et la mention « Vous êtes un professionnel ? »
   (déjà text-align:center) se centre dessous.
   ========================================================================== */
@media (max-width: 991px) {
  html body #wk-one-page-checkout .row > .col-lg-4,
  html body #wk-one-page-checkout .row > .col-lg-8,
  html body #wk-one-page-checkout .col-md-12 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
}

/* GM-WIRE-20261113 — option virement bancaire : fermee par defaut, ouverte a la selection */
#ps_wirepayment-additional-information{display:none}
.gm-wire-info{margin:8px 0 2px;padding:12px 14px;border:1px solid #e3d9f2;border-left:3px solid #350665;border-radius:10px;background:#faf8fd}
.gm-wire-info .gm-wire-lead{margin:0 0 8px;font-size:12.5px;line-height:1.45;color:#3a3742}
.gm-wire-info .gm-wire-badge{display:inline-block;margin-right:6px;padding:2px 8px;border-radius:20px;background:#350665;color:#fff;font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.03em;vertical-align:1px}
.gm-wire-info .gm-wire-steps{margin:0 0 8px;padding:0;list-style:none;counter-reset:gw}
.gm-wire-info .gm-wire-steps li{position:relative;padding-left:24px;margin:0 0 5px;font-size:12.5px;line-height:1.4;color:#3a3742}
.gm-wire-info .gm-wire-steps li:before{counter-increment:gw;content:counter(gw);position:absolute;left:0;top:1px;width:17px;height:17px;border-radius:50%;background:#350665;color:#fff;font-size:10.5px;line-height:17px;text-align:center;font-weight:600}
.gm-wire-info .gm-wire-note{margin:0;font-size:11.5px;color:#6b6478}
