/* =========================================
   CHECKOUT PREMIUM V31 : COUPON DANS LE FLUX + HEADER CORRIGÉ
   ========================================= */

/* --- Animations globales checkout --- */
@keyframes shimmer { 0% { left: -100%; } 100% { left: 100%; } }

/* --- 0. RESET & STRUCTURE --- */
body.woocommerce-checkout #content,
body.single-product #content,
body.single-product .entry-content {
    max-width: 100% !important; margin: 0 !important; padding: 0 !important; width: 100% !important; overflow-x: clip;
}
.checkout-ui-wrapper * { box-sizing: border-box !important; }

/* --- 1. ANIMATIONS --- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- 2. WRAPPER PRINCIPAL --- */
.checkout-ui-wrapper {
    background: #F8FAFC; 
    min-height: 100vh; 
    font-family: 'Outfit', sans-serif;
    width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw;
    display: none; opacity: 0; transition: opacity 0.5s ease;
    padding-bottom: 80px; z-index: 40;
}
.checkout-ui-wrapper.active { display: block; opacity: 1; }

/* À modifier/ajouter vers la ligne 25 de votre CSS */
.checkout-container-pro {  max-width: 1600px !important; /* Augmenté de 1100px à 1600px */ width: 85% !important; 
    margin: 0 auto;  padding: 0 20px; position: relative; }


/* --- 3. HEADER (Basé sur votre HTML PHP) --- */
.checkout-header-clean {
    background: #0F172A; padding: 40px 20px 80px; text-align: center; margin-bottom: -50px;
}
/* Suppression du doublon CSS précédent */
.checkout-header-clean::before { display: none !important; }

/* Style du badge HTML existant */
.secure-pill {
    display: inline-block;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.9rem; font-weight: 700;
    border: 1px solid rgba(74, 222, 128, 0.3);
    margin-bottom: 15px;
    animation: fadeInUp 0.8s ease forwards;
}
.checkout-header-clean h1 { 
    font-family: 'Space Grotesk', sans-serif; font-size: 2.2rem; font-weight: 700; margin: 0; color: white;
}


/* --- 4. GRILLE (50/50 + STICKY) - VERSION LARGE & GAP CORRIGÉ --- */
@media (min-width: 992px) {
    form.woocommerce-checkout {
        display: grid !important; 
        grid-template-columns: 1fr 1fr !important; 
        
        /* CORRECTION GAP : Uniquement entre les colonnes, pas en hauteur */
        column-gap: 30px !important; 
        row-gap: 0 !important; 
        
        align-items: start; 
        grid-auto-flow: row dense;
    }

    /* Fix Stripe / Erreurs : Prennent toute la largeur au dessus */
    form.woocommerce-checkout > * {
        grid-column: 1 / -1 !important;
        width: 100%;
    }
    
    /* COLONNE GAUCHE : Coordonnées */
    #customer_details {
        grid-column: 1 !important; 
        grid-row: 20; 
        position: sticky !important; top: var(--checkout-sticky-top, 30px); align-self: start;
        background: #fff; padding: 35px; border-radius: 16px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); border: 1px solid #E2E8F0;
        display: flex !important; flex-direction: column; width: 100% !important;
        z-index: 10;
        margin-top: 0 !important; /* Sécurité anti-décalage */
    }

    /* COLONNE DROITE : Paiement */
    #order_review, #order_review_heading {
        grid-column: 2 !important; 
        grid-row: 20;
        position: sticky !important; top: var(--checkout-sticky-top, 30px); align-self: start;
        background: #fff; padding: 35px; border-radius: 16px;
        box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05); 
        border: 1px solid #E2E8F0;
        z-index: 10;
        margin-top: 0 !important;
    }
    
    /* FIX STRIPE SPECIFIQUE : Remonte tout en haut */
    #wc-stripe-payment-request-wrapper,
    #wc-stripe-payment-request-button-separator {
        grid-column: 1 / -1 !important;
        margin-bottom: 20px; /* Petit espace sous le bouton Stripe seulement */
        order: -10;
    }
}

/* Express checkout intégré au bloc Paiement (wrapper neutralisé) */
#order_review #payment > .wcpay-express-checkout-wrapper { display: block; width: 100%; margin: 0 0 12px !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-sizing: border-box; }
#order_review #payment > .wcpay-express-checkout-wrapper > #wc-stripe-payment-request-wrapper { display: block; width: 100% !important; margin: 0 !important; padding: 10px; border: 1px solid #E2E8F0; border-radius: 12px; background: #F8FAFC; box-sizing: border-box; }
#order_review #payment > .wcpay-express-checkout-wrapper > #wc-stripe-payment-request-wrapper #wc-stripe-payment-request-button,
#order_review #payment > .wcpay-express-checkout-wrapper > #wc-stripe-payment-request-wrapper .payment-request-button,
#order_review #payment > .wcpay-express-checkout-wrapper > #wc-stripe-payment-request-wrapper button { min-height: 48px; }
#order_review #payment > .wcpay-express-checkout-wrapper #wc-stripe-payment-request-button-separator,
#order_review #payment > .wcpay-express-checkout-wrapper #wcpay-express-checkout-button-separator { display: none !important; }

/* Masquer le placeholder "gros logo Google" qui reste visible trop longtemps */
.publicard-gpay-placeholder { display: none !important; }

/* Express checkout (ECE) : skeleton shimmer pendant le chargement,
   puis révélation du vrai bouton quand JS ajoute .gpay-ready. */
@keyframes gpay-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.wcpay-express-checkout-wrapper {
    position: relative;
    min-height: 58px;
    transition: min-height .3s ease;
}

/* Skeleton : visible tant que .gpay-ready n'est pas posé */
.wcpay-express-checkout-wrapper:not(.gpay-ready)::before {
    content: "";
    display: block;
    width: 100%;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
    background-size: 200% 100%;
    animation: gpay-shimmer 1.5s ease-in-out infinite;
}

/* Cacher le contenu réel tant que l'iframe n'est pas prêt */
.wcpay-express-checkout-wrapper:not(.gpay-ready) > * {
    opacity: 0;
    height: 0;
    overflow: hidden;
    position: absolute;
}

/* Révélation : le skeleton disparaît, le vrai bouton apparaît en fondu */
.wcpay-express-checkout-wrapper.gpay-ready::before {
    display: none;
}
.wcpay-express-checkout-wrapper.gpay-ready > * {
    opacity: 1;
    height: auto;
    overflow: visible;
    position: static;
    transition: opacity .3s ease;
}

