.shop {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 46px;
  padding-block: 60px var(--section-pad);
  align-items: start;
}

/* Sidebar ----------------------------------------------------------------- */
.shop__side-inner { position: sticky; top: calc(var(--header-h) + 20px); }
.filter + .filter { margin-top: 34px; }
/* MEASURED: Tenor Sans 20px, weight 500, letter-spacing normal, black. */
.filter__head {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: normal;
  color: #000;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.filter__list { display: grid; gap: 10px; }
.filter__sub { display: grid; gap: 8px; margin: 8px 0 14px 18px; }

/* MEASURED: Nunito 13px, weight 400, letter-spacing normal, uppercase, #222. */
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: normal;
  text-transform: uppercase;
  color: var(--ink);
}
.check:hover { color: var(--brand); }
.check input {
  appearance: none;
  width: 14px; height: 14px;
  flex: none;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
}
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after {
  content: "";
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-1px);
}
.check__n { margin-left: auto; opacity: 0.65; font-size: 13px; }
.filter__sub .check { font-size: 13px; color: var(--ink-muted); }

.filter__range { width: 100%; accent-color: var(--brand); margin: 6px 0 10px; }
.filter__pricelabel { font-size: 12px; color: var(--ink-muted); margin-bottom: 14px; }
.filter__pricelabel strong { color: var(--brand); }

/* Toolbar ----------------------------------------------------------------- */
.shop__bar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.shop__filtertoggle { display: none; padding: 10px 18px; }
.shop__density { display: flex; gap: 6px; }
.shop__dbtn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid transparent;
}
.shop__dbtn.is-on { border-color: var(--line); background: var(--surface); }
.shop__dicon { display: flex; gap: 2px; }
.shop__dicon i { display: block; width: 3px; height: 13px; background: var(--ink-muted); }
.shop__dbtn.is-on .shop__dicon i { background: var(--brand); }

/* MEASURED: Nunito 14px, uppercase. */
.shop__count { margin: 0 0 0 auto; font-size: 13px; text-transform: uppercase; color: var(--ink); }
/* MEASURED: the reference's orderby is 135x32 - 13px on a rgba(0,0,0,.1)
   hairline with 5px/8px padding. This was 195x38 at 14px, half again as wide. */
.shop__sort {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--surface);
  padding: 5px 26px 5px 8px;
  font-size: 13px;
  letter-spacing: normal;
  text-transform: uppercase;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
                    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* Grid density ------------------------------------------------------------ */
#shopGrid[data-density="2"] { grid-template-columns: repeat(2, 1fr); }
#shopGrid[data-density="3"] { grid-template-columns: repeat(3, 1fr); }
#shopGrid[data-density="4"] { grid-template-columns: repeat(4, 1fr); }
#shopGrid[data-density="5"] { grid-template-columns: repeat(5, 1fr); }
.shop__item[hidden] { display: none; }

.shop__empty { text-align: center; padding: 70px 0; color: var(--ink-muted); }

@media (max-width: 1199px) {
  #shopGrid[data-density="5"], #shopGrid[data-density="4"] { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991px) {
  .shop { grid-template-columns: 1fr; gap: 0; }
  .shop__filtertoggle { display: inline-flex; }
  .shop__side {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--dur) var(--ease);
  }
  .shop__side.is-open { max-height: 1400px; margin-bottom: 34px; }
  .shop__side-inner { position: static; padding-top: 24px; }
  #shopGrid[data-density="5"], #shopGrid[data-density="4"], #shopGrid[data-density="3"] {
    grid-template-columns: repeat(2, 1fr);
  }
  .shop__count { width: 100%; margin-left: 0; order: 5; }
}
/* MEASURED at 353px: the reference's shop listing is ONE column on a phone -
   every card sits at x=12 with the full 314px width. This build showed two. */
@media (max-width: 575px) {
  #shopGrid[data-density] { grid-template-columns: 1fr; gap: 30px; }
  .shop__density { display: none; }
}

