/**
 * Product Browser & Filter Widget Styles
 * Integrated with site design - matches nav#menus styling
 */

/* ==========================================================================
   Layout
   ========================================================================== */

/* Hide SSR elements when React is mounted */
.browse-sidebar:has(#filter-widget-react-root:not(:empty)) > .filter-widget-container,
.browse-sidebar:has(#filter-widget-react-root:not(:empty)) > .category-nav {
    display: none !important;
}

/* Show the React root when it has content */
#filter-widget-react-root:not(:empty) {
    display: block !important;
}

.product-browser-page {
    max-width: 100%;
}

.browse-container {
    margin-top: 1rem;
}

.browse-sidebar {
    position: relative;
}

.browse-main {
    min-width: 0;
}

.browse-header {
    position: static !important;
    margin-bottom: 2rem;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none !important;
}

.browse-header h1 {
    margin: 0 0 0.75rem 0;
    font-size: 2.25rem;
    font-weight: bold;
    text-shadow: none !important;
}

.browse-header-image {
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 0.4rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.browse-header-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.5rem 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}

.browse-header-overlay h1 {
    color: #fff;
    margin: 0;
}

.browse-description {
    color: #333;
    font-size: 1.15rem;
    line-height: 1.6;
    max-width: 900px;
    text-shadow: none !important;
}

/* ==========================================================================
   Filter Widget - Desktop (in sidebar)
   Designed to match #menus styling from illmar.css
   ========================================================================== */

/* The React root in the sidebar */
#filter-widget-react-root {
    display: none;
}

#filter-widget-react-root:not(:empty) {
    display: block;
}

/* On desktop, give the filter widget some breathing room in the sidebar */
@media (min-width: 56em) {
    #filter-widget-react-root {
        margin-bottom: 1.6rem;
    }
}

.filter-widget {
    background: transparent;
    border: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.filter-widget *,
.filter-widget *::before,
.filter-widget *::after {
    box-sizing: border-box;
}

.filter-widget.loading {
    opacity: 0.6;
    pointer-events: none;
}

.filter-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.1rem solid #eee;
    margin-bottom: 0;
    padding: 1.25rem 1rem;
    min-height: 4.5rem;
}

.filter-widget-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: inherit;
    text-shadow: none !important;
}

.clear-filters {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    background: #fff !important;
    color: #333;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
}

.clear-filters:hover {
    background: #f5f5f5 !important;
    color: #000;
}

.filter-widget-content {
    padding: 0;
}

/* On desktop, make filter content scrollable if sidebar is tall */
@media (min-width: 56em) {
    .filter-widget-content {
        max-height: calc(100vh - 12rem);
        overflow-y: auto;
    }
}

.filter-widget-footer {
    padding: 1.25rem 1rem;
    border-top: 0.1rem solid #eee;
}

.result-count {
    font-size: 1.1rem;
    color: #333;
}

/* ==========================================================================
   Filter Sections
   ========================================================================== */

.filter-section {
    border-bottom: 0.1rem solid #eee;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1.25rem 1rem;
    border: none;
    box-sizing: border-box;
    overflow: hidden;
    background: none !important;
    text-shadow: none !important;
    cursor: pointer;
    text-align: left;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #333;
    box-shadow: none !important;
}

.filter-section-header:hover {
    background: #f9f9f9 !important;
}

.filter-section-header i:first-child {
    color: #666;
    width: 1.25rem;
    text-align: center;
}

.filter-section-title {
    flex: 1;
    min-width: 0;
    text-shadow: none !important;
}

.filter-section-header i:last-child {
    color: #999;
    font-size: 0.75rem;
}

.filter-section-content {
    padding: 0.5rem 1rem 1.5rem;
    box-sizing: border-box;
}

/* ==========================================================================
   Checkbox Filter
   ========================================================================== */

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

.filter-options-list li {
    margin: 0;
    padding: 0;
}

.filter-options-list li.disabled {
    opacity: 0.5;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    cursor: pointer;
}

.filter-checkbox input {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    cursor: pointer;
}

.filter-checkbox-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.filter-count {
    color: #888;
    font-size: 1rem;
}

.color-swatch {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 1px solid #ddd;
}

.option-image {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: cover;
    border-radius: 0.2rem;
}

