/* --- Top Banner --- */
.top-banner {
    background-color: #355057;
    color: #fff;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.top-banner a {
    color: #fff;
    margin-left: 0.5rem;
    text-decoration: underline;
    font-weight: 600;
}

.top-banner a:hover {
    color: #f5f5f5;
}

/* --- NEW: Brand Color Palette & Font --- */
:root {
    --brand-green: var(--ds-color-primary-500);
    --brand-green-dark: var(--ds-color-primary-700);
    --brand-green-light: var(--ds-color-primary-500);
    --brand-graphite: var(--ds-color-primary-500);
    --brand-background: var(--ds-color-neutral-0);
    --brand-text: var(--ds-color-text-default);
    --brand-accent: var(--ds-color-accent-500);
    --font-family-brand: var(--ds-font-sans);
    --shadow-sm: var(--ds-shadow-sm);
    --shadow-md: var(--ds-shadow-md);
    --shadow-lg: var(--ds-shadow-lg);
    --radius-md: var(--ds-radius-lg);
    --radius-lg: var(--ds-radius-2xl);

    /* Education-blue header theme */
    --edu-blue-primary: #1a365d;
    --edu-blue-secondary: #2d3748;
    --edu-blue-accent: #3182ce;
    --edu-blue-light: #ebf8ff;

    /* Header dimensions */
    --header-height-mobile: 56px;
    --search-height-mobile: 48px;
    --category-nav-height: 52px;
    --drawer-width: 320px;
}

/* --- Universal Box Sizing --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0 auto;
    padding: 0;
    font-family: var(--font-family-brand);
    background-color: var(--brand-background);
    color: var(--brand-text);
}

/* --- NEW: Container for Header Image and Benefits Bar --- */
.header-group {
    max-width: 1500px;
    margin: 0 auto 2rem;
    /* Center the group and add space below */
}

/* --- NEW: Mobile Category Navigation --- */
.mobile-category-nav {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e0e0d1;
    position: fixed;
    /* Changed from sticky to fixed */
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    /* Fixed height for consistency */
    z-index: 100;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
    align-items: center;
    /* Center items vertically */
}

.mobile-category-nav::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.category-pill {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f0f2f5;
    border-radius: 999px;
    text-decoration: none;
    color: var(--brand-text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    border: 1px solid transparent;
}

.category-pill:hover {
    background: #2A2A2A;
    color: #fff;
}

.category-pill:active {
    background: var(--brand-green-dark);
    color: #fff;
}

/* --- Full-width Header Image (within its container) --- */
.header-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Benefits Bar (aligned under image) --- */
.site-header-benefits {
    background-color: var(--brand-green-dark);
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.benefit-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    /* Add some space between check and text */
}

.main-container {
    padding: 0 1.5rem 2rem;
    /* Adjusted top padding */
    max-width: 1500px;
    margin: 0 auto;
}

.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

.panel {
    margin-bottom: 1.5rem;
}

h3 {
    margin: 0 0 .5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-green-dark);
}

/* <!-- MODIFIED: Removed old hit styles, new styles are below --> */

.topbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.topbar>* {
    flex: 1 1 auto;
}

/* --- UPDATED: Styles for collapsible filter panel --- */
.filter-panel details {
    border: 1px solid #e0e0d1;
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: #fff;
}

.filter-panel summary {
    font-weight: 600;
    padding: 0.75rem 1rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f7f5e9;
    border-radius: 8px 8px 0 0;
}

.filter-panel details[open] summary {
    border-bottom: 1px solid #e0e0d1;
}

.filter-panel summary::-webkit-details-marker {
    display: none;
}

.filter-panel summary::after {
    content: '▾';
}

.filter-panel details[open] summary::after {
    content: '▴';
}

.filter-panel-body {
    padding: 1rem;
}

.facet-search-container {
    margin-bottom: 0.5rem;
}

/* --- NEW: Clear Filters button styles --- */
.clear-filters-container {
    margin-bottom: 1rem;
}