/* Invité: express checkout wrapper — curseur interdit */
body:not(.logged-in) #order_review #payment > .wcpay-express-checkout-wrapper { position: relative; }


/* --- 5. GESTION DES COUPONS (CORRECTION) --- */

/* 1. On cache la barre de notification "WooCommerce Message" tout en haut */
/* C'est souvent celle-ci qui est le "mauvais doublon" hors du flux */
.woocommerce-error, .woocommerce-message { margin-bottom: 20px !important; }
/* Si le coupon du haut est dans une div spécifique 'woocommerce-form-coupon-toggle' AVANT le form */
/* On essaie de cibler spécifiquement celle qui est hors du flux si possible, 
   mais souvent il n'y a qu'une classe.
   ICI : On part du principe que vous voulez voir le formulaire. */

.woocommerce-form-coupon-toggle {
    display: block !important; /* On affiche le lien */
    margin-bottom: 20px; 
    width: 100%;
    order: -1; /* Essayer de le remonter si flex */
}

/* Style du lien "Avez-vous un code promo ?" pour qu'il soit discret dans le flux */
.woocommerce-form-coupon-toggle .woocommerce-info {
    background: transparent !important; 
    border: none !important; padding: 0 !important;
    color: #64748B !important; font-size: 0.9rem;
    box-shadow: none !important;
    text-align: left;
}
.woocommerce-form-coupon-toggle .woocommerce-info::before { display: none !important; }
.woocommerce-form-coupon-toggle .woocommerce-info a {
    color: #64748B; text-decoration: underline; font-weight: 600; margin-left: 5px;
}
.woocommerce-form-coupon-toggle .woocommerce-info a:hover { color: #0F172A; }

/* Style du formulaire coupon quand il est ouvert */
form.checkout_coupon {
    background: #F8FAFC !important; border: 1px dashed #CBD5E1 !important; 
    padding: 15px !important; margin-bottom: 25px; border-radius: 8px;
    width: 100% !important;
    animation: fadeInUp 0.3s ease;
}

/* Bouton "Appliquer le code promo" : contraste renforcé */
form.checkout_coupon .form-row-last {
    margin-bottom: 0 !important;
}
form.checkout_coupon .form-row-last .button,
form.checkout_coupon button[name="apply_coupon"] {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #000000;
    background-color: #000000 !important;
    background-image: linear-gradient(90deg, #FFFFFF 0%, #FFFFFF 100%) !important;
    background-repeat: no-repeat !important;
    background-size: 0% 100% !important;
    background-position: left top !important;
    color: #FFFFFF !important;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: none !important;
    transform: none !important;
    transition: background-size 0.28s ease, border-color 0.22s ease, color 0.22s ease;
}
form.checkout_coupon .form-row-last .button:hover,
form.checkout_coupon button[name="apply_coupon"]:hover {
    background-size: 100% 100% !important;
    border-color: #000000 !important;
    color: #000000 !important;
    box-shadow: none !important;
    transform: none !important;
}
form.checkout_coupon .form-row-last .button:active,
form.checkout_coupon button[name="apply_coupon"]:active {
    background-color: #E2E8F0 !important;
    background-image: linear-gradient(90deg, #E2E8F0 0%, #E2E8F0 100%) !important;
    background-size: 100% 100% !important;
    border-color: #000000 !important;
    color: #000000 !important;
}
form.checkout_coupon .form-row-last .button:focus-visible,
form.checkout_coupon button[name="apply_coupon"]:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* style-checkout.css */

/* 1. On s'assure que le wrapper du login est visible et bien placé */
.woocommerce-form-login-toggle {
    display: block !important;
    margin-bottom: 10px; 
    width: 100%;
}

/* 2. On applique le style "texte visible" (MODIFIÉ : Plus grand + Bleu) */
.woocommerce-form-login-toggle .woocommerce-info,
.woocommerce-form-coupon-toggle .woocommerce-info {
    background: transparent !important; 
    border: none !important; 
    padding: 0 !important;
    color: #334155 !important; /* Texte gris foncé (plus lisible) */
    font-size: 1.1rem !important; /* TAILLE AUGMENTÉE (avant 0.9rem) */
    box-shadow: none !important;
    text-align: left;
    margin-bottom: 10px !important;
    font-weight: 500;
}

/* On cache l'icône par défaut avant le texte */
.woocommerce-form-login-toggle .woocommerce-info::before,
.woocommerce-form-coupon-toggle .woocommerce-info::before { 
    display: none !important; 
}

/* Style du lien "Cliquez ici" -> EN BLEU */
.woocommerce-form-login-toggle .woocommerce-info a,
.woocommerce-form-coupon-toggle .woocommerce-info a {
    color: #2563EB !important; /* BLEU ROI VIF */
    text-decoration: underline; 
    font-weight: 700; 
    margin-left: 5px;
    font-size: 1.1rem; /* Même taille que le texte */
}

.woocommerce-form-login-toggle .woocommerce-info a:hover,
.woocommerce-form-coupon-toggle .woocommerce-info a:hover { 
    color: #1D4ED8 !important; /* Bleu plus foncé au survol */
    text-decoration: none;
}

/* 3. Style du formulaire de connexion quand il est ouvert */
form.woocommerce-form-login {
    background: #F8FAFC !important; 
    border: 1px dashed #CBD5E1 !important; 
    padding: 20px !important; 
    margin-bottom: 25px; 
    border-radius: 8px;
    width: 100% !important;
    animation: fadeInUp 0.3s ease;
}




/* --- 6. INPUTS & STRUCTURE --- */
.woocommerce-checkout .col2-set, .woocommerce-checkout .col2-set .col-1 { 
    width: 100% !important; float: none !important; max-width: 100% !important; flex: 0 0 100% !important; display: block !important;
}
.woocommerce-checkout .col2-set .col-2 { display: none !important; }
.woocommerce-billing-fields__field-wrapper { width: 100% !important; }

#customer_details > h3, #order_review_heading, .woocommerce-billing-fields > h3 { display: none !important; }
#customer_details::before {
    content: var(--cd_checkout_customer_title); display: block; font-size: 1.4rem; font-weight: 700; color: #0F172A;
    margin-bottom: 20px; border-bottom: 2px solid #F1F5F9; padding-bottom: 15px;
}
.publicard-checkout-auth-status { margin: 0 0 18px; font-size: 1.075rem; font-weight: 600; color: #64748B; }
.publicard-checkout-auth-status.is-connected { color: #0F766E; }

/* --- MASQUER LES CHAMPS PAR DÉFAUT (LOGIQUE ACCORDÉON) --- */


/* --- LOGIQUE ACCORDÉON (CORRECTIF) --- */

/* 1. On cache TOUS les champs de saisie par défaut */
.woocommerce-billing-fields__field-wrapper,
.woocommerce-account-fields, /* Cache la zone mot de passe */
.create-account {            /* Cache le wrapper compte */
    display: none;
}

/* 2. SÉCURITÉ : Si une erreur survient, on force l'affichage de tout */
.woocommerce-checkout.woocommerce-page .woocommerce-error ~ form .woocommerce-billing-fields__field-wrapper,
.woocommerce-checkout.woocommerce-page .woocommerce-error ~ form .woocommerce-account-fields,
.woocommerce-checkout.woocommerce-page .woocommerce-error ~ form .create-account {
    display: block !important;
}

/* 3. Style du lien "Vous êtes nouveau" (MODIFIÉ : Plus grand + Bleu) */
.toggle-new-customer {
    display: block !important; 
    background: transparent;
    border: none;
    padding: 15px 0; 
    color: #334155; /* Texte gris foncé */
    font-size: 1.1rem; /* TAILLE AUGMENTÉE */
    cursor: pointer;
    width: 100%;
    text-align: left;
    position: relative;
    z-index: 10;
    font-weight: 500;
}

.toggle-new-customer span {
    color: #2563EB; /* BLEU ROI VIF */
    text-decoration: underline;
    font-weight: 700;
    margin-left: 5px;
}

.toggle-new-customer span:hover {
    color: #1D4ED8; /* Bleu plus foncé au survol */
    text-decoration: none;
}


#order_review::before {
    content: var(--cd_checkout_order_title); display: block; font-size: 1.4rem; font-weight: 700; color: #0F172A;
    margin-bottom: 20px; border-bottom: 2px solid #F1F5F9; padding-bottom: 15px;
}

.form-row { width: 100% !important; margin-bottom: 15px; position: relative; display: block; }
.form-row label { font-weight: 600; color: #334155; margin-bottom: 5px; display: block; font-size: 0.85rem; }

.woocommerce-checkout input.input-text, .woocommerce-checkout select {
    background-color: #F8FAFC !important; border: 1px solid #CBD5E1 !important; border-radius: 8px !important;
    height: 50px !important; padding: 0 15px 0 45px !important; font-size: 0.95rem !important; color: #0F172A !important;
    width: 100% !important; outline: none !important; transition: all 0.2s ease !important;
}
.woocommerce-checkout input.input-text:focus {
    background-color: #fff !important; border-color: #0F172A !important; box-shadow: none !important; outline: 2px solid rgba(15, 23, 42, 0.45) !important; outline-offset: 2px !important;
}

/* FIX PRÉNOM / NOM */
#billing_first_name_field, #billing_last_name_field {
    width: 48% !important; display: inline-block !important; vertical-align: top; margin-right: 0 !important;
}
#billing_first_name_field { float: left !important; margin-right: 2% !important; }
#billing_last_name_field { float: right !important; }
#billing_last_name_field::after { content: ""; display: table; clear: both; }

/* Icônes Inputs */
.form-row::before {
    font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; left: 16px; top: 42px; 
    font-size: 1rem; color: #94A3B8; z-index: 5; pointer-events: none;
}
#billing_first_name_field::before, #billing_last_name_field::before { content: "\f007"; } 
#billing_email_field::before { content: "\f0e0"; } 
#billing_phone_field::before { content: "\f095"; }
#billing_address_1_field::before { content: "\f3c5"; }
#billing_postcode_field::before { content: "\f1ad"; }
#billing_city_field::before { content: "\f64f"; }

@media (max-width: 991px) {
    body.woocommerce-checkout #billing_phone_field {
        display: none !important;
    }
}


/* --- 7. TABLEAU & PAIEMENT (DESIGN SAAS PREMIUM) --- */

/* Reset du tableau récapitulatif */
table.shop_table { border: none !important; width: 100%; margin-bottom: 25px; border-collapse: separate; border-spacing: 0; }
table.shop_table td { border-bottom: 1px solid #F1F5F9 !important; padding: 15px 0 !important; font-size: 0.95rem; color: #64748B; }
table.shop_table th { border-bottom: 1px solid #F1F5F9 !important; padding: 15px 0 !important; font-size: 0.95rem; color: #0F172A; font-weight: 600; }
tr.order-total td, tr.order-total th { border-bottom: none !important; font-size: 1.2rem; font-weight: 800; color: #0F172A; padding-top: 20px !important; }

/* Conteneur Paiement */
#payment { background: transparent !important; margin-top: 10px; }
#payment ul.payment_methods { padding: 0 !important; list-style: none !important; margin: 0 !important; display: flex; flex-direction: column; gap: 12px; }

.publicard-payment-terms {
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    color: #334155;
}
.publicard-payment-terms strong {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0F172A;
    font-size: 0.95rem;
    margin-bottom: 8px;
}
.publicard-payment-terms strong i {
    color: #047857;
}
.publicard-payment-terms ul {
    margin: 0;
    padding-left: 18px;
}
.publicard-payment-terms li {
    margin: 4px 0;
    font-size: 0.86rem;
    line-height: 1.35;
}
.publicard-payment-terms-link {
    display: inline-flex;
    margin-top: 10px;
    color: #0F172A;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.publicard-payment-terms-link:hover {
    color: #047857;
}

/* 1. Carte de méthode de paiement (L'élément <li>) */
#payment li.wc_payment_method {
    background: #fff;
    border: 1px solid #D8E1EC;
    padding: 16px 18px;
    margin-bottom: 0;
    border-radius: 16px;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background-color .2s ease;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
}

/* État Survol */
#payment li.wc_payment_method:hover {
    border-color: #BAC8DB;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
}

/* État SÉLECTIONNÉ (La méthode active) */
#payment li.wc_payment_method.payment_method_selected, /* Compatibilité standard */
#payment li.wc_payment_method:has(input:checked) {    /* Modern browsers */
    border-color: #B7C8DE;
    background-color: #fff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
    z-index: 2;
}

/* 2. Le Label (Nom de la méthode : Carte bancaire, PayPal...) */
#payment li label {
    margin-bottom: 0 !important; 
    flex: 1; 
    font-weight: 600;
    color: #334155;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pousse les icônes à droite si besoin */
}

/* Bouton Radio Custom (Accentué) */
#payment li input[type="radio"] {
    margin-right: 13px;
    accent-color: #0F172A;
    transform: scale(1.1);
    cursor: pointer;
}

