/* House of Elki: All products page (search, filters, grid). Builds on styles.css + pages.css. */

/* ---------- hero + search ---------- */
.shop-hero { padding-block: clamp(32px, 5vw, 64px) clamp(36px, 5vw, 64px); }
.shop-hero .container { max-width: 1240px; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.shop-hero .container > * { min-width: 0; }
.shop-hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.25rem); max-width: none; }
.shop-hero .lead { max-width: 56ch; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 0; padding: 0; list-style: none; font-size: .8125rem; color: var(--soft); }
.crumbs li { display: inline-flex; align-items: center; gap: 8px; }
.crumbs li + li::before { content: ""; width: 5px; height: 5px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); opacity: .6; }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; border-bottom: 1px solid transparent; }
.crumbs a:hover { color: var(--ink); border-bottom-color: var(--gold); }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; }

.shop-search { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; width: min(760px, 100%); margin-top: 6px; }
.shop-search-label { font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.shop-search-field { position: relative; display: flex; align-items: center; gap: 4px; min-height: 60px; padding: 6px 6px 6px 18px; border-radius: 14px; background: var(--paper); color: var(--navy); border: 2px solid transparent; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.shop-search-field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(214, 168, 90, .28); }
.shop-search-field .lead-icon { width: 22px; height: 22px; color: var(--text-muted); margin-right: 8px; }
.shop-search-field input { flex: 1; min-width: 0; min-height: 48px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1.0625rem; color: var(--navy); -webkit-appearance: none; appearance: none; }
.shop-search-field input::placeholder { color: var(--text-muted); opacity: 1; }
.shop-search-field input::-webkit-search-cancel-button { display: none; }
.shop-search-field .clear { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--text-muted); }
.shop-search-field .clear:hover { background: color-mix(in srgb, var(--navy) 8%, transparent); color: var(--navy); }
.shop-search-field .clear[hidden] { display: none; }
.shop-search-field .go { min-height: 48px; padding: 0 24px; border: 0; border-radius: 10px; background: var(--terracotta); color: var(--paper); font-weight: 500; font-size: .9375rem; transition: background-color .2s var(--ease); }
.shop-search-field .go:hover { background: color-mix(in srgb, var(--terracotta) 86%, #000); }
.shop-hint { font-size: .8125rem; color: var(--muted); }
.shop-hint kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid rgba(246, 241, 233, .35); border-radius: 5px; font: inherit; font-size: .75rem; text-align: center; color: var(--ink); }
@media (hover: none) { .shop-hint { display: none; } }
.shop-popular { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.shop-popular > span { font-size: .8125rem; color: var(--muted); margin-right: 4px; }
.pop { min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid rgba(246, 241, 233, .32); background: transparent; color: var(--ink); font-size: .875rem; transition: background-color .2s var(--ease), border-color .2s var(--ease); }
.pop:hover { background: rgba(246, 241, 233, .1); border-color: var(--gold); }

/* ---------- layout ---------- */
.shop { padding-block: clamp(28px, 4vw, 56px) clamp(56px, 7vw, 96px); }
.shop-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 44px; align-items: start; scroll-margin-top: 90px; }
@media (min-width: 1024px) { .shop-layout { grid-template-columns: 264px minmax(0, 1fr); } }

/* ---------- filters ---------- */
.shop-filters { display: none; padding: 20px; border-radius: var(--r-md); border: 1px solid var(--hairline); background: var(--surface); }
.shop-filters.is-open { display: block; }
@media (min-width: 1024px) {
  .shop-filters, .shop-filters.is-open { display: block; position: sticky; top: 88px; max-height: calc(100vh - 108px); overflow-y: auto; padding: 0 6px 0 0; border: 0; background: none; scrollbar-width: thin; }
}
.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; min-height: 36px; }
.filters-head h2 { font-size: 1.75rem; }
.link-btn { min-height: 44px; padding: 0 4px; border: 0; background: none; font-size: .875rem; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; color: var(--terracotta); }
.link-btn[hidden] { display: none; }
.facet { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.facet legend { padding: 0; margin-bottom: 12px; font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid color-mix(in srgb, var(--navy) 28%, transparent); background: var(--paper); font-size: .875rem; line-height: 1.2; text-align: left; transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); }
.fchip small { font-size: .75rem; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.fchip:hover { border-color: var(--navy); }
.fchip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--paper); }
.fchip[aria-pressed="true"] small { color: var(--soft); }
.fchip.is-zero { border-style: dashed; color: var(--text-muted); }
.fchip .sw { width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 1px solid color-mix(in srgb, var(--navy) 30%, transparent); flex: none; }
.fchip[aria-pressed="true"] .sw { border-color: var(--paper); }
@media (pointer: coarse) { .fchip { min-height: 44px; } }

