/* ==========================================================================
   SHOP ARCHIVE
   ========================================================================== */

.shop-archive {
    padding: var(--space-xl) 0 var(--space-2xl);
    background: var(--color-warm);
    min-height: 70vh;
    flex: 1;
}

/* Mobile: the space-xl (4rem) top padding reads as unintended dead air
   between the sticky site header and the shop hero on a small viewport —
   it was never scaled down here even though other shop-archive spacing
   already halves on mobile elsewhere in this file. */
@media (max-width: 600px) {
    .shop-archive {
        padding-top: var(--space-md);
    }
}

.shop-archive .container {
    max-width: var(--container-wide);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-lg) var(--space-xl);
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}



.shop-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.shop-header-compact {
    margin-bottom: var(--space-md);
}

.shop-header-compact .shop-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: var(--space-2xs);
}

.shop-header-compact .shop-subtitle {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.shop-title {
    margin-bottom: var(--space-xs);
}

.shop-subtitle {
    font-size: 1.0625rem;
    color: var(--color-gray-600);
    margin-bottom: var(--space-sm);
}

.sold-archive-sell-teaser {
    font-size: 0.9rem;
    margin-top: calc(var(--space-sm) * -1);
    margin-bottom: var(--space-sm);
}

.sold-archive-sell-teaser a {
    color: var(--color-gray-600);
    text-decoration: underline;
}

/* ── Category hero banner (shown when the WP category has an image set) ── */
.category-hero {
    position: relative;
    width: 100%;
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-bg-alt);
}

.category-hero-img {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
    object-position: center 40%;
}

.category-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem 2rem;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.60) 0%,
        rgba(0, 0, 0, 0.25) 50%,
        transparent 100%
    );
}

.category-hero-title {
    margin: 0 0 0.25rem;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.category-hero-subtitle {
    margin: 0;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    /* clamp to 2 lines so it never swallows too much of the image */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-hero-count {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(0, 0, 0, 0.30);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 2rem;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
    .category-hero-img {
        height: 180px;
    }

    .category-hero-overlay {
        padding: 1rem 1.25rem;
    }

    .category-hero-title {
        font-size: 1.5rem;
    }

    .category-hero-subtitle {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .category-hero-img {
        height: 160px; /* raised 140→160px: more image visible on small phones */
    }

    .category-hero-overlay {
        padding: 0.75rem 1rem;
        /* Stronger gradient on small screens where image height is compressed:
           text lands in a narrower band so contrast needs more support. */
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.72) 0%,
            rgba(0, 0, 0, 0.30) 55%,
            transparent 100%
        );
    }

    .category-hero-title {
        font-size: 1.25rem;
    }

    /* At 160px image height the subtitle eats too much of the frame at 2 lines;
       clamp to 1 line so the image reads as the hero, not the text. */
    .category-hero-subtitle {
        -webkit-line-clamp: 1;
        font-size: 0.8125rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .category-hero-img {
        transition: transform 6s ease;
    }

    .category-hero:hover .category-hero-img {
        transform: scale(1.03);
    }
}
/* ── end category hero banner ── */

.shop-intro {
    font-size: 0.9375rem;
    color: var(--color-gray-600);
    line-height: 1.7;
}


/* ==========================================================================
   CATEGORY FEATURED STRIP
   Shown on category archive pages when at least one product is marked
   "featured" in WooCommerce.  Up to 4 items rendered by woocommerce.php.
   ========================================================================== */

.category-featured {
    margin-bottom: var(--space-lg);
}

.category-featured-title {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-gray-600);
    margin-bottom: var(--space-xs);
}

.category-featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xs);
}

.category-featured-item {
    display: block;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-gray-100);
    transition: transform var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease);
}

.category-featured-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.category-featured-item:focus-visible {
    outline: 2px solid var(--color-black);
    outline-offset: 2px;
    border-radius: var(--radius-md);
}

.category-featured-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.category-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--duration-slow) var(--ease);
}

