/* store.css — the store (V15 lane 1), from the canvas's "Store · phone" and "Store · computer": the grid, the filters
   (the computer's sidebar, the phone's sheet — a small sheet for a choice), the card tile the card page's rows reuse,
   and the phone feed (pass 3). Colours are navi.css's tokens (and their soft rgba shades, as Home's). */

#store [hidden], .feed [hidden], .toast[hidden] { display: none !important; }
#store { padding-top: 16px; }
@media (min-width: 900px) { #store { padding-top: 28px; } }

.store-layout { display: block; }
@media (min-width: 900px) {
  .store-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
  .store-layout.no-side { grid-template-columns: minmax(0, 1fr); }
  /* The cards keep their column while the filters are still loading beside them: before this they drew in the
     filters' 260 px, then jumped right when the filters arrived (a layout shift of 0.84 — V17). */
  .store-layout:not(.no-side) .store-main { grid-column: 2; }
}

/* ── The title row ── */
.store-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.store-title { min-width: 0; }
.store-title h1 { font-size: 40px; overflow-wrap: anywhere; }
.store-title .hint { margin-top: 2px; }
@media (min-width: 900px) { .store-title h1 { font-size: 56px; } }

.filter-btn {
  flex: none; position: relative; min-height: 44px; padding: 0 16px; border-radius: 22px;
  display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.filter-btn .icon { width: 18px; height: 18px; }
.filter-btn .dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@media (min-width: 900px) { .filter-btn { display: none; } }

/* ── The phone's search box (the computer's is the header's) ── */
.store-search { margin-top: 14px; }
.search-box {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border-radius: 24px;
  background: rgba(255,255,255,.8); border: 1px solid #fff; box-shadow: 0 4px 14px rgba(160,72,104,.08);
}
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 16px; outline: none; }
.search-box:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }   /* the box wears the input's focus */
.search-box .icon { width: 19px; height: 19px; color: var(--ink-dim); }
@media (min-width: 900px) { .store-search { display: none; } }

/* ── Chips: the phone's quick row (groups, then a group's members) ── */
.chip-row {
  margin: 14px calc(-1 * var(--gutter)) 0; padding: 2px var(--gutter) 6px; display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid #fff; cursor: pointer;
  background: rgba(255,255,255,.8); color: var(--ink); font-size: 15px; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px; box-shadow: 0 3px 10px rgba(160,72,104,.08);
  -webkit-tap-highlight-color: transparent;
}
.chip[aria-pressed="true"], .chip.chip-on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.chip .icon { width: 16px; height: 16px; margin-right: -4px; }
@media (min-width: 900px) { .chip-row { display: none; } }

/* What's set beyond the group: each one a chip that takes it off */
.active-row { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.active-chip {
  min-height: 44px; padding: 0 10px 0 14px; border-radius: 22px; border: 1px solid rgba(168,70,106,.22); cursor: pointer;
  background: rgba(255,255,255,.7); color: var(--ink); font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px; -webkit-tap-highlight-color: transparent;
}
.active-chip .icon { width: 16px; height: 16px; color: var(--accent); }
@media (min-width: 900px) { .active-row { margin-top: 14px; } .active-chip { min-height: 36px; } }

/* ── Sort and the tip ── */
.store-bar { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.store-bar .hint { margin: 0; font-size: 14px; }
.sort { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--ink-dim); flex: none; }
.sort select {
  min-height: 44px; border: 0; background: transparent; font-size: 16px; font-weight: 600; color: var(--ink);
  padding: 0 2px; cursor: pointer;
}
.sort-word { display: none; }
@media (min-width: 900px) { .store-bar { margin-top: 16px; } .sort select { font-size: 15px; } .sort-word { display: inline; } }

/* ── The grid ── each card a small glass tile: the photo in her card's shape, the member, the album, the price */
.grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; margin-top: 16px; } }