.show-more-options {
    display: block;
    width: 100%;
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    border: none;
    background: none;
    color: #333;
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    text-align: left;
    text-decoration: underline;
    box-shadow: none !important;
    text-shadow: none !important;
    background: none !important;
}

.show-more-options:hover {
    color: #000;
}

/* ==========================================================================
   Swatch Filter
   ========================================================================== */

.swatch-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.swatch-option {
    width: 3.5rem;
    height: 3.5rem;
    padding: 0.2rem;
    border: 2px solid transparent;
    border-radius: 0;
    background: #f5f5f5 !important;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
    transition: border-color 0.15s;
}

.swatch-option:hover {
    border-color: #bbb;
}

.swatch-option.selected {
    border-color: #333;
}

.swatch-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.swatch-color {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0.2rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.swatch-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.2rem;
}

.swatch-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.1;
    overflow: hidden;
}

/* ==========================================================================
   Toggle Filter
   ========================================================================== */

.filter-toggle {
    border-bottom: 0.1rem solid #eee;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.8rem;
    cursor: pointer;
}

.toggle-label i {
    color: #666;
    width: 1.25rem;
    text-align: center;
}

.toggle-label .filter-section-title {
    flex: 1;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 2.5rem;
    height: 1.4rem;
    border: none;
    border-radius: 0.7rem;
    background: #ccc;
    cursor: pointer;
    transition: background-color 0.2s;
}

.toggle-switch.on {
    background: #333;
}

.toggle-slider {
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: 1rem;
    height: 1rem;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch.on .toggle-slider {
    transform: translateX(1.1rem);
}

/* ==========================================================================
   Range Filter
   ========================================================================== */

.range-inputs {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    box-sizing: border-box;
}

.range-input-group {
    flex: 1;
}

.range-input-group label {
    display: block;
    font-size: 1.1rem;
    color: #333;
    font-weight: bold;
    margin-bottom: 0.4rem;
}

.range-input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 1.1rem;
    box-shadow: none !important;
    box-sizing: border-box;
}

.range-separator {
    padding-bottom: 0.5rem;
    color: #999;
}

.range-unit {
    padding-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.range-info {
    margin-top: 0.5rem;
    font-size: 1rem;
    color: #666;
}

.filter-apply-btn {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.8rem;
    border: 1px solid #333;
    border-radius: 0;
    background: #fff !important;
    box-sizing: border-box;
    color: #333;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
    transition:
        background-color 0.15s,
        color 0.15s;
}

.filter-apply-btn:hover {
    background: #333 !important;
    color: #fff !important;
}

/* ==========================================================================
   Quick Toggles
   ========================================================================== */

.quick-toggles {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-bottom: 0.1rem solid #eee;
}

.quick-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    cursor: pointer;
    border-bottom: 0.1rem solid #eee;
    font-size: 1.1rem;
    text-shadow: none !important;
    background: none !important;
}

.quick-toggle:last-child {
    border-bottom: none;
}

.quick-toggle:hover {
    background: #f9f9f9 !important;
}

.quick-toggle input {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

/* ==========================================================================
   Active Filters / Chips
   ========================================================================== */

.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem;
    background: #f5f5f5;
    border-bottom: 0.1rem solid #eee;
}

.active-filters-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: #f0f0f0;
    border-radius: 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    box-shadow: none !important;
    text-shadow: none !important;
}

.filter-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: none;
    padding: 0;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: none !important;
}

.filter-chip-remove:hover {
    color: #333;
}

.clear-all-filters {
    padding: 0.25rem 0.5rem;
    border: none;
    background: none;
    color: #333;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    white-space: nowrap;
}

.clear-all-filters:hover {
    color: #000;
}

/* ==========================================================================
   Category Navigation
   ========================================================================== */

.category-nav {
    margin-top: 1.6rem;
}

.category-nav-title {
    padding: 0 0.8rem 1rem 0.8rem;
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 0.1rem solid #eee;
}

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

.category-nav-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.8rem;
    text-decoration: none;
    color: #333;
    border-bottom: 0.1rem solid #eee;
}

.category-nav-item a:hover {
    background: #fff;
}

.category-nav-item.active a {
    font-weight: bold;
    background: #fff;
}

