/* ==========================================================================
   NEXR — catalog: swatches, filters, sorting, compare, shop layout.
   Uses the existing NEXR tokens (no new palette / typography).
   ========================================================================== */

/* ---- Shop layout: full-width grid, filters in an off-canvas drawer -------
   Full-width on every screen so product cards render at the SAME size on the
   homepage and inside any category/shop archive (Oula-style; no persistent
   sidebar). Filters open from the "Filter" toolbar button. -------------------- */
.nexr-shop { display: block; }
.nexr-shop__main { width: 100%; }

.nexr-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); flex-wrap: wrap; margin-block-end: var(--space-l); padding-block-end: var(--space-s); border-block-end: 1px solid var(--border); }
.nexr-toolbar__count { color: var(--text-muted); font-size: var(--step--1); }
.nexr-toolbar__count b { color: var(--text); }
.nexr-toolbar__right { display: flex; align-items: center; gap: var(--space-s); }
.nexr-sort { min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface); color: var(--text); padding: 0 2rem 0 1rem; font: inherit; }
.nexr-filter-toggle { display: inline-flex; }

[data-products] { transition: opacity var(--dur-base) var(--ease-out); }
[data-products].is-loading { opacity: .45; pointer-events: none; }
[data-pagination] { display: flex; gap: .4rem; justify-content: center; margin-block-start: var(--space-xl); }

/* ---- Filter sidebar ----------------------------------------------------- */
.nexr-filters__head { display: flex; align-items: center; justify-content: space-between; margin-block-end: var(--space-s); }
.nexr-filters__clear { color: var(--text-muted); font-size: var(--step--1); text-decoration: underline; text-underline-offset: 3px; }
.nexr-filters__clear:hover { color: var(--c-brass); }
.nexr-filter { border-block-end: 1px solid var(--border); padding-block: var(--space-s); }
.nexr-filter > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; font-size: var(--step-0); font-family: var(--font-display); }
.nexr-filter > summary::-webkit-details-marker { display: none; }
.nexr-filter > summary::after { content: "+"; color: var(--text-muted); font-size: 1.1em; }
.nexr-filter[open] > summary::after { content: "–"; }
.nexr-filter__body { display: flex; flex-direction: column; gap: .5rem; margin-block-start: var(--space-s); max-height: 15rem; overflow-y: auto; }
.nexr-filter__body--swatch { flex-direction: row; flex-wrap: wrap; gap: .5rem; }
.nexr-filter__price { flex-direction: row; align-items: center; gap: .5rem; }
.nexr-filter__price input { width: 100%; min-height: 42px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); color: var(--text); padding: 0 .6rem; font: inherit; }
.nexr-filter-check { display: flex; align-items: center; gap: .55rem; font-size: var(--step--1); color: var(--text-muted); cursor: pointer; }
.nexr-filter-check input { accent-color: var(--c-brass); width: 16px; height: 16px; }
.nexr-filter-check:hover span { color: var(--text); }
.nexr-filter-check em { opacity: .55; font-style: normal; }

/* Filter colour swatches */
.nexr-filter-swatch { position: relative; cursor: pointer; }
.nexr-filter-swatch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.nexr-filter-swatch > span { display: block; width: 26px; height: 26px; border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1px var(--c-line-strong); transition: transform var(--dur-fast) var(--ease-out); }
.nexr-filter-swatch:hover > span { transform: scale(1.12); }
.nexr-filter-swatch.is-active > span { box-shadow: inset 0 0 0 1px var(--c-brass), 0 0 0 2px var(--c-brass); }

/* Off-canvas filters (all widths) */
.nexr-filters { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: var(--z-modal); width: min(88vw, 22rem); background: var(--surface); color: var(--text); border-inline-end: 1px solid var(--border); padding: var(--space-l) var(--space-m); overflow-y: auto; transform: translateX(-100%); transition: transform var(--dur-slow) var(--ease-out); box-shadow: var(--shadow-3); }
[dir="rtl"] .nexr-filters { inset-inline-start: auto; inset-inline-end: 0; transform: translateX(100%); }
body.nexr-filters-open .nexr-filters { transform: none; }
body.nexr-filters-open::after { content: ""; position: fixed; inset: 0; z-index: calc(var(--z-modal) - 1); background: rgba(0,0,0,.6); }