/* Icônes devant les labels (FontAwesome) */
#payment li label::before { 
    font-family: "Font Awesome 6 Free"; font-weight: 900; 
    font-size: 1.08rem; margin-right: 11px; width: 24px; text-align: center;
    color: #94A3B8; transition: color 0.2s;
}

/* Icônes Spécifiques */
#payment li.payment_method_stripe label::before, 
#payment li.payment_method_cc label::before { content: "\f09d"; } /* Carte */
#payment li.payment_method_paypal label::before { content: "\f1ed"; color: #003087; } /* PayPal (Bleu officiel) */
#payment li.payment_method_bacs label::before { content: "\f19c"; } /* Virement */

/* Changement couleur icône si sélectionné */
#payment li.wc_payment_method:has(input:checked) label::before { color: #0F172A; }


/* 3. La Boîte de Description / Formulaire Stripe (.payment_box) */
#payment li .payment_box {
    width: 100% !important;
    flex-basis: 100% !important;
    margin-top: 12px;
    padding: 0 !important;
    border-top: 0 !important;
    background: transparent !important;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #64748B;
    position: relative;
}

#payment li.payment_method_woocommerce_payments .payment_box::before { content: none !important; }
#payment .payment_method_woocommerce_payments .wcpay-upe-form { width: 100%; padding: 12px; border: 1px solid #DFE7F1; border-radius: 14px; background: #F8FAFC; box-shadow: inset 0 1px 0 rgba(255,255,255,0.95); }
#payment .payment_method_woocommerce_payments .wcpay-upe-form .wc-payment-form { padding: 0 !important; margin: 0 !important; border: 0 !important; background: transparent !important; }
#payment .payment_method_woocommerce_payments .wcpay-upe-element { padding: 0 !important; margin: 0 !important; width: 100% !important; }
#payment .payment_method_woocommerce_payments .wcpay-upe-element.StripeElement { display: block !important; width: 100% !important; min-height: 160px !important; padding: 12px !important; border: 1px solid #C8D4E2 !important; border-radius: 12px !important; background: #fff !important; box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; transition: border-color .2s ease, box-shadow .2s ease; }
#payment .payment_method_woocommerce_payments .wcpay-upe-element.StripeElement--focus { border-color: #0F172A !important; box-shadow: none !important; outline: 2px solid rgba(15, 23, 42, 0.45) !important; outline-offset: 2px !important; }
#payment .payment_method_woocommerce_payments .wcpay-upe-element iframe { border-radius: 12px; }
#payment .payment_method_woocommerce_payments .payment-methods--logos img { height: 24px !important; max-height: 24px !important; border: 1px solid #D7E1EE; border-radius: 6px; padding: 2px 4px; background: #fff; }
#payment .payment_method_woocommerce_payments .payment-methods--logos-count { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 24px; border-radius: 7px; border: 1px solid #D7E1EE; background: #fff; color: #334155; font-size: 13px; font-weight: 700; }
#payment .payment_method_woocommerce_payments .woocommerce-SavedPaymentMethods-saveNew { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0 !important; padding: 10px 12px; border: 1px solid #E2E8F0; border-radius: 12px; background: #fff; }
#payment .payment_method_woocommerce_payments .woocommerce-SavedPaymentMethods-saveNew input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: #0F172A; flex: 0 0 18px; }
#payment .payment_method_woocommerce_payments .woocommerce-SavedPaymentMethods-saveNew label { display: block !important; margin: 0 !important; color: #334155; font-size: .98rem; font-weight: 600; line-height: 1.45; cursor: pointer; }
#payment .payment_method_woocommerce_payments .woocommerce-SavedPaymentMethods-saveNew label::before { content: none !important; }
#payment li.payment_method_paypal { background: #fff; border-color: #DCE4EF; }
#payment li.payment_method_paypal .payment_box { margin-top: 10px; }

