/* Shop page (/shop/). Loads after styles.css and reuses its tokens. Patterns from the Mobbin study:
   big title + count (lululemon), category tabs (H&M), numbered filter drawer (ZARA), pills (UO). */
.shop { padding: clamp(40px, 6vw, 80px) var(--pad) clamp(56px, 8vw, 96px); }
.shop-head { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 8px 20px; }
.shop-head .display { font-size: clamp(3.25rem, 9vw, 7.5rem); }
.shop-count { margin: 0 0 0.6em; font-size: 0.875rem; color: var(--ink-soft); }
.shop-intro { grid-column: 1 / -1; max-width: 52ch; margin: 18px 0 0; color: var(--ink-soft); line-height: 1.55; }

.shop-bar { position: sticky; top: calc(var(--bar) + var(--head)); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: clamp(28px, 4vw, 48px); padding: 14px 0; background: var(--bg); border-bottom: 1px solid var(--rule); }
.shop-tabs { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tab { position: relative; flex: none; font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); text-decoration: none; padding: 6px 0; transition: color 250ms ease; }
.shop-tab sup { font-size: 0.625rem; margin-left: 3px; letter-spacing: 0; }
.shop-tab[aria-current="true"] { color: var(--ink); }
.shop-tab[aria-current="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); }
.shop-tools { flex: none; display: flex; align-items: center; gap: 20px; font-size: 0.8125rem; }
.shop-view { display: flex; align-items: center; gap: 4px; color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; }
.shop-view button { font: inherit; background: none; border: 0; padding: 4px 6px; cursor: pointer; color: var(--ink-faint); }
.shop-view button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.shop-view .m { display: none; }
.shop-filter-btn { font: inherit; letter-spacing: 0.08em; text-transform: uppercase; background: none; border: 1px solid var(--ink); padding: 9px 18px; cursor: pointer; color: var(--ink); }

.shop-pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 0; }
.shop-pills[hidden] { display: none; }
.pill, .pill-clear { font: inherit; font-size: 0.8125rem; background: var(--card); border: 0; padding: 7px 12px; cursor: pointer; color: var(--ink); }
.pill-clear { background: none; text-decoration: underline; text-underline-offset: 3px; }

.shop-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); grid-auto-flow: dense; gap: clamp(28px, 3vw, 40px) 8px; margin-top: 24px; }
.shop-grid[data-cols="2"] { --cols: 2; }
.shop-grid[data-cols="3"] { --cols: 3; }
.shop-grid[data-cols="4"] { --cols: 4; }
.shop-grid [hidden] { display: none !important; }

.shop-group { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; align-items: end; gap: 12px 32px; padding: clamp(28px, 4vw, 48px) 0 4px; border-top: 1px solid var(--ink); margin-top: 8px; }
.shop-group:first-child { border-top: 0; padding-top: 8px; margin-top: 0; }
.shop-group h2 { font: 400 clamp(1.5rem, 2.6vw, 2.25rem)/1 var(--display); letter-spacing: -0.02em; text-transform: uppercase; }
.shop-group p { margin: 0; max-width: 60ch; font-size: 0.875rem; line-height: 1.55; color: var(--ink-soft); }
.shop-group .link { font-size: 0.8125rem; white-space: nowrap; }

.tile { display: grid; align-content: start; gap: 4px; color: var(--ink); text-decoration: none; }
.tile-media { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--card); margin-bottom: 12px; }
.tile-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1200ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.tile-note { position: absolute; left: 10px; bottom: 10px; font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--light); background: rgba(20, 20, 20, 0.45); padding: 4px 7px; }
.tile-brand { font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.tile-name { font: 400 1.0625rem/1.15 var(--display); text-transform: uppercase; letter-spacing: -0.005em; }
.tile-meta { font-size: 0.8125rem; color: var(--ink-faint); }

.tile-guide { grid-column: span 2; position: relative; }
.tile-guide .tile-media { aspect-ratio: auto; height: 100%; min-height: 100%; margin: 0; }
.tile-guide .tile-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(12, 10, 8, 0.72), rgba(12, 10, 8, 0.1) 60%); }
.tile-guide-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: grid; gap: 8px; padding: clamp(18px, 2.4vw, 28px); color: var(--light); }
.tile-guide .tile-brand { color: rgba(240, 240, 240, 0.8); }
.tile-guide-title { font: 400 clamp(1.5rem, 2.6vw, 2.4rem)/1 var(--display); text-transform: uppercase; letter-spacing: -0.02em; }
.tile-guide-cta { font-size: 0.8125rem; text-decoration: underline; text-underline-offset: 4px; }

.shop-empty { margin: 48px 0; color: var(--ink-soft); }
.shop-empty button { font: inherit; background: none; border: 0; text-decoration: underline; cursor: pointer; color: var(--ink); }
.shop-note { margin: clamp(48px, 6vw, 72px) 0 0; max-width: 70ch; font-size: 0.75rem; line-height: 1.55; color: var(--ink-faint); }

/* Filter drawer: right-hand panel on desktop, bottom sheet on phones. */
.shop-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(20, 20, 20, 0.35); }
.shop-drawer { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(420px, 100%); display: grid; grid-template-rows: auto 1fr auto; background: var(--bg); box-shadow: -1px 0 0 var(--rule); }
.shop-drawer[hidden], .shop-scrim[hidden] { display: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--rule); font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; }
.drawer-close { font: inherit; background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.drawer-body { overflow-y: auto; padding: 8px 24px 24px; }
.facet { border: 0; margin: 0; padding: 22px 0 10px; border-bottom: 1px solid var(--rule); }
.facet legend { float: left; width: 100%; padding: 0; margin-bottom: 8px; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }
.facet legend span { color: var(--ink-faint); margin-right: 6px; }
.facet legend + label { clear: both; }
.facet label { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 0.9375rem; cursor: pointer; }
.facet input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }
.facet-n { margin-left: auto; font-size: 0.75rem; color: var(--ink-faint); }
.facet label.is-empty { opacity: 0.4; }
.drawer-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; padding: 16px 24px 20px; border-top: 1px solid var(--rule); }
.drawer-foot button { font: inherit; font-size: 0.875rem; min-height: 48px; cursor: pointer; border: 1px solid var(--ink); background: none; color: var(--ink); }
.drawer-foot .drawer-apply { background: var(--ink); color: var(--light); }
html.drawer-open { overflow: hidden; }

@media (hover: hover) {
  .tile:hover .tile-media img { transform: scale(1.04); }
  .shop-tab:hover { color: var(--ink); }
  .shop-filter-btn:hover { background: var(--ink); color: var(--light); }
}

@media (max-width: 900px) {
  .shop-group { grid-template-columns: 1fr; align-items: start; }
}

@media (max-width: 720px) {
  .shop-head { grid-template-columns: 1fr; }
  .shop-count { margin: 0; }
  .shop-bar { flex-wrap: wrap; gap: 12px; padding: 10px 0; }
  .shop-tabs { width: 100%; gap: 18px; }
  .shop-tools { width: 100%; justify-content: space-between; }
  .shop-view .d, .shop-view .desk { display: none; }
  .shop-view .m { display: inline; }
  .shop-grid[data-cols="2"] { --cols: 1; }
  .shop-grid[data-cols="3"], .shop-grid[data-cols="4"] { --cols: 2; }
  .shop-grid[data-cols="2"] .tile-guide { grid-column: span 1; }
  .tile-guide { aspect-ratio: 4 / 3; }
  .tile-name { font-size: 0.9375rem; }
  .shop-drawer { top: auto; width: 100%; max-height: 82vh; box-shadow: 0 -1px 0 var(--rule); }
}