/* ---- Variation swatches (single product) -------------------------------- */
.nexr-swatch-field .nexr-native-select { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nexr-swatch-group { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: .35rem; }
.nexr-swatch { position: relative; width: 34px; height: 34px; border-radius: var(--radius-pill); border: 0; padding: 0; cursor: pointer; background: none; }
.nexr-swatch > span { display: block; width: 100%; height: 100%; border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1px var(--c-line-strong); transition: transform var(--dur-fast) var(--ease-out); }
.nexr-swatch:hover > span { transform: scale(1.1); }
.nexr-swatch.is-active > span { box-shadow: inset 0 0 0 2px var(--c-brass), 0 0 0 2px var(--bg), 0 0 0 3px var(--c-brass); }
.nexr-swatch.is-disabled { opacity: .35; pointer-events: none; }
.nexr-swatch.is-disabled::after { content: ""; position: absolute; inset: 45% 8% auto; height: 1px; background: var(--c-danger); transform: rotate(-45deg); }
.nexr-size { min-width: 46px; height: 40px; padding: 0 .75rem; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-s); background: transparent; color: var(--text); font-size: var(--step--1); cursor: pointer; transition: all var(--dur-fast) var(--ease-out); }
.nexr-size:hover { border-color: var(--c-brass); }
.nexr-size.is-active { border-color: var(--c-brass); color: var(--c-brass); }
.nexr-size.is-disabled { opacity: .35; pointer-events: none; text-decoration: line-through; }

/* Card swatches */
.nexr-swatches--card { gap: .35rem; margin-block-start: .5rem; }
.nexr-swatch--static { width: 15px; height: 15px; border-radius: var(--radius-pill); display: inline-block; box-shadow: inset 0 0 0 1px var(--c-line-strong); }
.nexr-swatch-more { font-size: 11px; color: var(--text-muted); align-self: center; }

/* Measurements table */
.nexr-measurements { margin-block: var(--space-s); font-size: var(--step--1); }
.nexr-measurements summary { cursor: pointer; color: var(--c-brass); }
.nexr-measurements table { width: 100%; margin-block-start: .5rem; border-collapse: collapse; }
.nexr-measurements th, .nexr-measurements td { text-align: start; padding: .4rem .5rem; border-block-end: 1px solid var(--border); color: var(--text-muted); }
.nexr-measurements th { color: var(--text); }

/* ---- Product card: compare + choose options ----------------------------- */
.product-card .nexr-compare { position: absolute; inset-block-start: 54px; inset-inline-end: 10px; z-index: 3; width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--c-ink) 55%, transparent); color: var(--c-ivory); border: 1px solid var(--border); backdrop-filter: blur(8px); transition: color var(--dur-fast), background var(--dur-fast); }
.product-card .nexr-compare:hover, .product-card .nexr-compare.is-active { color: var(--c-ink); background: var(--c-brass); }
.product-card .nexr-compare svg { width: 17px; height: 17px; }
.product-card__brand { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }

/* ---- Compare bar + table ------------------------------------------------ */
.nexr-compare-bar { position: fixed; inset-block-end: 0; inset-inline: 0; z-index: var(--z-sticky); transform: translateY(110%); transition: transform var(--dur-base) var(--ease-out); background: var(--surface); color: var(--text); border-block-start: 1px solid var(--border); box-shadow: 0 -8px 30px rgba(0,0,0,.10); }
.nexr-compare-bar.is-visible { transform: none; }
.nexr-compare-bar__inner { display: flex; align-items: center; gap: var(--space-m); padding-block: .75rem; }
.nexr-compare-bar__label { margin-inline-end: auto; font-size: var(--step--1); letter-spacing: .1em; text-transform: uppercase; }
.nexr-compare-table { width: 100%; overflow-x: auto; }
.nexr-compare-table table { border-collapse: collapse; min-width: 40rem; width: 100%; }
.nexr-compare-table th, .nexr-compare-table td { border: 1px solid var(--border); padding: var(--space-s); text-align: start; vertical-align: top; }
.nexr-compare-table th { font-family: var(--font-display); font-weight: 500; }

/* ---- Brand archive header ----------------------------------------------- */
.nexr-brand-header { text-align: center; padding-block: var(--space-xl); border-block-end: 1px solid var(--border); margin-block-end: var(--space-l); }
.nexr-brand-header img { max-height: 64px; width: auto; margin-inline: auto; margin-block-end: var(--space-s); }
