/* ============================================
   Collection Page V1 — Pine Rivers Bearings
   ============================================ */

/* Breadcrumbs */
.breadcrumbs {
    background: var(--color-white);
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
}

.breadcrumbs .container {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumbs__link {
    font-size: 0.85rem;
    color: var(--color-gray);
    transition: color var(--transition-fast);
}

.breadcrumbs__link:hover {
    color: var(--color-red);
}

.breadcrumbs__sep {
    font-size: 0.55rem;
    color: var(--color-gray-medium);
}

.breadcrumbs__current {
    font-size: 0.85rem;
    color: var(--color-dark);
    font-weight: 600;
}

/* ============================================
   Category Hero Banner
   ============================================ */
.cat-hero {
    position: relative;
    padding: 60px 0;
    overflow: hidden;
    min-height: 200px;
}

.cat-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.cat-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.82), rgba(15, 15, 15, 0.6));
}

.cat-hero__inner {
    position: relative;
    z-index: 2;
}

.cat-hero__title {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.cat-hero__inner p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.05rem;
    max-width: 620px;
    line-height: 1.6;
}

.cat-hero__count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-white);
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 500;
}

.cat-hero__count i {
    color: var(--color-gold);
}

/* ============================================
   Subcategories (Third Level)
   ============================================ */
.subcategories {
    padding: 32px 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
}

.subcategories__header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
}

.subcategories__title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-dark);
    text-transform: capitalize;
    letter-spacing: 0;
}

.subcategories__count {
    font-size: 0.85rem;
    color: var(--color-gray-medium);
    font-weight: 400;
}

/* Splide overrides */
.subcategories__splide {
    padding: 4px 0;
}

.subcategories__splide .splide__slide {
    display: flex;
}

.subcategories__splide .subcat-card {
    width: 100%;
    min-height: 140px;
    justify-content: center;
}

.subcategories__splide .splide__arrow {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    width: 36px;
    height: 36px;
    opacity: 1;
}

.subcategories__splide .splide__arrow svg {
    fill: var(--color-gray-dark);
    width: 12px;
    height: 12px;
}

.subcategories__splide .splide__arrow:hover {
    background: var(--color-red);
    border-color: var(--color-red);
}

.subcategories__splide .splide__arrow:hover svg {
    fill: var(--color-white);
}

.subcategories__splide .splide__arrow:disabled {
    opacity: 0.3;
}

/* Hide the arrows entirely when the slide count doesn't exceed the current
   breakpoint's perPage (Splide adds `is-overflow` to the root only when it
   needs to scroll). Removes the arrows for ≤4 categories on desktop (perPage
   = 5), and behaves correctly at every breakpoint without extra JS. */
.subcategories__splide:not(.is-overflow) .splide__arrows {
    display: none;
}

.subcat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: var(--color-gray-dark);
    background: var(--color-white);
}

.subcat-card:hover {
    border-color: var(--color-red);
    box-shadow: 0 2px 12px rgba(191, 30, 46, 0.15);
}

.subcat-card__img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.subcat-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.subcat-card:hover .subcat-card__img img {
    transform: scale(1.1);
}

.subcat-card__name {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-dark);
}

/* ============================================
   Filter Bar
   ============================================ */
.filter-bar {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 0;
    position: sticky;
    top: var(--header-height);
    z-index: 50;
}

.filter-bar__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-bar__filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-bar__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-gray-dark);
    white-space: nowrap;
}

.filter-bar__pill {
    padding: 7px 18px;
    border-radius: 24px;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    font-family: var(--font-primary);
    font-size: 0.82rem;
    color: var(--color-gray-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-bar__pill:hover {
    border-color: var(--color-red);
    color: var(--color-red);
}

.filter-bar__pill.active {
    background: var(--color-red);
    color: var(--color-white);
    border-color: var(--color-red);
}

.filter-bar__mobile-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 24px;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-bar__mobile-toggle:hover {
    border-color: var(--color-red);
    color: var(--color-red);
}

.filter-bar__sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-bar__select select {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: var(--color-gray-dark);
    background: var(--color-white);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-fast);
}

.filter-bar__select:focus {
    border-color: var(--color-red);
}

.filter-bar__active-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.filter-bar__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-gray-light);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--color-gray-dark);
}

.filter-bar__tag-remove {
    background: none;
    border: none;
    color: var(--color-gray-medium);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.filter-bar__tag-remove:hover {
    color: var(--color-red);
}

.filter-bar__clear {
    background: none;
    border: none;
    color: var(--color-red);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast);
}

.filter-bar__clear:hover {
    color: var(--color-red-dark);
}

.filter-bar__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter-bar__view {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.filter-bar__view-btn {
    width: 38px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    border: none;
    color: var(--color-gray-medium);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-bar__view-btn:first-child {
    border-right: 1px solid var(--color-border);
}

.filter-bar__view-btn.active {
    background: var(--color-dark);
    color: var(--color-white);
}

.filter-bar__view-btn:hover:not(.active) {
    color: var(--color-red);
    background: var(--color-gray-light);
}

/* ============================================
   Quick Links (Popular Sizes & Seal Types)
   ============================================ */
.quick-links {
    background: var(--color-gray-light);
    padding: 22px 0;
    border-bottom: 1px solid var(--color-border);
}

.quick-links__row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-links__row+.quick-links__row {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--color-border);
}

.quick-links__label {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-dark);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.quick-links__label i {
    color: var(--color-red);
    font-size: 0.85rem;
}

.quick-links__chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: var(--color-white);
    border: 1.5px solid var(--color-border);
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-dark);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.quick-links__chip:hover {
    background: var(--color-red);
    border-color: var(--color-red);
    color: var(--color-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(191, 30, 46, 0.2);
}

@media (max-width: 768px) {
    .quick-links {
        padding: 16px 0;
    }

    .quick-links__row {
        gap: 6px;
    }

    .quick-links__row+.quick-links__row {
        margin-top: 10px;
        padding-top: 10px;
    }

    .quick-links__label {
        min-width: 100%;
        margin-bottom: 4px;
        font-size: 0.72rem;
    }

    .quick-links__chip {
        padding: 6px 14px;
        font-size: 0.78rem;
    }
}

/* ============================================
   Collection Layout
   ============================================ */
.collection {
    padding: 32px 0 60px;
    background: var(--color-gray-light);
}

.collection__layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

/* Sidebar */
.collection__sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height) + 70px);
    background: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: 24px;
}

