/* ===== TOP BAR ===== */
.top-bar {
    background: linear-gradient(90deg, #C8410B 0%, #E8521A 50%, #C8410B 100%);
    color: white;
    font-size: 0.8rem;
    padding: 8px 0;
    width: 100%;
}
.top-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.top-bar a { color: rgba(255,255,255,0.9); }
.top-bar a:hover { color: white; }
.top-bar span {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
/* Give each span a class for easier targeting */
.top-bar .tb-delivery { /* free delivery — always visible */ }
.top-bar .tb-contact  { /* phone + email */ }
.top-bar .tb-location { /* address */ }

/* ===== NAVBAR ===== */
.navbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    height: 70px;
    transition: box-shadow 0.3s ease;
}
.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.navbar .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* ===== LOGO ===== */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}
.nav-logo img {
    height: 42px;
    width: auto;
    display: block;
}
.nav-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.nav-logo-text .brand-name {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}
.nav-logo-text .brand-tagline {
    font-size: 0.6rem;
    color: var(--text-light);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ===== SEARCH ===== */
.nav-search {
    position: relative;
    flex: 1;
    max-width: 300px;
    min-width: 0;
}
.nav-search input {
    width: 100%;
    padding: 9px 16px 9px 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    background: var(--off-white);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: var(--font-primary);
}
.nav-search input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(200,65,11,0.1);
}
.nav-search input::placeholder { color: var(--text-muted); }
.nav-search .search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

/* ===== NAV LINKS ===== */
.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.nav-link {
    padding: 7px 13px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-medium);
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
    position: relative;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.nav-link:hover { color: var(--primary); background: var(--light-bg); }
.nav-link.active { color: var(--primary); }
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* ===== DROPDOWN ===== */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border: 1px solid var(--border);
    min-width: 180px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-menu a {
    display: block;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-medium);
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}
.nav-dropdown-menu a:hover { background: var(--light-bg); color: var(--primary); }

/* ===== NAV ACTIONS ===== */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.nav-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-medium);
    font-size: 1.1rem;
    transition: background 0.2s, color 0.2s;
    position: relative;
    text-decoration: none;
}
.nav-icon-btn:hover { background: var(--light-bg); color: var(--primary); }
.cart-count {
    position: absolute;
    top: 3px;
    right: 3px;
    background: var(--primary);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

/* ===== USER MENU ===== */
.user-menu { position: relative; }
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.user-menu:hover .user-avatar { border-color: var(--primary); }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border: 1px solid var(--border);
    min-width: 200px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 200;
}
.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.user-dropdown .user-info {
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}
.user-dropdown .user-info .name { font-weight: 600; font-size: 0.88rem; color: var(--text-dark); }
.user-dropdown .user-info .email { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-medium);
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}
.user-dropdown a:hover { background: var(--light-bg); color: var(--primary); }
.user-dropdown .logout { color: var(--danger); }
.user-dropdown .logout:hover { background: #fff5f5; color: var(--danger); }

/* ===== HAMBURGER ===== */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 6px;
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.menu-toggle:hover { background: var(--light-bg); }
.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== MOBILE NAV — hidden on desktop ===== */
.mobile-nav { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    /* Hide desktop elements */
    .nav-links  { display: none !important; }
    .nav-search { display: none !important; }

    /* Show hamburger */
    .menu-toggle { display: flex; }

    /* Navbar height on mobile */
    .navbar { height: 62px; }

    /* Top bar — show FREE DELIVERY centered, hide phone/email and address */
    .top-bar .tb-contact  { display: none; }
    .top-bar .tb-location { display: none; }
    .top-bar .tb-delivery { margin: 0 auto; }
    .top-bar .container   { justify-content: center; }

    /* ── Logo: hide tagline, tighten size ── */
    .nav-logo-text .brand-tagline { display: none; }
    .nav-logo-text .brand-name    { font-size: 1rem; }
    .nav-logo img                 { height: 36px; }
    .nav-logo                     { gap: 8px; }

    /* ── Login button → icon only ── */
    .btn-login-text { display: none; }          /* hide "Login" text */
    .nav-actions .btn.btn-primary.btn-sm {
        width: 38px;
        height: 38px;
        padding: 0;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    /* ── Tighten actions gap ── */
    .nav-actions { gap: 4px; }

    /* Mobile nav drawer */
    .mobile-nav {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 2px solid var(--border);
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        padding: 12px 16px 16px;
        transform: translateY(-105%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1),
                    opacity 0.3s ease,
                    visibility 0.3s ease;
        z-index: 998;
        max-height: 80vh;
        overflow-y: auto;
        top: 62px; /* overridden by JS to navbar bottom */
    }
    .mobile-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    /* Mobile search */
    .mobile-search {
        margin-bottom: 10px;
        position: relative;
    }
    .mobile-search input {
        width: 100%;
        padding: 10px 16px 10px 38px;
        border: 1.5px solid var(--border);
        border-radius: var(--radius-full);
        font-size: 0.9rem;
        outline: none;
        font-family: var(--font-primary);
        background: var(--off-white);
    }
    .mobile-search input:focus { border-color: var(--primary); background: #fff; }
    .mobile-search::before {
        content: '\f002';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        position: absolute;
        left: 13px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-muted);
        font-size: 0.8rem;
        pointer-events: none;
    }

    /* Mobile nav links */
    .mobile-nav .nav-link {
        display: flex;
        align-items: center;
        padding: 12px 14px;
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--text-medium);
        border-radius: var(--radius-md);
        text-decoration: none;
        transition: background 0.15s, color 0.15s;
        border-bottom: 1px solid var(--border);
    }
    .mobile-nav .nav-link:last-child { border-bottom: none; }
    .mobile-nav .nav-link:hover,
    .mobile-nav .nav-link.active { background: var(--light-bg); color: var(--primary); }
}

/* Extra small screens */
@media (max-width: 380px) {
    .nav-logo-text { display: none; }   /* hide brand name too, keep only logo image */
    .nav-logo img  { height: 34px; }
    .navbar        { height: 56px; }
}
