/**
 * WS Booster - Widget Onglets Avances
 */

.ws-tabs {
    width: 100%;
}

.ws-tabs--vertical {
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: 20px;
}

.ws-tabs__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.ws-tabs--vertical .ws-tabs__nav {
    flex-direction: column;
    flex-wrap: nowrap;
    margin-bottom: 0;
}

.ws-tab__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.ws-tab__btn:hover {
    transform: translateY(-1px);
}

.ws-tab__btn.is-active {
    background: #ef3340;
    color: #fff;
    font-weight: 600;
}

.ws-tab__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ws-tab__icon i,
.ws-tab__icon svg {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* Panneaux */
.ws-tabs__panels {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.ws-tabs__panel {
    display: none;
    padding: 24px;
    color: #1f2937;
    animation: ws-tabs-fade 0.25s ease-out;
}

.ws-tabs__panel.is-active {
    display: block;
}

@keyframes ws-tabs-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ws-tabs__panel-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.ws-tabs__panel-text > *:first-child { margin-top: 0; }
.ws-tabs__panel-text > *:last-child { margin-bottom: 0; }

/* Variantes de position image */
.ws-tabs--img-top .ws-tabs__panel {
    display: none;
}
.ws-tabs--img-top .ws-tabs__panel.is-active {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ws-tabs--img-bottom .ws-tabs__panel.is-active {
    display: flex;
    flex-direction: column-reverse;
    gap: 16px;
}

.ws-tabs--img-left .ws-tabs__panel.is-active,
.ws-tabs--img-right .ws-tabs__panel.is-active {
    display: grid;
    gap: 20px;
    align-items: center;
}

.ws-tabs--img-left .ws-tabs__panel.is-active {
    grid-template-columns: minmax(0, 0.8fr) 1fr;
}

.ws-tabs--img-right .ws-tabs__panel.is-active {
    grid-template-columns: 1fr minmax(0, 0.8fr);
}

.ws-tabs--img-right .ws-tabs__panel-image {
    order: 2;
}

@media (max-width: 768px) {
    .ws-tabs--vertical {
        grid-template-columns: 1fr;
    }
    .ws-tabs--vertical .ws-tabs__nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .ws-tabs--img-left .ws-tabs__panel.is-active,
    .ws-tabs--img-right .ws-tabs__panel.is-active {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ws-tabs__panel,
    .ws-tab__btn {
        animation: none;
        transition: none;
    }
}

/* ==========================================================================
   SKINS visuels pour les tabs horizontaux / verticaux (pas stack-scroll)
   ========================================================================== */

/* Skin BOXED : onglets qui se connectent au panneau (look desktop classique) */
.ws-tabs-skin-boxed .ws-tabs__nav {
    gap: 2px;
    margin-bottom: 0;
    padding-left: 4px;
    border-bottom: 2px solid #e2e8f0;
}

.ws-tabs-skin-boxed .ws-tab__btn {
    border-radius: 10px 10px 0 0;
    padding: 14px 24px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -2px;
    position: relative;
    font-weight: 500;
}

.ws-tabs-skin-boxed .ws-tab__btn.is-active {
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    border-color: #e2e8f0;
    border-bottom: 2px solid #fff;
    z-index: 2;
}

.ws-tabs-skin-boxed .ws-tabs__panels {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
}

/* Skin UNDERLINE : juste soulignement */
.ws-tabs-skin-underline .ws-tabs__nav {
    border-bottom: 1px solid #e2e8f0;
    gap: 24px;
    padding: 0;
}

.ws-tabs-skin-underline .ws-tab__btn {
    background: transparent;
    border-radius: 0;
    padding: 14px 0;
    color: #64748b;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.ws-tabs-skin-underline .ws-tab__btn.is-active {
    background: transparent;
    color: #0f172a;
    border-bottom-color: currentColor;
    font-weight: 600;
}

.ws-tabs-skin-underline .ws-tabs__panels {
    background: transparent;
}

/* Skin MINIMAL : juste couleur */
.ws-tabs-skin-minimal .ws-tab__btn {
    background: transparent;
    color: #94a3b8;
    padding: 6px 0;
    margin-right: 24px;
    border-radius: 0;
}

.ws-tabs-skin-minimal .ws-tab__btn.is-active {
    background: transparent;
    color: #0f172a;
    font-weight: 700;
}

.ws-tabs-skin-minimal .ws-tabs__panels {
    background: transparent;
    padding-top: 12px;
}

/* Skin CARD : chaque panneau dans une card detachee, onglets en pills au-dessus */
.ws-tabs-skin-card .ws-tabs__nav {
    margin-bottom: 16px;
}

.ws-tabs-skin-card .ws-tabs__panels {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

/* Skin PILLS : style par defaut, deja defini au-dessus */

/* ==========================================================================
   Mode Stack-Scroll : fiches empilees au scroll avec sticky + header colore
   ========================================================================== */

.ws-tabs-stack {
    width: 100%;
    position: relative;
}

.ws-tabs-stack__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 6px;
    background: #f3f4f6;
    border-radius: 999px;
    width: fit-content;
    max-width: 100%;
}

.ws-tabs-stack__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
}

.ws-tabs-stack__chip:hover {
    color: #1a1a2e;
}

.ws-tabs-stack__chip.is-active {
    background: var(--chip-bg, #1a1a2e);
    color: #fff;
    font-weight: 600;
}

.ws-tabs-stack__chip-icon {
    display: inline-flex;
}

.ws-tabs-stack__chip-icon svg,
.ws-tabs-stack__chip-icon i {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.ws-tabs-stack__cards {
    position: relative;
}

/* Runway de scroll OBLIGATOIRE pour l'effet d'empilement.
   position:sticky ne fige un element que tant que le CONTENT BOX de son bloc
   conteneur a de la place sous lui (le padding ne compte PAS). Sans runway, le
   conteneur fait exactement la hauteur des cartes => la DERNIERE carte n'a
   aucune place pour se figer et defile avec la page ("la carte nous suit").
   Ce spacer est un vrai enfant : il agrandit le content box du conteneur, donc
   TOUTES les cartes (derniere incluse) peuvent se coller et rester attachees
   au stack pendant qu'on scrolle a travers le runway. */
.ws-tabs-stack__runway {
    height: 60vh;
    pointer-events: none;
}

.ws-tabs-stack__card {
    position: sticky;
    top: var(--ws-stack-top, 20px);
    display: block;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    transition: transform 0.3s ease;
}

a.ws-tabs-stack__card:hover {
    transform: translateY(-4px);
}

.ws-tabs-stack__header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    font-weight: 700;
    font-size: 16px;
    color: #1a1a2e;
}

.ws-tabs-stack__header-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
}

.ws-tabs-stack__header-label {
    letter-spacing: 0.01em;
}

.ws-tabs-stack__body {
    position: relative;
    padding: 40px 48px 48px;
}

.ws-tabs-stack__heading {
    margin: 0 0 24px;
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #1a1a2e;
}

.ws-tabs-stack__specs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-bottom: 32px;
    color: #64748b;
    font-size: 15px;
}

.ws-tabs-stack__spec {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ws-tabs-stack__spec-icon,
.ws-tabs-stack__spec svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.ws-tabs-stack__spec-sep {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
    display: inline-block;
}

.ws-tabs-stack__text {
    margin-bottom: 28px;
    color: #475569;
    line-height: 1.6;
}

.ws-tabs-stack__text > *:first-child { margin-top: 0; }
.ws-tabs-stack__text > *:last-child { margin-bottom: 0; }

.ws-tabs-stack__image {
    border-radius: 16px;
    overflow: hidden;
}

.ws-tabs-stack__image img {
    display: block;
    width: 100%;
    height: auto;
}

.ws-tabs-stack__arrow {
    position: absolute;
    top: 28px;
    right: 28px;
    opacity: 0;
    color: #1a1a2e;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.ws-tabs-stack__card:hover .ws-tabs-stack__arrow {
    opacity: 1;
    transform: translate(4px, -4px);
}

@media (max-width: 768px) {
    .ws-tabs-stack__body {
        padding: 28px 24px 32px;
    }
    .ws-tabs-stack__specs {
        gap: 10px;
        font-size: 13px;
    }
    .ws-tabs-stack__spec-sep {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ws-tabs-stack__card,
    .ws-tabs-stack__arrow,
    .ws-tabs-stack__chip {
        transition: none;
    }
}

/* ============================================================
   Skin "pills-bg" : container gris arrondi avec pills a l'interieur
   (style Webflow / shadcn)
   ============================================================ */
.ws-tabs-skin-pills-bg .ws-tabs__nav {
    display: inline-flex;
    background-color: #f1f5f9;
    border-radius: 100px;
    padding: 4px;
    gap: 0;
}
.ws-tabs-skin-pills-bg .ws-tab__btn {
    background: transparent;
    border-radius: 100px;
    transition: background-color 0.25s ease, color 0.25s ease;
}
.ws-tabs-skin-pills-bg .ws-tab__btn.is-active {
    background-color: #0f172a;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* ============================================================
   Stack header style "volet" : onglet de dossier qui depasse
   au-dessus de la carte (comme l'image Vaultik / Cook.in)
   ============================================================ */
.ws-tabs-stack__card {
    overflow: visible !important;
}
.ws-tabs-stack__header--tab {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 24px 8px;
    border-radius: 12px 12px 0 0;
    font-weight: 700;
    font-size: 13px;
    color: inherit;
    z-index: 1;
    pointer-events: none;
    /* Cree l'illusion que l'onglet sort de la carte */
}

/* Aucun en-tete : on retire le bandeau */
.ws-tabs-stack__header--none {
    display: none !important;
}

/* En-tete bandeau : style par defaut conserve */
.ws-tabs-stack__header--bar {
    /* heritage du .ws-tabs-stack__header existant */
}

/* === VOLET (header tab) : positions LEFT / RIGHT === */
.ws-stack-volet-left .ws-tabs-stack__header--tab {
    top: 50%;
    left: -36px;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: right center;
    padding: 6px 18px 8px;
    border-radius: 12px 12px 0 0;
    white-space: nowrap;
}

.ws-stack-volet-right .ws-tabs-stack__header--tab {
    top: 50%;
    left: auto;
    right: -36px;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: left center;
    padding: 6px 18px 8px;
    border-radius: 12px 12px 0 0;
    white-space: nowrap;
}

.ws-stack-volet-top .ws-tabs-stack__header--tab {
    /* defaut existant */
}

/* Quand mode volet est actif : on cache la nav du haut (deja fait via condition PHP) */
.ws-stack-header-tab .ws-tabs-stack__nav {
    display: none !important;
}
