/* --- General Body Styles --- */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa; /* Light grey background */
    color: #212529; /* Darker text for better readability */
}

/* --- Main Layout Container --- */
.main-container {
    display: flex;
    width: 100%;
    max-width: 1500px;
    margin: 30px auto;
    padding: 0 20px;
    gap: 30px; /* Add gap between sidebar and main content */
}

/* --- Brand Sidebar --- */
.brand-sidebar {
    flex: 0 0 220px; /* Slightly wider sidebar */
    background-color: #fff;
    padding: 20px;
    border: 1px solid #e9ecef; /* Softer border */
    border-radius: 8px;
    height: fit-content; /* Sidebar only as tall as its content */
}

.brand-sidebar h3 {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    color: #343a40;
}

.brand-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.brand-list li a {
    display: block;
    padding: 10px 5px;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 5px;
}

.brand-list li a:hover {
    background-color: #f1f3f5;
    color: #000;
}

.brand-list li a.active {
    font-weight: 600;
    color: #c59d5f; /* Muted gold for active state */
    background-color: #f8f9fa;
}

/* --- Product Display Area --- */
.product-area {
    flex: 1;
}

/* --- Product Type Navigation --- */
.product-type-nav {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
}

.product-type-nav a {
    margin: 0 8px;
    padding: 8px 15px;
    color: #495057;
    text-decoration: none;
    border-radius: 20px; /* Pill-shaped buttons */
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.product-type-nav a:hover {
    background-color: #e9ecef;
    color: #000;
}

.product-type-nav a.active {
    background-color: #343a40; /* Dark slate for active type */
    color: #fff;
    font-weight: 500;
}

/* --- Product Grid --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
}

/* --- Individual Product Card --- */
.product-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column; /* Flex layout for card content */
}

/* --- Footer Styles --- */
.footer-bottom .copyright {
    margin: 0;
    text-align: center;
    font-size: 0.9em;
    color: #6c757d;
}

/* --- Mobile Bottom Navigation --- */
.mobile-bottom-nav {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    z-index: 1000;
    padding: 5px 0;
}

/* Force responsive tables globally on mobile */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }
}

.category-toggle-btn {
    display: none; /* Hide on desktop by default */
}

.mobile-nav-btn {
    flex: 1; /* Each button will take up equal width */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    color: #333;
    font-size: 24px; /* Larger icons */
}

.mobile-nav-btn:hover {
    color: #c59d5f;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        margin-top: 15px;
        gap: 20px;
    }

    .brand-sidebar {
        display: none; /* Hide sidebar on mobile, as requested by deleting the toggle */
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .product-card .product-image {
        height: 150px;
    }

    .product-card .product-info {
        padding: 15px;
    }

    .footer-bottom {
        padding: 20px 0;
    }

    .footer-bottom .copyright {
        font-size: 0.8em; /* Smaller font on mobile */
        white-space: normal; /* Allow text to wrap */
    }

    /* Show mobile nav and hide desktop actions */
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
    }

    .header-user-actions {
        display: none; /* Hide the original header icons on mobile */
    }

    /* Adjust main content padding to avoid overlap with bottom nav */
    body {
        padding-bottom: 70px; /* Height of the bottom nav + some buffer */
    }

    /* --- Header Layout on Mobile --- */
    .header-main .container {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .header-logo {
        margin-bottom: 0; /* Remove bottom margin for alignment */
    }

    .header-search-container {
        order: 3; /* Force search bar to the next line */
        width: 100%;
        margin-top: 15px;
    }

    .search-form {
        display: flex;
        align-items: center; /* Vertically align items in the form */
    }

    .category-toggle-btn {
        display: block; /* Show on mobile */
        background-color: #f0f0f0;
        border: 1px solid #e0e0e0;
        border-right: none;
        padding: 0 12px;
        border-radius: 8px 0 0 8px;
        font-size: 20px;
        color: #333;
        height: 44px; /* Match typical input height */
    }

    .search-field {
        border-radius: 0 !important; /* Ensure no radius in the middle */
        height: 44px;
        flex-grow: 1; /* Take up remaining space */
    }

    .header-search-container .search-btn {
        border-radius: 0 8px 8px 0;
        height: 44px;
        position: static; /* Override absolute positioning from style-prefix.css */
        transform: none;
    }

    #google_translate_element {
        order: 2; /* Place it after the logo */
    }

    #google_translate_element .goog-te-gadget-simple {
        background-color: transparent !important;
        border: none !important;
    }

    /* --- Category Sidebar as Modal on Mobile --- */
    .brand-sidebar {
        display: none; /* Hidden by default */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #fff;
        z-index: 2000;
        overflow-y: auto;
        padding: 20px;
    }

    .brand-sidebar.active {
        display: block; /* Show when active */
    }

    .sidebar-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 10px;
        margin-bottom: 15px;
    }

    .sidebar-top h3 {
        margin-bottom: 0;
        border-bottom: none;
    }

    .sidebar-close-btn {
        font-size: 26px;
        color: #333;
    }
}



.product-card:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.product-card .product-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.product-card .product-info {
    padding: 20px;
    flex-grow: 1; /* Allow info to fill space */
    display: flex;
    flex-direction: column;
}

.product-card .product-brand {
    color: #6c757d;
    font-size: 0.85em;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.product-card .product-name {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.3;
    flex-grow: 1; /* Push price and button down */
}

.product-card .product-type {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.product-card .product-price {
    font-size: 1.3em;
    font-weight: 700;
    color: #c59d5f; /* Muted gold for price */
    margin-top: auto; /* Pushes price to bottom if name is short */
}

.product-card .btn {
    margin-top: 15px;
    background-color: #343a40;
    border-color: #343a40;
    transition: all 0.3s ease;
}

.product-card:hover .btn {
    background-color: #c59d5f;
    border-color: #c59d5f;
}