.filter-section-title {
    margin: 1.25rem 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #4c4f5a;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Simplified, no gradients/shadows. Match filter panel look. */

/* Match the "Show more" pill look */
.clear-filters-button,
.ais-ClearRefinements-button {
    appearance: none;
    display: block;
    width: 100%;
    padding: 0.55rem 1rem;
    border: 1px solid #cfd2e5;
    /* soft bluish like show more */
    border-radius: 10px;
    background: #fff;
    color: #1f2432;
    /* dark text similar to theme */
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(207, 210, 229, 0.35) inset;
    /* subtle inner ring */
    background-image: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.clear-filters-button:hover,
.ais-ClearRefinements-button:hover {
    border-color: #b9bedb;
    box-shadow: 0 0 0 2px rgba(185, 190, 219, 0.5) inset;
}

/* Disabled state - clearly muted, no fades */
.ais-ClearRefinements-button--disabled,
.clear-filters-button:disabled {
    background: #fff;
    border-color: #e6e8f2;
    color: #9aa0b2;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

/* Homepage page-level styles moved to homepage.css and component-level files. */

/* --- NEW: Style for the "sub-header" info box in the top bar --- */
.sub-header-topbar {
    flex: 1 1 100%;
    /* Allow it to wrap and take full width if needed */
    font-size: 0.95rem;
    color: #444;
    line-height: 1.5;
    background-color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #e0e0d1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-width: 250px;
}

.sub-header-topbar a {
    color: var(--brand-graphite);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sub-header-topbar a:hover {
    color: var(--brand-green-dark);
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
    display: inline-block;
    cursor: help;
    color: var(--brand-green-dark);
    margin-left: 4px;
    font-weight: bold;
}

.tooltip-text {
    visibility: hidden;
    width: 260px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 12px;
    position: absolute;
    z-index: 100;
    bottom: 140%;
    /* Position above */
    left: 50%;
    margin-left: -130px;
    /* Center */
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    font-size: 0.9rem;
    font-weight: normal;
    line-height: 1.4;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
}

/* Tooltip Arrow */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    bottom: 125%;
    /* Small animation up */
}


/* --- UPDATED: Algolia Widget Overrides --- */

/* Remove white box behind rounded search */
.ais-SearchBox-form {
    background: transparent !important;
    /* Override theme default */
}

/* --- NEW: Specific styles for TOPBAR search/sort --- */
.topbar .ais-SearchBox-input,
.topbar .ais-SortBy-select {
    height: 44px;
    border-radius: 22px;
    border: 1px solid #ccc;
    background-color: #fff;
}

.topbar .ais-SearchBox-input:focus,
.topbar .ais-SortBy-select:focus {
    border-color: #2A2A2A;
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.3);
    outline: none;
}

.topbar .ais-SearchBox-input {
    padding-left: 2.5rem;
    /* Pushes text past the icon */
}

/* --- NEW: Specific styles for FILTER PANEL search --- */
.filter-panel .ais-SearchBox-input {
    height: 36px;
    /* Reduced height */
    border-radius: 18px;
    /* Adjusted radius */
    border: 1px solid #ccc;
    background-color: #fff;
    background-position: center left 0.75rem;
    padding-left: 2.25rem;
    display: flex;
    /* Vertically align content */
    align-items: center;
    /* Vertically align content */
}

.filter-panel .ais-SearchBox-input:focus {
    border-color: #2A2A2A;
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.3);
    outline: none;
}

/* Category search box in filter panel */
.category-search-box {
    margin-bottom: 12px;
}

.category-search-box .ais-SearchBox-form {
    display: flex;
}

.category-search-box .ais-SearchBox-input,
#category-search-input {
    width: 100%;
    height: 36px;
    border-radius: 18px;
    border: 1px solid #ccc;
    background-color: #fff;
    padding: 0 12px;
    font-size: 13px;
    font-family: var(--font-family-brand);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#category-search-input:focus {
    border-color: #2A2A2A;
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.3);
}

#category-search-input::placeholder {
    color: #888;
}

/* <!-- MODIFIED: Removed old ais-Hits-item styles --> */
.ais-CurrentRefinements-item,
.ais-Pagination-item {
    border-radius: 15px;
}

.ais-Pagination-item--selected {
    background-color: var(--brand-green-dark);
    border-color: var(--brand-green-dark);
}

/* --- NEW: Pagination Fix for Mobile --- */
.ais-Pagination-list {
    display: flex;
    /* Use flexbox for alignment */
    flex-wrap: wrap;
    /* Allow items to wrap to the next line */
    justify-content: center;
    /* Center the pagination links */
}

/* --- START: Added styles for rangeInput widget --- */
.ais-RangeInput-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ais-RangeInput-label {
    flex-shrink: 0;
}

.ais-RangeInput-input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.ais-RangeInput-separator {
    flex-shrink: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.ais-RangeInput-submit {
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: var(--brand-green-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.ais-RangeInput-submit:hover {
    background-color: #2a4430;
}

/* --- END: Added styles for rangeInput widget --- */

/* --- START: Added styles for ratingMenu widget --- */
.ais-RatingMenu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ais-RatingMenu-item {
    padding: 0.35rem 0;
}

.ais-RatingMenu-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--brand-text);
    cursor: pointer;
}

.ais-RatingMenu-link:hover {
    color: var(--brand-green-dark);
}

.ais-RatingMenu-item--selected .ais-RatingMenu-link {
    font-weight: 600;
    color: var(--brand-green-dark);
}

.ais-RatingMenu-starIcon {
    width: 16px;
    height: 16px;
}

.ais-RatingMenu-starIcon--full {
    fill: #fbbf24;
}

.ais-RatingMenu-starIcon--empty {
    fill: #d1d5db;
}

.ais-RatingMenu-label {
    margin-left: 0.25rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.ais-RatingMenu-count {
    margin-left: auto;
    background-color: #f3f4f6;
    color: #6b7280;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.ais-RatingMenu-item--disabled {
    opacity: 0.5;
    pointer-events: none;
}
/* --- END: Added styles for ratingMenu widget --- */

/* --- START: Added styles for numericMenu widget (Customer Reviews) --- */
.ais-NumericMenu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ais-NumericMenu-item {
    padding: 0.25rem 0;
}

.ais-NumericMenu-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--brand-text);
}

.ais-NumericMenu-label:hover {
    color: var(--brand-green-dark);
}

.ais-NumericMenu-radio {
    accent-color: var(--brand-green-dark);
}

.ais-NumericMenu-item--selected .ais-NumericMenu-labelText {
    font-weight: 600;
    color: var(--brand-green-dark);
}

.ais-NumericMenu-labelText {
    color: var(--brand-text);
}
/* --- END: Added styles for numericMenu widget --- */

/* --- START: Added styles for hierarchicalMenu --- */
.ais-HierarchicalMenu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ais-HierarchicalMenu-list--child {
    margin-left: 1rem;
    padding-left: 0.5rem;
    border-left: 2px solid #e5e7eb;
}

.ais-HierarchicalMenu-item {
    padding: 0;
    margin: 0;
    border: none;
}

.ais-HierarchicalMenu-item > div {
    padding: 0;
    margin: 0;
}