.category-featured-item:hover .category-featured-image img {
    transform: scale(1.04);
}

.category-featured-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.25rem 0.625rem 0.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* Mobile: switch to horizontal scroll strip at ≤600px */
@media (max-width: 600px) {
    /* Wrapper: relative so ::after fade can overlay the right edge */
    .category-featured {
        position: relative;
    }

    /* Right-edge fade — signals there are more items to scroll to.
       pointer-events: none so the items behind remain tappable.
       The fade is always visible; a JS-free approach that degrades
       gracefully (it stays even after the user has scrolled to the end,
       but that's acceptable — the primary value is on first load). */
    .category-featured::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 3rem;
        background: linear-gradient(to right, transparent, var(--color-white) 90%);
        pointer-events: none;
        z-index: 2;
    }

    .category-featured-grid {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: var(--space-xs);
        padding-bottom: 0.25rem; /* space for scrollbar */
        padding-right: 1rem;     /* prevent last item clipping behind fade */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        scroll-snap-type: x mandatory;
    }

    .category-featured-grid::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .category-featured-item {
        flex: 0 0 calc(50% - var(--space-xs) / 2);
        min-width: 0;
        scroll-snap-align: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-featured-item:hover {
        transform: none;
    }

    .category-featured-item:hover .category-featured-image img {
        transform: none;
    }
}

/* Shop Filters */
.shop-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-white);
    border: 1px solid var(--color-gray-100);
    border-radius: var(--radius-md);
    /* Sticky: keep filter bar visible while scrolling the catalog */
    position: sticky;
    top: var(--header-height, 80px);
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Admin bar pushes sticky header down by 32px (46px on small screens) */
.admin-bar .shop-filters {
    top: calc(var(--header-height, 80px) + 32px);
}

@media (max-width: 782px) {
    .admin-bar .shop-filters {
        top: calc(var(--header-height, 80px) + 46px);
    }
}

.filter-search {
    display: flex;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.search-input {
    flex: 1;
    padding: 0.6875rem 1rem;
    font-family: var(--font);
    font-size: 0.875rem;
    border: 1px solid var(--color-gray-200);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    background: var(--color-bg);
    transition: all var(--duration) var(--ease);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-black);
    background: var(--color-white);
}

.search-input:focus-visible {
    outline: none;
    border-color: var(--color-black);
    background: var(--color-white);
    box-shadow: 0 0 0 2px var(--color-white), 0 0 0 4px var(--color-black);
}

.search-btn {
    padding: 0.6875rem 1rem;
    background: var(--color-black);
    color: var(--color-white);
    border: 1px solid var(--color-black);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
    transition: background var(--duration) var(--ease);
}

.search-btn:hover {
    background: var(--color-gray-800);
}

.search-btn:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--color-black);
}

.filter-category,
.filter-material,
.filter-brand,
.filter-sort,
.filter-price {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.filter-price-input {
    width: 5.5rem;
    padding: 0.6875rem 0.75rem;
    font-family: var(--font);
    font-size: 0.875rem;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    transition: all var(--duration) var(--ease);
    appearance: textfield;
}

.filter-price-input:hover {
    border-color: var(--color-gray-300);
}

.filter-price-input:focus {
    outline: none;
    border-color: var(--color-black);
}

.filter-price-sep {
    color: var(--color-gray-400);
}

.filter-price-apply {
    padding: 0.6875rem 1rem;
    font-family: var(--font);
    font-size: 0.875rem;
    background: var(--color-black);
    color: var(--color-white);
    border: 1px solid var(--color-black);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--duration) var(--ease);
}

.filter-price-apply:hover {
    background: var(--color-gray-800);
}

.filter-price-apply:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--color-black);
}

.filter-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-gray-600);
}