/* AJAX loading state on the product grid only — the sidebar stays interactive
   while a request is in flight. */
.collection__products.is-loading {
    pointer-events: none;
}

/* Skeleton placeholder cards (rendered into the grid by category-filter.js
   while waiting for the AJAX response). */
.collection__grid.is-skeleton {
    pointer-events: none;
}

.is-skeleton-cell {
    list-style: none;
}

.product-card--skeleton {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.skeleton {
    background: linear-gradient(90deg, #ececec 25%, #f5f5f5 37%, #ececec 63%);
    background-size: 400% 100%;
    animation: prb-skeleton 1.4s ease infinite;
    border-radius: 4px;
}

.skeleton--image {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 0;
    border-bottom: 1px solid var(--color-gold);
}

.product-card--skeleton .product-card__body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.skeleton--text {
    height: 14px;
    width: 80%;
}

.skeleton--short {
    width: 50%;
    height: 12px;
}

.skeleton--chip {
    width: 60px;
    height: 22px;
    border-radius: 12px;
    margin-top: 4px;
}

.skeleton--btn {
    height: 36px;
    width: 100%;
    margin-top: auto;
    border-radius: var(--radius-sm);
}

@keyframes prb-skeleton {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

/* Skeleton body stays a simple vertical stack regardless of view mode. */
.collection__grid.list-view .product-card--skeleton .product-card__body,
.collection__grid .product-card--skeleton .product-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* "No products found" — wrapped in a UL.prb-no-results so the JS swap target
   stays valid for subsequent filter changes. The notice itself spans full
   grid width. */
ul.products.collection__grid.prb-no-results {
    grid-template-columns: 1fr;
}

.prb-no-results__item {
    list-style: none;
    padding: 0;
    margin: 0;
    grid-column: 1 / -1;
}

.prb-no-results__item .woocommerce-info,
.prb-no-results__item .woocommerce-notice {
    margin: 0;
    padding: 24px;
    background: var(--color-gray-light);
    border-radius: var(--radius-md);
    color: var(--color-gray-dark);
    text-align: center;
}

/* Custom empty state — replaces WC's default "no products" notice. */
.prb-empty {
    padding: 56px 24px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg, 12px);
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.prb-empty__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-light);
    color: var(--color-red);
    border-radius: 50%;
    font-size: 1.8rem;
}

.prb-empty__title {
    margin: 0 0 8px;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-dark);
}

.prb-empty__subtitle {
    margin: 0 0 24px;
    color: var(--color-gray-dark);
    font-size: 0.95rem;
    line-height: 1.5;
}

.prb-empty__subtitle strong {
    color: var(--color-dark);
}

.prb-empty__actions {
    display: flex;
    justify-content: center;
}

.prb-empty__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.prb-empty__btn i {
    font-size: 0.85em;
}

/* Empty layout — sidebar is suppressed; .collection__content already has
   flex:1 so removing the sidebar lets it span the full width naturally. */
.collection__layout--empty .collection__sidebar {
    display: none;
}

@media (max-width: 600px) {
    .prb-empty {
        padding: 36px 16px;
    }
    .prb-empty__title {
        font-size: 1.3rem;
    }
    .prb-empty__btn {
        width: 100%;
        justify-content: center;
    }
}

/* "Try another search" retry box — reuses the header-search autocomplete (styled
   globally in layout.css) and the popular tags, re-themed here for the light
   empty-state card. Only brand tokens already defined in global.css are used. */
.prb-empty__retry {
    max-width: 560px;
    margin: 0 auto 24px;
}

.prb-empty__retry-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-dark);
    text-align: center;
}

.prb-empty__search {
    width: 100%;
}

/* Popular tags: hero styles are white-on-dark and live in home.css (not loaded
   on this page), so give them a light-card treatment with existing tokens. */
.prb-empty__tags {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.prb-empty__tags .hero-finder__tags-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-gray-dark);
}

.prb-empty__tags .hero-finder__tag {
    display: inline-block;
    padding: 4px 14px;
    background: var(--color-gray-light);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-gray-dark);
    transition: all var(--transition-fast, 0.15s ease);
}

.prb-empty__tags .hero-finder__tag:hover {
    background: var(--color-red);
    border-color: var(--color-red);
    color: var(--color-white);
}

@media (max-width: 600px) {
    .prb-empty__search.header-search__form {
        flex-wrap: wrap;
    }
    .prb-empty__search .header-search__btn {
        width: 100%;
        justify-content: center;
    }
}

/* Strip the native number-input spinner on Webkit (helps avoid stray click
   increments alongside our wheel/keydown guards). */
.sidebar__size-input::-webkit-inner-spin-button,
.sidebar__size-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sidebar__size-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

.sidebar__mobile-header {
    display: none;
}

/* Mobile-only apply bar (hidden on desktop — drawer doesn't render there). */
.sidebar__mobile-apply-bar {
    display: none;
}

.sidebar__section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}

.sidebar__section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar__title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-dark);
    margin-bottom: 14px;
}

.sidebar__nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar__nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    font-size: 0.9rem;
    color: var(--color-gray-dark);
    border-bottom: 1px solid var(--color-gray-light);
    transition: all var(--transition-fast);
}

.sidebar__nav-link:hover {
    color: var(--color-red);
    padding-left: 4px;
}

