/* Sous-nom de la boîte sous le titre produit */
.zavia-box-subname-under-title {
    display: block;
    margin-top: 4px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #777;
}

/* Conteneur principal – carte sous le bouton "Ajouter au panier" */
.zavia-box-selector {
    margin-top: 32px;
    padding: 22px 24px;
    border-radius: 18px;
    border: 1px solid #e4e2dc;
    background: #fbfaf7;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.03);
    width: 100%;
    max-width: 420px;          /* largeur max de la carte */
    margin-left: auto;         /* centre dans la colonne produit */
    margin-right: auto;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

/* Titre bloc sur la fiche produit */
.zavia-box-title {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #777;
}

/* Liste horizontale des types de boîtes */
.zavia-box-groups {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 6px;
    justify-content: center;   /* centre les cartes */
}

/* Scrollbar discrète (desktop) */
.zavia-box-groups::-webkit-scrollbar {
    height: 5px;
}
.zavia-box-groups::-webkit-scrollbar-track {
    background: transparent;
}
.zavia-box-groups::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.12);
    border-radius: 999px;
}

/* Bouton d’un groupe */
.zavia-box-group-btn {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    flex: 0 0 auto;
}

/* Carte d’un groupe */
.zavia-box-group-card {
    min-width: 120px;
    padding: 10px 12px;
    border-radius: 13px;
    border: 1px solid #e5e2da;
    background: #ffffff;
    text-align: center;
    transition: all 0.18s ease;
}

/* Visuel de la boîte */
.zavia-box-group-card img {
    max-width: 60px;
    max-height: 60px;
    height: auto;
    display: block;
    margin: 0 auto 8px;
}

/* Label sous l’icône */
.zavia-box-group-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #444;
}

/* Effet hover + état actif */
.zavia-box-group-card:hover {
    border-color: #b2c59b;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

.zavia-group-active {
    border-color: #5c7b46;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* On n’affiche pas l’ancien sélecteur sur la page produit */
.zavia-box-sublist-wrapper {
    display: none !important;
}

/* -----------------------
   Modal / Popup
   -------------------- */

.zavia-box-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.zavia-box-modal.is-visible {
    opacity: 1;
}

.zavia-box-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.zavia-box-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 520px;
    width: 92%;
    background: #ffffff;
    border-radius: 18px;
    transform: translate(-50%, -45%);
    padding: 24px 22px 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.zavia-box-modal.is-visible .zavia-box-modal-content {
    opacity: 1;
    transform: translate(-50%, -50%);
}

/* Bouton fermer */
.zavia-box-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: none;
    background: transparent;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
}

/* Titre de la popup */
.zavia-box-modal-body h4 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
    color: #222;
}

/* --- Sélecteur de modèles --- */

/* Liste des modèles (pilules) */
.zavia-box-model-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    justify-content: flex-start;
    max-height: 180px;      /* limite de hauteur quand il y a beaucoup de pilules */
    overflow-y: auto;
}

.zavia-box-model-btn {
    border-radius: 999px;
    border: 1px solid #ddd;
    background: #f7f6f3;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.zavia-box-model-btn:hover {
    border-color: #b2c59b;
    background: #f0eee6;
}

.zavia-model-active {
    border-color: #5c7b46;
    background: #e4ecda;
    color: #2f3a22;
}

/* Version liste déroulante quand il y a beaucoup de modèles */
.zavia-box-model-select-wrapper {
    margin-bottom: 14px;
}

.zavia-box-model-select-label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    color: #666;
}

.zavia-box-model-select {
    width: 100%;
    border-radius: 999px;
    border: 1px solid #ddd;
    padding: 6px 14px;
    background: #f7f6f3;
    font-size: 13px;
    line-height: 1.4;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #999 50%),
                      linear-gradient(135deg, #999 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 3px),
                         calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.zavia-box-model-select:focus {
    outline: none;
    border-color: #5c7b46;
    background-color: #f0eee6;
}

/* Sous-titre sous le titre principal (modèle choisi) */
.zavia-box-model-picked {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 400;
    color: #555;
    text-align: center;
}

/* Badge Zavia dans la popup */
.zavia-box-badge-wrapper {
    margin-bottom: 10px;
    text-align: left;
}

/* On override le positionnement absolu du badge global
   pour la version "inline" dans la popup */
.zavia-box-badge-wrapper .zavia-badge {
    position: static;
    display: inline-block;
    margin-bottom: 4px;
}

/* Image du modèle + zoom dynamique */
.zavia-box-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 12px;
}

.zavia-box-modal-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    cursor: zoom-in;
    transform-origin: 50% 50%;
    transition: transform 0.28s ease, transform-origin 0.12s ease;
}

