body {
    background-color: #faf7f0; /* Set page background color */
}

.browse-container {
    display: flex;
    padding: 20px;
    max-width: 1400px; /* Increased width */
    margin: 80px auto 20px auto; /* Adjusted top margin for navbar */
    gap: 30px;
}

.sidebar {
    flex: 0 0 250px; /* Fixed width for sidebar */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.sidebar h3 {
    font-size: 1.5rem;
    color: var(--dark-brown);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.category-filters a {
    display: block;
    padding: 10px 0;
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-filters a:hover,
.category-filters a.active {
    color: #E67E00;
    font-weight: 600;
}

.product-listing {
    flex: 1; /* Take remaining space */
}

.product-listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.product-listing-header h2 {
    font-size: 2rem;
    color: var(--dark-brown);
}

.sort-dropdown select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    font-size: 1rem;
    color: #555;
    cursor: pointer;
}

.sort-dropdown select:focus {
    outline: none;
    border-color: #E67E00;
}

/* Reusing .categories-grid from landingpage.css for product display */
.product-listing .categories-grid {
    grid-template-columns: repeat(4, 1fr); /* 4 columns for browse page */
    gap: 20px; /* Slightly reduced gap for more compact look */
    margin: 0; /* Override margin from landingpage.css */
}

.product-listing .categories-grid .category-card img {
    height: 200px; /* Smaller image height for smaller cards */
}

.product-listing .categories-grid .category-card h3 {
    font-size: 0.95rem; /* Smaller font size for title */
    margin: 8px 10px;
}

.product-listing .categories-grid .category-card .price {
    font-size: 1rem; /* Smaller font size for price */
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .browse-container {
        flex-direction: column;
        padding: 15px;
    }

    .sidebar {
        flex: none;
        width: 100%;
        margin-bottom: 20px;
    }

    .product-listing .categories-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on smaller screens */
    }
}

@media (max-width: 768px) {
    .product-listing-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .product-listing .categories-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on smaller tablets/large phones */
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .browse-container {
        padding: 10px;
    }

    .sidebar {
        padding: 15px;
    }

    .sidebar h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .category-filters a {
        padding: 8px 0;
        font-size: 0.95rem;
    }

    .product-listing-header h2 {
        font-size: 1.5rem;
    }

    .sort-dropdown select {
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    .product-listing .categories-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
        gap: 10px;
    }

    .product-listing .categories-grid .category-card img {
        height: 150px; /* Further reduced image height for mobile */
    }

    .product-listing .categories-grid .category-card h3 {
        font-size: 0.85rem; /* Smaller font size for title on mobile */
        margin: 5px 8px;
    }

    .product-listing .categories-grid .category-card .price {
        font-size: 0.9rem; /* Smaller font size for price on mobile */
    }
}

@media (max-width: 400px) {
    .product-listing .categories-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on very small phones */
        gap: 10px;
    }
}
