/* General Navigation Styles */
nav {
    z-index: 10000;
    position: relative;
    font-family: 'Poppins', sans-serif;
    background-color: #ffffff;
}

/* Banner Styles */
.nav-banner {
    background-color: #a60b00;
    height: 40px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    position: relative;
}

.nav-banner.hidden {
    display: none;
}

.banner-text-container {
    width: 100%;
    text-align: center;
}

.banner-text {
    display: inline-block;
    white-space: nowrap;
    font-size: 12px;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    animation: marquee 15s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Navigation Header */
.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0rem 2rem;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10000;
}

.nav-header-placeholder {
    display: none;
    height: 0;
}

/* Nav Logo */
.nav-logo a {
    display: block;
}

.logo-image {
    height: 75px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Icons */
.nav-icons {
    display: flex;
    gap: 1.5rem;
    position: relative;
}

.icon-wrapper {
    position: relative;
}

.icon-wrapper i {
    color: #000000;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.icon-wrapper a:hover i {
    color: #a60b00;
}

.count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #a60b00;
    color: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    text-align: center;
    line-height: 18px;
    font-family: 'Poppins', sans-serif;
}

/* Login/Logout Button */
.login-logout .btn {
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-logout .btn:hover {
    background-color: #a60b00;
}

/* Navigation Links */
.nav-links {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    background-color: #ffffff;
}

.nav-links li {
    margin: 0 1rem;
}

.nav-links a {
    color: #000000;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #a60b00;
}

/* Ensure nav-links and NEW IN are always visible above everything in mobile view */
@media (max-width: 768px) {
    .nav-links.open {
        z-index: 10002 !important; /* Above nav-banner (10001) and nav-header (10000) */
        top: 40px; /* Start below nav-banner when visible */
    }
    .nav-links.open.banner-hidden {
        top: 0; /* Align with nav-header when nav-banner is hidden */
    }
    .nav-links.open li.new-in {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        order: -1; /* Ensures NEW IN appears first after back button */
        position: relative;
    }
    .nav-links.open li.new-in a {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #ffffff !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        padding: 0.5rem 1rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        text-indent: 0 !important;
    }
}

/* Dropdown Styles */
.category-dropdown, .account-dropdown {
    position: relative;
}

.category-link, .account-link {
    color: #000000;
    font-weight: 600;
    text-decoration: none;
}

.category-submenu, .account-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    min-width: 220px;
    padding: 0.5rem 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    z-index: 1000;
}

.category-dropdown:hover .category-submenu,
.account-dropdown:hover .account-submenu {
    display: block;
}

.category-submenu li, .account-submenu li {
    padding: 0.5rem 1rem;
}

.category-submenu a, .account-submenu a {
    color: #000000;
    font-size: 0.85rem;
    text-decoration: none;
    display: block;
    transition: color 0.3s ease;
}

.category-submenu a:hover, .account-submenu a:hover {
    color: #a60b00;
}

/* Desktop Styles (above 768px) */
@media (min-width: 769px) {
    nav.fixed {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10000;
    }

    nav.fixed + .nav-header-placeholder {
        display: block;
        height: 110px;
    }

    .nav-header {
        background-color: #000000;
    }

    .nav-menu-btn, .back-button-container, .mobile-login-logout {
        display: none;
    }

    .nav-links {
        position: static;
        flex-direction: row;
        height: auto;
        width: 100%;
        overflow: visible;
    }

    .nav-icons .mobile-icon {
        display: inline-block !important;
        color: #ffffff;
    }

    .nav-icons .desktop-icon {
        display: none !important;
    }

    #search-icon-mobile::after, #shopping-bag-mobile::after, #heart-mobile::after {
        font-family: 'Poppins', sans-serif;
        font-size: 0.9rem;
        font-style: normal;
        margin-left: 0.5rem;
        color: #ffffff;
        transition: color 0.3s ease;
    }

    #search-icon-mobile::after {
        content: "Search";
    }

    #shopping-bag-mobile::after {
        content: "Bag";
    }

    #heart-mobile::after {
        content: "Wishlist";
    }

    .nav-icons a:hover #search-icon-mobile::after,
    .nav-icons a:hover #shopping-bag-mobile::after,
    .nav-icons a:hover #heart-mobile::after {
        color: #a60b00;
    }

    .login-logout .btn {
        background-color: #ffffff;
        color: #000000;
    }

    .login-logout .btn:hover {
        background-color: #a60b00;
        color: #ffffff;
    }

    .category-submenu li, .account-submenu li {
        list-style: none;
    }
}