.sidebar__nav-link.active {
    color: var(--color-red);
    font-weight: 600;
}

.sidebar__count {
    font-size: 0.78rem;
    color: var(--color-gray-medium);
    background: var(--color-gray-light);
    padding: 2px 8px;
    border-radius: 10px;
}

.sidebar__nav-link.active .sidebar__count {
    background: rgba(191, 30, 46, 0.1);
    color: var(--color-red);
}

.sidebar__checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    font-size: 0.9rem;
    color: var(--color-gray-dark);
    cursor: pointer;
}

/* Hierarchical Type tree — compact, supports up to ~6 nesting levels */
.sidebar__tree {
    display: flex;
    flex-direction: column;
}

.sidebar__tree-node {
    display: flex;
    flex-direction: column;
}

.sidebar__tree-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.sidebar__tree-checkbox {
    flex: 1;
    min-width: 0;
    padding: 4px 0;
    gap: 8px;
    align-items: flex-start;
    line-height: 1.35;
}

.sidebar__tree-checkbox input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.sidebar__tree-name {
    flex: 1;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.sidebar__tree-checkbox .sidebar__count {
    flex-shrink: 0;
    align-self: center;
}

.sidebar__tree-toggle {
    width: 16px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-gray-medium);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.sidebar__tree-toggle i {
    transition: transform 150ms ease;
    font-size: 0.65rem;
}

.sidebar__tree-node.is-open > .sidebar__tree-row > .sidebar__tree-toggle i {
    transform: rotate(90deg);
}

.sidebar__tree-spacer {
    width: 16px;
    flex-shrink: 0;
}

/* Indent only the wrapper, not every nested level — keeps deep text readable. */
.sidebar__tree-children {
    padding-left: 14px;
    margin-left: 7px;
    border-left: 1px solid var(--color-border);
}

/* Indeterminate styling — make the dash clearly visible. */
.sidebar__tree-checkbox input[type="checkbox"]:indeterminate {
    accent-color: var(--color-red);
}

.sidebar__checkbox input[type="checkbox"] {
    accent-color: var(--color-red);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.sidebar__size-group {
    margin-bottom: 14px;
}

.sidebar__size-group:last-child {
    margin-bottom: 0;
}

.sidebar__size-group label {
    font-size: 0.82rem;
    color: var(--color-gray);
    margin-bottom: 6px;
    display: block;
}

.sidebar__size-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar__size-inputs span {
    color: var(--color-gray-medium);
    font-size: 0.85rem;
}

.sidebar__size-inputs input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: var(--color-dark);
    outline: none;
    transition: border-color var(--transition-fast);
    -moz-appearance: textfield;
}

.sidebar__size-inputs input::-webkit-inner-spin-button,
.sidebar__size-inputs input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sidebar__size-inputs input:focus {
    border-color: var(--color-red);
}

/* Filter list with view more */
.sidebar__filter-list .sidebar__checkbox:nth-child(n+7) {
    display: none;
}

.sidebar__filter-list.expanded .sidebar__checkbox:nth-child(n+7) {
    display: flex;
}

.sidebar__filter-list.expanded {
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.sidebar__filter-list.expanded::-webkit-scrollbar {
    width: 4px;
}

.sidebar__filter-list.expanded::-webkit-scrollbar-track {
    background: var(--color-gray-light);
    border-radius: 4px;
}

.sidebar__filter-list.expanded::-webkit-scrollbar-thumb {
    background: var(--color-gray-medium);
    border-radius: 4px;
}

.sidebar__filter-list.expanded .sidebar__view-more i {
    transform: rotate(180deg);
}

.sidebar__view-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--color-red);
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0 0;
    transition: color var(--transition-fast);
}

.sidebar__view-more i {
    font-size: 0.65rem;
    transition: transform var(--transition-fast);
}

.sidebar__view-more:hover {
    color: var(--color-red-dark);
}

/* Collapsible filter sections */
.sidebar__title--toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.sidebar__title--toggle i {
    font-size: 0.7rem;
    color: var(--color-gray-medium);
    transition: transform var(--transition-fast);
}

.sidebar__title--toggle:hover {
    color: var(--color-red);
}

.sidebar__collapse {
    display: none;
    padding-top: 4px;
}

.sidebar__collapse.open {
    display: block;
}

/* Show all / Show less: cap a flat checkbox group at 6 options until expanded.
   nth-of-type targets the <label> options only, so the toggle <button> and the
   option count stay in sync (n+7 = PRB_Filter_Options::OPTION_LIMIT + 1). */
.sidebar__collapse--limited:not(.is-expanded) .sidebar__checkbox:nth-of-type(n+7) {
    display: none;
}

.sidebar__show-more {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 4px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-red);
}

.sidebar__show-more:hover {
    text-decoration: underline;
}