.ais-HierarchicalMenu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: var(--brand-text);
    font-size: 0.875rem;
    padding: 0.35rem 0;
    cursor: pointer;
    border: none;
    background: none;
}

.ais-HierarchicalMenu-link::before {
    display: none !important;
}

.ais-HierarchicalMenu-link:hover {
    color: var(--brand-green-dark);
}

.ais-HierarchicalMenu-item--selected > div > .ais-HierarchicalMenu-link,
.ais-HierarchicalMenu-item--selected > .ais-HierarchicalMenu-link {
    font-weight: 600;
    color: var(--brand-green-dark);
}

.ais-HierarchicalMenu-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ais-HierarchicalMenu-count {
    background-color: #f3f4f6;
    color: #6b7280;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}
/* --- END: Added styles for hierarchicalMenu search --- */


/* <!-- MODIFIED: START: NEW STYLES for Product Grid --> */
.ais-Hits-list {
    display: grid;
    /* Define responsive grid columns */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.ais-Hits-item {
    /* Resetting InstantSearch default styles for the item wrapper */
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
}

/* Product card wrapper */
.product-card-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0d1;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.product-card-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border-color: #2A2A2A;
}

.product-card-wrapper .product-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
    transform: none;
}

.product-card-wrapper .product-card:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Make cards in a row equal height */
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0d1;
    overflow: hidden;
    /* Ensures content respects border-radius */
    text-decoration: none;
    color: var(--brand-text);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border-color: #2A2A2A;
}

.product-card:hover .product-title {
    color: var(--brand-graphite);
}

.product-image {
    width: 100%;
    padding-top: 100%;
    /* Creates a 1:1 aspect ratio square */
    position: relative;
    background-color: #f7f7f7;
    /* Placeholder color */
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Crop image to fit, not stretch */
}

.product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Allows this container to fill available space */
}

.product-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--brand-green-dark);
    margin-bottom: 0.5rem;
    /* Clamp title to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-description {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    flex-grow: 1;
    /* Pushes meta-info to the bottom */
    /* Clamp description to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4em;
    /* <<< ADD THIS LINE */
}

/* MODIFIED RULE */
.product-meta {
    font-size: 0.8rem;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    /* Vertically align supplier and price */
    row-gap: 0.25rem;
    /* Space between the two lines */
    column-gap: 3.0rem;
    /* Space between supplier and price */
}

/* MODIFIED RULE */
.product-price {
    font-weight: 700;
    color: var(--brand-green-dark);
    margin-left: auto;
    /* Magic property to push it to the right */
    flex-shrink: 0;
    /* Prevent it from shrinking */
}

.product-sold-out {
    font-weight: 600;
    color: #c05621;
    flex-basis: 100%;
}

/* MODIFIED RULE for Supplier */
.product-supplier {
    /* This allows the supplier to grow but not exceed the available space */
    flex: 1 1 0;
    min-width: 0;
    /* Crucial for enabling truncation in a flex item */

    /* These properties handle the truncation with "..." */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* MODIFIED RULE for Date */
.product-seen {
    /* Force this element to a new line by taking 100% of the width */
    flex-basis: 100%;
    margin-bottom: 0.25rem;
    /* Adds space below the date */
}

/* <!-- MODIFIED: END: NEW STYLES for Product Grid --> */

/* --- Legal Disclaimer Footer --- */
.legal-disclaimer {
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0d1;
    padding: 2rem 1.5rem;
    margin-top: 4rem;
    text-align: center;
}

.disclaimer-content {
    max-width: 800px;
    margin: 0 auto;
}

.disclaimer-content p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: 1rem;
}

.disclaimer-content p:last-child {
    margin-bottom: 0;
}

/*
============================================
== NEW: MOBILE STYLES (860px and below)   ==
============================================
*/
@media (max-width: 860px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .main-container {
        padding: 0 1rem 1rem;
    }

    #desktop-benefits {
        display: none;
    }

    #mobile-benefits {
        display: flex;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
        padding: 0 1rem;
        /* Add padding to the content inside main */
    }

    .topbar #searchbox,
    .topbar #sort-by,
    .topbar #stats,
    .topbar .sub-header-topbar {
        flex-basis: auto;
        width: 100%;
        text-align: center;
    }

    /* --- NEW FIX: Force main content blocks to screen width --- */
    .filter-panel,
    main {
        width: 100vw;
        margin-left: -1rem;
        /* Counteract parent padding */
    }

    /* Add padding back to the direct children of the constrained containers */
    .filter-panel>details,
    #current-refinements,
    #hits,
    #pagination {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* <!-- MODIFIED: Responsive grid for mobile --> */
    .ais-Hits-list {
        grid-template-columns: 1fr;
        /* 1 column on mobile */
        gap: 1rem;
    }

    /* ▼▼▼ ADD THIS NEW RULE ▼▼▼ */
    .product-card {
        width: 100%;
    }

    /* Homepage mobile card/button/input styles were moved to homepage.css components. */

    /* --- Mobile styles for legal disclaimer --- */
    .legal-disclaimer {
        padding: 1.5rem 1rem;
        margin-top: 3rem;
    }

    .disclaimer-content p {
        font-size: 0.8rem;
    }
}

/*
============================================
== DESKTOP STYLES (861px and above)       ==
============================================
*/
@media (min-width: 861px) {
    #mobile-benefits {
        display: none;
    }
}

/* Ensure body has padding to account for the fixed category nav */
/* Note: When .has-header class is present, padding is handled by css/header.css */
body:not(.has-header) {
    padding-top: 60px;
}

/* Hide old mobile-category-nav when new header is active */
body.has-header .mobile-category-nav {
    display: none !important;
}

