/* ============================================================
   BENI IMO — Variation Format Cards  v5
   Badge intégré dans le flux (plus de position: absolute)
   ============================================================ */

/* ----- Reset table WooCommerce ----- */
.variations_form .variations,
.variations_form .variations tbody,
.variations_form .variations tr,
.variations_form .variations td,
.variations_form .variations th {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border: none !important;
}

.variations_form .variations th.label {
    padding-bottom: 6px !important;
}

/* ----- Conteneur des cards ----- */
.beniimo-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;          /* espace plus généreux pour loger le badge */
    margin-top: 10px;
    width: 100%;
    max-width: 480px;
    box-sizing: border-box;
}

/* ----- Card : overflow visible pour que le badge dépasse ----- */
.beniimo-card {
    position: relative;
    display: block;
    border: 1.5px solid #e2d9ed;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
    box-sizing: border-box;
    width: 100%;
    overflow: visible;  /* badge peut dépasser */
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    outline: none;
}

.beniimo-card:hover      { border-color: #7a4fa3; box-shadow: 0 2px 10px rgba(122,79,163,.12); }
.beniimo-card:focus-visible { border-color: #7a4fa3; box-shadow: 0 0 0 3px rgba(122,79,163,.25); }
.beniimo-card.is-selected   { border-color: #7a4fa3; background: #faf7fd; box-shadow: 0 2px 14px rgba(122,79,163,.14); }

/* ----- Badge : DANS LE FLUX, centré au-dessus du contenu ----- */
.beniimo-badge {
    display: block;
    width: fit-content;
    margin: 0 auto;             /* centré horizontalement */
    transform: translateY(-50%);/* remonte à cheval sur la bordure */
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: 20px;
    white-space: nowrap;
    line-height: 1.4;
    /* NE PAS mettre position:absolute ici */
}

.beniimo-badge--gold   { background: #b8955a; color: #fff; }
.beniimo-badge--purple { background: #7a4fa3; color: #fff; }

/* ----- Zone de contenu de la card ----- */
.beniimo-card__body {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: start;
    gap: 10px;
    min-width: 0;
    padding: 12px 14px 14px 14px;
}

/* Card sans badge : padding normal en haut */
.beniimo-card:not(:has(.beniimo-badge)) .beniimo-card__body {
    padding-top: 14px;
}

/* Card avec badge : padding réduit en haut (badge occupe l'espace) */
.beniimo-card:has(.beniimo-badge) .beniimo-card__body {
    padding-top: 4px;
}

/* ----- Radio ----- */
.beniimo-radio {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #c9b8da;
    background: #fff;
    flex-shrink: 0;
    margin-top: 2px;
    transition: border-color 0.2s ease;
}

.beniimo-radio__dot {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.2s ease;
}

.beniimo-card.is-selected .beniimo-radio      { border-color: #7a4fa3; }
.beniimo-card.is-selected .beniimo-radio__dot { background: #7a4fa3; }

/* ----- Texte ----- */
.beniimo-card__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

.beniimo-card__title {
    font-size: 14px;
    font-weight: 600;
    color: #2d1a3e;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
}

.beniimo-card__desc {
    font-size: 12px;
    color: #7a6f87;
    line-height: 1.45;
}

/* ----- Prix ----- */
.beniimo-card__pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    white-space: nowrap;
}

.beniimo-card__price,
.beniimo-card__price .woocommerce-Price-amount {
    font-size: 15px;
    font-weight: 700;
    color: #2d1a3e;
}

.beniimo-card__pkg {
    font-size: 10px;
    color: #a090b5;
}

/* ============================================================
   TABLETTE (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    .beniimo-cards {
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ============================================================
   MOBILE (≤ 480px) — prix sous le texte
   ============================================================ */
@media (max-width: 480px) {

    .beniimo-cards {
        padding-left: 12px;
        padding-right: 12px;
        gap: 18px;
    }

    .beniimo-card__body {
        grid-template-columns: 20px 1fr;
        grid-template-rows: auto auto;
        gap: 6px;
    }

    .beniimo-card__pricing {
        grid-column: 2 / 3;
        grid-row: 2;
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
        white-space: normal;
    }
}

/* ============================================================
   TRÈS PETIT MOBILE (≤ 360px)
   ============================================================ */
@media (max-width: 360px) {
    .beniimo-cards        { padding-left: 8px; padding-right: 8px; }
    .beniimo-card__title  { font-size: 13px; }
    .beniimo-card__desc   { font-size: 11px; }
}
