/* ============================================
   MODERN E-COMMERCE NAVBAR STYLES
   Optimized for mobile and desktop
   ============================================ */

/* Main Navbar */
.ecom-navbar {
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.ecom-navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.navbar-wrapper {
    width: 100%;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 2rem;
}

/* ============================================
   BRAND / LOGO
   ============================================ */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.brand-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary, #652d2c), #8B4513);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.brand-tagline {
    font-size: 0.65rem;
    color: #6b7280;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ============================================
   DESKTOP NAVIGATION
   ============================================ */
.nav-menu-desktop {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.nav-link-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    background: transparent;
    border: none;
    white-space: nowrap;
}

.nav-link-item:hover {
    background: #f3f4f6;
    color: var(--color-primary, #652d2c);
}

.nav-link-item i:first-child {
    font-size: 1.125rem;
}

.nav-link-item i:not(.arrow-icon) {
    font-size: 1.125rem;
}

.arrow-icon {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    margin-left: 0.25rem;
}

.nav-dropdown:hover .arrow-icon {
    transform: rotate(180deg);
}

/* ============================================
   MEGA MENU
   ============================================ */
.nav-dropdown {
    position: relative;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform-origin: top center;
    transform: translateX(-50%) scale(0.95) translateY(-10px);
}

.nav-dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    margin-top: 1.25rem;
    transform: translateX(-50%) scale(1) translateY(0);
}

.mega-menu-content {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mega-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    background: transparent;
}

/* Main Category Highlight */
.mega-item-main {
    background: rgba(101, 45, 44, 0.04);
    margin-bottom: 0.5rem;
    padding: 1rem;
    border: 1px solid rgba(101, 45, 44, 0.08);
}

.mega-item-main .mega-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary, #652d2c);
}

.mega-item-main:hover {
    background: rgba(101, 45, 44, 0.08);
    transform: none;
    /* Stable main item */
}

/* Sub Category Clean List */
.mega-item-sub {
    padding: 0.5rem 1rem;
    border: none;
}

.mega-item-sub:hover {
    background: rgba(0, 0, 0, 0.02);
    transform: translateX(5px);
}

.mega-item-sub .mega-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #4b5563;
}

.mega-item-sub:hover .mega-title {
    color: var(--color-primary, #652d2c);
    font-weight: 600;
}

/* Main Item Icon - Big and Bold */
.mega-item-main i {
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary, #652d2c);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    font-size: 1.25rem;
}

/* Sub Item Icon - Minimal */
.mega-item-sub i,
.mega-item-sub .nav-cat-img {
    width: 24px;
    height: 24px;
    background: transparent;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    box-shadow: none;
    font-size: 1rem;
    border: none;
    object-fit: contain;
}

.mega-item-sub:hover i,
.mega-item-sub:hover .nav-cat-img {
    color: var(--color-primary, #652d2c);
    transform: scale(1.1);
    background: transparent;
    box-shadow: none;
}

.mega-title {
    transition: all 0.2s ease;
}

.mega-desc {
    font-size: 0.8125rem;
    color: #6b7280;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.125rem;
    text-decoration: none;
    position: relative;
}

.action-btn:hover {
    background: var(--color-primary, #652d2c);
    color: #ffffff;
    transform: translateY(-2px);
}

.action-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    font-size: 0.6875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.cart-badge {
    background: #ef4444;
    color: #ffffff;
}

.wishlist-badge {
    background: #ec4899;
    color: #ffffff;
}

.mobile-menu-btn {
    display: none;
}

/* ============================================
   USER DROPDOWN
   ============================================ */
.user-menu {
    position: relative;
}

.dropdown-panel {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 0.5rem;
}

.user-menu:hover .dropdown-panel {
    opacity: 1;
    visibility: visible;
    margin-top: 0.75rem;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dropdown-link:hover {
    background: #f3f4f6;
    color: var(--color-primary, #652d2c);
}

.dropdown-link i {
    font-size: 1rem;
    width: 20px;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

.logout-link {
    color: #ef4444;
}

.logout-link:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ============================================
   EXPANDABLE SEARCH BAR
   ============================================ */
.search-bar-expanded {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.search-bar-expanded.active {
    max-height: 80px;
}

.search-bar-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.search-form {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    gap: 0.75rem;
}

.search-icon {
    color: #9ca3af;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.9375rem;
    color: #1f2937;
    background: transparent;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-close:hover {
    background: #e5e7eb;
    color: #374151;
}

/* ============================================
   MOBILE SIDEBAR
   ============================================ */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: #ffffff;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-sidebar.active {
    left: 0;
}

.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-logo {
    height: 36px;
    width: auto;
}

.mobile-brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary, #652d2c), #8B4513);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-close-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.mobile-sidebar-content {
    padding: 1rem;
}

.mobile-user-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--color-primary, #652d2c), #8B4513);
    color: #ffffff;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.mobile-user-section i {
    font-size: 1.5rem;
}

.mobile-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-primary, #652d2c);
    color: #ffffff;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.mobile-login-btn:hover {
    background: #4a1f1e;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mobile-nav-link:hover {
    background: #f3f4f6;
    color: var(--color-primary, #652d2c);
}

.mobile-nav-link i {
    font-size: 1.125rem;
    width: 20px;
}

.mobile-nav-link.logout {
    color: #ef4444;
}

.mobile-nav-link.logout:hover {
    background: #fee2e2;
    color: #dc2626;
}

.mobile-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.75rem 0;
}

/* Mobile Accordion */
.mobile-accordion {
    margin-bottom: 0.25rem;
}

.mobile-accordion-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    color: #374151;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.mobile-accordion-btn:hover {
    background: #f3f4f6;
}

.mobile-accordion-btn span {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-accordion-btn i:last-child {
    transition: transform 0.2s ease;
    font-size: 0.875rem;
}

.mobile-accordion.active .mobile-accordion-btn i:last-child {
    transform: rotate(180deg);
}

.mobile-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 2.5rem;
}

.mobile-accordion.active .mobile-accordion-content {
    max-height: 300px;
    padding-top: 0.25rem;
    padding-bottom: 0.5rem;
}

.mobile-accordion-content a {
    display: block;
    padding: 0.625rem 1rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mobile-accordion-content a:hover {
    background: #f3f4f6;
    color: var(--color-primary, #652d2c);
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .nav-menu-desktop {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .navbar-container {
        gap: 1rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .navbar-container {
        padding: 0 1rem;
        height: 60px;
    }

    .brand-logo {
        height: 36px;
    }

    .brand-name {
        font-size: 1.25rem;
    }

    .brand-tagline {
        font-size: 0.6rem;
    }

    .action-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .navbar-actions {
        gap: 0.375rem;
    }

    /* Hide wishlist on very small screens */
    .navbar-actions .action-btn:not(.search-toggle-btn):not(.cart-action):not(.mobile-menu-btn) {
        display: none;
    }

    .search-bar-wrapper {
        padding: 0.875rem 1rem;
    }

    .search-form {
        padding: 0.625rem 1rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .brand-text {
        display: none;
    }

    .navbar-container {
        gap: 0.5rem;
    }

    .mobile-sidebar {
        width: 90%;
    }
}