/* Mobile Styles (below 768px) */
@media (max-width: 768px) {
    .nav-header {
        padding: 2.5px 16px;
        background-color: #000000;
    }

    .nav-header.fixed {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10000;
    }

    .nav-header.fixed + .nav-header-placeholder {
        display: block;
        height: 60px;
    }

    .nav-logo a {
        display: block;
    }

    .logo-image {
        height: 55px;
        width: auto;
        max-width: 150px;
    }

    .nav-actions {
        gap: 0.75rem;
    }

    .nav-icons i {
        color: #ffffff;
        font-size: 1.1rem;
    }

    .nav-icons a:hover i {
        color: #a60b00;
    }

    .nav-menu-btn {
        display: block;
        color: #ffffff;
        font-size: 1.5rem;
        cursor: pointer;
    }

    .nav-menu-btn i {
        transition: color 0.3s ease;
    }

    .nav-menu-btn:hover i {
        color: #a60b00;
    }

    .login-logout {
        display: none;
    }

    .nav-links {
        position: fixed;
        top: 40px; /* Start below nav-banner by default */
        left: -100%;
        width: 100%;
        max-width: 300px;
        height: 100vh;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        background-color: #000000;
        padding: 1rem 0;
        margin: 0;
        transition: left 0.3s ease;
        z-index: 10002;
        overflow-y: auto;
    }

    .nav-links.open {
        left: 0;
    }

    .nav-links li {
        margin: 0;
        width: 100%;
    }

    .nav-links a {
        color: #ffffff;
        font-size: 0.9rem;
        font-weight: 600;
        padding: 0.5rem 1rem;
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-links a:hover {
        color: #a60b00;
    }

    .category-submenu, .account-submenu {
        position: static;
        transform: none;
        background-color: #2a2a2a;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    .category-submenu.show, .account-submenu.show {
        max-height: 500px;
        padding: 0;
    }

    .category-submenu li, .account-submenu li {
        padding: 0.5rem 2rem;
        width: 100%;
    }

    .category-submenu a, .account-submenu a {
        color: #ffffff;
        font-size: 0.85rem;
        font-weight: 400;
        width: 100%;
        box-sizing: border-box;
    }

    .category-submenu a:hover, .account-submenu a:hover {
        color: #a60b00;
    }

    .mobile-login-logout .btn {
        width: 90%;
        padding: 0.5rem 1rem;
        background-color: #a60b00;
        color: #ffffff;
        text-align: center;
        font-size: 0.9rem;
        margin: 0.5rem 1rem;
    }

    .mobile-login-logout .btn:hover {
        background-color: #a60b00;
    }

    .back-button {
        background: none;
        border: none;
        color: #ffffff;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        cursor: pointer;
        width: 100%;
        text-align: left;
    }

    .back-button i {
        color: #ffffff;
    }

    .back-button:hover, .back-button:hover i {
        color: #a60b00;
    }

    .nav-icons .desktop-icon {
        display: none !important;
    }

    .nav-icons .mobile-icon {
        display: inline-block !important;
    }

    .nav-menu-btn .desktop-icon {
        display: none !important;
    }

    .nav-menu-btn .mobile-icon {
        display: inline-block !important;
    }

    .back-button .desktop-icon {
        display: none !important;
    }

    .back-button .mobile-icon {
        display: inline-block !important;
    }
}