/* ==========================================================================
   Browse Meta (Sort & Count)
   ========================================================================== */

.browse-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 0.1rem solid #eee;
}

.browse-results-info .total-count {
    font-size: 1.25rem;
    color: #333;
    font-weight: 500;
}

.browse-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.browse-sort label {
    font-size: 1.25rem;
    color: #333;
    margin-right: 0.75rem;
    font-weight: bold;
}

.sort-select {
    padding: 0.6rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 0;
    background: #fff;
    font-size: 1.1rem;
    box-shadow: none !important;
}

/* ==========================================================================
   Product Grid
   ========================================================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.6rem;
}

.product-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.product-grid-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.product-grid-empty p {
    margin: 0;
}

/* ==========================================================================
   Product Card
   ========================================================================== */

.product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0.4rem;
    overflow: hidden;
    transition: transform 0.15s;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 0;
    color: #fff;
}

.product-badge.sale {
    background: #c00;
}

.product-badge.new {
    background: #28a745;
}

.product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card .product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s;
}

.product-card:hover .product-image img {
    transform: scale(1.03);
}

.product-info {
    padding: 0.8rem;
}

.product-featured-property {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    margin-bottom: 0.5rem;
    background: #f0f0f0;
    border-radius: 0;
    font-size: 0.95rem;
    color: #333;
}

.product-card .product-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: normal;
    line-height: 1.3;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.8rem 0.8rem;
    margin-top: auto;
}

.product-card .product-price {
    font-weight: bold;
    font-size: 1rem;
}

.product-card .old-price {
    text-decoration: line-through;
    color: #888;
    font-size: 1rem;
    font-weight: normal;
    margin-right: 0.4rem;
}

.product-card .current-price {
    font-weight: bold;
}

.product-card.on-sale .current-price {
    color: #c00;
}

.product-card .button-buy {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 0;
    background: #333 !important;
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
}

.product-card .button-buy:hover:not(:disabled) {
    background: #000 !important;
}

.product-card .button-buy:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.product-stock {
    font-size: 0.95rem;
    margin-top: 0.5rem;
    padding: 0 0.8rem 1rem;
}

.product-stock .in-stock {
    color: #28a745;
}

.product-stock .out-of-stock {
    color: #c00;
}

.product-stock i {
    margin-right: 0.25rem;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.pagination-btn,
.pagination-prev,
.pagination-next,
.pagination-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    height: 3rem;
    padding: 0 1rem;
    border: 1px solid #ddd;
    border-radius: 0;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
}

.pagination-btn:hover:not(:disabled):not(.active),
.pagination-prev:hover,
.pagination-next:hover,
.pagination-page:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.pagination-btn.active,
.pagination-page.active {
    background: #333 !important;
    border-color: #333;
    color: #fff;
    cursor: default;
}

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

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: #888;
}

/* ==========================================================================
   Quick Filter Bar
   ========================================================================== */

.quick-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.8rem;
    background: #f9f9f9;
    border-bottom: 0.1rem solid #eee;
    margin-bottom: 1rem;
}

.quick-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-filter-label {
    font-size: 0.85rem;
    color: #666;
}

.quick-filter-options {
    display: flex;
    gap: 0.3rem;
}

.quick-filter-btn {
    padding: 0.3rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 0;
    background: #fff !important;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.quick-filter-btn:hover {
    border-color: #bbb;
}

.quick-filter-btn.selected {
    background: #333;
    border-color: #333;
    color: #fff;
}

.quick-filter-btn .color-dot {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid #eee;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   No Products
   ========================================================================== */

.no-products {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.no-products p {
    margin: 0;
}

/* ==========================================================================
   Mobile Filter Trigger Button
   ========================================================================== */

.mobile-filter-trigger {
    display: none;
}

.mobile-filter-spacer {
    display: none;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    margin-left: 0.4rem;
    background: #c00;
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 0.75rem;
}

/* ==========================================================================
   Mobile: Bottom Sheet Filter
   ========================================================================== */

/* Mobile filter overlay (backdrop) */
.mobile-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.25s ease,
        visibility 0.25s;
}

.mobile-filter-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Hide collapsed state by not showing overlay */
.mobile-filter-overlay.collapsed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* The bottom sheet container */
.mobile-filter-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fafafa;
    max-height: 85vh;
    border-radius: 0.8rem 0.8rem 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-filter-sheet.open {
    transform: translateY(0);
}

/* Sheet header with drag handle */
.mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 0.1rem solid #eee;
    background: #fafafa;
    border-radius: 0.8rem 0.8rem 0 0;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
}

