/* ── Boutique Accès Restreint — Front CSS (chargé sur toutes les pages) ── */

/* ══ PAGE DE STATUT D'ACCÈS (/acces-vente/) ══════════════════════
   Template dynamique : upcoming (compte à rebours) + expired
   ══════════════════════════════════════════════════════════════ */

.bar-acces-vente {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: #f9f7f4;
}

.bar-av-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 40, 85, .10);
    padding: 56px 48px 48px;
    max-width: 580px;
    width: 100%;
    text-align: center;
}

/* ── Icône ── */
.bar-av-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #e8f0fb;
    color: #002855;
    margin-bottom: 28px;
}

.bar-av-icon--expired {
    background: #f5f5f5;
    color: #9e9e9e;
}

/* ── Titre / sous-titre ── */
.bar-av-title {
    font-family: 'Karla', Helvetica, Arial, sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: #002855;
    margin: 0 0 10px;
    line-height: 1.2;
}

.bar-av-subtitle {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 1rem;
    color: #555;
    margin: 0 0 32px;
}

.bar-av-body {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 1rem;
    color: #444;
    line-height: 1.7;
    margin: 0 0 28px;
}

/* ── Compte à rebours ── */
.bar-av-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 36px;
}

.bar-av-cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.bar-av-cd-value {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    background: #002855;
    color: #fff;
    font-family: 'Karla', Helvetica, Arial, sans-serif;
    font-size: 2rem;
    font-weight: 800;
    border-radius: 10px;
    letter-spacing: .02em;
    line-height: 1;
    transition: background .3s;
}

.bar-av-cd-label {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #888;
}

.bar-av-cd-sep {
    font-family: 'Karla', Helvetica, Arial, sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #002855;
    line-height: 1;
    margin-bottom: 22px; /* aligne avec les chiffres */
    opacity: .4;
}

/* ── Dates d'ouverture / fermeture ── */
.bar-av-dates {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f4f7fc;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    text-align: left;
}

.bar-av-dates-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: .9rem;
    color: #444;
}

.bar-av-dates-row svg {
    flex-shrink: 0;
    color: #002855;
    opacity: .7;
}

.bar-av-dates-row strong {
    color: #002855;
}

/* ── Hint ── */
.bar-av-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: .85rem;
    color: #888;
    line-height: 1.5;
    margin: 0;
    text-align: left;
}

.bar-av-hint svg {
    flex-shrink: 0;
    margin-top: 1px;
    opacity: .65;
}

/* ── Bouton retour (expired) ── */
.bar-av-btn {
    display: inline-block;
    margin-top: 28px;
    padding: 12px 28px;
    background: #002855;
    color: #fff;
    font-family: 'Karla', Helvetica, Arial, sans-serif;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 6px;
    letter-spacing: .04em;
    transition: background .2s, transform .15s;
}

.bar-av-btn:hover {
    background: #ee751c;
    color: #fff;
    transform: translateY(-1px);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .bar-av-card {
        padding: 36px 24px 32px;
    }

    .bar-av-title {
        font-size: 1.4rem;
    }

    .bar-av-cd-value {
        width: 58px;
        height: 58px;
        font-size: 1.5rem;
        border-radius: 8px;
    }

    .bar-av-cd-sep {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }

    .bar-av-countdown { gap: 8px; }
}

@media (max-width: 380px) {
    .bar-av-cd-value {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .bar-av-countdown { gap: 5px; }
}

/* ══ SIDE CART ════════════════════════════════════════════════════
   Panier flottant — chargé globalement, masqué si .bar-access-denied
   ══════════════════════════════════════════════════════════════ */

/* Masquer le side cart et le bouton toggle sans accès valide */
.bar-access-denied .bar-side-cart,
.bar-access-denied .bar-cart-toggle { display: none !important; }

/* ── Bouton toggle flottant ── */
.bar-cart-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100000;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ee751c;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(238,117,28,.35);
    transition: background .2s, transform .2s;
}

.bar-cart-toggle:hover {
    background: #d4640f;
    transform: scale(1.05);
}

.bar-cart-toggle .bar-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #002855;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* ── Panneau latéral ── */
.bar-side-cart {
    position: fixed;
    top: 0;
    right: -420px;
    padding-top: 80px; /* espace sous le header Divi fixe */
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 100000;
    box-shadow: none; /* ombre uniquement quand ouvert — évite le trait vertical sur mobile */
    transition: right .3s cubic-bezier(.4,0,.2,1), box-shadow .3s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
}

.bar-side-cart.is-open {
    right: 0;
    box-shadow: -4px 0 24px rgba(0,40,85,.12);
}

.bar-side-cart-header {
    padding: 20px;
    border-bottom: 1px solid #e8e4df;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bar-side-cart-header h3 {
    margin: 0;
    font-family: 'Karla', Helvetica, Arial, sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #002855;
    letter-spacing: .02em;
}

.bar-side-cart-close {
    background: var(--bar-green, #2e7d32);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    color: #fff;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .2s;
    flex-shrink: 0;
}

.bar-side-cart-close:hover {
    background: #256b28;
    transform: scale(1.1);
}

/* Masquer le bouton toggle quand le side cart est ouvert */
.bar-side-cart.is-open ~ .bar-cart-toggle {
    display: none !important;
}

.bar-side-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.bar-side-cart-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f0ece7;
    align-items: center;
}