/* Search results padding */
#search-results {
    padding-top: 16px;
}

/* --- Hamburger Menu Button --- */
.filter-toggle-btn {
    display: none;
    /* Hidden by default on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--brand-green-dark);
    border-radius: 50%;
    transition: background-color 0.2s;
}

.filter-toggle-btn:hover {
    background-color: #f0f2f5;
}

/* --- Filter Panel (Desktop Default) --- */
.filter-panel {
    display: block;
}

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

/* --- Mobile Responsive Styles --- */
@media (max-width: 860px) {
    .filter-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Filter Drawer */
    .filter-panel {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 100%;
        max-width: 320px;
        background: #fff;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        padding: 0;
    }

    .filter-panel.open {
        transform: translateX(0);
    }

    .filter-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid #eee;
        background: #f9f9f9;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .filter-header-mobile h2 {
        margin: 0;
        font-size: 1.2rem;
        color: var(--brand-green-dark);
    }

    .close-filters-btn {
        background: none;
        border: none;
        font-size: 2rem;
        line-height: 1;
        cursor: pointer;
        color: #666;
    }

    .filter-panel-content {
        padding: 1rem;
    }

    /* Overlay when filters are open */
    body.filters-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
    }

    /* Adjust layout grid for mobile */
    .layout {
        display: block;
    }
}

/* --- NEW: Full Width Layout Fixes --- */
/* Since #search-results is now outside .main-container */
#search-results {
    width: 100%;
}

.layout {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 0 2rem;
}

/* Mobile adjustments for layout padding */
@media (max-width: 860px) {
    .layout {
        padding: 0 0 1rem;
    }

    /* Reset the negative margins we added earlier since we now have a different structure */
    .filter-panel,
    main {
        width: auto;
        margin-left: 0;
    }

    /* But wait, if we want the filter panel to be a drawer, it needs fixed positioning which ignores this */
    /* The main content should be normal block */

    /* Re-apply padding to children if needed, but now .layout handles the container padding */
    .filter-panel>details,
    #current-refinements,
    #hits,
    #pagination {
        padding-left: 0;
        padding-right: 0;
    }
}

/* --- NEW: Mobile Sort Logic --- */
.mobile-sort-container {
    display: none;
    /* Hidden on desktop */
    margin-bottom: 1.5rem;
}

.mobile-sort-container h3 {
    margin-bottom: 0.5rem;
}

/* Mobile Styles */
@media (max-width: 860px) {

    /* Hide the topbar sort on mobile */
    .topbar #sort-by {
        display: none;
    }

    /* Show the mobile sort in the drawer */
    .mobile-sort-container {
        display: block;
    }

    /* Style the mobile sort select to look good in the drawer */
    .mobile-sort-container .ais-SortBy-select {
        width: 100%;
        height: 44px;
        border-radius: 8px;
        border: 1px solid #ccc;
        padding: 0 1rem;
        font-size: 1rem;
        background-color: #fff;
    }
}

/* --- Mobile Search Fixes --- */
@media (max-width: 860px) {
    /* Fix Header Gap & Movement */
    /* Enforce fixed height and alignment on category nav */
    .mobile-category-nav {
        height: 60px;
        padding: 0 1.5rem;
        /* Horizontal padding only */
        align-items: center;
        /* Vertically center the pills */
        box-sizing: border-box;
    }
}

/* --- Homepage Icon --- */
.homepage-icon {
    max-width: 100px;
    height: auto;
    margin-bottom: 1.5rem;
    display: inline-block;
}

/* ============================================
   NEW: Enhanced Product Card Styles
   ============================================ */

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-grid-item {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
}

/* Updated Product Card */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    text-decoration: none;
    color: var(--brand-text);
    transition: all 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #2A2A2A;
}

.product-card--sold-out {
    opacity: 0.85;
}

.product-card--sold-out .product-image img {
    filter: grayscale(30%);
}

/* Product Image Container */
.product-card .product-image {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background-color: #f9fafb;
    overflow: hidden;
}

.product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform 0.3s ease;
}

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

/* Sold Out Badge */
.product-sold-out-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dc2626;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

/* Product Info Section */
.product-card .product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.35rem;
}

/* Brand */
.product-brand {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Title */
.product-card .product-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--brand-green-dark);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.product-card:hover .product-title {
    color: var(--brand-graphite);
}

/* Star Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0;
}

.product-stars {
    display: inline-flex;
    font-size: 0.9rem;
    line-height: 1;
}

.star {
    color: #fbbf24;
}

.star-full {
    color: #f59e0b;
}

.star-half {
    color: #f59e0b;
    opacity: 0.7;
}

.star-empty {
    color: #d1d5db;
}

.product-rating-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}

.product-review-count {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Price Row */
.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.product-card .product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #059669;
}

.product-card .product-supplier {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6b7280;
}

.no-results strong {
    color: var(--brand-green-dark);
}

/* Current Refinements */
.current-refinements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.current-refinement-item {
    display: inline-flex;
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    color: #166534;
}

.current-refinement-label {
    font-weight: 600;
    margin-right: 0.25rem;
}

.current-refinement-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: #166534;
    font-size: 1rem;
    padding: 0 0 0 0.5rem;
    line-height: 1;
}

.current-refinement-delete:hover {
    color: #dc2626;
}