@media (max-width: 767px) {
    #payment ul.payment_methods { gap: 10px; }
    #payment li.wc_payment_method { padding: 14px; border-radius: 13px; }
    #payment li label { font-size: 1rem; }
    #payment .payment_method_woocommerce_payments .wcpay-upe-form { padding: 10px; border-radius: 13px; }
    #payment .payment_method_woocommerce_payments .wcpay-upe-element.StripeElement { min-height: 148px !important; padding: 10px !important; border-radius: 11px !important; }
    #payment .payment_method_woocommerce_payments .woocommerce-SavedPaymentMethods-saveNew { padding: 9px 10px; border-radius: 11px; }
    #payment .payment_method_woocommerce_payments .woocommerce-SavedPaymentMethods-saveNew label { font-size: .94rem; }
}

/* 4. Boutons principaux funnel : style unifié sans effet 3D */
#place_order,
#btn-add-fix.btn-shimmer-effect {
    width: 100%;
    min-height: 56px;
    padding: 16px 22px;
    border-radius: 12px;
    border: 1px solid #000000;
    background-color: #000000 !important;
    background-image: linear-gradient(90deg, #FFFFFF 0%, #FFFFFF 100%) !important;
    background-repeat: no-repeat !important;
    background-size: 0% 100% !important;
    background-position: left top !important;
    color: #fff !important;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: none !important;
    transform: none !important;
    transition: background-size 0.3s ease, border-color 0.3s ease, color 0.2s ease, opacity 0.2s ease;
}

#place_order {
    margin-top: 25px;
}

#btn-add-fix.btn-shimmer-effect {
    margin-top: 0;
}

#place_order:hover,
#btn-add-fix.btn-shimmer-effect:hover {
    background-size: 100% 100% !important;
    border-color: #000000;
    color: #000000 !important;
    box-shadow: none !important;
    transform: none !important;
}

#place_order:active,
#btn-add-fix.btn-shimmer-effect:active {
    background-color: #E2E8F0 !important;
    background-image: linear-gradient(90deg, #E2E8F0 0%, #E2E8F0 100%) !important;
    background-size: 100% 100% !important;
    border-color: #000000;
    color: #000000 !important;
    box-shadow: none !important;
    transform: none !important;
}

#place_order:focus-visible,
#btn-add-fix.btn-shimmer-effect:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

#place_order::before,
#place_order::after {
    content: none !important;
    display: none !important;
}

/* Désactive l'ancien shimmer du bouton produit pour garder un style sobre */
#btn-add-fix .shimmer-line {
    display: none !important;
}

