/**
 * Style de la barre de navigation — Redesign Premium
 * @author Shawn Dutil
 */

/* ===========================
   VARIABLES GLOBALES
   (partagées avec l'accueil)
=========================== */
:root {
    --vert-profond:  #1c2e1c;
    --vert-fonce:    #243824;
    --vert-moyen:    #3a5a3a;
    --or:            #c9a84c;
    --or-clair:      #e0c870;
    --or-pale:       #f5e9c0;
    --creme:         #f8f3e8;
    --blanc:         #ffffff;
    --texte-sombre:  #1a1a1a;
    --navbar-h:      90px;
}

/* ===========================
   RESET / BASE BODY
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    background: var(--creme);
}

body {
    font-family: 'Raleway', 'Georgia', sans-serif;
    background: var(--creme);
    color: var(--texte-sombre);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===========================
   HEADER
=========================== */
.Header-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--vert-profond);
    border-bottom: 1px solid rgba(201, 168, 76, 0.25);
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
    height: var(--navbar-h);

    /* Ligne dorée subtile en haut */
    border-top: 2px solid var(--or);
}

/* ===========================
   NAVBAR
=========================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    height: 100%;
    gap: 24px;
}

/* ===========================
   LOGO
=========================== */
.navbar-logo {
    flex-shrink: 0;
}

.navbar-logo .logo {
    height: 70px;
    width: auto;
    display: block;
    /* TODO: remplacer par un PNG avec fond transparent */
    border-radius: 50%;
    border: 2px solid rgba(201, 168, 76, 0.5);
    box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.15), 0 3px 12px rgba(0,0,0,0.4);
    transition: opacity 0.25s ease, transform 0.3s ease;
}

.navbar-logo .logo:hover {
    opacity: 0.85;
    transform: scale(1.03);
}

/* ===========================
   MENU MOBILE WRAPPER
   (sert aussi de menu desktop)
=========================== */
.menu-mobile {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: space-between;
    gap: 0;
}

/* ===========================
   LISTES DE LIENS
=========================== */
.navbar-section {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 4px;
}

.navbar-left  { justify-content: flex-start; }
.navbar-right { justify-content: flex-end; }

/* ===========================
   LIENS
=========================== */
.navbar_link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Raleway', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.78);
    padding: 8px 14px;
    border-radius: 2px;
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.navbar_link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 14px;
    right: 14px;
    height: 1px;
    background: var(--or);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar_link:hover {
    color: var(--or-clair);
}

.navbar_link:hover::after {
    transform: scaleX(1);
}

/* Lien actif */
.navbar_link.actif {
    color: var(--or);
}
.navbar_link.actif::after {
    transform: scaleX(1);
}

/* ===========================
   PANIER + BADGE
=========================== */
.badge-panier {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--or);
    color: var(--vert-profond);
    font-family: 'Raleway', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 9px;
    line-height: 1;
    animation: badgePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes badgePop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ===========================
   DROPDOWN (Mon compte)
=========================== */
.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 170px;
    background: var(--vert-fonce);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-top: 2px solid var(--or);
    border-radius: 0 0 4px 4px;
    list-style: none;
    padding: 8px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    z-index: 100;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content li a {
    display: block;
    padding: 10px 18px;
    font-family: 'Raleway', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.78);
    transition: color 0.2s ease, background 0.2s ease, padding-left 0.2s ease;
}

.dropdown-content li a:hover {
    color: var(--or-clair);
    background: rgba(201, 168, 76, 0.08);
    padding-left: 22px;
}

/* ===========================
   SÉPARATEUR VERTICAL
=========================== */
.navbar-right {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 16px;
}

/* ===========================
   BURGER (mobile)
=========================== */
.navbar-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 2px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
    /* Mobile : élimine le délai 300ms et le flash au tap */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.navbar-burger:hover {
    border-color: var(--or);
}

.burger-bar {
    display: block;
    width: 20px;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 2px;
    transition: background 0.2s ease;
}

.navbar-burger:hover .burger-bar {
    background: var(--or);
}

/* Bouton fermer (mobile) */
.menu-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--or);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    margin-bottom: 16px;
    align-self: flex-start;
}

/* ===========================
   RESPONSIVE MOBILE
=========================== */
@media (max-width: 900px) {
    .navbar-burger { display: flex; }

    .menu-mobile {
        position: fixed;
        top: 0;
        left: 0;
        width: min(320px, 85vw);
        height: 100dvh;
        background: var(--vert-profond);
        border-right: 1px solid rgba(201, 168, 76, 0.2);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 24px 20px;
        gap: 0;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        z-index: 999;
    }

    .menu-mobile.open {
        transform: translateX(0);
    }

    .menu-close-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        font-family: 'Raleway', sans-serif;
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.55);
    }
    .menu-close-btn:hover { color: var(--or); }

    .navbar-section {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
    }

    .navbar-right {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        margin-top: 16px;
        padding-top: 16px;
    }

    .navbar_link {
        font-size: 0.88rem;
        padding: 14px 12px;
        border-radius: 2px;
    }

    .navbar_link::after {
        bottom: 6px;
        left: 12px;
        right: 12px;
    }

    .dropdown-content {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 2px solid rgba(201, 168, 76, 0.3);
        border-top: none;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.2);
        margin-left: 12px;
        padding: 4px 0;
    }

    .dropdown-content li a {
        font-size: 0.82rem;
        padding: 10px 16px;
    }

    /* Overlay derrière le menu mobile */
    .menu-mobile::before {
        content: '';
        position: fixed;
        inset: 0;
        left: min(320px, 85vw);
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .menu-mobile.open::before {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 480px) {
    .navbar { padding: 0 16px; }
}

/* ===========================
   TOGGLE CSS PUR (sans JS)
=========================== */

/* Cache la checkbox */
.menu-toggle-input {
    display: none;
}

/* Quand cochée → menu visible */
.menu-toggle-input:checked ~ .menu-mobile {
    transform: translateX(0) !important;
}

/* Overlay visible quand menu ouvert */
.menu-toggle-input:checked ~ .menu-mobile::before {
    opacity: 1 !important;
    pointer-events: auto !important;
}