/* --- Espacement --- */
.u-section-1 {
    padding-top: 50px !important;
    padding-bottom: 50px !important;
}

/* --- Formulaire --- */
.form-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    column-gap: 15px;
    row-gap: 8px;
    margin-top: 20px; 
}

.full-width {
    grid-column: span 2;
}

input.form-input { 
    width: 100%;
    height: 50px;
    box-sizing: border-box;
    padding: 12px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    background-color: white; /* Fond par défaut */
    transition: background-color 0.3s;
}

/* --- Couleur Vert Clair quand le champ est rempli (tous les champs) --- */
input.form-input:focus, 
input.form-input:not(:placeholder-shown) {
    background-color: #eaffea !important; /* Vert très clair */
    border-color: var(--u-custom-color-1) !important;
}

/* Force le vert même en cas d'auto-remplissage navigateur */
input.form-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px #eaffea inset !important;
}

/* Case à cocher en vert */
input[type="checkbox"] {
    accent-color: #008a00;
    width: 18px;
    height: 18px;
    cursor: pointer;
	vertical-align: middle;
}

.checkbox-group { 
    margin: 20px 0; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

/* --- Alignement parfait du Select --- */
select.form-input {
    width: 100% !important;     /* Force la largeur sur toute la colonne */
    height: 50px;               /* Force la hauteur pour l'aligner sur les inputs */
    box-sizing: border-box;     /* Crucial : inclut le padding dans la largeur de 100% */
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white !important;
    font-family: inherit;
    font-size: inherit;
    color: #757575;             /* Gris type placeholder par défaut */
    appearance: none;           /* Supprime le style natif (flèche OS) */
    -webkit-appearance: none;
    cursor: pointer;
}

/* On cible le select quand il a une valeur sélectionnée (grâce au required du HTML) */
select.form-input:valid {
    background-color: #eaffea !important;
    border-color: var(--u-custom-color-1) !important;
    color: black !important;
}

/* On force aussi le style quand le champ a le focus */
select.form-input:focus {
    background-color: #eaffea !important;
    border-color: var(--u-custom-color-1) !important;
    outline: none;
}

/* Force le style même si le navigateur applique son propre style d'autofill */
select.form-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px #eaffea inset !important;
    -webkit-text-fill-color: var(--u-custom-color-1) !important;
}

/* --- Petite flèche personnalisée (optionnelle mais recommandée) --- */
.full-width { position: relative; }
select.form-input {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23999%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 10px auto;
}

select.form-input option {
    background-color: white; /* Les choix dans la liste restent sur fond blanc pour la lisibilité */
    color: #757575 !important;
}

/* --- Récap paiement --- */
.recap-paiement {
    background-color: #f9f9f9; /* Fond gris très léger pour le distinguer */
    padding: 20px; 
    margin-bottom: 25px;
    font-size: 0.95rem;
    max-width: 500px; /* Aligné sur la largeur de ton formulaire Stripe */
    border: 1px solid #eee; /* Retour du cadre gris */
    border-radius: 4px;
}

.recap-ligne {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #444;
}

.recap-produit-titre {
    font-weight: bold;
    margin-bottom: 12px;
    color: #333;
    display: block;
    padding-bottom: 8px;
    font-size: 1.1rem;
    border-bottom: 1px dashed #ccc; /* Petit séparateur sous le titre */
}

.recap-ligne.total {
    margin-top: 15px;
    padding-top: 10px;
    font-weight: bold;
    color: #000;
    font-size: 1rem;
    border-top: 1px dashed #ccc; /* Séparateur en pointillés avant le Total */
}

.recap-remise {
    color: #e67e22;
    font-weight: bold;
}

.recap-tva {
    font-size: 0.8rem;
    color: #999;
    text-align: left;
    margin-top: 5px;
}

/* --- Progression / Stepper --- */
.stepper { 
    display: flex; 
    justify-content: space-between; 
    margin: 40px 0; 
    padding: 0; 
    list-style: none; 
    counter-reset: step; 
}

.step { 
    flex: 1; 
    text-align: center; 
    position: relative; 
    color: #ccc; 
    font-size: 14px; 
}