.filter-select {
    padding: 0.6875rem 2.25rem 0.6875rem 1rem;
    font-family: var(--font);
    font-size: 0.875rem;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    background: var(--color-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23666' d='M5 6L0 0h10z'/%3E%3C/svg%3E") no-repeat right 1rem center;
    cursor: pointer;
    appearance: none;
    min-width: 160px;
    transition: all var(--duration) var(--ease);
}

.filter-select:hover {
    border-color: var(--color-gray-300);
}

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

.filter-select:focus-visible {
    outline: none;
    border-color: var(--color-black);
    box-shadow: 0 0 0 2px var(--color-white), 0 0 0 4px var(--color-black);
}

.filter-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.filter-meta .product-count {
    font-size: 0.8125rem;
    color: var(--color-gray-600);
    white-space: nowrap;
}

.filter-meta .toolbar-pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-meta .pagination-link {
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
}

.filter-meta .page-indicator {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-gray-600);
    white-space: nowrap;
}

.pagination-pagenumber {
    width: 3.5ch;
    padding: 0.125rem 0.25rem;
    font-size: inherit;
    font-weight: 600;
    font-family: inherit;
    color: var(--color-gray-800);
    text-align: center;
    background: transparent;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    -moz-appearance: textfield;
    appearance: textfield;
}
.pagination-pagenumber::-webkit-inner-spin-button,
.pagination-pagenumber::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.pagination-pagenumber:focus {
    outline: none;
    border-color: var(--color-black);
}

.pagination-pagenumber:focus-visible {
    outline: none;
    border-color: var(--color-black);
    box-shadow: 0 0 0 2px var(--color-white), 0 0 0 4px var(--color-black);
}

/* Filter toggle button — hidden on desktop */
.filter-toggle {
    display: none;
}

/* Filter drawer — visible by default on desktop */
.filter-drawer {
    display: contents;
}

/* Filter drawer close button — only shown inside the mobile drawer */
.filter-drawer-close {
    display: none;
}

@media (max-width: 900px) {
    .shop-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-search {
        max-width: 100%;
    }

    .filter-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.625rem 1rem;
        font-family: var(--font);
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--color-gray-700);
        background: var(--color-bg);
        border: 1px solid var(--color-gray-200);
        border-radius: var(--radius-md);
        cursor: pointer;
        transition: all var(--duration) var(--ease);
    }

    .filter-toggle:hover {
        border-color: var(--color-gray-300);
    }

    .filter-toggle:focus-visible {
        outline: 2px solid var(--color-black);
        outline-offset: 2px;
        border-radius: var(--radius-md);
    }

    .filter-toggle[aria-expanded="true"] {
        border-color: var(--color-black);
        color: var(--color-black);
    }

    .filter-drawer {
        display: flex;
        flex-direction: column;
        gap: var(--space-sm);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.3s var(--ease), opacity 0.2s var(--ease), visibility 0s 0.3s;
    }

    .filter-drawer.is-open {
        max-height: 500px;
        opacity: 1;
        visibility: visible;
        transition: max-height 0.3s var(--ease), opacity 0.2s var(--ease), visibility 0s;
    }

    .filter-category,
    .filter-material,
    .filter-brand,
    .filter-era,
    .filter-sort,
    .filter-price {
        justify-content: space-between;
    }

    .filter-select {
        flex: 1;
    }

    .filter-meta {
        justify-content: space-between;
        margin-left: 0;
    }

    .filter-drawer-close {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.375rem;
        width: 100%;
        padding: 0.625rem 1rem;
        margin-top: 0.25rem;
        font-family: var(--font);
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--color-gray-700);
        background: var(--color-gray-50, #f9f9f9);
        border: 1px solid var(--color-gray-200);
        border-radius: var(--radius-md);
        cursor: pointer;
        transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease);
    }

    .filter-drawer-close:hover {
        background: var(--color-gray-100, #f0f0f0);
        border-color: var(--color-gray-300);
    }

    .filter-drawer-close:focus-visible {
        outline: 2px solid var(--color-black);
        outline-offset: 2px;
        border-radius: var(--radius-md);
    }
}