.bar-side-cart-item img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.bar-side-cart-item-info { flex: 1; }

.bar-side-cart-item-name {
    font-family: 'Karla', Helvetica, Arial, sans-serif;
    font-size: .95rem;
    font-weight: 700;
    color: #002855;
    line-height: 1.3;
}

.bar-side-cart-item-price {
    color: #ee751c;
    font-size: .9rem;
    font-weight: 600;
    margin-top: 4px;
}

.bar-side-cart-item-qty {
    font-size: .8rem;
    color: #999;
    margin-top: 2px;
}

.bar-side-cart-footer {
    padding: 16px 20px 20px;
    border-top: 1px solid #e8e4df;
    background: #fcfaf7;
}

.bar-side-cart-total {
    display: flex;
    justify-content: space-between;
    font-family: 'Karla', Helvetica, Arial, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #002855;
    margin-bottom: 14px;
}

.bar-side-cart-total span:last-child { color: #ee751c; }

.bar-side-cart-btn-checkout {
    display: block;
    width: 100%;
    padding: 13px 0;
    background: #ee751c;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    font-family: 'Karla', Helvetica, Arial, sans-serif;
    font-size: .9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    text-decoration: none;
    transition: background .2s;
    margin-bottom: 10px;
}

.bar-side-cart-btn-checkout:hover {
    background: #002855;
    color: #fff;
}

.bar-side-cart-btn-cart {
    display: block;
    text-align: center;
    color: var(--bar-green, #2e7d32);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: color .2s;
}

.bar-side-cart-btn-cart:hover { color: #1b5e20; text-decoration: underline; }

/* ── Overlay ── */
.bar-side-cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,40,85,.35);
    z-index: 99999;
}

.bar-side-cart-overlay.is-open { display: block; }

/* ── Admin bar : décaler le side cart ── */
html.admin-bar .bar-side-cart {
    padding-top: 112px; /* 80px header Divi + 32px admin bar */
}

/* ══ BOUTON MENU COMPTE ══════════════════════════════════════════
   Injecté dans le menu principal via wp_nav_menu_items
   ══════════════════════════════════════════════════════════════ */

.bar-account-menu-item {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    list-style: none;
    vertical-align: middle;
}

/* Masquer le logo panier natif Divi (remplacé par notre bouton) */
.et-cart-info { display: none !important; }

.bar-account-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 8px 18px !important;
    background: #4a8c3f !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    font-family: 'Open Sans', Arial, sans-serif !important;
    font-size: .88rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background .2s !important;
    white-space: nowrap !important;
    letter-spacing: .01em !important;
    line-height: 1 !important;
    box-shadow: none !important;
    text-transform: none !important;
}

.bar-account-btn:hover {
    background: #3a6d31 !important;
    color: #fff !important;
}

.bar-account-btn__chevron {
    transition: transform .2s;
    flex-shrink: 0;
}

.bar-account-btn.is-open .bar-account-btn__chevron {
    transform: rotate(180deg);
}

/* Dropdown — positionné en fixed via JS (position absolue non fiable sur mobile Divi) */
.bar-account-dropdown {
    display: none;
    position: fixed;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,40,85,.14);
    padding: 6px 0;
    margin: 0;
    list-style: none;
    z-index: 999999;
    animation: barDropFade .15s ease;
}

.bar-account-dropdown.is-open {
    display: block;
}

@keyframes barDropFade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bar-account-dropdown li {
    margin: 0;
    padding: 0;
}

.bar-account-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: #002855;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.bar-account-dropdown a:hover {
    background: #f7f4f0;
    color: #ee751c;
}

.bar-account-dropdown a svg {
    flex-shrink: 0;
    opacity: .75;
}

/* ── Bouton mobile icon-only (injecté dans #et-top-navigation) ── */
.bar-account-btn--mobile {
    display: none !important;
}

/* Masquer le bouton desktop dans le menu mobile Divi (hamburger overlay) */
#et_mobile_nav_menu .bar-account-menu-item,
#mobile_menu .bar-account-menu-item { display: none !important; }

/* ── Responsive ── */
@media (max-width: 980px) {
    /* Bouton positionné en absolu à gauche du hamburger Divi */
    #et-top-navigation { position: relative !important; }

    .bar-account-btn--mobile {
        display: inline-flex !important;
        position: absolute !important;
        right: 4px !important;   /* à droite du hamburger */
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 99999 !important;
    }
    /* Décaler le hamburger à gauche pour laisser la place au bouton */
    #et_mobile_nav_menu { margin-right: 44px !important; }
    .bar-side-cart {
        width: 100vw;
        right: -100vw;
        padding-top: 60px;
        height: 100vh;
        height: 100dvh; /* viewport dynamique mobile */
        max-height: -webkit-fill-available;
    }
    .bar-side-cart-footer {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    html.admin-bar .bar-side-cart {
        padding-top: 92px;
    }
    .bar-side-cart.is-open { right: 0; }
    .bar-cart-toggle { bottom: 20px; right: 20px; }
}

@media (max-width: 480px) {
    .bar-side-cart-item img {
        width: 60px;
        height: 60px;
    }
    .bar-side-cart-item-name {
        font-size: .88rem;
    }
}
