/* ============================================
   MOBILE-FRIENDLY NAVIGATION MENU CSS
   Modern Responsive Hamburger Menu
   ============================================ */

/* Navigation Container */
nav {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

nav .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Logo Styling */
.logo-img {
    height: 45px;
    width: auto;
    display: block;
}

/* Desktop Menu */
#menu {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

#menu li {
    position: relative;
}

#menu > li > a {
    text-decoration: none;
    color: #1e293b;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
    display: block;
}

#menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    transition: width 0.3s ease;
}

#menu > li > a:hover::after,
#menu > li > a.active::after {
    width: 100%;
}

#menu > li > a:hover {
    color: #6366f1;
}

/* Submenu Styling */
.has-submenu {
    position: relative;
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    padding: 0.5rem 0;
    list-style: none;
    min-width: 200px;
    display: none;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.has-submenu:hover .submenu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.submenu li {
    padding: 0;
}

.submenu li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.submenu li a:hover {
    background: #f8f9ff;
    color: #6366f1;
    padding-left: 2rem;
}

.product-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    color: #73ea48;
    background: rgba(115, 234, 72, 0.15);
    border-radius: 12px;
    letter-spacing: 0.5px;
    animation: badgePulse 2.5s ease-in-out infinite;
}

@keyframes badgePulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(115, 234, 72, 0.4); 
    }
    70% { 
        box-shadow: 0 0 0 6px rgba(115, 234, 72, 0); 
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(115, 234, 72, 0); 
    }
}

/* Hamburger Menu Toggle (Hidden on Desktop) */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    background: transparent;
    border: none;
    position: relative;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: #1e293b;
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

@media (max-width: 768px) {
    /* Show Hamburger Menu */
    .menu-toggle {
        display: flex;
    }
    
    /* Hamburger Animation when Active */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(9px, 9px);
        background: #6366f1;
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(20px);
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(9px, -9px);
        background: #6366f1;
    }
    
    /* Mobile Menu Styles */
    #menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 80px 0 2rem 0;
        box-shadow: -5px 0 30px rgba(0,0,0,0.15);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        align-items: stretch;
        z-index: 999;
    }
    
    /* Close button inside menu */
    .menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        background: #f8f9ff;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        color: #1e293b;
        transition: all 0.3s ease;
        z-index: 1000;
    }
    
    .menu-close:hover {
        background: #6366f1;
        color: white;
        transform: rotate(90deg);
    }
    
    .menu-close:active {
        transform: rotate(90deg) scale(0.9);
    }
    
    /* Show Menu when Active */
    #menu.active {
        right: 0;
    }
    
    /* Mobile Menu Items */
    #menu > li {
        border-bottom: 1px solid #f0f0f0;
    }
    
    #menu > li > a {
        padding: 1rem 2rem;
        font-size: 1rem;
        display: block;
    }
    
    #menu > li > a::after {
        display: none;
    }
    
    #menu > li > a:hover {
        background: #f8f9ff;
    }
    
    /* Mobile Submenu */
    .has-submenu {
        position: relative;
    }
    
    .submenu {
        position: static;
        display: none;
        background: #f8f9ff;
        box-shadow: none;
        margin: 0;
        padding: 0;
        border-radius: 0;
        opacity: 1;
        transform: none;
    }
    
    .has-submenu.active .submenu {
        display: block;
    }
    
    .submenu li a {
        padding: 0.75rem 3rem;
        font-size: 0.9rem;
    }
    
    .submenu li a:hover {
        padding-left: 3.5rem;
    }
    
    /* Mobile Submenu Toggle */
    .has-submenu > a::before {
        content: '+';
        position: absolute;
        right: 2rem;
        font-size: 1.5rem;
        font-weight: 300;
        transition: transform 0.3s ease;
    }
    
    .has-submenu.active > a::before {
        content: '−';
    }
    
    /* Overlay when menu is open */
    .menu-overlay {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 998;
        backdrop-filter: blur(2px);
    }
    
    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    
    /* Nav Container Mobile */
    nav .container {
        padding: 0 1.5rem;
    }
    
    .logo-img {
        height: 38px;
    }
}

/* Tablet Adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    #menu {
        gap: 1.5rem;
    }
    
    #menu > li > a {
        font-size: 0.9rem;
    }
    
    nav .container {
        padding: 0 1.5rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    #menu {
        width: 100%;
        right: -100%;
    }
    
    #menu.active {
        right: 0;
    }
    
    nav .container {
        padding: 0 1rem;
    }
    
    .logo-img {
        height: 35px;
    }
}

/* ============================================
   JAVASCRIPT SUPPORT STYLES
   ============================================ */

/* Smooth Transitions */
#menu,
.submenu,
.menu-toggle span {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active Menu Item Indicator (Mobile) */
@media (max-width: 768px) {
    #menu > li > a.active {
        background: #f0f4ff;
        color: #6366f1;
        border-left: 4px solid #6366f1;
    }
}

/* Accessibility - Focus States */
#menu a:focus,
.menu-toggle:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    nav {
        display: none;
    }
}