/* Price Range Styling */
.price-range-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-range-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.price-range-submit {
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: var(--brand-green-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.price-range-submit:hover {
    background-color: #2a4430;
}

/* Age Range Filter Styling */
.age-range-filter {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.age-range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.age-range-inputs label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.age-range-inputs label span {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.age-range-inputs input[type="number"] {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
}

.age-range-inputs input[type="number"]:focus {
    outline: none;
    border-color: #2A2A2A;
    box-shadow: 0 0 0 2px rgba(127, 168, 122, 0.2);
}

.age-range-separator {
    color: #6b7280;
    font-size: 0.9rem;
    padding: 0 0.25rem;
}

.age-filter-apply {
    padding: 0.5rem 1rem;
    background-color: var(--brand-green-dark);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-left: 0.25rem;
}

.age-filter-apply:hover {
    background-color: #2a4430;
}

.age-quick-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.age-quick-pick {
    padding: 0.375rem 0.75rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.age-quick-pick:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.age-quick-pick.active {
    background: #2A2A2A;
    border-color: #2A2A2A;
    color: #fff;
}

.age-quick-pick.active:hover {
    background: var(--brand-green-dark);
    border-color: var(--brand-green-dark);
}

/* Toggle Refinement */
.ais-ToggleRefinement-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.ais-ToggleRefinement-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-green-dark);
}

/* Responsive adjustments */
@media (max-width: 860px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .product-card .product-info {
        padding: 0.75rem;
    }

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

    .product-brand {
        font-size: 0.65rem;
    }

    .product-stars {
        font-size: 0.8rem;
    }

    .product-rating-text,
    .product-review-count {
        font-size: 0.7rem;
    }

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

    .product-card .product-supplier {
        font-size: 0.65rem;
        max-width: 80px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   CATALOG-STYLE SEARCH RESULTS
   Conversion-optimized product card design
   ============================================ */

/* Container for Catalog-style results */
.ais-Hits-list.catalog-results,
#hits .ais-Hits-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Reset InstantSearch item wrapper */
.ais-Hits-item:has(.catalog-product-card) {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
}

/* Catalog Product Card - Grid Layout for proper button positioning */
.catalog-product-card {
    display: grid;
    grid-template-columns: 140px 1fr;
    grid-template-rows: auto auto;
    gap: 16px 16px;
    background: #fff;
    border-bottom: 1px solid #e7e7e7;
    padding: 16px;
    position: relative;
}

.catalog-product-card:first-child {
    border-top: 1px solid #e7e7e7;
}

.catalog-product-link {
    display: contents; /* Let children participate in parent grid */
    text-decoration: none;
    color: inherit;
}

/* Stretched link: Make entire card clickable via pseudo-element */
.catalog-product-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: pointer;
}

/* Product Image */
.catalog-product-image {
    grid-column: 1;
    grid-row: 1 / 3; /* Span both rows */
    width: 140px;
    height: 180px;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #fff;
}

.catalog-product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Sold Out Badge */
.catalog-sold-out-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #cc0c39;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

.catalog-product-card--sold-out .catalog-product-image img {
    opacity: 0.6;
}

/* Product Details */
.catalog-product-details {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Product Title - Catalog Blue */
.catalog-product-title {
    font-size: 16px;
    font-weight: 400;
    color: #0F1111;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.catalog-product-link:hover .catalog-product-title {
    color: #C45500;
    text-decoration: underline;
}

/* Brand/Author */
.catalog-product-brand {
    font-size: 14px;
    color: #565959;
    margin: 0;
}

.catalog-product-brand a {
    color: #007185;
    text-decoration: none;
    /* Position above the stretched card link */
    position: relative;
    z-index: 2;
}

.catalog-product-brand a:hover {
    color: #C45500;
    text-decoration: underline;
}

/* Star Rating */
.catalog-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.catalog-rating-value {
    font-size: 13px;
    font-weight: 600;
    color: #0F1111;
}

.catalog-stars {
    display: inline-flex;
    font-size: 14px;
    line-height: 1;
}

.catalog-stars .star {
    color: #FFA41C;
}

.catalog-stars .star-empty {
    color: #DDDDDD;
}

.catalog-stars .star-half {
    color: #FFA41C;
}

.catalog-review-count {
    font-size: 13px;
    color: #007185;
}

.catalog-review-count:hover {
    color: #C45500;
    text-decoration: underline;
    cursor: pointer;
}

/* Product Format */
.catalog-product-format {
    font-size: 13px;
    color: #565959;
    margin: 0;
}

/* Price Row */
.catalog-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.catalog-price {
    font-size: 20px;
    font-weight: 400;
    color: #0F1111;
}

.catalog-price sup {
    font-size: 12px;
    top: -6px;
}

.catalog-original-price {
    font-size: 14px;
    color: #565959;
    text-decoration: line-through;
}

/* Delivery Info */
.catalog-delivery-info {
    font-size: 13px;
    color: #565959;
    margin: 6px 0 0 0;
}

.catalog-delivery-info strong {
    color: #0F1111;
}

/* Prime Badge */
.catalog-prime-badge {
    display: inline-flex;
    align-items: center;
    background: #232F3E;
    color: #00A8E1;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 6px;
    letter-spacing: 0.5px;
}

.catalog-prime-badge::before {
    content: "✓";
    margin-right: 3px;
    font-size: 10px;
}

/* Add to Cart Button - Full width in details column, matches product page .btn-primary */
.catalog-add-to-cart-btn {
    /* Grid positioning: fill the details column */
    grid-column: 2;
    grid-row: 2;
    justify-self: stretch; /* Fill full width of column */
    margin-top: 0;

    /* Styling from product page .btn-primary */
    background: #c27455;
    border: none;
    border-radius: 9999px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.875rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-sizing: border-box;

    /* Position above the stretched card link */
    position: relative;
    z-index: 2;
}

.catalog-add-to-cart-btn:hover {
    background: #b06545;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(194, 116, 85, 0.3);
}

.catalog-add-to-cart-btn:active {
    background: #a05a3a;
    transform: translateY(0);
    box-shadow: none;
}

/* Filter Chips - Horizontal Scrollable */
.catalog-filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e7e7e7;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.catalog-filter-chips::-webkit-scrollbar {
    display: none;
}

.catalog-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #D5D9D9;
    border-radius: 20px;
    font-size: 13px;
    color: #0F1111;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.1s ease;
}

.catalog-filter-chip:hover {
    background: #F7FAFA;
    border-color: #c7cbcb;
}

.catalog-filter-chip.active {
    background: #EDFDFF;
    border-color: #007185;
    color: #007185;
}

.catalog-filter-chip svg {
    width: 14px;
    height: 14px;
}

.catalog-filter-chip .chip-emoji {
    font-size: 14px;
    line-height: 1;
}

.catalog-filter-chip .chip-count {
    font-size: 11px;
    color: #565959;
    font-weight: 400;
}

.catalog-filter-chip.active .chip-count {
    color: #007185;
}

/* Stats/Results Count */
.catalog-results-stats {
    padding: 12px 16px;
    font-size: 14px;
    color: #565959;
    border-bottom: 1px solid #e7e7e7;
    background: #fff;
}

.catalog-results-stats strong {
    color: #C45500;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .catalog-product-card {
        padding: 12px;
    }

    .catalog-product-link {
        gap: 12px;
    }

    .catalog-product-image {
        width: 110px;
        height: 140px;
    }

    .catalog-product-title {
        font-size: 14px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .catalog-product-brand {
        font-size: 12px;
    }

    .catalog-stars {
        font-size: 12px;
    }

    .catalog-review-count,
    .catalog-rating-value {
        font-size: 12px;
    }

    .catalog-price {
        font-size: 18px;
    }

    .catalog-delivery-info {
        font-size: 12px;
    }

    .catalog-product-card {
        grid-template-columns: 110px 1fr;
        gap: 12px 12px;
    }

    .catalog-product-image {
        width: 110px;
    }

    .catalog-add-to-cart-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 400px) {
    .catalog-product-card {
        grid-template-columns: 90px 1fr;
    }

    .catalog-product-image {
        width: 90px;
        height: 120px;
    }
}

/* Topbar adjustments for Catalog style - 3 column layout */
.catalog-topbar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid #e7e7e7;
    gap: 12px;
    min-height: 44px;
}

/* Topbar refinements column */
.catalog-topbar .topbar-refinements {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.catalog-topbar .topbar-refinements:empty {
    display: none;
}

.catalog-topbar .topbar-refinements .ais-CurrentRefinements {
    display: contents;
}

.catalog-topbar .topbar-refinements .ais-CurrentRefinements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    border: none;
}

.catalog-topbar .topbar-refinements .ais-CurrentRefinements-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #EDFDFF;
    border: 1px solid #007185;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    color: #007185;
}

.catalog-topbar .topbar-refinements .ais-CurrentRefinements-label {
    font-weight: 600;
}

.catalog-topbar .topbar-refinements .ais-CurrentRefinements-delete {
    background: none;
    border: none;
    color: #007185;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    line-height: 1;
}

.catalog-topbar .topbar-refinements .ais-CurrentRefinements-delete:hover {
    color: #C45500;
}

/* Topbar actions column (sort + filter button) */
.catalog-topbar .topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.catalog-topbar .ais-SortBy-select {
    padding: 8px 12px;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}

.catalog-topbar .ais-SortBy-select:hover {
    background: #f5f5f5;
}

/* Search results container */
#search-results.catalog-style {
    background: #EAEDED;
    padding-top: 0 !important;
}

#search-results.catalog-style .layout {
    background: #fff;
    max-width: 100%;
    padding: 0;
}