/* Category pages ---------------------------------------------------------- */
.catpage { padding-block: 50px var(--section-pad); }
.catpage__blurb { color: var(--ink-muted); max-width: 60ch; margin-bottom: 28px; }
.catpage__subs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.catpage__sub {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 16px;
  font-size: 13px;
  letter-spacing: normal;
  text-transform: uppercase;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.catpage__sub:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.catpage__subn { opacity: 0.6; margin-left: 4px; }
.catpage__count {
  font-size: 14px;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-bottom: 18px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

/* ==========================================================================
   Shop layout variants
   Driven by shopLayouts.json through shop-body.njk. Each class here is what
   actually makes a variant different - without them all nine would render
   identically and the pages would be pointless.
   ========================================================================== */

/* Sidebar side ------------------------------------------------------------ */
.shop--side-right { grid-template-columns: minmax(0, 1fr) 260px; }
.shop--side-right .shop__side { order: 2; }
.shop--side-right .shop__main { order: 1; }

/* No sidebar column at all - filters come from a toggle or a drawer. */
.shop--side-none { grid-template-columns: minmax(0, 1fr); }
.shop--side-none .shop__side-inner { position: static; }

/* Filter presentation ------------------------------------------------------ */
/* Always-visible sidebar: hide the toggle button - but ONLY on desktop, where
   the sidebar really is always visible. Below 992px the responsive rule
   collapses that sidebar to max-height:0, so hiding the toggle there left the
   filters completely unreachable on a phone. */
@media (min-width: 992px) {
  .shop--filters-static .shop__filtertoggle { display: none; }
}

/* Collapsible panel above the grid. */
.shop--filters-toggle .shop__filtertoggle { display: inline-flex; }
.shop--filters-toggle .shop__side {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur) var(--ease);
}
.shop--filters-toggle .shop__side.is-open { max-height: 1600px; margin-bottom: 30px; }
.shop--filters-toggle .shop__side-inner { padding-top: 24px; }
.shop--filters-toggle .filter__list { columns: 2; column-gap: 30px; }
.shop--filters-toggle .filter__list > li { break-inside: avoid; }

/* Off-canvas drawer, sliding from either edge. */
.shop--filters-drawer-left .shop__filtertoggle,
.shop--filters-drawer-right .shop__filtertoggle { display: inline-flex; }
.shop--filters-drawer-left .shop__side,
.shop--filters-drawer-right .shop__side {
  position: fixed;
  top: 0; bottom: 0;
  width: min(86vw, 330px);
  background: var(--bg);
  z-index: 95;
  padding: 26px 24px 60px;
  overflow-y: auto;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.16);
  transition: transform var(--dur) var(--ease);
}
.shop--filters-drawer-left .shop__side { left: 0; transform: translateX(-100%); }
.shop--filters-drawer-right .shop__side { right: 0; transform: translateX(100%); }
.shop--filters-drawer-left .shop__side.is-open,
.shop--filters-drawer-right .shop__side.is-open { transform: translateX(0); }
.shop--filters-drawer-left .shop__side-inner,
.shop--filters-drawer-right .shop__side-inner { position: static; }

/* Column counts ----------------------------------------------------------- */
#shopGrid[data-density="6"] { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1399px) { #shopGrid[data-density="6"] { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1199px) { #shopGrid[data-density="6"] { grid-template-columns: repeat(3, 1fr); } }

@media (max-width: 991px) {
  .shop--side-right { grid-template-columns: 1fr; }
  .shop--side-right .shop__side { order: 1; }
  .shop--side-right .shop__main { order: 2; }
  #shopGrid[data-density="6"] { grid-template-columns: repeat(2, 1fr); }
}

/* Pagination ---------------------------------------------------------------
   MEASURED off the reference: 35px squares, 13px, square corners. The current
   page is filled maroon with bone text; the rest sit on a transparent ground
   with a rgba(0,0,0,.1) hairline and black text. A next arrow closes the row.
   -------------------------------------------------------------------------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 40px;
}
.pager__btn {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  color: #000;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.pager__btn:hover { border-color: var(--brand); color: var(--brand); }
.pager__btn.is-current {
  background: var(--brand);
  border-color: var(--brand);
  color: #f0efea;
}