/* Mentions légales sous le bouton */
.woocommerce-privacy-policy-text {
    font-size: 0.8rem; color: #94A3B8; margin-top: 15px; text-align: center; line-height: 1.4;
}
.woocommerce-privacy-policy-text a { color: #64748B; text-decoration: underline; }


/* --- 8. MOBILE - FIX Z-INDEX & SUPERPOSITION --- */
@media (max-width: 991px) {
    
    /* 1. Header mobile sans chevauchement avec le contenu */
    .checkout-header-clean { 
        position: relative !important;
        z-index: 1 !important; 
        padding-bottom: 24px !important;
        margin-bottom: 0 !important;
    }
    
    form.woocommerce-checkout { 
        display: flex; 
        flex-direction: column; 
        gap: 20px; 
    }
    
    /* 2. Colonne coordonnées */
    #customer_details { 
        order: 1; 
        width: 100% !important; 
        padding: 25px 20px; 
        background: #fff !important; /* Fond blanc opaque obligatoire */
        border-radius: 12px;
        
        position: relative !important; 
        z-index: 10 !important;
        margin-top: 0 !important;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    }
    
    #order_review { 
        order: 2; 
        width: 100% !important; 
        padding: 25px 20px; 
        position: relative !important; 
        z-index: 10 !important; 
    }

    /* Ajustement des inputs Prénom/Nom en pleine largeur mobile */
    #billing_first_name_field, #billing_last_name_field { 
        width: 100% !important; 
        float: none !important; 
    }

    /* --- CORRECTION LARGEUR MOBILE --- */
    
    /* 1. On force le conteneur principal à prendre toute la largeur (au lieu de 85%) */
    .checkout-container-pro {
        width: 100% !important;
        padding: 0 10px !important; /* Marge externe très fine */
    }

    /* 2. On réduit légèrement le padding interne des boîtes blanches pour gagner de la place */
    #customer_details, #order_review {
        padding: 25px 15px !important; /* 15px sur les côtés au lieu de 20px ou 35px */
    }
    
    /* 3. (Optionnel) Ajustement des inputs pour qu'ils aillent bien jusqu'au bord */
    .form-row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* --- 9. STYLE DES BADGES GARANTIE (SIDEBAR) --- */

.sidebar-guarantee-box {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #F1F5F9; /* Séparateur discret */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.guarantee-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: #F8FAFC; /* Fond gris très clair */
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: all 0.2s ease;
}

