/* ===========================================================================
   JUST CREATE — the shop page
   ========================================================================= */

.shop-head { padding-block: clamp(1.5rem, 4vw, 2.6rem) 1.2rem; }
.shop-head h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: .2em; }
.shop-head p { margin: 0; font-size: .9rem; }

/* ---- the bar over the grid --------------------------------------------- */
.shop-bar {
  display: flex;
  gap: .7rem;
  align-items: center;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 1.6rem;
}
.search-box { flex: 1 1 auto; min-width: 0; }
.sort-box { flex: 0 0 auto; width: 190px; }
.filter-toggle { display: none; flex: 0 0 auto; }

/* ---- the two-column layout ---------------------------------------------- */
.shop-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}
.shop-results { min-width: 0; }

.filters {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  /* Its own scroll, so a long filter list never pushes the grid down and
     never traps the page. */
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding-right: .3rem;
}
.filter-group h4 {
  color: var(--ink-muted);
  font-size: .72rem;
  margin-bottom: .7rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--hairline);
}
.filter-body { display: flex; flex-direction: column; gap: .1rem; }

.filter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  width: 100%;
  background: none;
  border: 0;
  padding: .46rem .3rem;
  margin-inline: -.3rem;
  color: var(--ink-body);
  font: inherit;
  font-size: .92rem;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color var(--quick), background var(--quick);
}
.filter-link em { font-style: normal; color: var(--ink-faint); font-size: .8rem; }
.filter-link:hover { color: var(--ink); background: var(--paper-3); }
.filter-link.is-on { color: var(--ocean); }
.filter-link.is-on em { color: var(--ocean-mid); }

.filter-sublabel {
  font-size: .74rem;
  color: var(--ink-faint);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: .5rem;
  display: block;
}

/* ---- size chips ---------------------------------------------------------
   44px targets. A size chip is the single most-tapped control on a clothing
   shop and a 30px one is a mis-tap on a phone. */
.size-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.size-chip {
  min-width: 44px;
  height: 40px;
  padding: 0 .55rem;
  background: var(--paper-3);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--ink-body);
  font-family: var(--display);
  font-size: .84rem;
  font-weight: 500;
  letter-spacing: .04em;
  cursor: pointer;
  transition: all var(--quick);
}
.size-chip:hover { border-color: var(--hairline-2); color: var(--ink); }
.size-chip.is-on {
  background: var(--ocean);
  border-color: var(--ocean);
  color: var(--on-ocean);
}
/* Nothing in this size right now. It stays clickable — a shopper is allowed
   to ask — but it does not pretend to be stocked. */
.size-chip.is-empty { color: var(--ink-faint); border-style: dashed; }
.size-chip.is-empty.is-on { color: var(--on-ocean); border-style: solid; }

/* ---- colour swatches ----------------------------------------------------- */
.swatch-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.swatch {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--hairline-2);
  background: var(--swatch);
  cursor: pointer;
  position: relative;
  transition: transform var(--quick);
}
.swatch:hover { transform: scale(1.08); }
.swatch.is-on::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--ocean);
}

/* ---- checkboxes ---------------------------------------------------------- */
.check {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .92rem;
  color: var(--ink-body);
  cursor: pointer;
  margin: 0;
  padding: .4rem 0;
  min-height: 40px;
}
.check input { width: 17px; height: 17px; accent-color: var(--ocean); flex: 0 0 auto; }
.check-note { font-style: normal; color: var(--ink-faint); font-size: .8rem; }

/* ---- the sheet's header (phones only; see the media query below) -------- */
.filter-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .4rem;
}
.filter-head h3 { margin: 0; }
.filter-done { display: none; }

/* ---- active filter chips -------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.3rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--paper-3);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--ink-body);
  font: inherit;
  font-size: .82rem;
  padding: .4rem .6rem;
  min-height: 34px;
  cursor: pointer;
  transition: border-color var(--quick), color var(--quick);
}
.chip:hover { border-color: var(--danger); color: var(--ink); }
.chip-x { color: var(--ink-faint); font-size: 1.05rem; line-height: 1; }

/* ---- sold out ------------------------------------------------------------
   Faded but still legible, and still a link. Somebody looking for a piece
   needs to know it exists and is coming back, not that it never existed. */
.card.is-sold .card-media img { opacity: .38; }
.card.is-sold .card-name { color: var(--ink-muted); }

/* =========================================================================
   MOBILE — the filter becomes a full-screen sheet
   ========================================================================= */
@media (max-width: 880px) {
  .shop-layout { grid-template-columns: 1fr; }
  .filter-toggle { display: inline-flex; }
  .sort-box { width: 150px; }

  .filters {
    position: fixed;
    inset: 0;
    z-index: 95;
    max-height: none;
    background: var(--paper);
    padding: 1.4rem var(--gutter) 6rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: none;
    gap: 1.9rem;
  }
  body.filters-open { overflow: hidden; }
  body.filters-open .filters { display: flex; }

  /* The sheet's own header and confirm bar — see the note in shop.js. */
  .filter-head { display: flex; }
  .filter-done {
    display: block;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 97;
    padding: .9rem var(--gutter) calc(.9rem + env(safe-area-inset-bottom));
    background: var(--paper-2);
    border-top: 1px solid var(--hairline);
  }
  /* Room for the fixed bar, so the last filter is not permanently hidden
     behind it — a control you cannot scroll to is a control that is not
     there. */
  body.filters-open .filters { padding-bottom: 7rem; }
}

@media (max-width: 520px) {
  .shop-bar { flex-wrap: wrap; }
  .search-box { flex: 1 1 100%; order: -1; }
  .sort-box { flex: 1 1 auto; width: auto; }
}
