/* Mobile Sidebar Navigation Styles */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    position: relative;
    cursor: pointer;
    z-index: 30;
    padding: 0;
}

.mobile-menu-icon {
    position: relative;
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text);
    margin: 0 auto;
    transition: background-color 0.3s ease;
}

.mobile-menu-icon:before,
.mobile-menu-icon:after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--text);
    transition: transform 0.3s ease;
}

.mobile-menu-icon:before {
    top: -8px;
}

.mobile-menu-icon:after {
    bottom: -8px;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background-color: var(--bg-accent);
    z-index: 1000;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.active {
    left: 0;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar-header {
    padding: 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.mobile-logo {
    font-weight: bold;
    font-size: 18px;
    color: var(--primary);
}

.mobile-sidebar-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.mobile-sidebar-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-sidebar-content {
    flex-grow: 1;
    padding: 15px 0;
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-links li {
    margin: 0;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.2s;
    position: relative;
}

.mobile-nav-links a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
    color: var(--primary);
    font-size: 16px;
}

.mobile-nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.mobile-register-btn {
    color: var(--primary) !important;
    font-weight: 500;
}

.mobile-cart-badge {
    position: absolute;
    right: 20px;
    background-color: var(--accent);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
}

.mobile-sidebar-footer {
    padding: 15px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    border-top: 1px solid var(--border);
}

.no-scroll {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Responsive Styles */
@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: block;
        /* Changed: Position on the right side */
        order: 3; /* Higher order than cart */
        margin-left: 15px;
    }
    
    .logo {
        order: 1;
        margin-right: auto;
    }
    
    .nav-links {
        display: none;
    }
    
    .cart-icon {
        order: 2; /* Lower order than mobile-menu-toggle */
    }
    
    .register-btn {
        display: none;
    }
    
    nav {
        padding: 15px;
        position: relative;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
    
    /* Adjust the cart icon position for desktop */
    @media (min-width: 992px) {
        .cart-icon {
            margin-left: auto; /* Push it to the right */
            margin-right: 20px; /* Add some spacing before the register button */
        }
        
        .register-btn {
            margin-left: 0; /* Reset any left margin */
        }
        
        /* Ensure proper spacing between navigation elements */
        .nav-links {
            margin-right: auto; /* Push other elements to the right */
        }
    }
    
    /* Adjust header spacing for mobile */
    header {
        padding: 0;
    }
    
    .container {
        padding: 0 15px;
    }
}

/* Fix desktop navigation layout */
@media (min-width: 992px) {
    nav {
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }
    
    .logo {
        margin-right: 40px;
    }
    
    .nav-links {
        flex: 1;
        display: flex;
        justify-content: flex-start;
        margin-right: auto;
    }
    
    .cart-icon {
        order: 3;
        margin-left: auto;
        margin-right: 20px;
    }
    
    .register-btn {
        order: 4;
    }
    
    .mobile-menu-toggle {
        order: 5;
    }
}

/* iPhone X/SE Notch Safe Area */
@supports (padding: max(0px)) {
    .mobile-sidebar {
        padding-top: max(15px, env(safe-area-inset-top));
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
}