.sidebar__toggle {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.sidebar__toggle-btn {
    flex: 1;
    padding: 9px;
    font-family: var(--font-primary);
    font-size: 0.82rem;
    border: none;
    background: var(--color-white);
    color: var(--color-gray-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar__toggle-btn.active {
    background: var(--color-red);
    color: var(--color-white);
}

/* Content column (flex child of .collection__layout). */
.collection__content {
    flex: 1;
    min-width: 0;
}

/* Wrapper div between .collection__content and the <ul>. */
.collection__products {
    width: 100%;
}

/* Product Grid — works for both DOM shapes:
   (a) WC: <ul class="products collection__grid"> > <li class="product"> > .product-card
   (b) Mockup: <div class="collection__grid"> > .product-card                              */
.woocommerce ul.products.collection__grid,
.woocommerce-page ul.products.collection__grid,
ul.products.collection__grid,
.collection__grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Kill WC's clearfix pseudo-elements on ul.products (they create a ghost
   first cell in the CSS grid). Matched WC's own selector + .collection__grid
   so specificity wins. */
.woocommerce ul.products.collection__grid::before,
.woocommerce ul.products.collection__grid::after,
.woocommerce .products ul.collection__grid::before,
.woocommerce .products ul.collection__grid::after,
ul.products.collection__grid::before,
ul.products.collection__grid::after {
    content: none;
    display: none;
}

/* Reset WC core li.product defaults (float, %-width, %-margin). Specificity
   (0,4,1) beats WC's (0,3,1). */
.woocommerce ul.products.collection__grid li.product,
.woocommerce-page ul.products.collection__grid li.product,
ul.products.collection__grid>li.product,
.collection__grid>li.product {
    float: none;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    position: relative;
    list-style: none;
    clear: none;
    min-width: 0;
}

.woocommerce ul.products.collection__grid li.product::before,
.woocommerce ul.products.collection__grid li.product::after,
.collection__grid>li.product::before,
.collection__grid>li.product::after {
    content: none;
    display: none;
}

/* Override WC's `li.product a img` (margin-bottom: 1em; box-shadow). */
.woocommerce ul.products.collection__grid li.product a img,
ul.products.collection__grid li.product a img {
    margin: 0;
    box-shadow: none;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Guard against WC's default loop title styling leaking into the card. */
.woocommerce ul.products.collection__grid li.product .woocommerce-loop-product__title {
    font: inherit;
    padding: 0;
    margin: 0;
}

/* List View */
.woocommerce ul.products.collection__grid.list-view,
ul.products.collection__grid.list-view,
.collection__grid.list-view {
    grid-template-columns: 1fr;
    gap: 0;
}

/* In list-view the <li> just acts as a row container — let the inner card fill. */
.woocommerce ul.products.collection__grid.list-view li.product,
ul.products.collection__grid.list-view li.product {
    display: block;
    width: 100%;
}

.collection__grid.list-view .product-card {
    flex-direction: row;
    align-items: stretch;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

/* First / last item rounding — handle both DOM shapes (WC <li> wrapper or flat). */
.woocommerce ul.products.collection__grid.list-view li.product:first-child .product-card,
ul.products.collection__grid.list-view li.product:first-child .product-card,
.collection__grid.list-view>li.product:first-child .product-card,
.collection__grid.list-view>.product-card:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.woocommerce ul.products.collection__grid.list-view li.product:last-child .product-card,
ul.products.collection__grid.list-view li.product:last-child .product-card,
.collection__grid.list-view>li.product:last-child .product-card,
.collection__grid.list-view>.product-card:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-bottom: 1px solid var(--color-border);
}

.collection__grid.list-view .product-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    background: var(--color-gray-light);
}

.collection__grid.list-view .product-card__image {
    width: 140px;
    flex-shrink: 0;
    aspect-ratio: 1;
    border-bottom: none;
    border-right: 1px solid var(--color-gold);
}

.collection__grid.list-view .product-card__badge--stock {
    display: none;
}

.collection__grid.list-view .product-card__badge--sale {
    top: 8px;
    left: 8px;
    bottom: auto;
    font-size: 0.65rem;
    padding: 3px 8px;
}

.collection__grid.list-view .product-card__badge--sku {
    display: none;
}

.collection__grid.list-view .product-card__body {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 0 32px;
    padding: 16px 24px;
    align-items: start;
    align-content: center;
}

/* Row 1: Brand + SKU title | Price + Stock */
.collection__grid.list-view .product-card__name {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 2px;
    font-size: 1.05rem;
}

.collection__grid.list-view .product-card__price {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
    text-align: right;
    font-size: 1.2rem;
    white-space: nowrap;
}

/* Row 2: Description / dims | Stock badge */
.collection__grid.list-view .product-card__dims {
    grid-column: 1;
    grid-row: 2;
    margin-top: 2px;
}

.collection__grid.list-view .product-card__brand {
    grid-column: 1;
    grid-row: 3;
    margin-top: 8px;
}

/* Row 3: Actions */
.collection__grid.list-view .product-card__actions {
    grid-column: 2;
    grid-row: 2 / 4;
    align-self: end;
    margin-top: 0;
    padding-top: 0;
    flex-direction: row;
    align-items: stretch;
    gap: 6px;
}

.collection__grid.list-view .product-card__btn,
.collection__grid.list-view .product-card__cart-btn {
    white-space: nowrap;
    padding: 8px 20px;
    font-size: 0.8rem;
}

/* ============================================
   Product Card
   ============================================ */
.product-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: transparent;
}

.product-card__image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #fff;
    border-bottom: 1px solid var(--color-gold);
}

.product-card__image img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    transition: transform var(--transition);
}

.product-card:hover .product-card__image img {
    transform: scale(1.05);
}

.product-card__badge {
    position: absolute;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    z-index: 2;
}

.product-card__badge--stock {
    top: 12px;
    left: 12px;
    background: #27ae60;
    color: var(--color-white);
}

.product-card__badge--sku {
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--color-white);
    backdrop-filter: blur(4px);
    font-family: var(--font-heading);
}

.product-card__badge--sale {
    bottom: 12px;
    left: 12px;
    top: auto;
    background: var(--color-red);
    color: var(--color-white);
}

.product-card__body {
    padding: 16px 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card__name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 6px;
    line-height: 1.35;
}

.product-card__name a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
    text-transform: capitalize;
}

.product-card__name a:hover {
    color: var(--color-red);
}

.product-card__dims {
    font-size: 0.82rem;
    color: var(--color-gray);
    margin-bottom: 0;
}

.product-card__dims span {
    opacity: 0.7;
    font-size: 0.78rem;
}

.product-card__brand {
    display: inline-block;
    width: fit-content;
    margin-top: 10px;
    padding: 3px 12px;
    background: var(--color-gray-light);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-gray-dark);
    align-self: flex-start;
}

.product-card__price {
    margin-top: 12px;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--color-red);
    font-weight: 700;
}

