/* Product Listing Styles for Brilliance - Lab-Grown Diamond Luxury */

/* Define missing variables */
:root {
    --color-primary-light: rgba(198, 198, 198, 0.2);
    --color-primary-medium: #5f5f5f;
    --color-primary-dark: #001738;
    --color-background-main: var(--color-background, #FFFFFF);
    --color-text-on-light-primary: var(--color-primary, #001738);
    --color-text-on-light-secondary: var(--color-secondary, #5f5f5f);
    --font-heading: var(--font-secondary, 'Cormorant Garamond', serif);
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    --border-radius-soft: var(--radius-sm, 4px);
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --shadow-soft: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.05));
    --shadow-medium: var(--shadow-md, 0 4px 16px rgba(0,0,0,0.07));
    --filter-sidebar-width: 280px;
    --product-grid-gap: 24px;
    --product-card-bg: var(--color-surface, #FFFFFF);
    --product-card-border: var(--color-border, #c6c6c6);
    --product-card-radius: var(--radius-sm, 4px);
    --filter-title-color: var(--color-primary, #001738);
    --filter-text-color: var(--color-secondary, #5f5f5f);
    --filter-accent-color: var(--color-accent, #001738);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Global container constraints to prevent horizontal scrolling */
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.container {
    width: 100%;
    max-width: var(--container-width, 1360px);
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
}

/* ======== Category Hero ======== */
.category-hero {
    padding: 8rem 0 4rem;
    background-color: var(--color-background-main);
    text-align: center;
    margin-top: 60px;
    width: 100%;
    box-sizing: border-box;
}

.category-hero .container {
    max-width: var(--container-width, 1360px);
    margin: 0 auto;
    padding: 0 2rem;
}

.category-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--color-text-on-light-primary);
}

.category-description {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.8rem;
    color: var(--color-text-on-light-secondary);
}

/* ======== Product Listing Body ======== */
.product-listing-body {
    padding: 4rem 0 2rem;
    background-color: var(--color-background-main);
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.product-listing-body .container {
    display: flex;
    gap: 3rem;
    max-width: var(--container-width, 1360px);
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
    position: relative; /* Needed for absolute positioning of sidebar */
    min-height: 50vh; /* Ensure minimum height for short content pages */
}

/* Additional styling for smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ======== Filters Sidebar ======== */
.filters-sidebar {
    flex: 0 0 var(--filter-sidebar-width);
    max-width: var(--filter-sidebar-width);
    position: sticky;
    top: 90px; /* Adjusted to account for header height with some padding */
    align-self: flex-start;
    padding: 2.4rem;
    background-color: var(--color-surface, #FFFFFF);
    border-radius: var(--product-card-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    max-height: calc(100vh - 140px); /* Adjusted to ensure space at top and bottom */
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    box-sizing: border-box;
    margin-bottom: 2rem;
    z-index: 10; /* Ensure it appears above content when sticky */
    position: relative;
    z-index: 10;
}

/* JS-powered class to handle stopping at footer */
.filters-sidebar.at-footer {
    position: absolute;
    bottom: 0;
    top: auto;
}

.filters-sidebar::-webkit-scrollbar {
    width: 5px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: rgba(198, 198, 198, 0.25);
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 10px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.4rem;
    border-bottom: 1px solid var(--product-card-border);
    padding-bottom: 1.6rem;
}

.filters-header h3 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 600;
    margin: 0;
    color: var(--filter-title-color);
}

.filters-clear-all {
    background: none;
    border: none;
    color: var(--filter-accent-color);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0;
}

.filters-clear-all:hover {
    text-decoration: underline;
}

/* Filter Group Styling - Collapsible */
.filter-group {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(198, 198, 198, 0.3);
    padding-bottom: 15px;
}

.gender-select-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 1rem;
}

.gender-select-container label {
    font-size: 1rem;
    color: var(--color-text-on-light-secondary);
}

#gender-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-soft);
    background: white;
    cursor: pointer;
    font-size: 1rem;
    color: var(--color-text-on-light-secondary);
    transition: all var(--transition-fast);
}

#gender-select:hover {
    background-color: var(--color-primary-light);
}

.filter-group-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    font-family: var(--font-heading);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-secondary);
    transition: color var(--transition-fast);
    padding: 8px 0;
}

.filter-group-title:hover {
    color: var(--color-primary-dark);
}

.filter-group-title::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 14px;
    transition: transform var(--transition-medium);
    color: var(--color-secondary);
}

.filter-group.collapsed .filter-group-title::after {
    transform: rotate(180deg);
}

.filter-options {
    max-height: 300px;
    overflow: hidden;
    transition: max-height var(--transition-medium), opacity var(--transition-medium), margin var(--transition-medium);
    opacity: 1;
    margin-top: 10px;
}

.filter-group.collapsed .filter-options {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    overflow: hidden;
}

/* Loading state for filters */
.filter-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.filter-loader::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(198, 198, 198, 0.3);
    border-top-color: var(--color-secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}

/* Responsive adjustments for filter panels */
@media (max-width: 992px) {
    .filter-group-title {
        font-size: 15px;
        padding: 10px 0;
    }
    
    .filter-options {
        max-height: 250px;
    }
}

@media (max-width: 576px) {
    .filter-group-title {
        font-size: 14px;
    }
}

/* Diamond shape buttons styling */
.shape-filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.shape-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shape-btn:hover {
    border-color: var(--color-accent, #001738);
    background-color: rgba(198, 198, 198, 0.2);
}

.shape-btn.active {
    border-color: var(--color-accent, #001738);
    background-color: rgba(198, 198, 198, 0.2);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.shape-icon {
    font-size: 20px;
    margin-bottom: 5px;
    color: #555;
}

.shape-btn.active .shape-icon {
    color: var(--color-accent, #001738);
}

.shape-name {
    font-size: 12px;
    color: #333;
}

/* Price range slider styling */
.price-slider {
    padding: 0 5px;
    margin-top: 15px;
}

.range-slider {
    position: relative;
    height: 5px;
    margin-bottom: 25px;
}

.range-slider .slider-progress {
    height: 5px;
    background: var(--color-accent, #001738);
    position: absolute;
    left: 0%;
    right: 0%;
    border-radius: 5px;
    top: 0;
}

.range-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    width: 100%;
    height: 5px;
    background: none;
    pointer-events: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-accent, #001738);
    cursor: pointer;
    pointer-events: auto;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.price-inputs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
}

.price-inputs .field {
    display: flex;
    align-items: center;
    width: 45%;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.price-inputs .field span {
    padding: 0 10px;
    color: #999;
}

.price-inputs .field input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    padding: 0 5px;
    font-size: 14px;
}

.price-inputs .separator {
    display: flex;
    align-items: center;
    font-size: 18px;
    color: #999;
}

/* Mobile filters */
@media (max-width: 768px) {
    .shape-filters {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .price-inputs {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .price-inputs .field {
        width: 100%;
    }
    
    .price-inputs .separator {
        display: none;
    }
    
    .responsive-field {
        width: 100% !important;
    }
}

/* ======== Product Grid Main ======== */
.product-grid-main {
    flex: 1;
    min-width: 0; /* Fix for flexbox overflow issues */
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.4rem;
    padding-bottom: 1.6rem;
    border-bottom: 1px solid var(--product-card-border);
    width: 100%;
    box-sizing: border-box;
}

.product-count {
    font-size: 1.5rem;
    color: var(--filter-text-color);
}

.sort-container {
    display: flex;
    align-items: center;
}

.sort-container label {
    margin-right: 1rem;
    font-size: 1.5rem;
    color: var(--filter-text-color);
}

.sort-container select {
    padding: 0.8rem 3rem 0.8rem 1.2rem;
    border: 1px solid var(--product-card-border);
    border-radius: var(--product-card-radius);
    background-color: var(--product-card-bg);
    font-size: 1.4rem;
    color: var(--filter-title-color);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23666666' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
    background-position: calc(100% - 12px) center;
    background-repeat: no-repeat;
    min-width: 180px;
}

.sort-container select:focus {
    outline: none;
    border-color: var(--filter-accent-color);
}

/* ======== Product Grid ======== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--product-grid-gap);
    width: 100%;
    box-sizing: border-box;
    grid-auto-rows: 1fr; /* Ensure equal height rows */
}

.product-listing-body .product-grid .product-card {
    width: 100% !important; /* ensure grid defines width */
    box-sizing: border-box;
}

.product-card {
    background-color: var(--product-card-bg, #FFFFFF);
    border: 1px solid var(--product-card-border, #EAEAEA);
    border-radius: var(--product-card-radius, 8px); /* Slightly more rounded */
    overflow: hidden;
    transition: transform var(--transition-medium) ease, box-shadow var(--transition-medium) ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    padding: 1.5rem; /* Added padding to the card itself */
    text-align: left; /* Align text to the left for a cleaner look */
    box-shadow: var(--shadow-soft, 0 2px 8px rgba(0,0,0,0.05)); /* Softer initial shadow */
}

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

.product-image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1/1;
    /* border-bottom: 1px solid var(--product-card-border); */ /* Removed bottom border */
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--product-card-radius, 8px); /* Match card radius */
    background-color: #f9f9f9; /* Light background for images */
    margin-bottom: 1.5rem; /* Add space below image */
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image-container img {
    transform: scale(1.05); /* Subtle zoom on hover */
}

.product-info {
    padding: 0; /* Removed padding as it's now on the parent .product-card */
    text-align: left; /* Align text to the left */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-size: 1.9rem; /* Increased size */
    font-weight: 600; /* Bolder */
    margin: 0 0 1rem; /* Increased spacing */
    color: var(--color-text-on-light-primary, #1a1a1a);
    line-height: 1.4;
    min-height: calc(1.9rem * 1.4 * 2); /* Ensure space for two lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 1.8rem; /* Increased size */
    color: var(--color-accent, #001738); /* Navy blue instead of gold */
    margin: 0 0 1.5rem; /* Increased spacing */
    font-weight: 700; /* Bolder */
    font-family: var(--font-body, 'Poppins', sans-serif);
}

.product-specs {
    font-size: 1.4rem;
    color: var(--color-secondary, #888);
    margin: 0;
}

.product-card-action {
    padding: 0 1.6rem 1.6rem;
    width: 100%;
    box-sizing: border-box;
}

.btn-view-product {
    width: 100%;
    background-color: var(--color-accent, #001738);
    color: white;
    border: none;
    border-radius: var(--product-card-radius);
    padding: 1rem 0;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-sizing: border-box;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn-view-product:hover {
    background-color: var(--color-secondary, #5f5f5f);
}

.wishlist-btn {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 2;
    top: 10px;
    right: 10px;
}

.product-card:hover .wishlist-btn {
    opacity: 1;
}

.wishlist-btn:hover {
    transform: scale(1.1);
    background-color: white;
}

.product-name a {
    color: var(--filter-title-color);
    text-decoration: none;
}

.product-actions {
    margin-top: auto;
    padding: 0; /* Removed padding as it's now on the parent .product-card */
    width: 100%;
    box-sizing: border-box;
}

.quick-view-btn, .btn-view-product /* Consolidate similar button styles */ {
    width: 100%;
    background-color: var(--color-primary-dark, #333333);
    color: var(--color-surface, #FFFFFF);
    border: 1px solid transparent;
    border-radius: var(--product-card-radius, 8px); /* Match card radius */
    padding: 1.2rem 2.2rem; /* Slightly larger padding */
    font-size: 1.5rem; /* Slightly larger font */
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-medium) ease, transform var(--transition-fast) ease, border-color var(--transition-medium) ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-sizing: border-box;
    display: inline-block;
    text-align: center;
    text-decoration: none; /* Ensure links look like buttons */
}

.quick-view-btn:hover, .btn-view-product:hover {
    background-color: var(--color-secondary, #5f5f5f);
    color: var(--color-surface, #FFFFFF);
    transform: translateY(-2px);
    border-color: var(--color-secondary, #5f5f5f);
}

/* Specific style for quick-view if it needs to be different, e.g., outline */
.quick-view-btn.outline-style {
    background-color: transparent;
    border: 1px solid var(--color-primary-dark, #333333);
    color: var(--color-primary-dark, #333333);
}

.quick-view-btn.outline-style:hover {
    background-color: var(--color-primary-dark, #333333);
    color: var(--color-surface, #FFFFFF);
    border-color: var(--color-primary-dark, #333333);
}

/* Removed as consolidated above */

/* Wishlist and Quick View Icon Buttons (if you plan to add them visually on the card image) */
.product-card .wishlist-btn,
.product-card .quick-view-icon-btn {
    position: absolute;
    width: 40px; /* Slightly larger */
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--product-card-border, #EAEAEA);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden; /* Hide completely until hover */
    transform: scale(0.8) translateY(10px); /* Initial state for animation */
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 2;
}

.product-card:hover .wishlist-btn {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.product-card .wishlist-btn {
    top: 12px;
    right: 12px;
}



.product-card .wishlist-btn i {
    font-size: 1.8rem;
    color: var(--color-primary-dark, #333333);
    transition: color 0.2s ease;
}

.product-card .wishlist-btn:hover {
    background-color: var(--color-accent, #001738);
    border-color: var(--color-accent, #001738);
}

.product-card .wishlist-btn:hover i {
    color: var(--color-surface, #FFFFFF);
}

.product-card .wishlist-btn.active i {
    color: var(--color-accent, #001738); /* Active wishlist state */
}

.product-card .wishlist-btn.active:hover i {
    color: var(--color-surface, #FFFFFF);
}

/* ======== No Products Message ======== */
.no-products-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    font-size: 1.6rem;
    color: var(--filter-text-color);
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: var(--product-card-radius);
}

/* ======== Loading Spinner ======== */
.loading-spinner {
    grid-column: 1 / -1;
    margin: 4rem auto;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--filter-accent-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ======== Pagination ======== */
.pagination-container {
    margin-top: 7rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 1rem;
    border: 1px solid var(--product-card-border);
    border-radius: var(--product-card-radius);
    color: var(--filter-text-color);
    font-size: 1.4rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination-link:hover:not(.active):not(.disabled) {
    border-color: var(--filter-accent-color);
    color: var(--filter-accent-color);
}

.pagination-link.active {
    background-color: var(--filter-accent-color);
    border-color: var(--filter-accent-color);
    color: white;
}

.pagination-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ======== Mobile Filters Toggle ======== */
.mobile-filters-toggle {
    display: none;
    width: 100%;
    background-color: var(--filter-title-color);
    color: white;
    border: none;
    border-radius: var(--product-card-radius);
    padding: 1.2rem;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 2rem;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-sizing: border-box;
}

.mobile-filters-toggle i {
    font-size: 1.8rem;
}

/* ======== Responsive Styles ======== */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 992px) {
    .product-listing-body .container {
        flex-direction: column;
    }
    
    .filters-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: #fff;
        z-index: 1000;
        padding: 1.5rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        max-height: 100vh;
    }
    
    .filters-sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 15px rgba(0,0,0,0.2);
    }
    
    .filters-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--color-primary);
        z-index: 10;
    }

    .mobile-filters-toggle {
        display: flex;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .category-hero {
        padding: 6rem 0 3rem;
    }
    
    .category-title {
        font-size: 3.2rem;
    }
    
    .category-description {
        font-size: 1.6rem;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.6rem;
    }
    
    .sort-container {
        width: 100%;
    }
    
    .sort-container select {
        flex-grow: 1;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .product-name {
        font-size: 1.6rem;
        margin-top: 1.2rem;
    }
    
    .product-price {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }

    .product-actions {
        padding: 0 1.2rem 1.2rem;
    }
}

@media (max-width: 576px) {
    .category-hero {
        padding: 5rem 0 2.5rem;
    }
    
    .category-title {
        font-size: 2.8rem;
    }
    
    /* Fix for product grid on small mobile devices */
    .product-grid {
        grid-template-columns: repeat(1, 1fr); /* Single column on very small screens */
        gap: 16px;
    }
    
    .product-name {
        font-size: 1.5rem;
        padding: 0 1rem;
    }
    
    .product-price {
        font-size: 1.3rem;
    }
    
    .product-actions {
        padding: 0 1rem 1rem;
    }
    
    .quick-view-btn {
        padding: 0.8rem 0;
        font-size: 1.2rem;
    }
    
    .filters-sidebar {
        width: 100%;
    }
    
    .field input[type="number"] {
        width: 100%;
        box-sizing: border-box;
        padding-left: 25px; /* Ensure space for the $ sign */
    }
    
    /* Prevent text overflow in shape buttons */
    .shape-btn {
        flex: 1 0 calc(50% - 8px); /* Larger size on small screens for better touch targets */
    }
    
    .shape-btn .shape-name {
        font-size: 1.1rem;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Ensure product cards have appropriate spacing and sizing on mobile */
    .product-card {
        margin-bottom: 16px;
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        border-radius: 8px;
    }
    
    /* Ensure product images display properly */
    .product-image-container {
        height: auto;
        aspect-ratio: 1/1;
        max-width: 100%;
    }
    
    /* Improve product name and price display */
    .product-name {
        font-size: 1.6rem;
        padding: 0 12px;
        margin: 16px 0 8px;
        text-align: center;
        line-height: 1.3;
    }
    
    .product-price {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }
    
    /* Improve button sizing and padding */
    .quick-view-btn {
        width: 100%;
        padding: 12px 0;
        font-size: 1.4rem;
        margin: 0 auto;
    }
    
    .product-actions {
        padding: 0 12px 16px;
    }
    
    /* Fix toolbar spacing */
    .toolbar {
        margin-bottom: 16px;
    }
    
    /* Improve sort dropdown usability on mobile */
    .sort-container select {
        height: 44px;
        padding: 0 32px 0 12px;
        background-position: calc(100% - 8px) center;
        font-size: 1.4rem;
    }
}

/* Additional improvement for small phones in portrait mode */
@media (max-width: 375px) {
    .product-grid {
        gap: 12px;
    }
    
    .product-card {
        margin-bottom: 12px;
    }
    
    .product-name {
        font-size: 1.5rem;
    }
    
    .product-price {
        font-size: 1.4rem;
    }
    
    .quick-view-btn {
        padding: 10px 0;
    }
}

/* Add intermediate breakpoint for small tablets and large phones */
@media (min-width: 577px) and (max-width: 767px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* Exactly 2 columns for mid-sized screens */
        gap: 16px;
    }
}

/* Price range slider specific fixes for mobile */
@media (max-width: 576px) {
    .price-slider input[type="range"] {
        width: 100%;
        max-width: 100%;
    }
    
    .price-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .field {
        width: 100%;
    }
}

/* make all links inside product-card full width */
.product-card a {
    display: block;
    width: 100%;
    text-decoration: none;
}

/* prevent flex children from shrinking */
.product-card * {
    min-width: 0;
}

/* --- Range slider track reset for custom progress overlay --- */
.range-slider input[type="range"]::-webkit-slider-runnable-track {
  background: transparent;
}
.range-slider input[type="range"]::-moz-range-track {
  background: transparent;
}
.range-slider input[type="range"]::-ms-track {
  background: transparent;
  color: transparent;
}

/* Ensure thumbs appear above progress bar */
.range-slider input[type="range"] {
  z-index: 3;
}
.range-slider .slider-progress {
  z-index: 1;
}

/* Filter action buttons */
.filter-actions {
  margin-top: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-apply-filters {
  background-color: var(--color-accent, #001738);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-apply-filters:hover {
  background-color: var(--color-secondary, #5f5f5f);
}

.btn-clear-filters {
  background-color: transparent;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px 0;
  font-size: 14px;
  cursor: pointer;
}

.btn-clear-filters:hover {
  border-color: var(--color-accent, #001738);
  color: var(--color-accent, #001738);
}

/* Custom Design CTA Section */
.custom-design-cta-section {
    margin-top: 1rem;
    margin-bottom: 1rem;
    clear: both;
    position: relative;
    z-index: 1;
    padding-top: 20px;
}

.custom-design-cta {
    background-color: rgba(198, 198, 198, 0.2);
    border-radius: var(--radius-lg, 8px);
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.custom-design-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-accent), transparent);
}

.custom-design-cta::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-accent), transparent);
}

.custom-design-cta h3 {
    font-family: var(--font-secondary, 'Cormorant Garamond', serif);
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--color-primary, #001738);
}

.custom-design-cta p {
    font-family: var(--font-primary, 'Poppins', sans-serif);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: var(--color-secondary, #5f5f5f);
}

.custom-design-cta .btn-accent {
    background-color: var(--color-accent, #001738);
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-sm, 4px);
    font-family: var(--font-primary, 'Poppins', sans-serif);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid var(--color-accent, #001738);
}

.custom-design-cta .btn-accent:hover {
    background-color: transparent;
    color: var(--color-accent, #001738);
    transform: translateY(-2px);
}

.custom-design-cta .btn-accent i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.custom-design-cta .btn-accent:hover i {
    transform: rotate(45deg);
}

@media (max-width: 767px) {
    .custom-design-cta {
        padding: 2rem 1.5rem;
    }
    
    .custom-design-cta h3 {
        font-size: 1.8rem;
    }
    
    .custom-design-cta p {
        font-size: 1rem;
    }
}

/* Fix for filter overlap */
@media (max-width: 991px) {
    .filters-sidebar.active {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        padding-bottom: 120px; /* Add padding at bottom to ensure content isn't covered */
    }

    .product-listing-body {
        margin-bottom: 0;
    }
}

/* Ensure proper spacing between sections */
.product-listing-body .container {
    padding-bottom: 0;
}

.site-footer {
    margin-top: 2rem;
}

/* Filter options styling */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-item input {
    margin-right: 8px;
}