/* Zoom important au survol */
.zavia-box-image-wrapper:hover .zavia-box-modal-img {
    transform: scale(1.6); /* ajuste le facteur de zoom si tu veux */
}

.zavia-box-price {
    font-weight: 600;
    margin-bottom: 8px;
    color: #5c7b46;
}

.zavia-box-desc {
    font-size: 13px;
    color: #555;
}

/* Avertissement */
.zavia-box-warning {
    margin-top: 10px;
    font-size: 12px;
    color: #777;
}

/* Animation lors du changement de modèle */
.zavia-box-model-detail {
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.zavia-box-model-detail.is-fading-out {
    opacity: 0;
    transform: translateY(4px);
}

.zavia-box-model-detail.is-fading-in {
    opacity: 1;
    transform: translateY(0);
}

/* Bouton "Ajouter cette boîte" */
.zavia-box-add-btn {
    margin-top: 18px;
    padding: 9px 22px;
    border-radius: 999px;
    border: none;
    background: #5c7b46;            /* vert proche de ton bouton principal */
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: background 0.18s ease, transform 0.1s ease;
    position: relative;
    overflow: hidden;
}

.zavia-box-add-btn:hover {
    background: #4d6a3a;
    transform: translateY(-1px);
}

/* Spinner de chargement sur le bouton */
.zavia-box-add-btn.is-loading {
    color: transparent;
    pointer-events: none;
}

.zavia-box-add-btn.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    margin-left: -9px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: rgba(255, 255, 255, 1);
    animation: zavia-spin 0.6s linear infinite;
}

@keyframes zavia-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------------------------
   Responsive
   ------------------------ */

/* Tablette / petit écran */
@media (max-width: 1024px) {
    .zavia-box-selector {
        margin-top: 24px;
        padding: 18px 20px;
        max-width: 480px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .zavia-box-selector {
        padding: 16px 14px;
        border-radius: 14px;
        max-width: 100%;
    }

    .zavia-box-title {
        font-size: 13px;
    }

    .zavia-box-group-card {
        min-width: 110px;
        padding: 8px 10px;
    }

    .zavia-box-group-card img {
        max-width: 52px;
    }

    .zavia-box-modal-content {
        max-width: 95%;
        padding: 18px 16px 14px;
    }
}

/* ------------------------------------------------------------------
   Champ langue du texte sur la boîte (page produit + popup)
   ------------------------------------------------------------------ */

/* Le form.cart de ton thème est en flex : on le contrôle */
.single-product form.cart {  
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* évite le space-between qui colle tout à droite */
}

/* Bloc "Texte sur la boîte" */
.zavia-box-lang-field {
    margin-top: 22px;
    margin-bottom: 24px;
    padding: 16px 20px;
    border-radius: 10px;
    border: 1px solid #e4e2dc;
    background: #fbfaf7;
    font-size: 15px;          /* meilleure lisibilité */
    line-height: 1.5;
}

/* Dans le form.cart : une ligne entière, largeur limitée */
.single-product form.cart .zavia-box-lang-field {
    flex: 0 0 100%;
    max-width: 460px;         /* évite de déborder trop à droite */
}

/* Titre "Texte sur la boîte" */
.zavia-box-lang-title {
    margin: 0 0 6px;
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

/* Petite phrase d’aide */
.zavia-box-lang-help {
    margin: 0 0 8px;
    color: #777;
    font-size: 14px;
}

/* Options radio */
.zavia-box-lang-option {
    display: block;
    margin-bottom: 2px;       /* encore moins d’espace entre les options */
    font-size: 15px;
    color: #444;
}

.zavia-box-lang-option:last-child {
    margin-bottom: 0;
}

.zavia-box-lang-option input[type="radio"] {
    margin-right: 6px;
}