@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
    .filter-drawer,
    .filter-drawer.is-open {
        transition: visibility 0s;
    }
}

/* ≤768px: put search + filter-toggle on one row to halve filter-bar height */
@media (max-width: 768px) {
    .shop-filters {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    /* Search grows to fill available space next to the toggle button */
    .filter-search {
        flex: 1;
        min-width: 0;
        max-width: none;
    }
    /* The text input's intrinsic width (~size=20) kept the form from shrinking,
       so on a 412 px phone the submit button spilled over the Filtrer toggle
       (seen 2026-09-13). Let the input shrink; the button keeps its size. */
    .filter-search .search-input {
        min-width: 0;
        width: 100%;
    }
    .filter-search .search-btn {
        flex: 0 0 auto;
    }

    /* Toggle sits on the same row as search; don't stretch to full width */
    .filter-toggle {
        flex: 0 0 auto;
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

    /* Open drawer still flows below the search+toggle row */
    .filter-drawer {
        flex: 0 0 100%;
    }
}

/* Active Filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding: 0.875rem 1rem;
    background: var(--color-white);
    border: 1px solid var(--color-gray-100);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    /* Sticky: pin active-filter chips just below the sticky filter bar
       so users always know which filters are active while browsing.
       Only when the filter drawer is collapsed — when it's open the chips
       are visible directly beneath it, so stickiness would be disruptive.
       --filter-bar-h is set by ResizeObserver in archive-product.twig. */
}
.shop-archive:not(:has(.filter-drawer.is-open)) .active-filters {
    position: sticky;
    top: calc(var(--header-height, 80px) + var(--filter-bar-h, 78px));
    z-index: 49;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.admin-bar .shop-archive:not(:has(.filter-drawer.is-open)) .active-filters {
    top: calc(var(--header-height, 80px) + 32px + var(--filter-bar-h, 78px));
}
@media (max-width: 782px) {
    .admin-bar .shop-archive:not(:has(.filter-drawer.is-open)) .active-filters {
        top: calc(var(--header-height, 80px) + 46px + var(--filter-bar-h, 78px));
    }
}

.active-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-gray-100);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
}

.active-filter-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.remove-filter {
    color: var(--color-gray-600);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.remove-filter:hover,
.remove-filter:focus-visible {
    color: var(--color-black);
}

.clear-all-filters {
    margin-left: auto;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-gray-600);
    cursor: pointer;
}

.clear-all-filters:hover,
.clear-all-filters:focus-visible {
    color: var(--color-black);
}

/* Saved-search / new-arrivals alert (item 86) */
.shop-save-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-gray-700);
    cursor: pointer;
}
.shop-save-search-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.shop-save-search-btn:hover,
.shop-save-search-btn:focus-visible {
    border-color: var(--color-gray-400);
    color: var(--color-black);
}
.shop-save-search-btn:disabled {
    cursor: default;
    opacity: 0.75;
}

.shop-save-search-login {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-gray-600);
    text-decoration: underline;
}
.shop-save-search-login:hover,
.shop-save-search-login:focus-visible {
    color: var(--color-black);
}

.shop-saved-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding: 0.625rem 1rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-gray-100);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
}
.shop-saved-searches-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.shop-saved-search-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: var(--color-white);
    border: 1px solid var(--color-gray-100);
    border-radius: var(--radius-sm);
    font-weight: 500;
}
.shop-saved-search-chip a {
    color: inherit;
    text-decoration: none;
}
.shop-saved-search-chip a:hover,
.shop-saved-search-chip a:focus-visible {
    text-decoration: underline;
}
.shop-saved-search-remove {
    color: var(--color-gray-600);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}
.shop-saved-search-remove:hover,
.shop-saved-search-remove:focus-visible {
    color: var(--color-black);
}

/* Mobile: active-filter chips scroll horizontally instead of wrapping to multiple
   rows. Multiple wrapped rows push the product grid far down on small screens.
   A single scrollable strip keeps the grid reachable without disrupting the
   sticky positioning (sticky = vertical scroll; overflow-x = horizontal swipe). */