.tile { position: relative; border-radius: 22px; padding: 7px 7px 12px; }
.grid .tile:nth-child(n+13) { content-visibility: auto; contain-intrinsic-size: auto 340px; }
@media (min-width: 900px) { .grid .tile:nth-child(n+13) { contain-intrinsic-size: auto 320px; } }
.tile-link { display: block; text-decoration: none; color: inherit; border-radius: 16px; -webkit-tap-highlight-color: transparent; }
.tile .pc { width: 100%; box-shadow: 0 2px 8px rgba(90,40,60,.12); }
.tile-name { display: block; margin: 9px 5px 0; font-size: 17px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-album { display: block; margin: 1px 5px 0; min-height: 1.4em; font-size: 13px; line-height: 1.4; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-price { display: block; margin: 2px 5px 0; font-size: 22px; line-height: 1.2; }
.tile.is-out .pc img { opacity: .55; }
.tile.is-out .tile-price { color: var(--ink-dim); }
.tile-flag {
  position: absolute; left: 6px; bottom: 6px; padding: 3px 9px; border-radius: 12px;
  background: rgba(255,255,255,.92); font-size: 12px; font-weight: 600; color: var(--ink);
}
@media (hover: hover) {
  .tile { transition: transform .3s var(--ease); }
  .tile:hover { transform: translateY(-4px); }
}

/* The heart: a 44 px target, a 34 px circle */
.heart-btn {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; padding: 0; border: 0; background: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--accent);
  -webkit-tap-highlight-color: transparent;
}
.heart-btn::before {
  content: ""; position: absolute; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.86); border: 1px solid rgba(255,255,255,.95); box-shadow: 0 2px 8px rgba(160,72,104,.14);
}
.heart-btn svg { position: relative; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.heart-btn[aria-pressed="true"] svg { fill: currentColor; }

/* Before the cards land: their shapes, softly */
.skeleton-tile .pc { background: rgba(255,255,255,.6); box-shadow: none; }
.sk-line { display: block; height: 12px; margin: 12px 5px 0; border-radius: 6px; background: rgba(168,70,106,.08); }
.sk-line.short { width: 50%; height: 18px; margin-top: 8px; }

/* Empty, or didn't load */
.store-note { margin-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.store-note h2 { font-size: 30px; }
.store-note .hint { margin: 0 0 6px; }

/* ── The filters: the computer's sidebar and the phone's sheet ── */
.filters { display: none; }
@media (min-width: 900px) {
  .filters {
    display: block; position: sticky; top: 92px; border-radius: 30px; padding: 22px 20px 24px;
    max-height: calc(100vh - 112px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  }
}
.fp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fp-head h2 { font-size: 30px; }
.text-btn {
  min-height: 44px; padding: 0 6px; border: 0; background: transparent; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--accent); -webkit-tap-highlight-color: transparent;
}
.fp-label { display: block; margin: 18px 0 8px; font-size: 14px; font-weight: 600; color: var(--ink-dim); }
.fp-groups { border-radius: 18px; background: rgba(255,255,255,.8); border: 1px solid #fff; overflow: hidden; }
.fp-group + .fp-group { border-top: 1px solid rgba(168,70,106,.10); }
.fp-group-btn {
  width: 100%; min-height: 48px; padding: 0 14px; border: 0; background: transparent; cursor: pointer; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
.fp-group.is-on > .fp-group-btn { color: var(--accent); }
.fp-group-btn .chev { width: 16px; height: 16px; stroke-width: 2; transition: transform .2s var(--ease); }
.fp-group-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.fp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-members { padding: 0 12px 14px; }
.fp-chip {
  min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid rgba(168,70,106,.16); cursor: pointer;
  background: #fff; color: var(--ink); font-size: 14px; display: inline-flex; align-items: center; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.fp-chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-weight: 600; }
.fp-vault { color: var(--accent); font-weight: 600; font-style: italic; }
.fp-select {
  width: 100%; min-height: 48px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--field-line);
  background: #fff; font-size: 16px; cursor: pointer;
}
@media (min-width: 900px) { .fp-chip { min-height: 36px; padding: 0 12px; font-size: 13.5px; } .fp-select { min-height: 40px; font-size: 15px; } }

/* The sheet rises from the bottom over a soft scrim (a choice, not content: Natalie's no-popups rule) */
html.sheet-open, html.sheet-open body { overflow: hidden; }
.sheet-wrap { position: fixed; inset: 0; z-index: 60; }
.sheet-scrim { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; background: rgba(58,42,48,.28); cursor: pointer; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 84vh; max-height: 84dvh; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 30px 30px 0 0; padding: 10px 20px calc(16px + env(safe-area-inset-bottom, 0px)); outline: none;
  background: var(--ground); box-shadow: inset 0 1px 0 #fff, 0 -10px 30px rgba(90,40,60,.12); animation: store-up .32s var(--ease) both;
}
.grabber { width: 40px; height: 5px; border-radius: 3px; background: rgba(168,70,106,.22); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-size: 32px; }
.sheet-done { position: sticky; bottom: 0; margin-top: 20px; box-shadow: 0 -8px 20px rgba(251,244,246,.9); }
@keyframes store-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (min-width: 900px) { .sheet-wrap { display: none; } }

/* ── The toast: one short line at the bottom ── */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 120; margin: 0;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 22px; font-size: 15px; font-weight: 600; text-align: center;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ── A double-tap's heart: one small thing pops, once (the feed and the card page) ── */
.pop { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 2; }
.pop svg { width: 120px; height: 120px; fill: #fff; stroke: var(--accent); stroke-width: .6; opacity: 0;
  filter: drop-shadow(0 8px 18px rgba(168,70,106,.45)); }
.pop.on svg { animation: navi-pop .95s ease-out both; }
@keyframes navi-pop {
  0% { opacity: 0; transform: scale(.2); } 15% { opacity: 1; transform: scale(1.18); } 30% { transform: scale(.94); }
  45% { transform: scale(1.02); } 75% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.08) translateY(-26px); }
}

/* ── The phone feed ── a layer over the page: one card a screen, swiped with the browser's own scrolling.
   Each card sits at its own slot (top: slot × 100%), so cards come and go around you and the scroll never moves.
   Nothing tall ever moves by transform; only the small things animate (the pop, the flying heart, the "+1").
   Frost only on what floats (X, the bag); the cards' panels are plain glass (no blur under a moving screen). */
html.feed-open { overflow: hidden; }
html.feed-open .page, html.feed-open .ribbons { visibility: hidden; }
.feed { position: fixed; inset: 0; z-index: 80; background: var(--ground); touch-action: manipulation; }
.feed-scroll {
  position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; outline: none;
  scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.feed-scroll::-webkit-scrollbar { display: none; }
.feed.single .feed-scroll { overflow-y: hidden; }
/* the snap points: one empty marker per slot, fixed for the feed's life (WebKit re-snaps by index, not by element) */
.feed-snap {
  position: absolute; left: 0; top: calc(var(--p) * 100%); width: 1px; height: 100%; pointer-events: none;
  scroll-snap-align: start; scroll-snap-stop: always;
}
.feed-item {
  position: absolute; left: 0; right: 0; top: calc(var(--p) * 100%); height: 100%; overflow: hidden; contain: strict;
  display: grid; grid-template-rows: calc(64px + env(safe-area-inset-top, 0px)) minmax(0, 1fr) auto;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}
/* behind each card, a soft blur of its own colours — stronger than the canvas (Natalie, 11-01), then a touch calmer
   (Natalie, 11-02: "slightly more muted and normal … less of a color bomb"; was saturate(1.9), opacity .8) */
.feed-bg {
  position: absolute; left: -60px; top: -60px; width: calc(100% + 120px); height: calc(100% + 120px); max-width: none;
  object-fit: cover; filter: blur(30px) saturate(1.3); opacity: .7; pointer-events: none;
}
.feed-pos {
  grid-row: 1; align-self: end; justify-self: center; position: relative; margin: 0 0 10px; padding: 5px 12px;
  border-radius: 14px; background: rgba(255,255,255,.75); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.feed-stage {
  grid-row: 2; position: relative; min-height: 0; container-type: size;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.feed-card {
  flex: none; height: min(100cqh - 76px, (100cqw - 120px) * 85 / 55); width: auto;
  box-shadow: 0 24px 50px rgba(90,40,70,.30), 0 2px 6px rgba(90,40,60,.12);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.feed-photos {
  position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; border-radius: inherit;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
}
.feed-photos::-webkit-scrollbar { display: none; }
.feed-photos img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; display: block; scroll-snap-align: center; }
.feed-card.is-out img { opacity: .6; }
.feed-dots, .feed-hint { flex: none; max-width: calc(100% - 120px); margin: 0; text-align: center; }
.feed-dots { display: flex; justify-content: center; gap: 6px; }
.feed-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(58,42,48,.25); }
.feed-dots span.on { background: var(--ink); }
.feed-hint { padding: 5px 10px; border-radius: 14px; background: rgba(255,255,255,.85); font-size: 12.5px; line-height: 1.35; }

/* the rail: heart, the member's face, share */
.feed-rail { position: absolute; right: 8px; bottom: 12px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.rail-btn {
  width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.95); cursor: pointer;
  background: rgba(255,255,255,.88); color: var(--ink); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(90,40,70,.16); -webkit-tap-highlight-color: transparent;
}
.rail-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail-btn[data-feed-heart] { color: var(--accent); }
.rail-btn[aria-pressed="true"] svg { fill: currentColor; }
.rail-face { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.face-crop {
  display: block; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; border: 2px solid #fff; background: #fff;
  box-shadow: 0 6px 16px rgba(90,40,70,.16);
}
.face-crop img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transform: scale(1.6); transform-origin: 50% 22%; display: block; }
.rail-count {
  display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 9px; background: rgba(255,255,255,.9);
  font-size: 11px; font-weight: 700; line-height: 16px; color: var(--accent); font-variant-numeric: tabular-nums;
}
.rail-count svg { width: 9px; height: 9px; fill: currentColor; }
.plus {
  position: absolute; left: 50%; top: 24px; padding: 3px 8px 4px; border-radius: 12px; background: #fff;
  font: 700 17px/1 var(--display); color: var(--accent); white-space: nowrap; box-shadow: 0 4px 12px rgba(168,70,106,.25);
  opacity: 0; pointer-events: none; transform: translate(-50%, -50%);
}
.flyer { position: absolute; left: 50%; top: 14px; width: 20px; height: 20px; margin-left: -10px; opacity: 0; pointer-events: none; color: var(--accent); }
.flyer svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.flyer.go { animation: feed-fly .5s cubic-bezier(.45, 0, .6, 1) both; }
.rail-face.gulp .face-crop { animation: feed-gulp .45s var(--ease); }
.rail-face.gulp .plus { animation: feed-plus 1s ease-out both; }
@keyframes feed-fly { 0% { opacity: 1; transform: translateY(0) scale(1.15); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(var(--fly, 60px)) scale(.5); } }
@keyframes feed-gulp { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes feed-plus { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.8); } 20% { opacity: 1; transform: translate(-50%, -60%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -190%); } }

/* what it is, and the bag */
.feed-info { grid-row: 3; position: relative; margin: 0 16px; padding: 14px 16px 16px; border-radius: 24px; }
.feed-name-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.feed-name-row h2 { font-size: 30px; line-height: 1.05; min-width: 0; overflow-wrap: anywhere; }
.feed-name-row .price { flex: none; font-size: 28px; line-height: 1; }
.feed-sub { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); }
.feed-tags { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.feed-tags span { padding: 3px 10px; border-radius: 12px; background: rgba(255,255,255,.9); font-size: 12px; font-weight: 600; }
[data-feed-buy] { margin-top: 12px; }
[data-feed-buy] .btn[disabled] { opacity: .8; cursor: default; }

/* floating over every card: X and the bag (frost: they float) */
.feed-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2; pointer-events: none;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 0; display: flex; justify-content: space-between;
}
.feed-top > * { pointer-events: auto; }
.feed-x, .feed-bag {
  position: relative; width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer; color: var(--ink);
  display: flex; align-items: center; justify-content: center; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.feed-x .icon, .feed-bag .icon { width: 20px; height: 20px; }
.feed-x .icon { stroke-width: 2; }

/* "That's every card": a quiet screen between the last and the first */
.feed-item.feed-end { display: flex; align-items: center; justify-content: center; }
.feed-end-words { max-width: 330px; padding: 0 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.feed-end-words img { width: 110px; height: auto; }
.feed-end-words h2 { font-size: 34px; }
.feed-end-words p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.feed-end-words .icon { width: 28px; height: 28px; stroke-width: 2; color: var(--accent); margin-top: 8px; }
