@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables (cohérentes avec stylelog.css) ── */
:root {
    --h-bg: #ffffff;
    --h-surface: #f4f6f9;
    --h-border: rgba(15, 52, 96, 0.10);
    --h-border-mid: rgba(15, 52, 96, 0.18);
    --h-accent: #0f3460;
    --h-accent-dim: rgba(15, 52, 96, 0.10);
    --h-accent-glow: rgba(15, 52, 96, 0.18);
    --h-text: #0d1b2a;
    --h-text-soft: #4a5568;
    --h-text-muted: #7a8a9a;
    --h-danger: #f87171;
    --h-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --h-t: 0.22s;
}

/* ── TOP BAR ── */
.header-topbar {
    background: var(--h-bg);
    border-bottom: 1px solid var(--h-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 7px 20px;
    position: relative;
    overflow: hidden;
}

/* scan-line animation */
.header-topbar::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(15, 52, 96, 0.35), transparent);
    animation: headerScan 5s linear infinite;
}

@keyframes headerScan {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.topbar-text {
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--h-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-text .bi-lightning-charge-fill {
    color: var(--h-accent);
    font-size: 0.7rem;
}

.topbar-sep {
    color: var(--h-border-mid);
    font-size: 0.8rem;
}

/* ── NAVBAR ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--h-bg);
    box-shadow: 0 1px 0 var(--h-border), 0 8px 32px rgba(15, 52, 96, 0.08);
}

.navbar {
    background: var(--h-surface) !important;
    border-bottom: 1px solid var(--h-border);
    padding: 0;
}

.nav-inner {
    display: flex;
    align-items: center;
    min-height: 64px;
    padding: 0 20px;
    gap: 24px;
}

/* ── Logo ── */
.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 60px;
    width: 130px;
    opacity: 0.92;
    transition: opacity var(--h-t) var(--h-ease), transform var(--h-t) var(--h-ease);
}

.nav-logo:hover .logo-img {
    opacity: 1;
    transform: scale(1.04);
}

/* ── Toggler mobile ── */
.nav-toggler {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 1px solid var(--h-border-mid);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    margin-left: auto;
}

.toggler-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--h-text-soft);
    border-radius: 2px;
    transition: all var(--h-t) var(--h-ease);
}

/* ── Menu central ── */
.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}

.nav-menu-link {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--h-text-soft);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    transition: color var(--h-t) var(--h-ease), background var(--h-t) var(--h-ease);
}

.nav-menu-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--h-accent);
    border-radius: 2px;
    transition: width var(--h-t) var(--h-ease);
}

.nav-menu-link:hover,
.nav-menu-link.active {
    color: var(--h-text);
    background: rgba(15, 52, 96, 0.05);
}

.nav-menu-link:hover::after,
.nav-menu-link.active::after {
    width: 60%;
}

/* Promotions */
.nav-promo {
    color: var(--h-danger) !important;
}

.nav-promo:hover,
.nav-promo.active {
    background: rgba(248, 113, 113, 0.08) !important;
    color: var(--h-danger) !important;
}

.nav-promo::after {
    background: var(--h-danger) !important;
}

.promo-icon {
    font-size: 0.8rem;
}

/* ── Actions droite ── */
.nav-actions {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
    flex-shrink: 0;
}

/* Bouton panier */
.btn-cart {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--h-accent-dim);
    border: 1px solid rgba(15, 52, 96, 0.2);
    border-radius: 10px;
    color: var(--h-accent);
    font-size: 1.15rem;
    text-decoration: none;
    transition: background var(--h-t) var(--h-ease), box-shadow var(--h-t) var(--h-ease), transform var(--h-t) var(--h-ease);
}

.btn-cart:hover {
    background: rgba(15, 52, 96, 0.18);
    box-shadow: 0 0 20px var(--h-accent-glow);
    transform: translateY(-1px);
    color: var(--h-accent);
}

.cart-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    background: var(--h-accent);
    color: #ffffff;
    font-family: 'DM Mono', monospace;
    font-size: 0.62rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--h-surface);
}

/* Boutons actions (commandes, logout, login) */
.btn-nav-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid var(--h-border-mid);
    background: transparent;
    color: var(--h-text-soft);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--h-t) var(--h-ease);
}

.btn-nav-action i {
    font-size: 0.9rem;
}

.btn-orders:hover {
    background: rgba(15, 52, 96, 0.05);
    border-color: var(--h-border-mid);
    color: var(--h-text);
}

.btn-logout {
    position: relative;
}

.btn-logout .logout-icon {
    opacity: 0;
    transform: translateX(-4px);
    transition: all var(--h-t) var(--h-ease);
    font-size: 0.8rem;
    color: var(--h-danger);
}

.btn-logout:hover {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.07);
    color: var(--h-text);
}

.btn-logout:hover .logout-icon {
    opacity: 1;
    transform: translateX(0);
}

/* Bouton login */
.btn-login {
    background: var(--h-accent);
    color: #ffffff !important;
    border: none;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    font-size: 0.85rem;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s var(--h-ease);
}

.btn-login:hover::before {
    left: 160%;
}