@media (max-width: 600px) {
    .active-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        /* Extra right padding so the last chip is visible before the fade fades it out */
        padding-right: 2rem;
        /* Fade the right edge — the standard affordance for "swipe for more" on chip strips */
        -webkit-mask-image: linear-gradient(to right, black 0%, black 75%, transparent 100%);
        mask-image: linear-gradient(to right, black 0%, black 75%, transparent 100%);
        /* Hide scrollbar (still scrollable via touch/mouse) */
        scrollbar-width: none;
    }
    .active-filters::-webkit-scrollbar {
        display: none;
    }
    /* Prevent individual chips from shrinking — they must stay full width.
       shop-save-search-btn/-login (item 86) sit in this same strip and were
       missed when that feature shipped — without flex-shrink:0 they squish
       and wrap against the search chip + "Ryd alle" on narrow viewports. */
    .active-filter,
    .clear-all-filters,
    .shop-save-search-btn,
    .shop-save-search-login {
        flex-shrink: 0;
    }
}

/* Ultra-narrow phones (≤360px, e.g. iPhone SE 320px): the 75% mask-image
   stop from the ≤600px rule above fades out chips starting at ~240px on a
   320px container — that's quite aggressive and can visually obscure the
   last chip even when scrolled to the end. Push the fade start to 88% and
   add extra scroll padding so the final chip is fully legible before fade. */
@media (max-width: 360px) {
    .active-filters {
        padding-right: 3rem;
        -webkit-mask-image: linear-gradient(to right, black 0%, black 88%, transparent 100%);
        mask-image: linear-gradient(to right, black 0%, black 88%, transparent 100%);
    }
}

/* Low-result reset hint in filter-meta toolbar */
.filter-meta-reset {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-gray-500);
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.filter-meta-reset:hover,
.filter-meta-reset:focus-visible {
    color: var(--color-black);
    outline: none;
}

.filter-meta-reset:focus-visible {
    box-shadow: 0 0 0 2px var(--color-white), 0 0 0 4px var(--color-black);
    border-radius: 2px;
}

/* Attribute-archive toolbar: count + optional reset link inline */
.attr-product-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Shop Toolbar */
.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding: 0.875rem 1rem;
    background: var(--color-white);
    border: 1px solid var(--color-gray-100);
    border-radius: var(--radius-md);
    /* Sticky: keep sort/search toolbar visible while scrolling */
    position: sticky;
    top: var(--header-height, 80px);
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Admin bar offset for sticky toolbar */
.admin-bar .shop-toolbar {
    top: calc(var(--header-height, 80px) + 32px);
}

@media (max-width: 782px) {
    .admin-bar .shop-toolbar {
        top: calc(var(--header-height, 80px) + 46px);
    }
}

/* Bottom pagination bar is NOT sticky — it lives below the product grid */
.shop-toolbar.bottom-pagination {
    position: static;
    box-shadow: none;
    margin-top: var(--space-md);
}

/* Zero-result search on category archive: toolbar shows only the search form.
   Slightly reduced margin so the empty-state feels less distant from the input. */
.shop-toolbar--search-only {
    margin-bottom: var(--space-sm);
}

/* Category-archive filter row (material/brand/era/price) — a separate row below
   .shop-toolbar rather than inside it, since that bar is a sticky space-between
   flex row with no room for four more controls. */
.toolbar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: var(--space-lg);
}

@media (max-width: 600px) {
    .toolbar-filters {
        gap: 0.5rem;
    }
}

/* Collapsible drawer for the category-archive filter row, same pattern as
   .shop-filters' mobile drawer (item 106) — stack the toggle button above
   the (collapsed) drawer instead of wrapping controls onto multiple lines. */
@media (max-width: 900px) {
    .toolbar-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-filters .filter-toggle {
        width: 100%;
    }
}

