/* ==========================================================================
   Header-Scoped Dark Design Tokens (Isolated from Global Styles)
   ========================================================================== */
.app-header,
.mobile-drawer {
    --header-bg: #0a0d09;
    --header-surface: #121811;
    --header-subtle: rgba(255, 255, 255, 0.05);
    --header-border: rgba(255, 255, 255, 0.1);
    --header-text: #f5f6f4;
    --header-muted: #8e958c;
    --header-gold: #ffcf8d;
    --header-rose: #efaa9c;

    --radius-full: 9999px;
    --radius-md: 10px;
    --radius-sm: 6px;

    --shadow-dropdown: 0 20px 45px rgba(0, 0, 0, 0.25);
    --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Header Container & Layout (Permanently Dark)
   ========================================================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background-color: #0a0d09 !important;
    color: #f5f6f4 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-main {
    padding: 0.75rem 0;
}

.header-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.header-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand {
    display: inline-flex;
    align-items: center;
}

.brand-logo {
    display: inline-block;
    width: 170px;
    height: 42px;
    background-image: url('/assets/logos/wunderbarf-logo.webp');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: contain;
    vertical-align: middle;
}

/* ==========================================================================
   Search Bar
   ========================================================================== */
.search-box {
    position: relative;
    flex: 1 1 380px;
    max-width: 480px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    width: 18px;
    height: 18px;
    color: #8e958c;
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 42px;
    padding: 0 1rem 0 2.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    color: #f5f6f4 !important;
    font-size: 0.88rem;
    outline: none;
    transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-input::placeholder {
    color: rgba(245, 246, 244, 0.55);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #ffcf8d;
    box-shadow: 0 0 0 3px rgba(255, 207, 141, 0.15);
}

/* ==========================================================================
   Action Buttons & Popovers
   ========================================================================== */
.popover-wrapper {
    position: relative;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 42px;
    padding: 0 0.5rem;
    background: transparent;
    border: none;
    box-shadow: none;
    color: #f5f6f4 !important;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.action-btn:hover,
.popover-wrapper.is-open .action-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #ffcf8d !important;
}

.action-btn:focus-visible {
    outline: 2px solid #ffcf8d;
    outline-offset: 2px;
}

/* 2. Common Action Icon Base (Account & Cart) */
.action-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    pointer-events: none;
    flex-shrink: 0;
}

/* 3. Action Icon Image Sources */
.action-icon--account {
    background-image: url('/assets/small%20icons/Hesabim-small-icon.webp');
}

.action-icon--cart {
    background-image: url('/assets/small%20icons/Cart-small-icon.webp');
}

.action-badge {
    background: #ffcf8d;
    color: #000;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
}

/* ==========================================================================
   Hesabım & Cart Dropdowns (Glassmorphic Pinkish-White + Black Text)
   ========================================================================== */
.popover-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    padding: 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(239, 170, 156, 0.45);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
}

.popover-wrapper.is-open .popover-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.popover-header {
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    color: #4a403e;
    border-bottom: 1px solid rgba(239, 170, 156, 0.35);
    margin-bottom: 0.4rem;
}

.cart-popover-header{    
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    color: #000000;
    border-bottom: 1px solid rgba(239, 170, 156, 0.35);
    margin-bottom: 0.4rem;
}

.popover-header strong {
    color: #000000;
}

.popover-item {
    display: block;
    padding: 0.55rem 0.8rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: #000000 !important;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.popover-item:hover {
    background: rgba(239, 170, 156, 0.28);
    color: #000000 !important;
}

.popover-item--accent {
    color: #c84e38 !important;
    font-weight: 700;
}

.popover-state {
    padding: 0.75rem 0.6rem;
    text-align: center;
}

.popover-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    color: #000000;
}

.popover-subtitle {
    display: block;
    font-size: 0.76rem;
    color: #4a403e;
    margin-top: 0.2rem;
}

.logout-form {
    margin-top: 0.4rem;
    border-top: 1px solid rgba(239, 170, 156, 0.35);
    padding-top: 0.4rem;
}

.logout-btn {
    width: 100%;
    padding: 0.5rem 0.8rem;
    background: transparent;
    border: none;
    color: #c84e38;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.logout-btn:hover {
    background: rgba(239, 170, 156, 0.25);
}

/* ==========================================================================
   Desktop Navigation (Full-Width with Icon Transitions)
   ========================================================================== */
.desktop-nav {
    position: relative;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
}

.desktop-nav .header-container {
    max-width: 100% !important;
    width: 100%;
    padding: 0;
    margin: 0;
}

