/* =====================================================
   ENVOI-V2 — Page unique (test A/B vs wizard 4 étapes)
   ===================================================== */

/* ----------------------------------------------------
   1. FORCE TOUTES LES SECTIONS VISIBLES
   Override la règle .hidden imposée par app.js sur les [data-step]
   ---------------------------------------------------- */
.envoi-v2-shell [data-step] {
    display: block !important;
}
.envoi-v2-shell [data-step].hidden {
    display: block !important;
}

/* Mais on garde la possibilité de masquer les data-options-for et autres */
.envoi-v2-shell [data-options-for].hidden {
    display: none !important;
}

/* ----------------------------------------------------
   2. STRUCTURE GLOBALE
   ---------------------------------------------------- */
.envoi-v2-shell {
    background: var(--bg-soft, #F8FAFC);
    padding: 2rem 0;
    min-height: calc(100vh - 130px);
}
.envoi-v2-container {
    max-width: var(--container-max, 1280px);
    margin: 0 auto;
    padding-left: var(--container-pad, 1.5rem);
    padding-right: var(--container-pad, 1.5rem);
    box-sizing: border-box;
}
@media (max-width: 640px) {
    .envoi-v2-container {
        padding-left: var(--container-pad-mobile, 1rem);
        padding-right: var(--container-pad-mobile, 1rem);
    }
}

.envoi-v2-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}
.envoi-v2-header h1 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 800;
    color: #0F1E3C;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.envoi-v2-header .lead {
    color: var(--muted, #6B7280);
    font-size: 1rem;
    margin: 0;
}

/* ----------------------------------------------------
   3. GRID DESKTOP : MAIN + ASIDE
   ---------------------------------------------------- */