.product-card__price-was {
    text-decoration: line-through;
    color: var(--color-gray-medium);
    font-weight: 400;
    font-size: 0.88rem;
    margin-right: 4px;
}

.product-card__price-ex {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--color-gray);
    text-transform: lowercase;
}

.product-card__actions {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.product-card__btn {
    flex: 1;
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 0.82rem;
}

.product-card__cart-btn {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 10px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.product-card__actions .elex-rqst-quote-front-wrap {
    flex: 1 1 auto;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    margin: 0;
    display: flex;
}

.product-card__actions .elex-rqst-quote-front-wrap .add_view_quote_btn,
.product-card__actions .elex-rqst-quote-front-wrap .w-100,
.product-card__actions .elex-rqst-quote-front-wrap a {
    display: flex;
    flex: 1 1 auto;
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    margin: 0;
    text-decoration: none;
}

.product-card__actions .elex-rqst-quote-front-wrap .add_to_quote,
.product-card__actions .elex-rqst-quote-front-wrap .elex-raq-view-quote-list-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 42px;
    margin: 0 !important;
    padding: 10px;
    border: none;
    border-radius: var(--radius-sm);
    background-color: var(--color-red) !important;
    background-image: linear-gradient(135deg, var(--color-red), var(--color-red-dark));
    color: var(--color-white) !important;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.product-card__actions .elex-rqst-quote-front-wrap .add_to_quote::before,
.product-card__actions .elex-rqst-quote-front-wrap .elex-raq-view-quote-list-open-btn::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.9em;
    line-height: 1;
    flex: 0 0 auto;
}

.product-card__actions .elex-rqst-quote-front-wrap .add_to_quote::before {
    content: "\f0fe";
}

.product-card__actions .elex-rqst-quote-front-wrap .elex-raq-view-quote-list-open-btn::before {
    content: "\f570";
    margin-right: 4px;
}

.product-card__actions .elex-rqst-quote-front-wrap .add_to_quote:hover,
.product-card__actions .elex-rqst-quote-front-wrap .elex-raq-view-quote-list-open-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-red);
    color: var(--color-white) !important;
}

.product-card__actions .elex-rqst-quote-front-wrap .add_to_quote:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.product-card__options-btn {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 42px;
    margin: 0 !important;
    padding: 10px;
    border: none;
    border-radius: var(--radius-sm);
    background-color: var(--color-red) !important;
    background-image: linear-gradient(135deg, var(--color-red), var(--color-red-dark));
    color: var(--color-white) !important;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.product-card__options-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-red);
    color: var(--color-white) !important;
}

.product-type-variable .product-card__actions .elex-rqst-quote-front-wrap {
    display: none;
}

@media (max-width: 480px) {
    .product-card__options-btn {
        min-height: 38px;
        padding: 8px 6px;
        font-size: 0.72rem;
        letter-spacing: 0.5px;
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .product-card__cart-btn {
        white-space: normal;
        font-size: 0.72rem;
        padding: 8px 6px;
    }

    .product-card__actions {
        gap: 6px;
    }

    .product-card__actions .elex-rqst-quote-front-wrap .add_to_quote,
    .product-card__actions .elex-rqst-quote-front-wrap .elex-raq-view-quote-list-open-btn {
        min-height: 38px;
        padding: 8px 6px;
        font-size: 0.72rem;
        letter-spacing: 0.5px;
        white-space: normal;
    }
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    padding: 0 0 50px;
    background: var(--color-gray-light);
}

.pagination .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.pagination__info {
    font-size: 0.85rem;
    color: var(--color-gray);
}

.pagination__info p {
    float: none;
}

.pagination__controls {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Desktop / mobile pagination variants — only one is visible at a time. */
.woocommerce-pagination--mobile {
    display: none;
}

@media (max-width: 600px) {
    .woocommerce-pagination--desktop {
        display: none;
    }

    .woocommerce-pagination--mobile {
        display: block;
    }
}

.pagination__btn {
    padding: 8px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: var(--color-gray-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination__btn:hover:not(:disabled) {
    border-color: var(--color-red);
    color: var(--color-red);
}

.pagination__btn.active {
    background: var(--color-red);
    color: var(--color-white);
    border-color: var(--color-red);
}

.pagination__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination__per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--color-gray);
}

.pagination__select {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.85rem;
    color: var(--color-gray-dark);
    background: var(--color-white);
    cursor: pointer;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Fully lock page scroll (and hide the page scrollbar) while the mobile
   filter drawer is open — otherwise the page scrollbar shows alongside the
   drawer's own inner scrollbar. */
html.prb-drawer-open,
body.prb-drawer-open {
    overflow: hidden !important;
    touch-action: none;
    overscroll-behavior: contain;
}

.filter-bar__select form {
    margin-bottom: 0 !important;
}

/* Hide WooCommerce's default `before_shop_loop` result-count + ordering output
   (rendered as direct children of .collection__content). The hook still fires so
   any third-party callbacks attached to woocommerce_before_shop_loop still run;
   only the default visual output is hidden. The WC ordering form lives inside
   the filter bar, and the result count lives in the hero + pagination row. */
.collection__content>.woocommerce-result-count,
.collection__content>form.woocommerce-ordering {
    display: none;
}

/* WooCommerce ordering form embedded in the filter bar */
.filter-bar__sort .woocommerce-ordering {
    margin: 0;
}

.filter-bar__sort .woocommerce-ordering select.orderby {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: var(--color-gray-dark);
    background: var(--color-white);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-fast);
}

.filter-bar__sort .woocommerce-ordering select.orderby:focus {
    border-color: var(--color-red);
}

/* Hero count using woocommerce_result_count() */
.cat-hero__count .woocommerce-result-count {
    margin: 0;
    color: inherit;
    font: inherit;
    display: inline;
}

/* Pagination row — per-page inline form */
.pagination__per-page .prb-per-page-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.pagination__per-page .prb-per-page-form label {
    font-size: 0.85rem;
    color: var(--color-gray);
}

.pagination__info .woocommerce-result-count {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-gray);
}

/* pagination */
.woocommerce .woocommerce-result-count,
.woocommerce-page .woocommerce-result-count {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-gray);
}

