/* =====================================================================
   Option B — Variation cards (Maxence test)
   ===================================================================== */

/* Quand le module Option B est actif (body.jcs-vc-active), on cache le select
   natif WC et la description redondante (info déjà visible sur chaque card). */
body.jcs-vc-active .variations select {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}
body.jcs-vc-active .woocommerce-variation-description {
    display: none !important;
}
body.jcs-vc-active .reset_variations {
    display: none !important;
}

/* Ne PAS hide le label "Nombre de graines :" — c'est le label des cards */
body.jcs-vc-active .variations th.label,
body.jcs-vc-active .variations label {
    margin-bottom: 4px;
}

/* Wrapper des cards : léger cadre autour de tout le groupe */
.jcs-variation-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 16px !important;   /* pas de gap au-dessus, le label est juste au-dessus */
    padding: 12px;
    border: 1px solid rgba(44, 35, 112, 0.15);
    border-radius: 14px;
    background: #fdfdff;
    width: 100%;
    box-sizing: border-box;
}

/* Tasse l'espacement entre le label "Nombre de graines :" et le wrapper.
   Approche radicale : on flatten la table, on cache la cellule du select. */
body.jcs-vc-active .variations,
body.jcs-vc-active form.variations_form .variations,
body.jcs-vc-active .single-product .variations,
body.jcs-vc-active .variations tbody,
body.jcs-vc-active .variations tr {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border-spacing: 0 !important;
    border-collapse: collapse !important;
    width: 100% !important;
    line-height: normal !important;
    min-height: 0 !important;
}
body.jcs-vc-active .variations th.label,
body.jcs-vc-active .variations label {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    min-height: 0 !important;
}
/* Cellule du select : complètement cachée (le select reste dans le DOM, accessible JS) */
body.jcs-vc-active .variations td.value,
body.jcs-vc-active .variations td {
    display: none !important;
}
/* Coller le wrapper de cards juste sous le label */
body.jcs-vc-active .jcs-variation-cards {
    margin-top: 6px !important;
    margin-bottom: 14px !important;
}
/* Eliminer aussi les espaces autour du single_variation_wrap si Woodmart en met */
body.jcs-vc-active .single_variation_wrap,
body.jcs-vc-active .woocommerce-variation {
    margin-top: 0 !important;
}

/* Carte individuelle */
.jcs-vc-card {
    --vc-radius: 10px;
    appearance: none;
    background: #ffffff;
    border: 2px solid rgba(44, 35, 112, 0.14);
    border-radius: var(--vc-radius);
    padding: 14px 18px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-align: left;
    color: #1a1a1a;
    font-family: inherit;
    font-size: 1em;
    line-height: 1.3;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
    position: relative;
}
/* Hover seulement sur appareils avec souris (évite le hover persistant sur mobile
   qui masquait l'état "is-active" au tap). */
@media (hover: hover) and (pointer: fine) {
    .jcs-vc-card:hover {
        border-color: rgba(44, 35, 112, 0.45);
        background: #f4f1ff;
    }
}
.jcs-vc-card:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 35, 112, 0.18);
}
/* État actif : double bordure interne + lavande franche.
   Specificity élevée pour ne jamais être écrasé par un hover/focus résiduel. */
.jcs-variation-cards .jcs-vc-card.is-active,
.jcs-variation-cards .jcs-vc-card.is-active:hover,
.jcs-variation-cards .jcs-vc-card.is-active:focus {
    border-color: var(--jcs-primary, #2C2370);
    background: #ebe7ff;
    box-shadow: 0 2px 8px rgba(44, 35, 112, 0.18), inset 0 0 0 1px var(--jcs-primary, #2C2370);
}

/* Pseudo-radio */
.jcs-vc-radio {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(44, 35, 112, 0.25);
    border-radius: 50%;
    background: #ffffff;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    transition: border-color .15s ease;
}
.jcs-vc-card.is-active .jcs-vc-radio {
    border-color: var(--jcs-primary, #2C2370);
}
.jcs-vc-card.is-active .jcs-vc-radio::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--jcs-primary, #2C2370);
}

/* Contenu central : pack + per seed */
.jcs-vc-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.jcs-vc-pack {
    font-weight: 700;
    font-size: 1.02em;
    color: #1a1a1a;
}
.jcs-vc-per-seed {
    font-size: 0.86em;
    color: #6b6b6b;
    font-style: italic;
    font-weight: 500;
}

/* Prix à droite */
.jcs-vc-price {
    font-weight: 700;
    font-size: 1.05em;
    color: var(--jcs-primary, #2C2370);
    white-space: nowrap;
    flex-shrink: 0;
}
.jcs-vc-price .woocommerce-Price-amount {
    color: inherit;
}

/* Badge -X% (positionnée comme un sticker en haut à droite) */
.jcs-vc-badge {
    position: absolute;
    top: -8px;
    right: 14px;
    background: var(--jcs-secondary, #EC5F7A);
    color: #ffffff;
    font-size: 0.72em;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10);
    letter-spacing: 0.02em;
}

/* Mobile : un peu plus tassé */
@media (max-width: 480px) {
    .jcs-vc-card {
        padding: 12px 14px;
        gap: 10px;
    }
    .jcs-vc-pack { font-size: 0.96em; }
    .jcs-vc-per-seed { font-size: 0.8em; }
    .jcs-vc-price { font-size: 1em; }
    .jcs-vc-badge { right: 10px; font-size: 0.68em; padding: 2px 7px; }
}