/* Category toolbar sort dropdown */
.toolbar-sort {
    display: flex;
    align-items: center;
}

.filter-sort-select {
    min-width: 0;
    width: auto;
    padding-left: 0.75rem;
    font-size: 0.8125rem;
}

@media (max-width: 600px) {
    .toolbar-sort {
        order: 3;
    }

    .filter-sort-select {
        font-size: 0.75rem;
        padding: 0.5rem 2rem 0.5rem 0.625rem;
    }

    /* Wrap category toolbar: search full-width first, then sort + count + pagination */
    .shop-toolbar:has(.toolbar-search) {
        flex-wrap: wrap;
    }

    .shop-toolbar .toolbar-search {
        flex: 0 0 100%;
        order: 1;
    }

    .shop-toolbar .product-count {
        order: 2;
        flex: 1;
    }

    .shop-toolbar .toolbar-pagination {
        order: 4;
    }
}

.product-count {
    font-size: 0.8125rem;
    color: var(--color-gray-600);
}

.toolbar-pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-indicator {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-gray-600);
}

@media (max-width: 600px) {
    .shop-toolbar {
        flex-direction: row;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .product-count {
        font-size: 0.75rem;
        flex: 1;
    }

    .toolbar-pagination {
        gap: 0.5rem;
    }

    .page-indicator {
        font-size: 0.75rem;
    }
}

/* Empty State */
.shop-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.shop-empty-icon {
    color: var(--color-gray-400);
    margin-bottom: var(--space-xs);
}

.shop-empty-heading {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-black);
    margin: 0;
}

.shop-empty-heading em {
    font-style: italic;
    font-weight: 400;
}

.shop-empty-sub {
    font-size: 0.9375rem;
    color: var(--color-gray-600);
    margin: 0;
}

.shop-empty-actions {
    margin-top: var(--space-sm);
}

.shop-empty-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.shop-empty-btn--primary {
    background: var(--color-black);
    color: var(--color-white);
    border: 1px solid var(--color-black);
}

.shop-empty-btn--primary:hover {
    background: var(--color-gray-800);
    border-color: var(--color-gray-800);
}

.shop-empty-btn--primary:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--color-black);
}

@media (max-width: 480px) {
    .shop-empty-state {
        padding: var(--space-lg) var(--space-sm);
    }
    .shop-empty-btn {
        width: 100%;
        text-align: center;
    }
}

/* Empty state — category quick-links */
.shop-empty-cats {
    margin-top: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.shop-empty-cats-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}

.shop-empty-cats-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.shop-empty-cat-link {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--color-gray-300);
    border-radius: 99px;
    font-size: 0.875rem;
    color: var(--color-gray-700);
    text-decoration: none;
    background: var(--color-white);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.shop-empty-cat-link:hover {
    border-color: var(--color-black);
    color: var(--color-black);
    background: var(--color-gray-50, #fafafa);
}

.shop-empty-cat-link:focus-visible {
    outline: 2px solid var(--color-black);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .shop-empty-cats-list {
        gap: 0.375rem;
    }
    .shop-empty-cat-link {
        font-size: 0.8125rem;
        padding: 0.3125rem 0.75rem;
    }
}

/* Recently-viewed rail — second recovery path on the empty-results state.
   Hidden by default (inline style), JS reveals it only when localStorage has
   data. Horizontal scroll strip, same item shape as the dashboard's "Sidst
   set" widget (.ads-rv-*, account-dashboard.css) but its own namespace —
   this file and account-dashboard.css aren't both loaded on the same page. */
.shop-empty-rv {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-gray-200);
    width: 100%;
    max-width: 560px;
}

.shop-empty-rv-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 var(--space-sm);
    text-align: center;
}

.shop-empty-rv-list {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0 0 4px;
    scrollbar-width: none;
}

.shop-empty-rv-list::-webkit-scrollbar {
    display: none;
}

.shop-empty-rv-item {
    flex: 0 0 auto;
}