/* Effet au survol (optionnel mais sympa) */
.guarantee-item:hover {
    background: #fff;
    border-color: #CBD5E1;
    box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Style des icônes */
.g-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

/* Couleurs spécifiques pour chaque icône */
.g-icon.icon-shield {
    background: rgba(34, 197, 94, 0.1); /* Fond vert transparent */
    color: #16a34a; /* Vert */
}

.g-icon.icon-bolt {
    background: rgba(234, 179, 8, 0.1); /* Fond jaune transparent */
    color: #ca8a04; /* Jaune/Or */
}

.g-icon.icon-infinity {
    background: rgba(4, 120, 87, 0.1);
    color: #047857;
}

/* Style du texte */
.g-text {
    display: flex;
    flex-direction: column;
}

.g-text strong {
    font-size: 0.95rem;
    color: #0F172A; /* Votre couleur sombre principale */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2px;
}

.g-text span {
    font-size: 0.85rem;
    color: #64748B; /* Gris texte secondaire */
}

/* --- FIX SCROLL HORIZONTAL --- */
html, body {
    overflow-x: clip !important; /* <--- SEULE MODIFICATION ICI (hidden -> clip) pour le sticky */
    max-width: 100% !important;
}

/* =========================================
   10. STYLE DU BADGE SÉCURITÉ (SOUS BOUTON)
   ========================================= */

/* Conteneur global sous le bouton */
/* Conteneur global sous le bouton */
.trust-badge-container {
    margin-top: 30px; /* <--- C'est ici que j'ai ajouté plus d'espace */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Ligne 1 : Le message "Transaction cryptée..." */
.secure-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #F0FDF4; /* Fond vert très pâle (rassurant) */
    border: 1px solid #BBF7D0; /* Bordure verte subtile */
    color: #166534;            /* Texte vert foncé lisible */
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    width: 100%;
    font-weight: 600;
    transition: all 0.3s ease;
}

.secure-line i {
    color: #16A34A; /* Vert vif pour le cadenas */
    font-size: 1rem;
}

/* Ligne 2 : Les icônes de cartes (Visa, MC, Amex...) */
.cards-line {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    font-size: 26px; /* Taille des logos */
    color: #94A3B8;  /* Gris neutre pro */
}

/* Petit effet au survol des cartes (optionnel) */
.cards-line i:hover {
    color: #475569;
}


/* =========================================
   FIX ANTI-DECALAGE CHECKOUT (PATCH)
   Force les erreurs à prendre toute la largeur
   pour ne pas casser la grille 50/50
   ========================================= */

form.woocommerce-checkout > .woocommerce-NoticeGroup,
form.woocommerce-checkout > .woocommerce-error,
form.woocommerce-checkout > .woocommerce-message {
    grid-column: 1 / -1 !important; /* Prend toute la largeur (gauche + droite) */
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 0 !important; /* On laisse le gap de la grille gérer l'espace */
    order: -1; /* S'assure qu'il reste tout en haut */
}

/* Ajustement visuel spécifique pour la boîte d'erreur */
form.woocommerce-checkout .woocommerce-error {
    margin-top: 0 !important;
}

/* --- 1. CACHER L'ERREUR DANS LE FLUX (Règle le problème de grille) --- */
form.woocommerce-checkout .woocommerce-NoticeGroup,
form.woocommerce-checkout .woocommerce-error,
form.woocommerce-checkout .woocommerce-message {
    display: none !important; /* On le cache visuellement, mais le JS pourra lire le texte */
}

/* --- 2. STYLE DE LA POPUP D'ERREUR --- */
body .checkout-error-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

body .checkout-error-modal.active {
    opacity: 1; visibility: visible;
}

body .checkout-error-modal .error-modal-content {
    background: #fff;
    width: 90%; max-width: 450px;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    text-align: center;
    transform: translateY(20px); transition: transform 0.3s ease;
    border-top: 5px solid #EF4444;
}

body .checkout-error-modal.active .error-modal-content {
    transform: translateY(0);
}

body .checkout-error-modal .error-modal-icon {
    font-size: 3rem; color: #EF4444; margin-bottom: 15px;
}

body .checkout-error-modal .error-modal-title {
    font-size: 1.25rem; font-weight: 700; color: #0F172A; margin-bottom: 10px;
    font-family: 'Space Grotesk', sans-serif;
}

body .checkout-error-modal .error-modal-body {
    font-size: 0.95rem; color: #64748B; margin-bottom: 25px; line-height: 1.5;
}
.error-modal-body ul { list-style: none; padding: 0; margin: 0; }
.checkout-login-required-msg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.checkout-login-required-msg p { margin: 0; font-weight: 600; color: #1E293B; }
.checkout-login-info { margin: 0; width: 100%; max-width: 340px; }
.checkout-login-info summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1px solid #CBD5E1; background: #F8FAFC; color: #334155; font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; }
.checkout-login-info summary::-webkit-details-marker { display: none; }
.checkout-login-info summary i { font-size: 11px; transition: transform 0.2s ease; }
.checkout-login-info[open] summary i { transform: rotate(180deg); }
.checkout-login-info-bubble { margin-top: 10px; width: 100%; background: #0F172A; color: #fff; border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.45; text-align: left; box-shadow: 0 10px 25px rgba(15, 23, 42, 0.28); }

/* Spécificité élevée pour que style-account.css ne l'écrase pas */
body .checkout-error-modal .error-modal-close {
    background: #0F172A;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    min-height: auto;
    box-shadow: none;
    cursor: pointer;
    transition: background 0.2s;
}
body .checkout-error-modal .error-modal-close:hover { background: #1E293B; }

/* Mobile: verrouille le centrage du popup d'erreur checkout.
   Empêche le décalage horizontal causé par les styles partagés d'autres pages. */
@media (max-width: 991px) {
    body .checkout-error-modal {
        inset: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        height: auto !important;
        padding: 16px !important;
        box-sizing: border-box !important;
        justify-content: center !important;
    }
    body .checkout-error-modal .error-modal-content {
        width: 100% !important;
        max-width: 450px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }
}

/* Animation d'erreur (Secousse) */
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake-animation {
  animation: shakeError 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* Style des messages d'erreur AJAX dans le login */
form.woocommerce-form-login .woocommerce-error {
    background: #FEF2F2 !important;
    border: 1px solid #FECACA !important;
    color: #991B1B !important;
    padding: 10px 15px !important;
    border-radius: 6px;
    list-style: none !important;
    margin-bottom: 15px !important;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

/* Icône d'erreur avant le texte */
form.woocommerce-form-login .woocommerce-error li::before {
    content: "\f071"; /* FontAwesome Warning */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 10px;
}

/* Message de succès temporaire */
form.woocommerce-form-login .woocommerce-message {
    background: #F0FDF4 !important;
    border: 1px solid #BBF7D0 !important;
    color: #166534 !important;
    padding: 15px !important;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}

/* Style du bouton d'inscription AJAX */
#js-register-btn {
    background-color: #0F172A !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 1rem;
    padding: 18px 25px !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.1);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#js-register-btn:hover {
    background-color: #1E293B !important;
    transform: translateY(-2px);
}

#js-register-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}
#order_review #payment .payment_box,
#order_review #payment .payment_box * { max-width: 100%; }
#order_review #payment,
#order_review #payment .payment_box { overflow: visible !important; }

/* =========================================
   13. CHECKOUT AUTH (INLINE LOGIN / REGISTER)
   Utilise les classes de style-account.css.
   On ajoute ici uniquement les ajustements
   spécifiques au contexte checkout.
   ========================================= */

/* ---- Responsive helpers bandeau auth ---- */
.co-auth-mobile-only { display: none !important; }
.co-auth-desktop-only { display: flex !important; }

/* ---- Bandeau CTA (visible par défaut, caché au clic) ---- */
.co-auth-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    margin: 0 0 10px;
}
.co-auth-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a3299, #0d47c2);
    box-shadow: 0 8px 20px rgba(10, 50, 153, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}
.co-auth-banner-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.co-auth-banner-text strong {
    font-size: 1.05rem;
    color: #101735;
}
.co-auth-banner-text span {
    font-size: 0.88rem;
    color: #5a6487;
    line-height: 1.4;
}
/* Boutons du bandeau: même style que les onglets login/register (sans 3D) */
.co-auth-banner-actions {
    position: relative;
    display: flex;
    width: 100%;
    gap: 0;
    border-radius: 14px;
    padding: 4px;
    background: rgba(10, 50, 153, 0.1);
    border: 1px solid rgba(10, 50, 153, 0.18);
    overflow: hidden;
}
.co-auth-banner-actions::before {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    border-radius: 10px;
    background: linear-gradient(120deg, #0a3299, #0d47c2);
    box-shadow: none;
    pointer-events: none;
}
.co-auth-banner-btn {
    position: relative;
    z-index: 2;
    flex: 1;
    border: 0;
    background: transparent;
    border-radius: 12px;
    padding: 13px 10px;
    font-size: 15px;
    font-weight: 700;
    color: #2c3a6b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-shadow: none;
    transform: none !important;
    box-shadow: none !important;
    transition: color 0.2s ease;
}
.co-auth-banner-btn--login {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(6, 12, 36, 0.3);
}
.co-auth-banner-btn--register {
    color: #2c3a6b;
}
.co-auth-banner-btn--register:hover {
    color: #061545;
}
.co-auth-banner-btn--login:hover {
    color: #ffffff;
}
.co-auth-banner-btn:active {
    transform: none !important;
}
.co-auth-banner-btn:focus {
    outline: none;
    box-shadow: none;
}
.co-auth-banner-btn:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}
.co-auth-banner-btn i {
    font-size: 0.82rem;
}

/* ---- Bloc mobile: paiement masqué tant que non connecté ---- */
.co-mobile-payment-lock {
    display: none;
}
.co-mobile-payment-lock__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #EEF2FF, #DBEAFE);
    color: #2563EB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.co-mobile-payment-lock__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.co-mobile-payment-lock__text strong {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
    color: #0F172A;
    font-family: var(--font-head, 'Plus Jakarta Sans', sans-serif);
}
.co-mobile-payment-lock__text span {
    font-size: 0.82rem;
    line-height: 1.45;
    color: #64748B;
}
.co-mobile-payment-lock__btn {
    position: relative;
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: var(--font-head, 'Plus Jakarta Sans', sans-serif);
    letter-spacing: 0.2px;
    box-shadow: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}
.co-mobile-payment-lock__btn > * {
    position: static;
}
.co-mobile-payment-lock__btn:hover,
.co-mobile-payment-lock__btn:focus-visible {
    box-shadow: none;
    outline: 2px solid rgba(37, 99, 235, 0.48);
    outline-offset: 2px;
}
.co-mobile-payment-lock__btn:active {
    transform: scale(0.98);
    box-shadow: none;
    background-size: 100% 100%;
    color: #0F172A;
}

/* ---- Container du formulaire (caché par défaut) ---- */
/* Les CSS variables viennent de .login-breakout-wrapper dans style-account.css.
   Comme on n'utilise plus ce wrapper, on les redéfinit ici. */
.co-auth-form-container {
    --login-bg-main: #f5f7ff;
    --login-bg-secondary: #e8edff;
    --login-card: rgba(255, 255, 255, 0.92);
    --login-border: rgba(16, 23, 53, 0.12);
    --login-text: #101735;
    --login-sub: #5a6487;
    --login-accent: #0f62fe;
    --login-accent-alt: #00a79d;
    --login-input-bg: #ffffff;
    --login-input-border: #dbe2ff;
    --login-input-icon: #7b86a8;
    --login-shadow: 0 30px 60px rgba(16, 23, 53, 0.14);
    --login-btn-height: 52px;
    --login-btn-radius: 14px;
    --login-btn-font-size: 15px;
    --login-btn-font-weight: 700;
    --login-btn-transition: transform 0.16s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    --login-btn-focus-ring: none;
    --login-btn-flat: #0a3299;
    --login-btn-fill: #061a52;
    --login-btn-shadow-soft: 0 10px 24px rgba(16, 23, 53, 0.12);
    --login-btn-shadow-strong: 0 14px 28px rgba(15, 98, 254, 0.24);
    margin: 0 0 10px;
}

/* Espace bas entre le formulaire et la fin de la colonne */
.co-auth-form-container .switch-msg {
    margin-bottom: 0;
    padding-bottom: 60px;
}

/* Connecté — statut inline */
.publicard-co-auth-connected {
    color: #0F766E;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
}
.publicard-co-auth-connected i { color: #16A34A; }
.publicard-co-auth-connected .co-auth-connected-label--mobile { display: none; }

@media (max-width: 991px) {
    .publicard-co-auth-connected .co-auth-connected-label--desktop { display: none; }
    .publicard-co-auth-connected .co-auth-connected-label--mobile { display: inline; }
}

/* ---- Transition de succès (formulaire → check animé → contenu connecté) ---- */
.co-auth-success-transition {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
}

/* Cercle extérieur avec pulse */
.co-auth-success-ring {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}
.co-auth-success-ring::before {
    content: none;
    display: none;
}

/* Cercle SVG animé (trait qui se dessine) */
.co-auth-success-svg {
    width: 64px;
    height: 64px;
    position: relative;
    z-index: 1;
}
.co-auth-success-svg .circle-bg {
    fill: none;
    stroke: #E2E8F0;
    stroke-width: 2.5;
}
.co-auth-success-svg .circle-progress {
    fill: none;
    stroke: #16A34A;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    transform-origin: center;
    animation: successCircleDraw 0.5s 0.1s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.co-auth-success-svg .checkmark-path {
    fill: none;
    stroke: #16A34A;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: successCheckDraw 0.35s 0.55s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

/* Texte de succès */
.co-auth-success-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0F766E;
    opacity: 0;
    animation: successLabelIn 0.4s 0.7s ease forwards;
}

@keyframes successCircleDraw {
    to { stroke-dashoffset: 0; }
}
@keyframes successCheckDraw {
    to { stroke-dashoffset: 0; }
}
@keyframes successPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50%      { transform: scale(1.15); opacity: 0.2; }
}
@keyframes successLabelIn {
    0%   { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ---- Social Auth Success Overlay (retour Google → checkout) ---- */
.co-social-auth-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: socialAuthFadeIn 0.4s ease;
}
.co-social-auth-success-overlay.dismissing {
    opacity: 0;
    transition: opacity 0.5s ease;
}
@keyframes socialAuthFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Loading spinner état */
.co-auth-form-container .account-form-btn.is-loading .btn-label { display: none; }
.co-auth-form-container .account-form-btn.is-loading .btn-spinner { display: inline-block; }

/* ---- Bouton fermer popup mobile (caché sur desktop) ---- */
.co-auth-modal-close {
    display: none;
}

/* ---- Desktop : overlay = simple wrapper inline dans la colonne ---- */
@media (min-width: 992px) {
    .co-auth-modal-overlay {
        display: block;
        position: static;
        padding: 0;
        background: none;
        backdrop-filter: none;
        z-index: auto;
    }
    .co-auth-modal-overlay .co-auth-form-container {
        max-width: 100%;
        border-radius: 16px;
        background: #fff;
        border: 1px solid #E2E8F0;
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
        padding: 24px;
        margin: 0 0 8px;
    }
}

/* ---- POPUP MODAL MOBILE/TABLET (≤ 991px) ---- */
@media (max-width: 991px) {

    /* --- Bandeau CTA simplifié sur mobile --- */
    .co-auth-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        gap: 10px;
        margin: 0 0 8px;
        padding: 10px 12px;
        border: 1px solid #E2E8F0;
        border-radius: 12px;
        background: #FFFFFF;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    }
    .co-auth-banner-icon {
        width: 30px;
        height: 30px;
        border-radius: 8px;
        font-size: 12px;
        box-shadow: none;
        background: #EEF2FF;
        color: #1D4ED8;
        flex-shrink: 0;
    }
    .co-auth-banner-text {
        min-width: 0;
        flex: 1;
        gap: 0;
    }
    .co-auth-banner-text strong {
        font-size: .84rem;
        color: #334155;
        line-height: 1.2;
    }
    .co-auth-banner-text span {
        display: none;
    }
    /* Cacher les 2 boutons desktop, montrer le bouton unique mobile */
    .co-auth-desktop-only {
        display: none !important;
    }
    .co-auth-mobile-only {
        display: flex !important;
        width: auto;
    }
    .co-auth-banner-actions {
        width: auto;
        border: 0;
        background: transparent;
        border-radius: 0;
        padding: 0;
        overflow: visible;
    }
    .co-auth-banner-actions::before {
        display: none;
    }
    .co-auth-banner-btn--login.co-auth-mobile-only {
        justify-content: center;
        padding: 8px 12px !important;
        min-height: 34px;
        border-radius: 10px;
        border: 1px solid #CBD5E1;
        background: #F8FAFC;
        color: #0F172A;
        font-size: 0.78rem !important;
        font-weight: 700;
        line-height: 1;
    }
    .co-auth-banner-btn--login.co-auth-mobile-only i {
        display: none;
    }

    /* --- Lock scroll page derrière popup --- */
    html.co-auth-modal-open,
    body.co-auth-modal-open {
        overflow: hidden !important;
        overscroll-behavior: none !important;
        height: 100%;
    }

    /* --- Overlay modal (bottom sheet) --- */
    .co-auth-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 99998;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding: 0;
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease, visibility 0s linear 0.3s;
        overflow: hidden;
    }
    .co-auth-modal-overlay.active {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transition: opacity 0.3s ease, visibility 0s linear 0s;
    }

    /* --- Bottom sheet --- */
    .co-auth-modal-overlay .co-auth-form-container {
        display: block !important;
        position: relative;
        width: 100%;
        max-width: 100%;
        max-height: var(--co-auth-modal-max-height, 88dvh);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        touch-action: pan-y;
        background: #fff;
        border-radius: 20px 20px 0 0;
        padding: 6px 20px 20px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 30px rgba(16, 23, 53, 0.15);
        transform: translateY(100%);
        transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
        will-change: transform;
    }
    .co-auth-modal-overlay.active .co-auth-form-container {
        transform: translateY(0);
    }

    /* Drag handle (indicateur de glissement) */
    .co-auth-modal-overlay .co-auth-form-container::before {
        content: '';
        display: block;
        width: 36px;
        height: 5px;
        background: #CBD5E1;
        border-radius: 3px;
        margin: 6px auto 14px;
    }

    /* Pas de padding-bottom excessif dans le sheet */
    .co-auth-modal-overlay .co-auth-form-container .switch-msg {
        padding-bottom: 8px;
    }

    /* --- Bouton fermer --- */
    .co-auth-modal-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: sticky;
        top: 0;
        float: right;
        z-index: 10;
        width: 32px;
        height: 32px;
        margin: -22px -2px 4px 0;
        border-radius: 50%;
        border: 1px solid rgba(16, 23, 53, 0.08);
        background: rgba(248, 250, 252, 0.95);
        color: #475569;
        font-size: 14px;
        cursor: pointer;
        transition: background 0.2s, color 0.2s;
    }
    .co-auth-modal-close:hover {
        background: #fff;
        color: #0F172A;
    }

    /* --- Animation de succès centrée dans le sheet --- */
    .co-auth-modal-overlay .co-auth-success-transition {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 220px;
        padding: 40px 20px;
    }
}

@media (max-width: 991px) {
    body:not(.logged-in) #customer_details {
        display: none !important;
    }
    body:not(.logged-in) #js-co-auth-banner {
        display: none !important;
    }
    body:not(.logged-in) #order_review {
        display: none !important;
    }
    body:not(.logged-in) .co-mobile-payment-lock {
        order: 2;
        display: grid;
        grid-template-columns: 42px 1fr;
        align-items: center;
        column-gap: 14px;
        row-gap: 14px;
        width: 100%;
        margin: 20px 0 0;
        padding: 20px;
        border: 1px solid #E2E8F0;
        border-radius: 16px;
        background: #FFFFFF;
        box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    }
    body:not(.logged-in) .co-mobile-payment-lock__btn {
        grid-column: 1 / -1;
    }
}