#search-results.catalog-style main {
    background: #fff;
}

/* Catalog Topbar - Filter Button */
.catalog-topbar .filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #F0F2F2;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    font-size: 13px;
    color: #0F1111;
    cursor: pointer;
    transition: all 0.1s ease;
}

.catalog-topbar .filter-toggle-btn:hover {
    background: #e7e9e9;
}

.catalog-topbar .filter-toggle-btn svg {
    width: 16px;
    height: 16px;
}

/* Catalog Style Sort Dropdown */
#search-results.catalog-style .ais-SortBy-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    font-size: 13px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    color: #0F1111;
}

#search-results.catalog-style .ais-SortBy-select:hover {
    background-color: #f5f5f5;
}

/* Catalog Style Stats */
#search-results.catalog-style #stats {
    font-size: 14px;
    color: #565959;
    padding: 0;
    background: none;
    border: none;
}

#search-results.catalog-style .ais-Stats-text {
    color: #565959;
}

/* Catalog Pagination */
.catalog-pagination {
    display: flex;
    justify-content: center;
    padding: 20px 16px;
    background: #fff;
    border-top: 1px solid #e7e7e7;
}

.catalog-pagination .ais-Pagination-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.catalog-pagination .ais-Pagination-item {
    margin: 0;
}

.catalog-pagination .ais-Pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    background: #fff;
    color: #0F1111;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.1s ease;
}

.catalog-pagination .ais-Pagination-link:hover {
    background: #F7FAFA;
    border-color: #c7cbcb;
}

.catalog-pagination .ais-Pagination-item--selected .ais-Pagination-link {
    background: #EDFDFF;
    border-color: #007185;
    color: #007185;
    font-weight: 600;
}

.catalog-pagination .ais-Pagination-item--disabled .ais-Pagination-link {
    color: #D5D9D9;
    cursor: not-allowed;
    background: #fff;
}