.shop-empty-rv-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100px;
    text-decoration: none;
    color: var(--color-gray-800);
}

.shop-empty-rv-link:hover .shop-empty-rv-name {
    color: var(--color-black);
    text-decoration: underline;
}

.shop-empty-rv-link:focus-visible {
    outline: 2px solid var(--color-black);
    outline-offset: 2px;
    border-radius: 4px;
}

.shop-empty-rv-thumb {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--color-gray-100, #f5f5f5);
    flex-shrink: 0;
}

.shop-empty-rv-thumb--ph {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gray-300);
}

.shop-empty-rv-name {
    font-size: 0.75rem;
    line-height: 1.3;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shop-empty-rv-price {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-gray-600);
}


/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination {
    margin-top: var(--space-xl);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-numbers {
    display: flex;
    gap: 0.25rem;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-gray-600);
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.pagination-link:hover,
.pagination-link:focus-visible {
    background: var(--color-black);
    border-color: var(--color-black);
    color: var(--color-white);
}

.pagination-link.current {
    background: var(--color-black);
    border-color: var(--color-black);
    color: var(--color-white);
}


/* Attribute archive header (brand / material / era archive pages).
   The .attribute-header block in archive-attribute.twig has no other CSS —
   these rules give it the same visual language as the compact shop header. */
.attribute-header {
    margin-bottom: var(--space-lg);
}

.attribute-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-gray-500);
    margin-bottom: 0.375rem;
}

.attribute-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-black);
    margin: 0 0 var(--space-xs);
}

.attribute-description {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--color-gray-600);
    margin: 0 0 var(--space-xs);
    max-width: 56ch;
}

.attribute-count {
    display: inline-block;
    font-size: 0.8125rem;
    color: var(--color-gray-500);
}

/* Attribute archive toolbar (sort + count) */
.attr-toolbar {
    margin-top: var(--space-md);
}

/* Back-to-top button (shop archive) */
.shop-back-to-top {
    position: fixed;
    bottom: calc(var(--space-lg) + 56px); /* sit above sticky mobile CTA if present */
    right: var(--space-md);
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-black);
    color: var(--color-white);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.shop-back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.shop-back-to-top:hover {
    background: var(--color-gray-800);
}

.shop-back-to-top:focus-visible {
    outline: 2px solid var(--color-black);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .shop-back-to-top {
        transition: opacity var(--duration-fast) var(--ease);
        transform: none;
    }
}

/* On desktop (≥769px) the sticky product CTA doesn't show, lower the button */
@media (min-width: 769px) {
    .shop-back-to-top {
        bottom: var(--space-lg);
    }
}

/* ── Category educational content (term meta prose, #1328) ── */
.category-content-block {
    max-width: 68ch;
    margin: var(--space-md) 0 var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-gray-200);
    color: var(--color-gray-700);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.category-content-block p {
    margin: 0 0 var(--space-sm);
}

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

.category-content-block h2,
.category-content-block h3 {
    color: var(--color-gray-900);
    margin: 0 0 var(--space-xs);
}

.category-content-block a {
    color: var(--color-gray-900);
    text-decoration: underline;
}

/* ==========================================================================
   TOUCH / HOVER-CAPABLE GUARD
   Remove CSS :hover side-effects on touch devices to prevent "sticky hover"
   (iOS/Android retain :hover after tap-then-back, causing lifted/scaled cards).
   JS handles image-swap and dots on touch natively.
   Split from a single shared @media block in shop.css — see PR for shop.css split.
   ========================================================================== */
@media (hover: none) {
    /* Category cards — no lift on touch */
    .category-card:hover {
        transform: none;
        box-shadow: none;
        border-color: var(--color-gray-100);
    }
    .category-card:hover .category-image img {
        transform: none;
    }
    /* Featured-category strip — no lift on touch */
    .category-featured-item:hover {
        transform: none;
        box-shadow: none;
    }
    .category-featured-item:hover .category-featured-image img {
        transform: none;
    }
}