/* ---------- results bar ---------- */
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--hairline); }
.results-main { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.results-count { font-weight: 500; font-size: 1rem; }
.filter-toggle { gap: 8px; }
.filter-toggle .icon { width: 18px; height: 18px; }
.filter-toggle:hover .icon { transform: none; }
.filter-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--terracotta); color: var(--paper); font-size: .75rem; font-weight: 600; line-height: 1; }
.filter-n[hidden] { display: none; }
.filter-toggle:hover .filter-n { background: var(--gold); color: var(--navy); }
@media (min-width: 1024px) { .filter-toggle { display: none; } }
.sort { display: flex; align-items: center; gap: 10px; font-size: .875rem; color: var(--text-muted); }
.select { position: relative; }
.select select { appearance: none; -webkit-appearance: none; min-height: 44px; padding: 0 40px 0 14px; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--navy) 28%, transparent); background: var(--paper); font: inherit; font-size: .9375rem; color: var(--navy); cursor: pointer; }
.select select:hover { border-color: var(--navy); }
.select .icon { position: absolute; right: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; pointer-events: none; }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.active-filters[hidden] { display: none; }
.active-filters button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 14px; border-radius: var(--r-pill); border: 1px solid color-mix(in srgb, var(--gold) 70%, var(--navy)); background: color-mix(in srgb, var(--gold) 22%, var(--paper)); font-size: .8125rem; font-weight: 500; transition: background-color .2s var(--ease); }
.active-filters button:hover { background: color-mix(in srgb, var(--gold) 38%, var(--paper)); }
.active-filters .icon { width: 14px; height: 14px; }

/* ---------- grid + cards ---------- */
.shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
.shop-grid[hidden] { display: none; }
@media (min-width: 720px) { .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 20px; } }
.shop-card h3 { font-size: clamp(1.1875rem, 1.2vw + .8rem, 1.5rem); }
.shop-card .card-origin { font-size: .75rem; }
.shop-card .card-media { background: color-mix(in srgb, var(--navy) 6%, var(--paper)); }
.shop-card .card-craft { font-size: .75rem; padding: 4px 10px; }
.shop-card .swatches { flex-wrap: wrap; gap: 6px; }
.shop-card .swatch { width: 24px; height: 24px; }   /* 24px: the WCAG 2.5.8 minimum target */
.shop-card .swatch::after { inset: -4px; }
.shop-card .variant-label span { color: var(--text-muted); }
.shop-card mark { background: color-mix(in srgb, var(--gold) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.card-actions { display: flex; gap: 8px; align-items: stretch; }
.shop-card .add { flex: 1; width: auto; min-width: 0; padding-inline: 12px; }
.shop-card .btn--sm { min-height: 44px; }
.box-btn { flex: none; width: 44px; padding: 0 !important; }
.box-btn .icon { width: 20px; height: 20px; }
.box-btn:hover .icon { transform: none; }
.box-btn[aria-pressed="true"] { background: var(--navy); color: var(--paper); }
.shop-card .variant-label { font-size: .75rem; }
@media (max-width: 479px) { .shop-card .add { font-size: .8125rem; } .shop-card .card-meta { gap: 8px; } }

/* ---------- empty state ---------- */
.shop-empty { display: grid; justify-items: center; gap: 14px; text-align: center; padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 48px); border-radius: var(--r-lg); border: 1px dashed color-mix(in srgb, var(--navy) 30%, transparent); background: var(--surface); }
.shop-empty[hidden] { display: none; }
.shop-empty > .icon { width: 40px; height: 40px; color: var(--terracotta); stroke-width: 1.3; }
.shop-empty h3 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
.shop-empty p { color: var(--text-muted); max-width: 44ch; }
.shop-empty .shop-popular { justify-content: center; margin-top: 6px; }
.shop-empty .pop { color: var(--navy); border-color: color-mix(in srgb, var(--navy) 30%, transparent); }
.shop-empty .pop:hover { background: color-mix(in srgb, var(--navy) 8%, transparent); border-color: var(--navy); }
.empty-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 28px; margin-top: 10px; }
.shop-noscript { padding: 16px 0; color: var(--text-muted); }
.shop-noscript a { text-decoration: underline; }

/* ---------- bottom CTA ---------- */
.shop-cta h2 { max-width: 20ch; }
.shop-cta .lead { margin-top: 12px; }

@media (max-width: 599px) {
  .shop-search-field { padding-left: 14px; min-height: 56px; }
  .shop-search-field .go { padding: 0 16px; }
  .shop-search-field .lead-icon { margin-right: 4px; }
  .sort label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .shop-search-field, .fchip, .pop { transition: none; }
}

/* ---- Touch targets (UI/UX pass, Nov 2026) ---- */
@media (pointer: coarse) {
  .fchip, .active-filters button { min-height: 44px; }
  .crumbs a { min-height: 44px; }
}