.catalog-pagination .ais-Pagination-item--disabled .ais-Pagination-link:hover {
    background: #fff;
    border-color: #D5D9D9;
}

/* Current Refinements - Catalog Style */
#search-results.catalog-style #current-refinements {
    padding: 0 16px;
    margin: 0;
}

#search-results.catalog-style .ais-CurrentRefinements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
    margin: 0;
    list-style: none;
    border-bottom: 1px solid #e7e7e7;
}

#search-results.catalog-style .ais-CurrentRefinements-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #EDFDFF;
    border: 1px solid #007185;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    color: #007185;
}

#search-results.catalog-style .ais-CurrentRefinements-label {
    font-weight: 600;
}

#search-results.catalog-style .ais-CurrentRefinements-delete {
    background: none;
    border: none;
    color: #007185;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    line-height: 1;
}

#search-results.catalog-style .ais-CurrentRefinements-delete:hover {
    color: #C45500;
}

/* Hide empty current refinements container and list */
#current-refinements:empty,
.ais-CurrentRefinements:empty,
.ais-CurrentRefinements-list:empty,
.current-refinements-list:empty,
.ais-CurrentRefinements--noRefinement,
.ais-CurrentRefinements--noRefinement .ais-CurrentRefinements-list {
    display: none;
}

/* Hide the old topbar in .layout for catalog style */
#search-results.catalog-style .layout .topbar {
    display: none;
}

/* Adjust layout for catalog style */
#search-results.catalog-style .layout {
    display: block;
    padding: 0;
}

#search-results.catalog-style .layout main {
    padding: 0;
}

#search-results.catalog-style #hits {
    padding: 0;
}

/* Mobile adjustments for catalog style */
@media (max-width: 860px) {
    .catalog-filter-chips {
        padding: 10px 12px;
        gap: 6px;
    }

    .catalog-filter-chip {
        padding: 6px 12px;
        font-size: 12px;
    }

    .catalog-topbar {
        grid-template-columns: 1fr auto;
        padding: 8px 12px;
        gap: 8px;
    }

    /* On mobile, refinements span full width on their own row */
    .catalog-topbar .topbar-refinements {
        grid-column: 1 / -1;
        order: 3;
    }

    .catalog-topbar .topbar-refinements:empty {
        display: none;
    }

    .catalog-topbar .filter-toggle-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    #search-results.catalog-style #stats {
        font-size: 12px;
    }

    /* Show filter button on left on mobile */
    .catalog-topbar .topbar-actions {
        order: -1;
    }
}

/* Desktop: Hide filter chips filter button on desktop when sidebar is visible */
@media (min-width: 861px) {
    #search-results.catalog-style .layout {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 0;
    }

    #search-results.catalog-style .filter-panel {
        display: block;
        border-right: 1px solid #e7e7e7;
        padding: 16px;
        background: #fff;
    }

    /* Main content area (topbar + results) */
    #search-results.catalog-style .main-content {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    #search-results.catalog-style .main-content .catalog-topbar {
        border-bottom: 1px solid #e7e7e7;
    }

    #search-results.catalog-style .main-content main {
        flex: 1;
    }

    .catalog-topbar .filter-toggle-btn {
        display: none;
    }
}

/* ============================================
   CATALOG DESKTOP LAYOUT
   Enhanced horizontal cards for desktop
   ============================================ */