/* --- Cacher le login WooCommerce par défaut (on le remplace) --- */
.woocommerce-form-login-toggle { display: none !important; }
form.woocommerce-form-login { display: none !important; }
.toggle-new-customer { display: none !important; }
.publicard-checkout-auth-shell { display: none !important; }

/* =========================================
   14. GUEST PAYMENT — RESTRICTIONS CIBLÉES
   ========================================= */
body:not(.logged-in) #payment {
    position: relative;
}

/* --- Éléments interactifs bloqués pour les guests --- */
/* Les parents (li, wrapper) gardent pointer-events pour le hover badge.
   Seuls les enfants interactifs sont désactivés. */

/* Google Pay / Apple Pay — enfants uniquement */
body:not(.logged-in) .wcpay-express-checkout-wrapper > *:not(.guest-lock-badge) {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(0.3);
    transition: opacity 0.3s;
}

/* Carte bancaire Stripe — inputs/iframe */
body:not(.logged-in) li.wc_payment_method .wcpay-upe-element,
body:not(.logged-in) li.wc_payment_method .wcpay-upe-form {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* PayPal — boutons iframes (toutes variantes) */
body:not(.logged-in) li.wc_payment_method .payment_box [class*="paypal-button"],
body:not(.logged-in) li.wc_payment_method .payment_box iframe[name*="paypal"],
body:not(.logged-in) li.wc_payment_method .payment_box .ppc-button-wrapper,
body:not(.logged-in) .payment_method_ppcp-gateway .payment_box,
body:not(.logged-in) .payment_method_paypal .payment_box {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* PayPal PPCP — boutons standalone (où qu'ils soient dans #order_review) */
body:not(.logged-in) #order_review .ppc-button-wrapper {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Bouton Commander */
body:not(.logged-in) #place_order {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
    transition: opacity 0.3s;
}
body:not(.logged-in) #place_order::after {
    animation: none;
}

/* --- Zones bloquées : curseur interdit au hover --- */
body:not(.logged-in) .guest-lock-zone {
    cursor: not-allowed;
}

/* --- Tooltip flottant (suit la souris) --- */
.guest-cursor-tooltip {
    position: fixed;
    z-index: 10000;
    background: #0F172A;
    color: #fff;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
}
.guest-cursor-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
}
.guest-cursor-tooltip > i {
    font-size: 14px;
    color: #FBBF24;
    flex-shrink: 0;
}

/* Masquer une fois connecté */
body.logged-in .guest-cursor-tooltip { display: none !important; }

/* --- Popup info (!) --- */
.guest-pay-info-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.guest-pay-info-popup.active {
    opacity: 1;
    visibility: visible;
}
.guest-pay-info-popup-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    transform: translateY(16px);
    transition: transform 0.3s ease;
}
.guest-pay-info-popup.active .guest-pay-info-popup-content {
    transform: translateY(0);
}
.guest-pay-info-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #F1F5F9;
    color: #64748B;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.guest-pay-info-close:hover {
    background: #E2E8F0;
    color: #0F172A;
}
.guest-pay-info-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.guest-pay-info-icon i {
    font-size: 22px;
    color: #4338CA;
}
.guest-pay-info-popup-content h3 {
    margin: 0 0 16px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0F172A;
}
.guest-pay-info-popup-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.guest-pay-info-popup-content li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #334155;
}
.guest-pay-info-popup-content li i {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    color: #6366F1;
    margin-top: 2px;
}