.nav-list {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.nav-item {
    position: static;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.nav-item:last-child {
    border-right: none;
}

.nav-item:hover,
.nav-item:focus-within {
    background: rgba(255, 255, 255, 0.04);
}

.nav-link {
    position: relative;
    width: 100%;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 0.75rem;
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none;
    font-size: clamp(0.78rem, 0.9vw, 0.88rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-link__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.nav-item:hover .nav-link,
.nav-item:focus-within .nav-link {
    color: #ffcf8d !important;
    border-bottom-color: #ffcf8d;
}

.nav-item:hover .nav-link__label,
.nav-item:focus-within .nav-link__label {
    opacity: 0;
    transform: translateY(-6px);
}

.nav-link::before {
    content: "";
    position: absolute;
    inset: 4px 0;
    display: block;
    width: 100%;
    height: calc(100% - 8px);
    background-repeat: no-repeat;
    background-position: center;
    background-size: auto 76%;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
    transition: opacity 0.22s ease, transform 0.22s ease;
    filter: drop-shadow(0 2px 8px rgba(255, 207, 141, 0.35));
}

.nav-item:hover .nav-link::before,
.nav-item:focus-within .nav-link::before {
    opacity: 1;
    transform: scale(1);
}

.nav-link--barf::before,
.drawer-icon--barf { background-image: url('/assets/small%20icons/Barf-Mama-small-icon.webp'); }

.nav-link--kurabiye::before,
.drawer-icon--kurabiye { background-image: url('/assets/small%20icons/Kurabiye-small-icon.webp'); }

.nav-link--saglik::before,
.drawer-icon--saglik { background-image: url('/assets/small%20icons/Saglik-Rehberi-small-icon.webp'); }

.nav-link--cig-beslenme::before,
.drawer-icon--cig-beslenme { background-image: url('/assets/small%20icons/Cig-Beslenme-Rehberi-small-icon.webp'); }

.nav-link--kurumsal::before,
.drawer-icon--kurumsal { background-image: url('/assets/small%20icons/Kurumsal-small-icon.webp'); }

/* ==========================================================================
   Desktop Primary Nav Submenu Panel (Glassmorphic Whitepink Backdrop)
   ========================================================================== */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    z-index: 1000;
    /* Pure white glassmorphic effect */
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12), inset 0 1px 0 #ffffff;
    padding: 1.5rem 0 2rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.nav-dropdown::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
}

.nav-item:hover > .nav-dropdown,
.nav-item:focus-within > .nav-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nav-dropdown-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Popping Glassmorphic Eyebrow Badge */
.dropdown-eyebrow {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: rgba(14, 18, 15, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid #ffcf8d;
    box-shadow: 0 0 12px rgba(255, 207, 141, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    color: #ffcf8d;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dropdown-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0c100d;
    letter-spacing: 0.02em;
}

.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem 1.25rem;
}

/* Text-Only Links: Transparent, No Border, Larger Typography */
.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;

    /* Increased size, all-caps, crisp black */
    color: #000000 !important;
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: color 0.18s ease, transform 0.18s ease;
}

.dropdown-item::after {
    content: "→";
    font-size: 1.25rem;
    color: #c48814;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

/* Hover: Turn text to golden yellow and nudge slightly forward */
.dropdown-item:hover,
.dropdown-item:focus-visible {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #c48814 !important;
    transform: translateX(5px);
}

.dropdown-item:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================================================
   Mobile Menu Trigger & Offcanvas Drawer
   ========================================================================== */
.menu-toggler {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}

.menu-toggler span {
    display: block;
    width: 20px;
    height: 2px;
    background: #f5f6f4;
    border-radius: 2px;
}

.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    visibility: hidden;
    transition: visibility 0.25s ease;
}

.mobile-drawer.is-active {
    visibility: visible;
}

.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-drawer.is-active .drawer-backdrop {
    opacity: 1;
}

.drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: min(85vw, 360px);
    height: 100%;
    background: #121811;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer.is-active .drawer-panel {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-title {
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #ffcf8d;
}

.drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: #8e958c;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.drawer-close:hover {
    color: #ffcf8d;
    background: rgba(255, 255, 255, 0.05);
}

.drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
}

.drawer-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.drawer-group {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
}

.drawer-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #f5f6f4;
    cursor: pointer;
    list-style: none;
}

.drawer-trigger::-webkit-details-marker {
    display: none;
}

.drawer-trigger-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
    pointer-events: none;
    opacity: 0.85;
    transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.drawer-group[open] .drawer-trigger-icon {
    opacity: 1;
    transform: scale(1.15);
    filter: drop-shadow(0 2px 6px rgba(255, 207, 141, 0.4));
}

.chevron-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    color: #ffcf8d;
}

.drawer-group[open] .chevron-icon {
    transform: rotate(180deg);
}

.drawer-sublinks {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0.75rem 0.75rem 1.25rem;
    gap: 0.25rem;
}

.drawer-sublink {
    padding: 0.45rem 0.5rem;
    font-size: 0.85rem;
    color: #8e958c;
    text-decoration: none;
    border-radius: 6px;
}

.drawer-sublink:hover {
    color: #ffcf8d;
    background: rgba(255, 255, 255, 0.05);
}

.drawer-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.drawer-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f5f6f4;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
}

.drawer-action-btn--accent {
    background: #efaa9c;
    border-color: #efaa9c;
    color: #000;
}

/* ==========================================================================
   Responsive Switching
   ========================================================================== */
@media (max-width: 991px) {
    .menu-toggler {
        display: flex;
    }

    .desktop-nav {
        display: none;
    }

    .action-label {
        display: none;
    }

    .action-btn {
        padding: 0;
        width: 36px;
        height: 36px;
        background: transparent;
        border: none;
        box-shadow: none;
        justify-content: center;
    }

    .search-box {
        max-width: 280px;
    }
}

@media (max-width: 640px) {
    .search-box {
        display: none;
    }
}