/* Le cercle */
.step:before { 
    content: counter(step); 
    counter-increment: step;
    width: 30px; 
    height: 30px; 
    border: 3px solid #ccc; 
    border-radius: 50%; 
    display: block; 
    margin: 0 auto 10px; 
    background: white; 
    z-index: 2; 
    position: relative; 
    
    /* Centrage du chiffre */
    line-height: 24px; /* 30px de hauteur - 6px de bordures = 24px */
    text-align: center;
    font-weight: bold;
}

/* La ligne entre les étapes */
.step:after { 
    content: ""; 
    position: absolute; 
    width: 100%; 
    height: 6px;           /* Épaisseur de la ligne */
    background: #ccc; 
    top: 12px;             /* Centrage vertical (Milieu du cercle de 30px) */
    left: -50%;            /* Aligne la ligne pour qu'elle parte du cercle précédent */
    z-index: 1; 
}

/* On cache la ligne pour la toute première étape */
.step:first-child:after { 
    content: none; 
}

/* États Actif et Courant */
.step.current { 
    color: #008a00; 
    font-weight: bold; 
}

.step.current:before { 
    border-color: #008a00; 
    color: #008a00; 
}

.step.active:before { 
    border-color: #008a00; 
    background-color: #008a00; 
    color: white; 
}

/* La ligne devient verte si l'étape suivante est active ou si l'actuelle est active */
.step.active + .step:after { 
    background-color: #008a00; 
}

/* Stepper quantité */
.qte-stepper {
    display: flex;
    align-items: stretch;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    height: 45px;
}

.qte-stepper .qte-picker {
    border: none;
    border-right: 1px solid #ccc;
    border-radius: 0;
    height: 100%;
    width: 45px;
    text-align: center;
}

.qte-btn-col {
    display: flex;
    flex-direction: column;
    width: 36px;
}

.qte-btn {
    flex: 1;
    background: var(--u-custom-color-1, #008a00);
    border: none;
    font-size: 1rem;
    font-weight: 900;
    color: white;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* Séparateur entre + et − */
.qte-btn:first-child {
    border-bottom: 2px solid rgba(255,255,255,0.3);
}

.qte-btn:hover  { background: #00bb00; }
.qte-btn:active { background: #008b00; }

/* Cache les flèches natives du navigateur */
.qte-picker::-webkit-inner-spin-button,
.qte-picker::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
.qte-picker { -moz-appearance: textfield; }

/* --- Mondial Relay Widget --- */
#titre-mr {
    margin-top: 0;
    margin-bottom: 8px;
}

#Zone_Widget {
    width: 100% !important;
    min-height: 600px;
    margin-top: 0;
    margin-bottom: 8px;
    border: none !important;
}
#MR-Widget-Container, .MR-Widget { 
    width: 100% !important; 
}

/* Alignement forcé des boutons Précédent/Suivant */
.button-group {
    display: flex !important;
    flex-direction: row !important; /* Force l'alignement horizontal */
    gap: 15px !important;
    margin-top: 30px !important;
    justify-content: flex-start !important;
    clear: both; /* Évite les chevauchements de flottants */
}

/* On neutralise les marges Nicepage qui pourraient casser la ligne */
.button-group .u-btn {
    margin: 0 !important; 
    display: inline-block !important; /* Empêche le bouton de prendre toute la ligne */
    width: auto !important; /* Force une largeur automatique selon le texte */
}
/* =====================================================================
   STEPPER — Responsive mobile
   ===================================================================== */

@media (max-width: 575px) {

    .stepper {
        margin: 24px 0 16px;    /* Moins d'espace vertical sur mobile */
    }

    /* Masque les labels texte sans toucher au pseudo-élément ::before */
    .step {
        font-size: 0;           /* Annule le texte du <li> */
        color: transparent;     /* Sécurité pour les navigateurs qui ignorent font-size:0 */
    }

    /* Rétablit la taille du cercle numéroté */
    .step:before {
        font-size: 13px;        /* Taille du chiffre dans le cercle */
        width: 26px;
        height: 26px;
        line-height: 20px;      /* 26px - 6px de bordure */
        margin-bottom: 0;       /* Plus de marge sous le cercle sans texte */
    }

    /* Réajuste le centrage vertical de la ligne de connexion */
    .step:after {
        top: 10px;              /* Milieu du cercle de 26px */
        height: 4px;
    }

    /* Rétablit la couleur verte du label courant (font-size:0 l'avait annulée) */
    .step.current:before {
        border-color: #008a00;
        color: #008a00;
    }

    /* Affiche le nom de l'étape courante en dessous du stepper */
    .stepper-label-mobile {
        display: block;
        text-align: center;
        font-size: 0.85rem;
        font-weight: 600;
        color: #008a00;
        margin-bottom: 20px;
        letter-spacing: 0.02em;
    }
}

/* Masqué sur desktop */
.stepper-label-mobile {
    display: none;
}

/* =====================================================================
   ÉTAPE 1 — Bloc commande stable + mise en page prix/remise
   ===================================================================== */

.step1-order-card { margin-top: 15px; }

/* Message devis : espace toujours réservé */
.step1-devis-zone { min-height: 28px; margin-bottom: 12px; }

#msg-devis {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
    margin: 0;
    color: #e67e22;
    font-weight: bold;
    font-size: 1rem;
}
#msg-devis.visible { visibility: visible; opacity: 1; }