/* Product Description - hidden on mobile, shown on desktop */
.catalog-product-description {
    display: none; /* Hidden by default on mobile */
    font-size: 14px;
    color: #565959;
    line-height: 1.5;
    margin: 8px 0 0 0;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Desktop-specific enhancements (861px+) */
@media (min-width: 861px) {
    /* Catalog-style large horizontal layout */
    .catalog-product-card {
        grid-template-columns: 220px 1fr;
        grid-template-rows: 1fr auto;
        gap: 0 28px;
        padding: 24px 28px;
        align-items: start;
    }

    .catalog-product-image {
        grid-row: 1 / 3;
        width: 220px;
        height: 280px;
        align-self: start;
    }

    .catalog-product-details {
        grid-column: 2;
        grid-row: 1;
        gap: 6px;
    }

    .catalog-product-title {
        font-size: 18px;
        font-weight: 400;
        line-height: 1.4;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        color: #0F1111;
    }

    .catalog-product-description {
        display: -webkit-box; /* Show on desktop */
        font-size: 14px;
        line-height: 1.6;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        color: #565959;
        margin: 8px 0 0 0;
    }

    .catalog-product-brand {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .catalog-product-brand a {
        color: #007185;
        text-decoration: none;
    }

    .catalog-product-brand a:hover {
        color: #C45500;
        text-decoration: underline;
    }

    .catalog-price {
        font-size: 24px;
        font-weight: 400;
    }

    .catalog-price-row {
        margin-top: 8px;
    }

    /* Button positioned in second row under details */
    .catalog-add-to-cart-btn {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
        align-self: start;
        width: auto;
        min-width: 180px;
        margin: 12px 0 0 0;
        padding: 12px 28px;
        font-size: 14px;
    }

    .catalog-product-rating {
        margin: 6px 0;
    }

    .catalog-stars {
        font-size: 15px;
    }

    .catalog-rating-value {
        font-size: 14px;
        font-weight: 600;
    }

    .catalog-review-count {
        font-size: 14px;
    }
}

/* Large desktop (1100px+) */
@media (min-width: 1100px) {
    .catalog-product-card {
        grid-template-columns: 240px 1fr;
        gap: 0 32px;
        padding: 28px 32px;
    }

    .catalog-product-image {
        width: 240px;
        height: 300px;
    }

    .catalog-product-title {
        font-size: 20px;
    }

    .catalog-price {
        font-size: 28px;
    }

    .catalog-add-to-cart-btn {
        min-width: 200px;
        padding: 14px 32px;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 860px) {
    .catalog-product-card {
        grid-template-columns: 160px 1fr;
        grid-template-rows: 1fr auto;
        gap: 0 20px;
        padding: 20px 24px;
    }

    .catalog-product-image {
        grid-row: 1 / 3;
        width: 160px;
        height: 200px;
    }

    .catalog-product-title {
        font-size: 16px;
    }

    .catalog-product-description {
        display: -webkit-box; /* Show on tablet */
        -webkit-line-clamp: 2;
        line-clamp: 2;
        font-size: 13px;
    }

    .catalog-add-to-cart-btn {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
        width: auto;
        min-width: 160px;
        margin: 10px 0 0 0;
    }
}

/* Mobile: Description hidden (display:none in base styles) */

/* ========================================
   SITE FOOTER
   ======================================== */

.site-footer {
    background: #fff;
    color: var(--brand-text);
    padding: 3rem 1.5rem 2rem;
    margin-top: 3rem;
    border-top: 1px solid #e5e5e5;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.footer-column {
    display: flex;
    flex-direction: column;
}

.footer-brand {
    grid-column: span 1;
}

.footer-logo {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 0;
}

.footer-logo img {
    height: 22px;
    width: auto;
    object-fit: contain;
}

.footer-slogan {
    font-family: 'Montserrat Alternates', sans-serif;
    font-style: italic;
    font-size: 0.77rem;
    font-weight: 500;
    color: #2A2A2A;
    white-space: nowrap;
    margin-top: 2px;
}

.footer-tagline {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 1rem 0;
    font-style: italic;
}

.footer-copyright {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 2rem;
    margin-top: 1rem;
    border-top: 1px solid #e5e5e5;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: var(--brand-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #2A2A2A;
    text-decoration: underline;
}

.footer-policy {
    color: #555;
    font-size: 0.9rem;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.footer-contact svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #888;
}

.footer-contact span {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Footer responsive */
@media (max-width: 900px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-brand {
        grid-column: span 2;
        text-align: center;
        margin-bottom: 1rem;
    }

    .footer-logo {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 600px) {
    .site-footer {
        padding: 2rem 1rem 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        grid-column: span 1;
    }

    .footer-column {
        align-items: center;
    }

    .footer-contact li {
        justify-content: center;
    }

    .footer-contact span {
        text-align: left;
    }

    .footer-copyright {
        grid-column: 1;
        order: 10;
    }
}

/* ========================================
   StepUP Direct Pay & Services Sections
   ======================================== */

/* StepUP Section Divider */
.stepup-divider {
    position: relative;
    width: 100%;
    height: 20px;
    margin: 1rem 0;
    background-image: url('/cdn/assets/icons/glyphs/assemblinators_section divider/divider_stepup.svg');
    background-repeat: no-repeat;
    background-size: 100% 2px;
    background-position: center;
}

.stepup-divider__line {
    display: none;
}

.stepup-divider__center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.stepup-divider__arrow {
    position: absolute;
    right: 13%;
    top: 50%;
    transform: translateY(-50%);
}

@media (min-width: 601px) {
    .stepup-divider {
        background-size: 100% 3px;
    }
}

/* StepUP Section */
.stepup-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 1rem;
}

.stepup-badge-wrapper {
    position: relative;
    display: inline-block;
}

.stepup-label {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.91rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #000;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 1;
}

.stepup-badge {
    max-width: 100%;
    height: auto;
    pointer-events: none;
    user-select: none;
}

.stepup-login-btn {
    min-width: 220px;
}

.stepup-login-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.stepup-login-modal[hidden] {
    display: none !important;
}

.stepup-login-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.stepup-login-modal__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 920px);
    background: #ffffff;
    border-radius: 16px;
    padding: 1rem;
    display: grid;
    gap: 0.75rem;
}

.stepup-login-modal__close {
    justify-self: end;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 999px;
    font-size: 1.25rem;
    line-height: 1;
    background: #f1f2f4;
    cursor: pointer;
}

.stepup-login-modal__status {
    margin: 0;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    background: #fde8e8;
    color: #b42318;
    font-size: 0.9rem;
    font-weight: 600;
}

.stepup-login-modal__embed {
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    min-height: 72vh;
    overflow: hidden;
}

.stepup-login-modal__embed iframe {
    width: 100%;
    height: 72vh;
    border: 0;
    display: block;
}

/* Services Section */
.services-section {
    padding: 0;
    margin-left: 10px;
}

@media (min-width: 601px) {
    .services-section {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

.service-option {
    margin-bottom: 0.75rem;
}

.service-option:last-child {
    margin-bottom: 0;
}

.service-header {
    padding-left: 22px;
}

.service-checkbox-label {
    display: inline;
    cursor: pointer;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.91rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.service-checkbox-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-left: -22px;
    margin-right: 4px;
}

.service-separator {
    font-family: 'Nunito', sans-serif;
    font-size: 0.875rem;
    color: #555;
}

.service-description {
    display: inline;
    font-family: 'Nunito', sans-serif;
    font-size: 0.875rem;
    color: #555;
    margin: 0;
}

.location-options {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    padding-left: 1.75rem;
    margin-top: 0.5rem;
}

.location-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Nunito', sans-serif;
    font-size: 0.875rem;
    color: #333;
    cursor: pointer;
}

.location-checkbox-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Mobile adjustments for services */
@media (max-width: 600px) {
    .service-description {
        font-size: 0.8125rem;
    }
}