/* Visual drag handle */
.mobile-filter-header::before {
    content: "";
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2.5rem;
    height: 0.25rem;
    background: #ccc;
    border-radius: 0.125rem;
}

.mobile-filter-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: none !important;
}

.mobile-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-filter-actions .clear-filters {
    padding: 0.4rem 0.75rem;
    border: none;
    background: none;
    color: #333;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

.mobile-filter-actions .clear-filters:hover {
    color: #000;
}

.mobile-expand-icon {
    color: #666;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.mobile-filter-sheet.open .mobile-expand-icon {
    transform: rotate(180deg);
}

.mobile-filter-close {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: #eee;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-filter-close:hover {
    background: #ddd;
}

/* Scrollable content area */
.mobile-filter-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fafafa;
}

/* Footer with apply button */
.mobile-filter-footer {
    padding: 1rem;
    border-top: 0.1rem solid #eee;
    background: #fff;
    flex-shrink: 0;
}

.mobile-filter-apply {
    width: 100%;
    padding: 0.875rem;
    border: none;
    background: #333 !important;
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 0;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
}

.mobile-filter-apply:hover {
    background: #000 !important;
}

/* Prevent body scroll when sheet is open */
body.filter-sheet-open {
    overflow: hidden;
}

body.filter-sheet-open .mobile-filter-trigger {
    display: none !important;
}

/* ==========================================================================
   Desktop Styles (56em = 896px)
   ========================================================================== */

@media (min-width: 56em) {
    /* Desktop: Hide mobile elements */
    .mobile-filter-trigger,
    .mobile-filter-overlay,
    .mobile-filter-sheet {
        display: none !important;
    }

    /* Desktop: Filter widget in sidebar */
    .filter-widget {
        display: block;
    }

    .filter-widget-footer {
        display: none;
    }
}

/* ==========================================================================
   Mobile Styles (below 56em)
   ========================================================================== */

@media (max-width: 55.99em) {
    /* Hide desktop filter widget */
    .filter-widget {
        display: none;
    }

    /* Show mobile filter trigger */
    .mobile-filter-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.8rem;
        padding: 0.9rem 1.8rem;
        border: none;
        border-radius: 3rem;
        background: #ca002f !important;
        font-size: 1.15rem;
        font-weight: bold;
        text-transform: uppercase;
        cursor: pointer;
        color: #fff !important;
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3) !important;
        text-shadow: none !important;
        position: sticky;
        top: calc(100vh - 5.5rem);
        bottom: 2rem;
        z-index: 95;
        margin: 1rem auto;
        width: fit-content;
    }

    .mobile-filter-trigger:active {
        background: #f0f0f0 !important;
    }

    .mobile-filter-trigger i {
        font-size: 1rem;
    }

    /* Show mobile elements */
    .mobile-filter-overlay,
    .mobile-filter-sheet {
        display: flex;
    }

    /* Adjust browse meta for mobile */
    .browse-meta {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .browse-sort {
        justify-content: space-between;
    }

    /* Smaller product grid on mobile */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .product-card .product-title {
        font-size: 0.85rem;
    }

    .product-footer {
        flex-direction: column;
        gap: 0.5rem;
    }

    .product-card .button-buy {
        width: 100%;
        text-align: center;
    }

    /* Active filters adjustments */
    .active-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .clear-all-filters {
        text-align: center;
    }

    /* Pagination on mobile */
    .pagination {
        flex-wrap: wrap;
    }

    .mobile-filter-spacer {
        display: block;
        height: 8rem;
    }
}

/* Very small screens */
@media (max-width: 30em) {
    .product-grid {
        gap: 0.5rem;
    }

    .product-card .product-title {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }

    .product-card .current-price {
        font-size: 0.95rem;
    }

    .pagination-btn,
    .pagination-prev,
    .pagination-next,
    .pagination-page {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
    }
}