/* Ligne principale : quantité + bloc prix, centrés verticalement */
.step1-order-row {
    display: flex;
    align-items: center;   /* centre le bloc prix avec l'input */
    gap: 40px;
}

.step1-qty-block {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Bloc prix : colonne, hauteur fixe → l'input ne bouge jamais */
.step1-price-block {
    display: flex;
    flex-direction: column;
}

/* Ligne prix + remise montant */
.step1-price-line {
    display: flex;
    align-items: baseline;
    gap: 14px;             /* espace entre prix et montant remise */
    flex-wrap: wrap;
}

/* Prix principal — !important pour ne pas être écrasé par Nicepage */
.step1-prix-ttc {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    line-height: 1;
    white-space: nowrap;
}

/* Prix barré (visible seulement quand remise active) */
.step1-prix-barre {
    font-size: 1rem;
    font-weight: 400;
    color: #aaa;
    text-decoration: line-through;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}
.step1-prix-barre.visible { visibility: visible; opacity: 1; }

/* Montant remise inline (ex : −15,00 €) */
#remise-montant {
    font-size: 0.9rem;
    font-weight: bold;
    color: #e67e22;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}
#remise-montant.visible { visibility: visible; opacity: 1; }

/* Zone réservée sous la ligne prix → évite le saut quand remise-info apparaît */
.step1-remise-info-zone {
    min-height: 22px;
    margin-top: 5px;
}

#remise-info {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
    color: #e67e22;
    font-weight: bold;
    margin: 0;
    font-size: 0.9rem;
}
#remise-info.visible { visibility: visible; opacity: 1; }

/* Mobile : empilement vertical */
@media (max-width: 575px) {
    .step1-order-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .step1-prix-ttc { font-size: 1.6rem !important; }
}

/* =====================================================================
   ÉTAPE 4 — Checkbox CGV responsive
   ===================================================================== */

.cgv-group {
    margin-top: 20px;
    display: grid;
    grid-template-columns: auto 1fr; /* checkbox | texte : le wrap reste dans la colonne texte */
    gap: 14px;
    align-items: start;
}

/* Checkbox plus grande, ancrée en haut */
.cgv-group input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin-top: 2px;   /* aligne optiquement avec la première ligne */
    cursor: pointer;
}

.cgv-group label {
    font-size: 0.9rem;
    cursor: pointer;
    line-height: 1.5;
}

@media (max-width: 575px) {
    .cgv-group {
        gap: 16px;
    }

    .cgv-group input[type="checkbox"] {
        width: 26px;
        height: 26px;
        min-width: 26px;
    }

    /* Lien CGV sur sa propre ligne avec plus d'air */
    .cgv-group label {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    /* Zone de tap agrandie sur le lien */
    .cgv-group label a {
        display: inline-block;
        padding: 4px 0;
        font-weight: 600;
    }
}

/* =====================================================================
   ÉTAPE 3 — Cartes transporteur + tableau tarifaire
   ===================================================================== */

.carrier-option,
#bloc-domicile {
    max-width: 500px;
}

.carrier-pricing-table {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    column-gap: 2px;
    row-gap: 10px;
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px dashed #ececec;
}

.cpt-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    color: #bbb;
}

.cpt-cell--active {
    color: #008b00;
    font-weight: 700;
}

.cpt-qty   { font-size: 0.6rem;  line-height: 1; }
.cpt-price { font-size: 0.68rem; line-height: 1.4; white-space: nowrap; }

@media (max-width: 575px) {
    .carrier-pricing-table {
        grid-template-columns: repeat(4, 1fr);
    }
}