.pagination__per-page select {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.85rem;
    color: var(--color-gray-dark);
    background: var(--color-white);
    cursor: pointer;
}

.woocommerce nav.woocommerce-pagination ul {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    border: 0;
    background: inherit;
    padding: 0;
    list-style: none;
}

.woocommerce .woocommerce-pagination ul.page-numbers li,
.woocommerce-page .woocommerce-pagination ul.page-numbers li {
    display: flex;
    background: inherit;
    border: 0;
    padding: 0;
    margin: 0;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    padding: 8px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: var(--color-gray-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: auto;
    line-height: 1.2em;
}

.woocommerce nav.woocommerce-pagination ul li a:focus,
.woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li span.current {
    border-color: var(--color-red);
    color: var(--color-red);
    background: inherit;

}

.woocommerce nav.woocommerce-pagination ul li span.current {
    background: var(--color-red);
    color: var(--color-white);
}

.woocommerce nav.woocommerce-pagination ul li a.next.page-numbers:before {
    content: "Next »";
    font-size: 0.85rem;
}

.woocommerce nav.woocommerce-pagination ul li a.next.page-numbers,
.woocommerce nav.woocommerce-pagination ul li a.prev.page-numbers {
    font-size: 0;
    display: flex;
    align-items: center;
}

.woocommerce nav.woocommerce-pagination ul li a.prev.page-numbers:after {
    content: "« Prev";
    font-size: 0.85rem;
}

/* ============================================
   Responsive — Collection Page
   ============================================ */
@media (max-width: 1024px) {

    .woocommerce ul.products.collection__grid,
    .woocommerce-page ul.products.collection__grid,
    ul.products.collection__grid,
    .collection__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .collection__sidebar {
        width: 240px;
    }

    .cat-hero__title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .collection__sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        border: none;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-xl);
        /* Flex column so the inner panel scrolls and the apply bar pins to the
           bottom of the drawer regardless of how tall the content is. */
        display: flex;
        flex-direction: column;
        overflow: hidden;
        /* No horizontal padding on the drawer itself — so the inner scrollbar
           sits flush at the drawer's right edge instead of inset by 24px. */
        padding: 0;
    }

    .collection__sidebar .sidebar__inner {
        flex: 1 1 auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 20px 24px 16px;
    }

    .collection__sidebar.active {
        transform: translateX(0);
    }

    .collection__layout {
        flex-direction: column;
        align-items: stretch;
    }

    .collection__content,
    .collection__products,
    .collection__products .products.collection__grid {
        width: 100%;
        min-width: 0;
    }

    .sidebar__mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 24px;
        background: var(--color-dark);
        color: var(--color-white);
        margin: 0;
        flex: 0 0 auto;
    }

    .sidebar__mobile-header h3 {
        font-family: var(--font-heading);
        font-size: 1rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin: 0;
    }

    .sidebar__mobile-close {
        background: none;
        border: none;
        color: var(--color-white);
        font-size: 1.2rem;
        cursor: pointer;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    .sidebar__mobile-close:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    .filter-bar__pill {
        display: none;
    }

    .filter-bar__filters .filter-bar__label {
        display: none;
    }

    /* Highlighted, outlined filter trigger — matches the "Enquire Now" outline
       style used inside product cards. Stretches full width for easy tap. */
    .filter-bar__mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        min-height: 52px;
        padding: 14px 22px;
        font-size: 1rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border: 2px solid var(--color-dark);
        background: transparent;
        color: var(--color-dark);
        border-radius: 30px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    }

    .filter-bar__mobile-toggle i {
        font-size: 1.1rem;
    }

    .filter-bar__mobile-toggle:hover,
    .filter-bar__mobile-toggle:active,
    .filter-bar__mobile-toggle:focus {
        background: var(--color-dark);
        border-color: var(--color-dark);
        color: var(--color-white);
    }

    /* Apply Filters bar pinned to the bottom of the drawer flex column. */
    .sidebar__mobile-apply-bar {
        display: block;
        flex: 0 0 auto;
        margin: 0;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
        background: var(--color-white);
        border-top: 1px solid var(--color-border);
        box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
    }

    .sidebar__apply-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        min-height: 42px;
        padding: 10px 18px;
        font-family: var(--font-heading);
        font-size: 0.9rem;
        font-weight: 700;
        letter-spacing: 0.4px;
        text-transform: uppercase;
        color: var(--color-white);
        background: var(--color-red);
        border: 1px solid var(--color-red);
        border-radius: 24px;
        cursor: pointer;
        transition: background var(--transition-fast), color var(--transition-fast);
    }

    .sidebar__apply-btn:hover,
    .sidebar__apply-btn:active {
        background: var(--color-white);
        color: var(--color-red);
    }

    .sidebar__apply-btn.is-pending {
        animation: prb-apply-pulse 1.6s ease-in-out infinite;
    }

    @keyframes prb-apply-pulse {
        0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
        50%      { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
    }

    .filter-bar__top {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar__view {
        display: none;
    }

    .filter-bar__right {
        justify-content: space-between;
    }

    .woocommerce ul.products.collection__grid.list-view,
    ul.products.collection__grid.list-view,
    .collection__grid.list-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .woocommerce ul.products.collection__grid.list-view li.product,
    ul.products.collection__grid.list-view li.product {
        border-bottom: none;
    }

    .collection__grid.list-view .product-card {
        flex-direction: column;
        border-radius: var(--radius-md) !important;
        border: 1px solid var(--color-border) !important;
        margin-bottom: 0;
    }

    .collection__grid.list-view .product-card__image {
        width: 100%;
        aspect-ratio: 4/3;
        border-right: none;
    }

    .collection__grid.list-view .product-card__badge--stock,
    .collection__grid.list-view .product-card__badge--sku {
        display: block;
    }

    .collection__grid.list-view .product-card__body {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .collection__grid.list-view .product-card__price {
        margin-top: 8px;
        font-size: 1.05rem;
    }

    .collection__grid.list-view .product-card__btn {
        margin-top: 10px;
        width: 100%;
    }

    .cat-hero {
        padding: 40px 0;
        min-height: auto;
    }

    .cat-hero__title {
        font-size: 1.8rem;
        letter-spacing: 1.5px;
    }

    .cat-hero__desc {
        font-size: 0.95rem;
    }

    .pagination .container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {

    .woocommerce ul.products.collection__grid,
    .woocommerce-page ul.products.collection__grid,
    ul.products.collection__grid,
    .collection__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .collection__grid .product-card__body {
        padding: 12px 12px 14px;
    }

    .collection__grid .product-card__name {
        font-size: 0.82rem;
    }

    .collection__grid .product-card__dims {
        font-size: 0.72rem;
    }

    .collection__grid .product-card__price {
        font-size: 0.88rem;
    }

    .collection__grid .product-card__cart-btn,
    .collection__grid .product-card__btn {
        font-size: 0.72rem;
        padding: 8px;
    }

    .collection__grid .product-card__actions {
        flex-direction: row;
        align-items: stretch;
    }

    .collection__sidebar {
        width: 100%;
    }

    .cat-hero__title {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }

    .cat-hero__desc {
        font-size: 0.88rem;
    }
}

/* ============================================
   Mobile pagination — compact for 100+ page archives
   ============================================ */
@media (max-width: 600px) {
    .pagination {
        padding: 0 0 32px;
    }

    .pagination .container {
        gap: 12px;
        padding-top: 16px;
    }

    .pagination__controls {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .pagination__info {
        order: 1;
        width: 100%;
        text-align: center;
    }

    .pagination__per-page {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .pagination__per-page .prb-per-page-form {
        justify-content: center;
    }

    .woocommerce nav.woocommerce-pagination ul {
        gap: 3px;
    }

    .woocommerce nav.woocommerce-pagination ul li a,
    .woocommerce nav.woocommerce-pagination ul li span {
        padding: 6px 10px;
        font-size: 0.78rem;
        min-width: 32px;
        text-align: center;
        justify-content: center;
    }

    /* Replace "Prev"/"Next" text with arrows on small screens to save horizontal room. */
    .woocommerce nav.woocommerce-pagination ul li a.prev.page-numbers:after {
        content: "\2039";
        /* ‹ */
        font-size: 1rem;
        line-height: 1;
    }

    .woocommerce nav.woocommerce-pagination ul li a.next.page-numbers:before {
        content: "\203A";
        /* › */
        font-size: 1rem;
        line-height: 1;
    }
}

/* AJAX loading state on the product grid wrapper. */
.collection__products.is-loading {
    pointer-events: none;
}

/* Skeleton placeholder cards. */
.collection__grid.is-skeleton {
    pointer-events: none;
}

.is-skeleton-cell {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 0;
    float: none;
}

.product-card--skeleton {
    width: 100%;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.skeleton {
    background: linear-gradient(90deg, #ececec 25%, #f5f5f5 37%, #ececec 63%);
    background-size: 400% 100%;
    animation: prb-skeleton 1.4s ease infinite;
    border-radius: 4px;
}

.skeleton--image {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 0;
    border-bottom: 1px solid var(--color-gold);
}

.product-card--skeleton .product-card__image.skeleton {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 0;
    border-bottom: 1px solid var(--color-gold);
}

.product-card--skeleton .product-card__body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.skeleton--text {
    height: 14px;
    width: 80%;
}

.skeleton--short {
    width: 50%;
    height: 12px;
}

.skeleton--chip {
    width: 60px;
    height: 22px;
    border-radius: 12px;
    margin-top: 4px;
}

.skeleton--btn {
    height: 36px;
    width: 100%;
    margin-top: auto;
    border-radius: var(--radius-sm);
}

@keyframes prb-skeleton {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

@keyframes prb-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Keep the skeleton body vertical even in list view. */
.collection__grid.list-view .product-card--skeleton .product-card__body,
.collection__grid .product-card--skeleton .product-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* List-view sizing for skeleton placeholders.
   Without this the generic `.product-card--skeleton .product-card__image.skeleton`
   rule (width:100% + aspect-ratio:4/3) was winning over the list-view image
   width, so each placeholder rendered ~viewport-wide and ¾-tall — huge. */
.collection__grid.list-view .product-card--skeleton .product-card__image.skeleton {
    width: 140px;
    height: auto;
    aspect-ratio: 1;
    flex-shrink: 0;
    border-right: 1px solid var(--color-gold);
    border-bottom: none;
}

@media (max-width: 768px) {
    /* On mobile the list view reverts each card to a vertical layout, so the
       skeleton image returns to full width / 4:3 like the grid view. */
    .collection__grid.list-view .product-card--skeleton .product-card__image.skeleton {
        width: 100%;
        aspect-ratio: 4 / 3;
        border-right: none;
        border-bottom: 1px solid var(--color-gold);
    }
}

/* "No products found" fallback — wrapped in a UL so subsequent AJAX still has a swap target. */
ul.products.collection__grid.prb-no-results {
    grid-template-columns: 1fr;
}

.prb-no-results__item {
    list-style: none;
    padding: 0;
    margin: 0;
    grid-column: 1 / -1;
}

.prb-no-results__item .woocommerce-info,
.prb-no-results__item .woocommerce-notice {
    margin: 0;
    padding: 24px;
    background: var(--color-gray-light);
    border-radius: var(--radius-md);
    color: var(--color-gray-dark);
    text-align: center;
}

/* Remove native number-input spinners on size inputs. */
.sidebar__size-input::-webkit-inner-spin-button,
.sidebar__size-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sidebar__size-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Mobile drawer loader — shown when AJAX fires while the filter drawer is open. */
@media (max-width: 768px) {
    .collection__sidebar.active.is-loading {
        pointer-events: none;
    }

    .collection__sidebar.active.is-loading::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 40px;
        height: 40px;
        margin: -20px 0 0 -20px;
        border: 3px solid var(--color-border);
        border-top-color: var(--color-red);
        border-radius: 50%;
        animation: prb-spin 0.8s linear infinite;
        z-index: 2001;
    }

    .collection__sidebar.active.is-loading::after {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(255, 255, 255, 0.7);
        z-index: 2000;
    }
}
/* =========================================================
   "Search Again" finder — homepage Bearing & Parts Finder
   replica inside the light empty-state card (.prb-empty).
   Structure mirrors home.css (front-page only); colors are
   re-themed light using existing brand tokens only.
   ========================================================= */
.prb-empty__finder.hero-finder__search-box {
    background: var(--color-gray-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 8px;
    margin-bottom: 0;
    text-align: left;
}

/* Tabs */
.prb-empty .hero-finder__tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 4px;
}

.prb-empty .hero-finder__tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-gray-dark);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.prb-empty .hero-finder__tab:not(.active):hover {
    background: var(--color-gray-light);
    color: var(--color-dark);
}

.prb-empty .hero-finder__tab.active {
    background: var(--color-red);
    color: var(--color-white);
    box-shadow: var(--shadow-glow-red);
}

.prb-empty .hero-finder__tab i {
    margin-right: 6px;
    font-size: 0.85em;
}

/* Panels */
.prb-empty .hero-finder__panel {
    display: none;
    padding: 16px 12px 12px;
}

.prb-empty .hero-finder__panel.active {
    display: block;
}

/* Part-number input sits on the gray box — give it a visible white field. */
.prb-empty__finder .header-search__input {
    background: var(--color-white);
    border-color: var(--color-border);
}

/* Controls row (unit + mode toggles) */
.prb-empty .hero-finder__controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.prb-empty .hero-finder__unit-toggle,
.prb-empty .hero-finder__mode-toggle {
    display: inline-flex;
    background: var(--color-white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.prb-empty .hero-finder__unit-btn,
.prb-empty .hero-finder__mode-btn {
    padding: 8px 20px;
    background: transparent;
    border: none;
    color: var(--color-gray-dark);
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.prb-empty .hero-finder__unit-btn:hover,
.prb-empty .hero-finder__mode-btn:hover {
    color: var(--color-dark);
}

.prb-empty .hero-finder__unit-btn.active,
.prb-empty .hero-finder__mode-btn.active {
    background: var(--color-red);
    color: var(--color-white);
}

/* Dimension fields */
.prb-empty .hero-finder__dim-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.prb-empty .hero-finder__dim-group {
    flex: 1;
    min-width: 0;
}

/* The card is narrower than the homepage hero — give the three dimension
   fields the full row and drop the submit button to its own line. */
.prb-empty .hero-finder__dim-row .hero-finder__btn {
    flex: 1 1 100%;
    margin-top: 6px;
}

.prb-empty .hero-finder__dim-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-gray-dark);
    margin-bottom: 6px;
    text-align: left;
}

.prb-empty .hero-finder__dim-group .hero-finder__dim-input {
    width: 100%;
    min-width: 0;
    padding: 14px 10px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    color: var(--color-dark);
    background: var(--color-white);
    outline: none;
    transition: all var(--transition);
    -moz-appearance: textfield;
    text-overflow: ellipsis;
}

.prb-empty .hero-finder__dim-input::-webkit-inner-spin-button,
.prb-empty .hero-finder__dim-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.prb-empty .hero-finder__dim-input:focus {
    border-color: var(--color-red);
    box-shadow: 0 0 0 4px rgba(191, 30, 46, 0.15);
}

.prb-empty .hero-finder__dim-unit {
    font-size: 0.72rem;
    color: var(--color-gray-medium);
    text-transform: lowercase;
    margin-left: 2px;
    font-weight: 400;
}

/* Exact / Range visibility (functional — mirrors home.css) */
.prb-empty .hero-finder__dim-range {
    display: none;
    align-items: center;
    gap: 8px;
}

.prb-empty .hero-finder__dim-range .hero-finder__dim-input {
    flex: 1;
}

.prb-empty .hero-finder__dim-separator {
    color: var(--color-gray-medium);
    font-size: 0.82rem;
    font-weight: 600;
    flex-shrink: 0;
}

.prb-empty .hero-finder__dim-exact {
    display: block;
}

.prb-empty .hero-finder__panel--range .hero-finder__dim-exact {
    display: none;
}

.prb-empty .hero-finder__panel--range .hero-finder__dim-range {
    display: flex;
}

/* Helper text */
.prb-empty .hero-finder__helper-text {
    font-size: 0.82rem;
    color: var(--color-gray-dark);
    font-style: italic;
    margin-top: 10px;
    margin-bottom: 0;
    text-align: center;
}

/* The finder is wider than the old single input — let the retry block breathe. */
.prb-empty__retry {
    max-width: 640px;
}

@media (max-width: 600px) {
    /* Two long uppercase labels side by side force the row's min-width past
       small viewports — stack them so the card can't overflow. */
    .prb-empty .hero-finder__tabs {
        flex-direction: column;
    }

    .prb-empty .hero-finder__tab {
        padding: 10px 8px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .prb-empty .hero-finder__dim-row {
        flex-direction: column;
        align-items: stretch;
    }

    .prb-empty .hero-finder__controls {
        justify-content: center;
    }
}
