/* ==========================
   Base & Existing Styles
   ========================== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f9f9f9;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 900;
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 50px;
}
nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}
nav ul { /* Desktop Nav */
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}
nav ul li {
    margin-left: 20px;
}
nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: bold;
}
nav ul li a:hover {
    color: #007bff;
}
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* Hamburger Menu Button (Hidden on Desktop) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #333;
    padding: 5px;
    line-height: 1;
    margin-left: auto;
}

/* ==========================
   Mobile Bottom Navigation (Existing)
   ========================== */
.mobile-nav {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: 60px;
    border-top: 1px solid #e0e0e0;
}
.mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.75rem;
    padding: 5px 0;
    position: relative;
}
.mobile-nav .nav-item .icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}
.mobile-nav .nav-item .text {
    line-height: 1;
}
.mobile-nav .nav-item.active {
    color: #007bff;
    font-weight: bold;
}
.mobile-nav .cart-item .cart-count {
    position: absolute;
    top: 5px;
    right: 15px;
    background-color: red;
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ==========================
   NEW: Slide-Out Profile Sidebar
   ========================== */

/* Dark overlay for background */
.profile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1010;
    opacity: 0;
    visibility: hidden; /* Hide and make unclickable */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* The sidebar itself */
.profile-sidebar {
    position: fixed;
    top: 0;
    right: -300px; /* Start off-screen */
    width: 300px;
    max-width: 80%; /* Max width on small screens */
    height: 100%;
    background-color: #ffffff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1020;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

/* --- Show sidebar when active --- */
body.sidebar-open .profile-sidebar-overlay {
    opacity: 1;
    visibility: visible;
}
body.sidebar-open .profile-sidebar {
    right: 0; /* Slide in */
}
/* --- End show sidebar --- */


/* Sidebar content styling */
.profile-sidebar .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}
.profile-sidebar .sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}
.profile-sidebar .sidebar-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.profile-sidebar .sidebar-user-info {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}
.profile-sidebar .user-icon {
    font-size: 3rem;
    color: #007bff;
    margin-bottom: 10px;
}
.profile-sidebar .user-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 5px;
}
.profile-sidebar .edit-profile-link {
    font-size: 0.9rem;
    color: #007bff;
    text-decoration: none;
}

.profile-sidebar .sidebar-nav-links {
    list-style: none;
    padding: 15px 0;
    margin: 0;
    flex-grow: 1; /* Make links fill available space */
    overflow-y: auto; /* Allow scrolling if links are many */
}
.profile-sidebar .sidebar-nav-links li a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
}
.profile-sidebar .sidebar-nav-links li a:hover {
    background-color: #f8f8f8;
}
.profile-sidebar .sidebar-nav-links li:last-child a {
    border-bottom: none;
}
/* Special link styles */
.profile-sidebar .sidebar-nav-links li a.btn-sidebar-login {
    background-color: #007bff;
    color: white;
    text-align: center;
    margin: 10px 20px;
    border-radius: 5px;
    width: auto;
    border-bottom: none;
}
.profile-sidebar .sidebar-nav-links li.admin-link a {
    background-color: #fffbe6;
    color: #d48806;
    font-weight: bold;
}


/* ==========================
   UPDATED: Media Query for Mobile (< 768px)
   ========================== */
@media (max-width: 768px) {

    /* Show the bottom mobile nav */
    .mobile-nav {
        display: flex;
    }
    body {
        padding-bottom: 70px; /* Add padding for bottom nav */
    }
     main.container {
        padding-bottom: 20px;
     }

    /* --- Top Header & Hamburger --- */
    header nav {
        padding: 5px 15px; /* Adjust header padding */
    }
    nav .logo {
        font-size: 1.3rem; /* Smaller logo */
    }

    /* Hide desktop nav, show hamburger */
    header nav ul {
        display: none; /* Desktop nav is ALWAYS hidden on mobile */
    }
    .mobile-menu-toggle {
        display: block; /* Show hamburger icon */
    }
    
    /* REMOVED: All the old ".mobile-menu-open" dropdown styles */
    
}