.btn-login:hover {
    background: #1a4a7a;
    box-shadow: 0 0 20px var(--h-accent-glow);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.btn-login::after {
    display: none;
}

/* Badge PRO */
.badge-pro {
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 1px;
    background: var(--h-accent);
    color: #ffffff;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ── Dropdown auth ── */
.dropdown-auth {
    background: #eef1f5;
    border: 1px solid var(--h-border-mid);
    border-radius: 14px;
    padding: 8px;
    min-width: 240px;
    margin-top: 8px !important;
    box-shadow: 0 20px 40px rgba(15, 52, 96, 0.12), 0 0 0 1px rgba(15, 52, 96, 0.04);
    animation: dropIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-header-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--h-text-muted);
    padding: 6px 12px 10px;
}

.dropdown-auth-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--h-text);
    transition: background var(--h-t) var(--h-ease), transform var(--h-t) var(--h-ease);
}

.dropdown-auth-item:hover {
    background: rgba(15, 52, 96, 0.06);
    color: var(--h-text);
    transform: translateX(4px);
}

.dropdown-auth-item strong {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--h-text);
}

.dropdown-auth-item small {
    font-size: 0.78rem;
    color: var(--h-text-soft);
}

.auth-item-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 52, 96, 0.05);
    border: 1px solid var(--h-border);
    border-radius: 9px;
    font-size: 1.1rem;
    color: var(--h-text-soft);
    flex-shrink: 0;
    transition: all var(--h-t) var(--h-ease);
}

.dropdown-auth-item:hover .auth-item-icon {
    background: var(--h-accent-dim);
    border-color: rgba(15, 52, 96, 0.2);
    color: var(--h-accent);
}

.auth-item-icon--pro {
    background: rgba(15, 52, 96, 0.07);
    border-color: rgba(15, 52, 96, 0.15);
    color: var(--h-accent);
}

.dropdown-divider-dark {
    height: 1px;
    background: var(--h-border);
    margin: 6px 0;
}

/* ── BARRE DE RECHERCHE ── */
.search-bar-wrap {
    background: var(--h-bg);
    border-bottom: 1px solid var(--h-border);
    padding: 12px 0;
}

.search-inner {
    max-width: 680px;
    margin: 0 auto;
    position: relative;
    padding: 0 20px;
}

.search-field {
    display: flex;
    align-items: center;
    background: #eef1f5;
    border: 1px solid var(--h-border-mid);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color var(--h-t) var(--h-ease), box-shadow var(--h-t) var(--h-ease);
}

.search-field:focus-within {
    border-color: rgba(15, 52, 96, 0.4);
    box-shadow: 0 0 0 3px var(--h-accent-glow);
}

.search-field-icon {
    padding: 0 14px 0 18px;
    color: var(--h-text-muted);
    font-size: 0.95rem;
    pointer-events: none;
    transition: color var(--h-t);
}

.search-field:focus-within .search-field-icon {
    color: var(--h-accent);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 13px 12px 13px 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--h-text);
    outline: none;
}

.search-input::placeholder {
    color: var(--h-text-muted);
}

.search-submit {
    background: var(--h-accent);
    color: #ffffff;
    border: none;
    padding: 13px 22px;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--h-t) var(--h-ease);
    position: relative;
    overflow: hidden;
}

.search-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s var(--h-ease);
}

.search-submit:hover::before {
    left: 160%;
}

.search-submit:hover {
    background: #1a4a7a;
}

/* ── Résultats de recherche ── */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 20px;
    right: 20px;
    background: #eef1f5;
    border: 1px solid var(--h-border-mid);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(15, 52, 96, 0.12);
    z-index: 9999;
    display: none;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.3s var(--h-ease);
}

.search-dropdown.show {
    display: block;
    max-height: 380px;
    opacity: 1;
    overflow-y: auto;
}

.search-dropdown>div {
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--h-t);
    border-bottom: 1px solid var(--h-border);
    display: flex;
    align-items: center;
    gap: 14px;
}

.search-dropdown>div:last-child {
    border-bottom: none;
}

.search-dropdown>div:hover {
    background: rgba(15, 52, 96, 0.04);
}

/* scrollbar custom */
.search-dropdown::-webkit-scrollbar {
    width: 4px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: var(--h-border-mid);
    border-radius: 4px;
}

/* ── RESPONSIVE ── */
@media (max-width: 991px) {
    .nav-toggler {
        display: flex;
    }

    .navbar-collapse {
        background: var(--h-surface);
        border-top: 1px solid var(--h-border);
        padding: 16px 20px 20px;
    }

    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        width: 100%;
        margin-bottom: 16px !important;
    }

    .nav-menu-link {
        width: 100%;
        padding: 10px 14px;
    }

    .nav-actions {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 8px;
    }

    .nav-actions li {
        width: 100%;
    }

    .btn-cart {
        width: 100%;
        height: 44px;
        border-radius: 10px;
        justify-content: center;
    }

    .btn-nav-action,
    .btn-login {
        width: 100%;
        justify-content: center;
    }

    .dropdown-auth {
        position: static !important;
        transform: none !important;
        box-shadow: none;
        border: 1px solid var(--h-border);
        margin-top: 4px !important;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-topbar {
        display: none;
    }

    .search-submit span {
        display: none;
    }
}