:root {
  --primary-color: #2f4858;
  --secondary-color: #7aabbd;
  --text-dark: #000000;
  --text-light: #ffffff;
  --background-light: #ffffff;
  --background-grey: #f2f2f2;
}

/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: none;
  text-decoration: none;
  background: none;
  -webkit-font-smoothing: antialiased;
}

body, h1, h2, h3, p, ul, li {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--background-light);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Main Content */
.product-page-container {
    display: flex;
    margin-top: 100px;
    gap: 40px;
    padding: 0 20px;
}

/* Filters Sidebar */
.filters {
    width: 280px;
    border: 1px solid #e0e0e0;
    padding: 24px;
    height: fit-content;
    border-radius: 25px;
    background: #ffffff;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
    display: none; /* Hidden by default */
}

/* Filter Actions */
.filter-actions {
    margin-top: 20px;
    text-align: center;
}

.reset-filters-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--text-light);
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2); /* Initial shadow */
}
 
.reset-filters-button:hover {
    background-color: #223846; /* Darker shade of primary-color */
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3); /* Enhanced shadow on hover */
}

/* Mobile Filter Slide-in Panel */
.filters.mobile-slide {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    z-index: 1001;
    overflow-y: auto;
    border-radius: 0;
    border: none;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

@media (min-width: 993px) {
    .filters {
        display: block; /* Show on desktop */
    }
}

.filters.mobile-slide.active {
    left: 0;
}

.filters.mobile-slide .filters-content {
    padding: 80px 20px 20px;
    flex: 1;
    overflow-y: auto;
}

.filters.mobile-slide .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1002;
}

.filters.mobile-slide .close-btn:hover {
    background: var(--background-grey);
}

/* Responsive adjustments for mobile filter panel */
@media (max-width: 768px) {
    .filters.mobile-slide {
        width: 100%;
        max-width: 320px;
        left: -100%;
    }
    
    .filters.mobile-slide.active {
        left: 0;
    }
    
    .filters.mobile-slide .filters-content {
        padding: 70px 20px 20px;
    }
}

@media (max-width: 480px) {
    .filters.mobile-slide {
        width: 100%;
        max-width: 280px;
        left: -100%;
    }
    
    .filters.mobile-slide .filters-content {
        padding: 60px 15px 15px;
    }
    
    .filters.mobile-slide .close-btn {
        top: 15px;
        right: 15px;
        font-size: 20px;
        padding: 8px;
    }
}

/* Overlay for slide-in panel */
.filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.filters-overlay.active {
    opacity: 1;
    visibility: visible;
}

.filters h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    color: var(--primary-color);
}

.filter-category h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    margin: 15px 0 10px;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-dark);
    padding: 10px 15px;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.filter-category h4:hover {
    background: var(--background-grey);
    transform: translateY(-2px);
}

.filter-category ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0 20px;
}

.filter-category li {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.filter-category li a {
    display: block;
    padding: 8px 15px;
    border-radius: 15px;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.filter-category li a:hover {
    background: var(--background-grey);
    transform: translateX(5px);
}

.filter-category .dropdown-arrow {
    width: 16px;
    transition: transform 0.3s ease;
}

/* Smooth toggle experience for filter lists */
.filter-category ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, margin-bottom 0.3s ease-out;
}

.filter-category.open ul {
    max-height: 500px;
    margin-bottom: 20px;
}

.filter-category .dropdown-arrow {
    width: 16px;
    transition: transform 0.3s ease;
}

.filter-category.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Product List */
.product-list {
    flex: 1;
}

.search-section {
    margin-bottom: 20px;
}

/* Enhanced Search Styling */
.search {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.search-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    transition: all 0.3s ease;
    background-color: white;
    padding: 0 5px 0 0;
}

.search input {
    flex-grow: 1;
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    outline: none;
    background: transparent;
    transition: all 0.3s ease;
}

.search .search-icon {
    height: 20px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    padding: 10px;
    flex-shrink: 0;
}

.mobile-filter-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 0;
    flex-shrink: 0;
}

.mobile-filter-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-50%) scale(1.1);
}

.mobile-filter-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.mobile-filter-toggle img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.mobile-filter-toggle:hover img {
    filter: brightness(0.2) saturate(100%);
}

.search-wrapper:hover,
.search-wrapper.focus {
    border-color: #DAB96B;
    box-shadow: 0 0 10px rgba(218, 185, 107, 0.2);
}

.search input::placeholder {
    color: #999;
    transition: color 0.3s ease;
}

.search input:focus::placeholder {
    color: #DAB96B;
}

.product-count {
    margin-bottom: 20px;
    color: #888;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* show more, smaller cards */
    gap: 20px; /* tighter spacing */
}

.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card img {
    max-width: 100%;
    height: 180px; /* limit image height */
    object-fit: contain; /* ensures images fit within the area without cropping */
    display: block;
    width: auto; /* allow width to adjust based on aspect ratio */
}

.product-card p {
    padding: 12px 10px; /* less padding */
    font-weight: 500;
    font-size: 14px; /* smaller title */
    line-height: 1.4;
}