.envoi-v2-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 2rem;
    align-items: start;
    overflow: visible;
}
@media (max-width: 900px) {
    .envoi-v2-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ----------------------------------------------------
   3b. MODE "SIDEBAR CACHÉE" — pour maximiser la conversion
   ---------------------------------------------------- */
.envoi-v2-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 100%;
    margin: 0 auto;
}
/* Cache la sidebar partout (desktop + mobile) */
.envoi-v2-aside,
aside.envoi-v2-aside {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.envoi-v2-main {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
@media (max-width: 600px) {
    .envoi-v2-main {
        gap: 1.25rem;
    }
}

.envoi-v2-aside {
    position: -webkit-sticky;
    position: sticky;
    top: 100px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* Desktop : force le sticky explicitement (parade contre les overrides) */
@media (min-width: 901px) {
    .envoi-v2-aside {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 100px !important;
        display: block !important;
        align-self: start !important;
    }
}

/* Mobile : aside en flux normal */
@media (max-width: 900px) {
    .envoi-v2-aside {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

/* ----------------------------------------------------
   4. CHAQUE SECTION = UNE CARD INDÉPENDANTE
   Card avec padding interne 1.5rem, header discret en haut
   ---------------------------------------------------- */
.envoi-v2-section {
    background: #fff;
    border: 1.5px solid #D6DCE6;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 30, 60, 0.04), 0 4px 12px rgba(15, 30, 60, 0.04);
    padding: 1.5rem;
    margin: 0;
    overflow: hidden;
}
/* Reset règles précédentes */
.envoi-v2-section:last-of-type {
    border: 1.5px solid #D6DCE6;
    margin: 0;
    padding: 1.5rem;
}

/* Header discret : fond gris très clair, accent bleu fin à gauche */
.envoi-v2-section-header {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem; /* étend le header au bord de la card */
    padding: 1rem 1.5rem;
    background: #F3F6FA;
    border-bottom: 1px solid #E5E9F2;
    border-left: 4px solid var(--bleu, #0060AE); /* fine bande bleue à gauche */
}

/* Numéro de l'étape : cercle bleu avec chiffre blanc (sobre) */
.envoi-v2-section-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bleu, #0060AE);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.envoi-v2-section-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 0.1rem;
    color: #0F1E3C;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.envoi-v2-section-header .lead-sm {
    color: var(--muted, #6B7280);
    font-size: 0.83rem;
    margin: 0;
    line-height: 1.4;
}

/* Mobile : padding cards réduit */
@media (max-width: 600px) {
    .envoi-v2-section,
    .envoi-v2-section:last-of-type {
        border-radius: 10px;
        padding: 1.1rem !important;
        padding-bottom: 1.5rem !important;
    }
    .envoi-v2-section-header {
        margin: -1.1rem -1.1rem 1.1rem -1.1rem;
        padding: 0.85rem 1.1rem;
        border-left-width: 3px;
    }
    .envoi-v2-section-num {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
    .envoi-v2-section-header h2 {
        font-size: 1rem;
    }
    .envoi-v2-section-header .lead-sm {
        font-size: 0.78rem;
    }
}

/* Spécifique : si le 2ème enfant après le header est un .option-section, conserve cohérence */
.envoi-v2-section .option-section + .option-section {
    margin-top: 1.25rem;
}

.envoi-v2-dropzone-footer{
	margin-bottom: 0rem!important;
}

.option-section {
  margin-bottom: 0rem!important;
}

@media (max-width: 600px) {
    .envoi-v2-section {
        padding-bottom: 0;
        margin-bottom: 1.25rem;
    }
    .envoi-v2-section-num {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
    .envoi-v2-section-header h2 {
        font-size: 1.05rem;
    }
    .envoi-v2-section-header .lead-sm {
        font-size: 0.8rem;
    }
}

/* ----------------------------------------------------
   4b. TYPE CARDS COMPACTES - LAYOUT HORIZONTAL
   Icône à gauche, texte à droite pour gagner de la place
   ---------------------------------------------------- */
.envoi-v2-shell .type-card {
    display: grid !important;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 1rem;
    align-items: center;
    padding: 0.85rem 1rem !important;
    min-height: auto;
    text-align: left;
}
/* L'icône à gauche, spanne sur 2 lignes */
.envoi-v2-shell .type-card .type-icon {
    grid-row: span 3;
    grid-column: 1;
    align-self: center;
    width: 44px;
    height: 44px;
    background: rgba(0, 96, 174, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bleu, #0060AE);
}
.envoi-v2-shell .type-card .type-icon svg {
    width: 24px !important;
    height: 24px !important;
}
/* Le titre, le prix et la desc à droite */
.envoi-v2-shell .type-card h3 {
    grid-column: 2;
    font-size: 1rem !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}
.envoi-v2-shell .type-card .price {
    grid-column: 2;
    font-size: 0.88rem !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}
.envoi-v2-shell .type-card .desc {
    grid-column: 2;
    font-size: 0.76rem !important;
    margin: 0 !important;
    line-height: 1.35 !important;
}
/* Le check en sélection : décalé vers le bas pour ne pas chevaucher le badge POPULAIRE */
.envoi-v2-shell .type-card .type-card-check {
    top: 20px !important;
    right: 10px !important;
}
/* Pour les cards sans badge populaire : check en haut à droite classique */
.envoi-v2-shell .type-card:not(.type-card-popular) .type-card-check {
    top: 10px !important;
    right: 10px !important;
}
/* Le badge populaire en absolute en haut à droite */
.envoi-v2-shell .type-card .type-card-badge {
    top: -10px !important;
    right: 10px !important;
}

/* ----------------------------------------------------
   4d. UNIFORMISATION DES BORDURES
   Force toutes les cards à utiliser la même épaisseur de bordure
   que les radios Prioritaire/Express (1.5px)
   ---------------------------------------------------- */
.envoi-v2-shell .type-card,
.envoi-v2-shell .doc-mode-tab,
.envoi-v2-shell .dropzone,
.envoi-v2-shell .option-card,
.envoi-v2-shell .toggle-btn,
.envoi-v2-shell .field input {
    border-width: 1.5px !important;
}
.envoi-v2-shell .envoi-v2-impression-card {
    border-width: 1.5px;
}

/* ----------------------------------------------------
   4f. OPTION-SECTION-TITLE : pas de bordure bottom
   (évite trop de lignes horizontales dans le formulaire)
   ---------------------------------------------------- */
.envoi-v2-shell .option-section-title {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

/* ----------------------------------------------------
   4e. DROPZONE COMPACTE
   ---------------------------------------------------- */
.envoi-v2-shell .dropzone {
    padding: 1.25rem 1rem !important;
    min-height: 110px;
}
.envoi-v2-shell .dropzone-icon-wrap svg {
    width: 22px !important;
    height: 22px !important;
}
.envoi-v2-shell .dropzone h3 {
    font-size: 0.98rem !important;
    margin: 0.5rem 0 0.25rem !important;
}
.envoi-v2-shell .dropzone .small {
    font-size: 0.8rem !important;
}
.envoi-v2-shell .dropzone .mt-2 {
    margin-top: 0.75rem !important;
}
.envoi-v2-shell .dropzone-hint {
    margin: 0.5rem 0 0 !important;
}
.envoi-v2-shell .dropzone {
    padding: 1.25rem 1rem !important;
    min-height: 110px;
}
.envoi-v2-shell .dropzone-icon-wrap svg {
    width: 22px !important;
    height: 22px !important;
}
.envoi-v2-shell .dropzone h3 {
    font-size: 0.98rem !important;
    margin: 0.5rem 0 0.25rem !important;
}
.envoi-v2-shell .dropzone .small {
    font-size: 0.8rem !important;
}
.envoi-v2-shell .dropzone .mt-2 {
    margin-top: 0.75rem !important;
}
.envoi-v2-shell .dropzone-hint {
    margin: 0.5rem 0 0 !important;
}

/* ----------------------------------------------------
   5. LIEN DISCRET "UTILISER UN MODÈLE"
   ---------------------------------------------------- */
.envoi-v2-template-link-wrap {
    text-align: center;
    margin-top: 1rem;
}
.envoi-v2-template-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--bleu, #0060AE);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}
.envoi-v2-template-link:hover {
    background: rgba(0, 96, 174, 0.06);
}
.envoi-v2-template-link strong {
    text-decoration: underline;
}

.envoi-v2-template-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: none;
    color: var(--muted, #6B7280);
    font-size: 0.88rem;
    cursor: pointer;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}
.envoi-v2-template-back:hover {
    color: var(--bleu, #0060AE);
}

/* ----------------------------------------------------
   6. ADRESSES 2 COLONNES DESKTOP + SÉPARATEUR
   ---------------------------------------------------- */
.envoi-v2-shell .addr-blocks-grid {
    min-width: 0;
}
.envoi-v2-shell .addr-block {
    min-width: 0;
    max-width: 100%;
}
.envoi-v2-shell .field {
    min-width: 0;
}
.envoi-v2-shell .field input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 901px) {
    .envoi-v2-shell .addr-blocks-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 2rem;
        align-items: start;
        position: relative;
    }
    .envoi-v2-shell .addr-blocks-grid::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 1px;
        background: var(--border, #E5E9F2);
        transform: translateX(-50%);
    }
    .envoi-v2-shell .addr-blocks-grid .addr-block {
        margin-bottom: 0;
    }
}

/* ----------------------------------------------------
   6b. IMPRESSION CARDS (Couleur + Recto-verso) 2 COLONNES
   Layout horizontal : icône à gauche, label à droite
   ---------------------------------------------------- */
.envoi-v2-impression-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.envoi-v2-impression-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.85rem;
    text-align: left;
    background: #fff;
    border: 1.5px solid var(--border, #E5E9F2);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
}
.envoi-v2-impression-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.envoi-v2-impression-card:not(.checked):hover {
    border-color: rgba(0, 96, 174, 0.35);
    box-shadow: 0 4px 12px rgba(0, 96, 174, 0.08);
    transform: translateY(-2px);
}
.envoi-v2-impression-card.checked {
    border-color: var(--bleu, #0060AE);
    background: var(--bleu-pale, #EFF6FB);
}

.envoi-v2-impression-visual {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 96, 174, 0.08);
    border-radius: 10px;
    flex-shrink: 0;
}
.envoi-v2-impression-visual svg {
    width: 28px;
    height: 28px;
}
.envoi-v2-impression-visual-duplex {
    color: var(--bleu, #0060AE);
}
.envoi-v2-impression-visual-ar {
    color: var(--bleu, #0060AE);
}

.envoi-v2-impression-label .title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0F1E3C;
    line-height: 1.2;
}
.envoi-v2-impression-label .desc {
    font-size: 0.76rem;
    color: var(--muted, #6B7280);
    margin-top: 0.15rem;
    line-height: 1.3;
}

/* Checkmark indicateur quand sélectionné */
.envoi-v2-impression-card.checked::before {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bleu, #0060AE);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

@media (max-width: 700px) {
    .envoi-v2-impression-grid {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------------------
   7. BOUTON SUBMIT (sorti des cards, espacé en bas)
   ---------------------------------------------------- */
.envoi-v2-submit-wrap {
    text-align: center;
    margin-top: 0;
    margin-bottom: 3rem;
    padding-top: 0;
}
.envoi-v2-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: var(--bleu, #0060AE);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 1.05rem 4rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    min-width: 360px;
    box-shadow: 0 4px 14px rgba(0, 96, 174, 0.25);
}
.envoi-v2-submit-btn:hover {
    background: #004A85;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 96, 174, 0.35);
}
.envoi-v2-submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 96, 174, 0.2);
}
.envoi-v2-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Sur mobile : on cache le bouton desktop (la sticky bar prend le relais) */
@media (max-width: 700px) {
    .envoi-v2-submit-wrap {
        display: none;
    }
}

/* ----------------------------------------------------
   8. BARRE STICKY BAS MOBILE
   ---------------------------------------------------- */
.envoi-v2-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border, #E5E9F2);
    box-shadow: 0 -4px 16px rgba(15, 30, 60, 0.08);
    padding: 0.7rem 1rem 0.85rem;
    z-index: 100;
    align-items: center;
    gap: 0.75rem;
}
.envoi-v2-mobile-bar-total {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.envoi-v2-mobile-bar-total .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted, #6B7280);
    font-weight: 600;
}
.envoi-v2-mobile-bar-total .value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--bleu, #0060AE);
    letter-spacing: -0.01em;
}
.envoi-v2-mobile-bar-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: var(--bleu, #0060AE);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 50px;
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.envoi-v2-mobile-bar-btn:hover {
    background: #004A85;
}
.envoi-v2-mobile-bar-btn:active {
    transform: translateY(1px);
}
.envoi-v2-mobile-bar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Afficher la barre uniquement en mobile */
@media (max-width: 700px) {
    .envoi-v2-mobile-bar {
        display: flex;
    }
    /* Espace minimal en bas pour que la sticky bar ne cache pas le bouton submit */
    .envoi-v2-shell {
        padding-bottom: 5rem;
    }
}

/* ----------------------------------------------------
   9. ASIDE RÉCAP — DÉSACTIVÉ EN MOBILE (la barre prend le relais)
   ---------------------------------------------------- */
@media (max-width: 700px) {
    .envoi-v2-aside {
        display: none;
    }
}

.envoi-v2-info-banner {
    margin-top: 1rem;
}

/* ----------------------------------------------------
   9b. ARGUMENTS COMMERCIAUX SOUS LE RÉCAP
   ---------------------------------------------------- */
.envoi-v2-args {
    background: #fff;
    border: 1.5px solid var(--border, #E5E9F2);
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    margin-top: 1rem;
}
.envoi-v2-args-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--muted, #6B7280);
    margin-bottom: 0.85rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border, #E5E9F2);
}
.envoi-v2-args-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.envoi-v2-args-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #374151;
}
.envoi-v2-args-list li svg {
    flex-shrink: 0;
    color: var(--bleu, #0060AE);
    margin-top: 0.05rem;
}
.envoi-v2-args-list li strong {
    color: #0F1E3C;
    font-weight: 700;
}

/* ----------------------------------------------------
   10. AJUSTEMENTS PETITS ÉCRANS
   ---------------------------------------------------- */
@media (max-width: 600px) {
    .envoi-v2-shell {
        padding: 2rem 0rem;
    }
    /* Inputs : font 16px iOS pour éviter zoom */
    .envoi-v2-shell .field input {
        font-size: 16px !important;
    }
}

/* ----------------------------------------------------
   11. DÉLAI DE DISTRIBUTION : 2 COLONNES DESKTOP / 1 COLONNE MOBILE
   Seules 2 cards sont visibles maintenant (Lettre verte / Lettre rouge)
   ---------------------------------------------------- */
.envoi-v2-delivery-grid {
    margin-top: 0 !important;
}
 
@media (min-width: 701px) {
    .envoi-v2-delivery-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        align-items: stretch;
    }
    .envoi-v2-delivery-grid .option-radio {
        margin: 0 !important;
        min-height: auto !important;
    }
    .envoi-v2-delivery-grid .option-radio-content {
        width: 100%;
    }
    .envoi-v2-delivery-grid .option-radio-content .title {
        font-size: 0.98rem;
        margin-bottom: 0.2rem !important;
    }
    .envoi-v2-delivery-grid .option-radio-content .desc {
        font-size: 0.78rem;
        line-height: 1.35;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    .envoi-v2-delivery-grid .option-radio.hidden {
        display: none !important;
    }
}

/* ----------------------------------------------------
   12. DROPZONE FOOTER : taille à gauche, modèle à droite
   ---------------------------------------------------- */
.envoi-v2-dropzone-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 0.6rem 0 0.5rem;
    flex-wrap: wrap;
}
.envoi-v2-dropzone-footer .dropzone-hint {
    margin: 0;
    flex: 1;
    min-width: 0;
}
.envoi-v2-dropzone-footer .envoi-v2-template-link {
    flex-shrink: 0;
}
@media (max-width: 500px) {
    .envoi-v2-dropzone-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }
    .envoi-v2-dropzone-footer .envoi-v2-template-link {
        padding-top: 0.5rem;
        padding-bottom: 0;
        padding-left: 0;
    }
}

/* ----------------------------------------------------
   13. SUPPRIMER LA BORDURE JAUNE DE LA TYPE-CARD POPULAR
   (le badge POPULAIRE en jaune suffit comme accent)
   ---------------------------------------------------- */
.envoi-v2-shell .type-card.type-card-popular {
    border-color: var(--border, #E5E9F2) !important;
}
.envoi-v2-shell .type-card.type-card-popular.selected {
    border-color: var(--bleu, #0060AE) !important;
}

/* ----------------------------------------------------
   14. OPTIONS SUPPLÉMENTAIRES : taille équilibrée
   La card AR seule reste à 50% de largeur (comme couleur/recto-verso)
   en gardant le même gap pour ne pas créer de décalage visuel.
   ---------------------------------------------------- */
@media (min-width: 701px) {
    /* La section recommandé a son grid impression : on garde 2 colonnes,
       la 2e cellule sera vide naturellement. */
    [data-options-for="recommande"] .envoi-v2-impression-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
}

/* ----------------------------------------------------
   15. CHECK UNIFORME SUR TOUTES LES CARDS
   Désactive les checks hérités d'app.css et réécrit un check
   unifié (même taille, même position, même style) pour toutes
   les cards : type-card, option-radio (délai), envoi-v2-impression-card.
   ---------------------------------------------------- */

/* 1. Annule les anciens checks (app.css ou ailleurs) */
.envoi-v2-shell .option-radio.checked::after,
.envoi-v2-shell .option-radio:has(input:checked)::after,
.envoi-v2-shell .envoi-v2-impression-card.checked::before,
.envoi-v2-shell .type-card.selected .type-card-check {
    /* on les reset, on va les redéfinir uniformément */
    content: none !important;
    display: none !important;
}

/* 2. Re-déclare un check unifié sur les cards sélectionnées */
.envoi-v2-shell .option-radio.checked::after,
.envoi-v2-shell .option-radio:has(input:checked)::after,
.envoi-v2-shell .envoi-v2-impression-card.checked::after,
.envoi-v2-shell .envoi-v2-impression-card:has(input:checked)::after,
.envoi-v2-shell .type-card.selected::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    right: 12px !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    background-color: var(--bleu, #0060AE) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    transform: translateY(-50%) !important;
    /* Important pour que le pseudo s'affiche au-dessus du contenu */
    z-index: 2;
}

/* 3. Cas spécifique type-card "POPULAIRE" : aucun ajustement nécessaire
   avec le centrage vertical (top: 50%) */

/* 4. S'assurer que la card est position:relative pour que ::after se positionne dedans */
.envoi-v2-shell .option-radio,
.envoi-v2-shell .envoi-v2-impression-card,
.envoi-v2-shell .type-card {
    position: relative;
}

/* 5. Cache aussi le check natif du type-card (span avec svg) pour ne pas doubler */
.envoi-v2-shell .type-card .type-card-check {
    display: none !important;
}

/* ----------------------------------------------------
   16. SUPPRIMER LE TEXTE BLEU SUR RADIO COCHÉ
   Override la règle d'app.css qui colore le titre en bleu quand la radio
   est cochée — on garde la couleur de texte normale pour rester cohérent.
   ---------------------------------------------------- */
.envoi-v2-shell .option-radio input[type="radio"]:checked + .option-radio-content .title,
.envoi-v2-shell .option-radio.checked .option-radio-content .title,
.envoi-v2-shell .option-radio:has(input:checked) .option-radio-content .title {
    color: #0F1E3C !important;
}

/* ----------------------------------------------------
   17. HOVER UNIFORME SUR LES CARDS DU DÉLAI
   Même effet que pour Impression et Options : 
   bordure bleu translucide + léger lift + box-shadow douce
   ---------------------------------------------------- */
.envoi-v2-shell .option-radio {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
}
.envoi-v2-shell .option-radio:not(.checked):not(:has(input:checked)):hover {
    border-color: rgba(0, 96, 174, 0.35) !important;
    box-shadow: 0 4px 12px rgba(0, 96, 174, 0.08) !important;
    transform: translateY(-2px) !important;
}

/* ----------------------------------------------------
   18. FIX MOBILE : padding bottom sur la card POPULAIRE
   Le badge POPULAIRE dépasse en haut (top: -10px) ce qui peut
   donner l'impression que le contenu est collé en bas. On compense
   avec un peu de padding-bottom supplémentaire en mobile.
   ---------------------------------------------------- */
@media (max-width: 700px) {
    .envoi-v2-shell .type-card.type-card-popular {
        padding-bottom: 1.1rem !important;
        padding-top: 1rem !important;
    }
}

/* ----------------------------------------------------
   19. FIX MOBILE : padding-right sur le contenu des cards
   Pour éviter que le texte passe derrière le check bleu (top: 50%, right: 12px)
   ---------------------------------------------------- */
.envoi-v2-shell .type-card h3,
.envoi-v2-shell .type-card .desc,
.envoi-v2-shell .option-radio-content,
.envoi-v2-shell .envoi-v2-impression-label {
    padding-right: 34px;
    box-sizing: border-box;
}

/* ----------------------------------------------------
   20. FIX MOBILE : supprimer margin-bottom du dernier
   addr-block et de la dernière option-section pour éviter
   un espace résiduel en bas de la card.
   ---------------------------------------------------- */
@media (max-width: 900px) {
    .envoi-v2-shell .addr-block:last-child {
        margin-bottom: 0 !important;
    }
}
@media (max-width: 600px) {
    .option-section {
        margin-bottom: 0 !important;
    }
}


/* ============================================================
   REMPLACER LA RÈGLE 21 DANS envoi-v2.css PAR CELLE-CI
   ============================================================ */

/* ----------------------------------------------------
   21. TYPE CARDS : LISTE DE FEATURES SOUS LE TITRE
   Pas de puces, pas de padding-left pour rester aligné au titre
   ---------------------------------------------------- */
.envoi-v2-shell .type-card .type-card-features {
    grid-column: 2;
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.envoi-v2-shell .type-card .type-card-features li {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--muted, #6B7280);
    padding-left: 0;
    position: static;
}
.envoi-v2-shell .type-card .type-card-features li::before {
    content: none;
}

/* Sélection : les puces passent en couleur plus foncée */
.envoi-v2-shell .type-card.selected .type-card-features li {
    color: #4B5563;
}

/* ----------------------------------------------------
   22. NOUVELLE CARD "IMPRIMER EN RECTO" AVEC SURCHARGE DYNAMIQUE
   ---------------------------------------------------- */

/* Icône du recto (couleur bleue) */
.envoi-v2-impression-visual-recto {
    color: var(--bleu, #0060AE);
}

/* Badge affichant la surcharge "+X,XX€" à côté du titre */
.envoi-v2-surcharge-badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.4rem;
    background: rgba(0, 96, 174, 0.1);
    color: var(--bleu, #0060AE);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    vertical-align: middle;
    line-height: 1.3;
}
.envoi-v2-surcharge-badge.hidden {
    display: none;
}


/* ============================================================
   SIDEBAR RECAP STYLE LA POSTE — À AJOUTER À LA FIN DU CSS
   Remplace les règles précédentes qui cachaient la sidebar.
   ============================================================ */

/* Réactiver la sidebar en DESKTOP uniquement (min-width: 901px) */
@media (min-width: 901px) {
    /* Override la règle globale qui cachait tout */
    .envoi-v2-grid {
        grid-template-columns: minmax(0, 1fr) 340px !important;
        gap: 1.5rem;
    }
    .envoi-v2-aside,
    aside.envoi-v2-aside {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 100px !important;
        align-self: start !important;
    }
}

/* Mobile : sidebar cachée (la sticky bar prend le relais) */
@media (max-width: 900px) {
    .envoi-v2-aside,
    aside.envoi-v2-aside {
        display: none !important;
    }
}

/* --------- Card du récap --------- */
.recap-laposte {
    background: #fff;
    border: 1.5px solid #D6DCE6;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 30, 60, 0.04), 0 4px 12px rgba(15, 30, 60, 0.04);
    overflow: hidden;
}

.recap-laposte-header {
    background: #F3F6FA;
    border-bottom: 1px solid #E5E9F2;
    border-left: 4px solid var(--bleu, #0060AE);
    padding: 1rem 1.25rem;
}
.recap-laposte-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: #0F1E3C;
    letter-spacing: -0.01em;
}

.recap-laposte-section {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #F0F3F7;
}
.recap-laposte-section:last-of-type {
    border-bottom: none;
}

.recap-laposte-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--muted, #6B7280);
    margin-bottom: 0.7rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #F0F3F7;
}

.recap-laposte-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    line-height: 1.4;
}
.recap-laposte-row .label {
    color: var(--muted, #6B7280);
    flex-shrink: 0;
}
.recap-laposte-row .value {
    color: #0F1E3C;
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

/* --------- Total en bas (mis en avant) --------- */
.recap-laposte-total {
    background: linear-gradient(180deg, #F8FAFC 0%, #EFF6FB 100%);
    padding: 1.1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #E5E9F2;
}
.recap-laposte-total .label {
    font-size: 0.85rem;
    color: #0F1E3C;
    font-weight: 700;
}
.recap-laposte-total .value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--bleu, #0060AE);
    letter-spacing: -0.02em;
}

/* ============================================================
   BADGE ROUGE POUR LETTRE ROUGE — À AJOUTER À LA FIN DU CSS
   ============================================================ */

/* Badge rouge doux (pas trop pétant) pour Lettre rouge J+1 */
.envoi-v2-shell .option-radio .badge.badge-red {
    background: #E53935;  /* rouge un peu atténué (pas le rouge vif Bootstrap #DC3545) */
    color: #fff;
}