* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background: #f5f6fa;
    color: #333;
    line-height: 1.6;
}

.ps-container {
    display: flex;
    max-width: 1400px;
    margin: 20px auto;
    gap: 20px;
    padding: 0 20px;
}

.filter-column {
    width: 25%;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.search-bar {
    margin-bottom: 20px;
    position: static;
    top: 20px;
    z-index: 10;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    color: #333;
}

.search-input:focus {
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.search-input::placeholder {
    color: #999;
}

.reset-button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.reset-button:hover {
    background: #c0392b;
}

.filter-toggle {
    display: none; /* Hidden by default on desktop */
    width: 100%;
    padding: 12px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.filter-toggle:hover {
    background: #357abd;
}

.filter-overlay {
    display: none; /* Hidden by default */
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #4a90e2;
    color: white;
}

.filter-header h2 {
    font-size: 20px;
}

.close-filter {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.filter-content {
    padding: 20px;
    background: #fff;
}

.filter-category {
    margin-bottom: 15px;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    padding: 10px 15px;
    background: #4a90e2;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-title:hover {
    background: #357abd;
}

.subcategories {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.subcategories.active {
    max-height: 1000px;
}

.subcategory-item {
    padding: 8px 20px;
    cursor: pointer;
    border-radius: 5px;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.subcategory-item:hover {
    background: #f0f7ff;
    padding-left: 25px;
    color: #4a90e2;
}

.subcategory-item.active {
    background: #4a90e2;
    color: white;
    padding-left: 25px;
}

.product-column {
    width: 75%;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.product-card img {
    width: 100%; /* Ensures all images take the full width of the container */
    height: 170px; /* Set a fixed height for all images */
    border-radius: 5px;
    margin-bottom: 10px;
    object-fit: contain; /* Ensures the image scales without distortion */
}


.hidden {
    display: none;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .filter-column {
        width: 100%;
        padding: 10px; /* Reduced padding for mobile */
    }
    .product-column {
        width: 100%;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .filter-toggle {
        display: block; /* Show button on mobile */
    }
    .filter-content {
        display: none; /* Hide filter content by default on mobile */
    }
    .filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 100;
        overflow-y: auto;
    }
    .filter-overlay.active {
        display: block; /* Show overlay when active */
    }
    .filter-header {
        position: sticky;
        top: 0;
        z-index: 101;
    }
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.product-item {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination a {
    padding: 8px 16px;
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pagination a.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination a:hover:not(.active) {
    background-color: #f5f5f5;
}

/* Make product images clickable */
.product-image {
    cursor: pointer;
    max-width: 100%;
    height: auto;
}

/* Modal styles */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Square modal */
.modal-content {
    position: relative;
    width: 80vh; /* Ensures the modal remains square */
    height: 80vh; /* Same as width to maintain square shape */
    background-color: #fff; /* Optional, to make the square visible */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 10px;
}

/* Square image inside modal */
.expanded-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures the image fills the square */
}

/* Close button */
.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    color: rgb(0, 0, 0);
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}

@media (max-width: 768px) {
    .ps-container {
        flex-direction: column;
        padding: 0 10px;
    }

    .filter-column {
        display: none;
        width: 100%;
        padding: 15px;
        display: none; /* Hide by default */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: white;
        z-index: 200;
        box-shadow: 0 0 10px rgba(0,0,0,0.3);
        overflow-y: auto;
    }

    .filter-column.active {
        display: block; /* Show when active */
    }

    .filter-toggle {
            display: block;
            width: 50%; /* Adjust width if needed */
            margin: 10px auto; /* Centers it */
            text-align: center;
    }
    .ps-container {
        flex-direction: column;
        align-items: center;
    }
    
    .product-column {
        width: 100%;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* For very small screens, show only 1 product per row */
    @media (max-width: 480px) {
        .product-grid {
            grid-template-columns: repeat(1, 1fr);
        }
    }
}
/* Ensure the filter toggle button matches the green button in the screenshot */
.filter-toggle {
    display: none; /* Hidden by default on desktop */
    width: 100%;
    padding: 12px;
    background: #28a745; /* Green color to match the screenshot */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin: 10px 0; /* Add some spacing */
}

.filter-toggle:hover {
    background: #218838; /* Darker green on hover */
}

/* Filter overlay for mobile */
.filter-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow-y: auto;
}

.filter-overlay.active {
    display: block; /* Show overlay when active */
}

/* Filter column adjustments for mobile */
@media (max-width: 768px) {
    .ps-container {
        flex-direction: column;
        padding: 0 10px;
    }

    .filter-toggle {
        display: block; /* Show the filter button on mobile */
    }

    .filter-column {
        width: 100%;
        padding: 15px;
        background: white;
        z-index: 200;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }

    .filter-overlay.active .filter-column {
        display: block; /* Show filter column when overlay is active */
    }

    .product-column {
        width: 100%;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* For very small screens, show only 1 product per row */
    @media (max-width: 480px) {
        .product-grid {
            grid-template-columns: repeat(1, 1fr);
        }
    }
}

.product-packaging {
    font-size: 14px;
    color: #666;
}

.product-origin {
    font-size: 14px;
    color: #666;
}

/* Mobile Filter Button Styles */
.mobile-filter-container {
    display: none;
    padding: 10px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-filter-btn {
    width: 100%;
    padding: 12px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mobile-filter-btn i {
    font-size: 14px;
}


/* Filter Overlay */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    display: none;
}



/* Mobile-specific styles */
@media (max-width: 768px) {
/* Mobile Filter Button Styles */
.mobile-filter-container {
    display: none;
    padding: 10px 15px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    text-align: center; /* Center the button */
}

.mobile-filter-btn {
    width: 100%;
    max-width: 200px; /* Give it a reasonable max width */
    padding: 12px 20px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 30px; /* More rounded corners */
    font-size: 16px;
    font-weight: 600; /* Make text bolder */
    cursor: pointer;
    display: inline-flex; /* Changed to inline-flex */
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto; /* Center horizontally */
    box-shadow: 0 3px 6px rgba(0,0,0,0.16); /* Add subtle shadow */
    transition: all 0.3s ease;
}

.mobile-filter-btn:hover {
    background: #357abd; /* Darker on hover */
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}

.mobile-filter-btn i {
    font-size: 16px;
}

/* Make the button more prominent on mobile */
@media (max-width: 768px) {
    .mobile-filter-container {
        display: block;
        text-align: center; /* Ensure center alignment */
    }
    
    .mobile-filter-btn {
        width: 80%; /* Wider button */
        max-width: 250px;
    }
    .filter-column {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: white;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 15px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    
    .filter-column.active {
        left: 0;
    }
    
    .filter-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        margin-bottom: 15px;
        border-bottom: 1px solid #eee;
    }
    
    .search-bar {
        margin-bottom: 20px;
    }
    
    .search-input {
        width: 100%;
        padding: 12px 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .reset-button {
        width: 100%;
        padding: 10px;
        background: #e74c3c;
        color: white;
        border: none;
        border-radius: 5px;
        font-size: 14px;
    }
    
    /* Make sure filter content is scrollable */
    .filter-content {
        height: calc(100vh - 150px);
        overflow-y: auto;
    }

}
}
/* Mobile toggle button (hidden on desktop) */
.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 900;
    background: #4a90e2;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  }
  
  /* Mobile close header (hidden on desktop) */
  .mobile-close-header {
    display: none;
    padding: 15px;
    background: #4a90e2;
    color: white;
  }
  
  .mobile-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
  }
  
  /* Mobile styles */
  @media (max-width: 768px) {
    .mobile-filter-toggle {
      display: block; /* Show floating button */
    }
    
    .filter-column {
      position: fixed;
      top: 0;
      left: -100%;
      width: 85%;
      height: 100vh;
      background: white;
      z-index: 1000;
      transition: left 0.3s ease;
    }
    
    .mobile-close-header {
      display: block; /* Show close button */
    }
    
    .mobile-filter-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.5);
      z-index: 999;
      display: none;
    }
    
    body.filter-active {
      overflow: hidden;
    }
  }

  