.image-not-available {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 180px; /* Match image height */
    background-color: #f0f0f0; /* Light grey background */
    color: #888; /* Grey text color */
    font-size: 14px;
    text-align: center;
    border-bottom: 1px solid #eee; /* Separator like the image */
}

/* Responsive tweaks for product grid */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .product-card img, .image-not-available {
        max-width: 100%;
        height: 160px;
        object-fit: contain;
        width: auto;
    }
    .product-card p {
        font-size: 13px;
        padding: 10px 8px;
    }
}

@media (max-width: 520px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .product-card img, .image-not-available {
        max-width: 100%;
        height: 180px;
        object-fit: contain;
        width: auto;
    }
}

/* Pagination Styling */
.pagination { /* This is the ul element */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    user-select: none;
    background-color: transparent; /* Removed background */
    border-radius: 30px;
    padding: 8px 15px;
    /* Removed box-shadow */
    transition: all 0.3s ease;
}
 
.pagination:hover { /* Apply hover effect directly to the ul */
    /* Removed box-shadow */
}
 
.pagination .page-item {
    list-style: none; /* Remove bullet points */
    margin: 0 5px; /* Spacing between items */
    display: flex; /* To center content within li */
    align-items: center;
    justify-content: center;
}
 
.pagination .page-link {
    display: flex; /* Changed from block to flex to center content */
    align-items: center;
    justify-content: center;
    width: 35px; /* Fixed width */
    height: 35px; /* Fixed height */
    padding: 0; /* Remove padding, use width/height for sizing */
    color: var(--primary-color); /* Default text color, dark blue */
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease; /* Transition for all changes */
    border-radius: 8px; /* Rounded corners for the background */
    background-color: transparent; /* No background by default */
    border: none; /* Ensure no borders */
}
 
.pagination .page-link:hover {
    background-color: #DAB96B; /* Yellow background on hover */
    color: var(--text-light); /* White text on hover */
}
 
.pagination .page-item.active .page-link {
    background-color: #DAB96B; /* Yellow background for active page */
    color: var(--text-light); /* White text for active page */
    font-weight: bold; /* Make active page bold */
}
 
.pagination .page-item.disabled .page-link {
    color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
    background-color: transparent; /* Ensure disabled links don't have a background */
}
 
.pagination .page-item.disabled .page-link:hover {
    background-color: transparent; /* No hover effect for disabled links */
    transform: none;
}
 
.pagination .page-item .page-link.ellipsis {
    color: #999;
    font-weight: normal;
    cursor: default;
    background-color: transparent; /* Ensure ellipsis doesn't have a background */
}

/* Responsive Pagination */
@media screen and (max-width: 768px) {
    .pagination {
        padding: 6px 10px;
    }
 
    .pagination .page-link {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}

/* Marketplace Section */
.marketplace-section {
    padding: 100px 20px;
    text-align: center;
    background: var(--background-grey);
    margin-top: 80px;
}

.marketplace-section h2 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.marketplace-description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 60px;
}

.marketplace-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 80px;
    align-items: center;
    justify-content: center;
    max-width: 1000px;
    margin: 0 auto;
}

.marketplace-grid img {
    max-width: 250px;
    max-height: 100px;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.marketplace-grid img:hover {
    transform: scale(1.05);
}

/* Responsive fine-tuning */
@media (min-width: 1200px) {
    .marketplace-grid {
        max-width: 1000px;
        gap: 40px 60px;
    }
    .marketplace-grid img {
        max-width: 200px;
        max-height: 80px;
    }
}

@media (max-width: 768px) {
    .marketplace-grid {
        max-width: 700px;
        gap: 30px 50px;
    }
    .marketplace-grid img {
        max-width: 150px;
        max-height: 60px;
    }
}

/* Responsive Adjustments (from responsive.css) */
/* Dropdown and Mobile Menu Styles */
.filter-category ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.filter-category ul.active {
    max-height: 500px; /* Adjust based on content */
    transition: max-height 0.5s ease-in;
}

.filter-category .dropdown-arrow {
    transition: transform 0.3s ease;
}

/* Hamburger Menu (from responsive.css) */
.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1000;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.4s;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Styles (up to 768px) (from responsive.css) */
@media screen and (max-width: 768px) {
    .product-page-container {
        flex-direction: column;
    }

    .mobile-filter-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.3);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-filter-sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 300px;
        height: 100%;
        background-color: white;
        z-index: 1001;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        padding: 20px;
    }

    .mobile-filter-sidebar.open {
        left: 0;
    }

    .mobile-filter-overlay.open {
        display: block;
        opacity: 1;
    }

    .mobile-filter-close {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 30px;
        height: 30px;
        cursor: pointer;
    }

    .mobile-filter-close::before,
    .mobile-filter-close::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 2px;
        background-color: #333;
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .mobile-filter-close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    .mobile-filter-toggle {
        display: block;
        position: fixed;
        bottom: 20px;
        left: 20px !important;
        background-color: #DAB96B;
        color: white;
        padding: 10px 15px;
        border-radius: 50px;
        z-index: 999;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        cursor: pointer;
    }
}