/* North Furnishings - shop / category / room / maker / search ("The Floor")
   Signage-scale heading with a live count tag, a segmented room bar,
   selection-row facets and a full-width "Show more" bar. */

/* ---------- Head: signage title, live count tag, search ---------- */
.shop-head { padding-bottom: var(--s-6); }
.shop-head__grid { display: grid; gap: var(--s-5); padding-top: var(--s-3); }
.shop-head__title-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3) var(--s-5); }
.shop-title {
  margin: 0; min-width: 0; overflow-wrap: anywhere;
  font-size: clamp(3rem, 1.3rem + 6.6vw, 7.5rem); font-weight: 900; font-stretch: 62%;
  line-height: 0.86; letter-spacing: -0.02em; text-transform: uppercase;
}
.shop-title:focus { outline: none; }
.shop-title:focus-visible { outline: 3px solid var(--focus); outline-offset: 6px; }
/* The count hangs beside the title like a tag on the floor model */
.shop-count {
  margin: 0 0 0.3em; font-size: clamp(1.6rem, 1.15rem + 1.5vw, 2.5rem);
  transform: rotate(-3deg); transform-origin: 0.6rem 50%;
}
.shop-count__unit { font-size: 1.2rem; font-weight: 800; font-stretch: 75%; letter-spacing: 0.02em; text-transform: uppercase; }
.shop-head__intro { margin: var(--s-4) 0 0; max-width: 54ch; color: var(--fg-2); font-size: var(--step-0); }

.shop-search { display: grid; gap: var(--s-2); }
.shop-search[hidden] { display: none; }
.shop-search .input {
  min-height: 64px; padding-left: 3.25rem; border-width: 2px;
  font-size: 1.15rem; font-weight: 500;
}
.shop-search .search-field svg { left: 1.05rem; width: 24px; height: 24px; }
.shop-search .input::-webkit-search-cancel-button { cursor: pointer; }

@media (min-width: 1000px) {
  .shop-head__grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 27rem); align-items: end; gap: var(--s-7); }
}

/* ---------- Room switcher: one heavy segmented bar ---------- */
.rooms { margin-top: var(--s-6); }
.rooms[hidden] { display: none; }
ul.rooms__list {
  display: flex; gap: 2px; padding: 2px; margin: 0; list-style: none;
  background: var(--fg); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
}
ul.rooms__list::-webkit-scrollbar { display: none; }
.rooms__list > li { flex: 1 0 auto; scroll-snap-align: start; }
.rooms__seg {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  min-height: 56px; height: 100%; padding: 0.5rem 1rem;
  background: var(--bg); color: var(--fg); text-decoration: none; white-space: nowrap;
  font-family: var(--font-display); font-stretch: 75%; font-weight: 800; font-size: 1.1rem;
  letter-spacing: 0.01em; text-transform: uppercase;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.rooms__seg:hover { background: var(--bg-2); }
.rooms__seg[aria-current="page"] { background: var(--fg); color: var(--bg); }
.rooms__seg:focus-visible { outline: 3px solid var(--focus); outline-offset: -6px; }
.rooms__seg:active .rooms__name { transform: translateY(1px); }
.rooms__n { font-family: var(--font-mono); font-stretch: 100%; font-weight: 400; font-size: 0.78rem; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.rooms__seg.is-empty { color: var(--muted); }
@media (min-width: 900px) {
  ul.rooms__list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; }
  .rooms__seg { min-height: 68px; padding-inline: 1.15rem; font-size: clamp(1.15rem, 0.8rem + 0.6vw, 1.45rem); }
}

.shop-noscript { margin-bottom: var(--s-7); }
.no-js .shop-layout { display: none; }

/* ---------- Layout ---------- */
.shop-layout { padding-bottom: var(--section); }
.shop-sidebar { display: none; }
.shop-results { min-width: 0; }
@media (min-width: 1000px) {
  .shop-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: var(--s-7); align-items: start; }
  .shop-sidebar { display: block; position: sticky; top: calc(var(--header-h) + var(--s-4)); }
  .shop-sidebar[hidden] { display: none; }
  .shop-sidebar__inner {
    max-height: calc(100vh - var(--header-h) - var(--s-6)); overflow-y: auto; overscroll-behavior: contain;
    padding: 6px 6px var(--s-5); margin: -6px -6px 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  }
}
@media (min-width: 1280px) { .shop-layout { grid-template-columns: 264px minmax(0, 1fr); gap: var(--s-8); } }

/* ---------- Facets: selection rows (input stays focusable, row is the target) ---------- */
.filters__sort { margin-bottom: var(--s-6); }
.shop-sidebar .filters__sort { display: none; }
.facet { min-width: 0; margin: 0 0 var(--s-6); padding: var(--s-3) 0 0; border: 0; border-top: var(--rule); }
.facet:last-child { margin-bottom: 0; }
.facet__title {
  display: block; float: left; width: 100%; margin: 0 0 var(--s-3); padding: 0;
  font-family: var(--font-mono); font-size: var(--step--2); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg);
}
.facet.field { gap: 0; }
.facet.field .facet__title { float: none; }
.facet__options { clear: both; display: grid; gap: 2px; }
.opt {
  position: relative; display: flex; align-items: center; gap: var(--s-3);
  min-height: 44px; padding: 0.45rem 0.75rem; cursor: pointer;
  color: var(--fg); font-size: 0.98rem; font-weight: 500; line-height: 1.2;
  transition: background-color 0.12s var(--ease), color 0.12s var(--ease);
}
.opt__input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.opt__label { flex: 1 1 auto; min-width: 0; }
.opt__count { flex: 0 0 auto; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.opt:hover { background: var(--bg-2); }
.opt.is-checked, .opt:has(.opt__input:checked) { background: var(--fg); color: var(--bg); box-shadow: inset 6px 0 0 var(--red); padding-left: 1.1rem; font-weight: 600; }
.opt.is-checked .opt__count, .opt:has(.opt__input:checked) .opt__count { color: var(--bg-3); }
.opt:has(.opt__input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; z-index: 1; }
.opt:active .opt__label { transform: translateY(1px); }
.opt.is-empty { color: var(--muted); cursor: default; }
.opt.is-empty:hover { background: transparent; }
@media (pointer: fine) and (min-width: 1000px) { .opt { min-height: 40px; } }
.facet .select { min-height: 48px; }

/* ---------- Toolbar: active chips + compact sort ---------- */
.shop-toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-4);
  padding-top: var(--s-3); border-top: var(--rule);
}
.shop-toolbar:has(.active-filters[hidden]) .shop-sort { margin-left: auto; }
.shop-sort { display: none; }
.shop-sort .select { width: auto; min-width: 13.5rem; min-height: 44px; padding-block: 0.5rem; font-size: 0.95rem; font-weight: 500; }
@media (min-width: 1000px) { .shop-sort { display: grid; margin-left: auto; } }

.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); min-width: 0; }
.active-filters[hidden] { display: none; }
.active-filters__list { display: flex; flex-wrap: wrap; gap: var(--s-2); min-width: 0; }
.chip--remove { max-width: 100%; white-space: normal; text-align: left; padding-right: 0.7rem; }
.chip--remove svg { width: 16px; height: 16px; flex: 0 0 auto; }
.chip--remove:hover { background: var(--fg); color: var(--bg); }
.active-filters__clear {
  min-height: 44px; padding: 0 0.35rem; border: 0; background: none; color: var(--fg);
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; text-decoration-color: var(--red);
}
.active-filters__clear:hover { color: var(--red-ink); }

/* ---------- Grid ---------- */
ul.shop-grid { margin-top: var(--s-6); }
.shop-skel {
  aspect-ratio: 4 / 6.1;
  background:
    linear-gradient(var(--bg-2), var(--bg-2)) 0 0 / 100% 65.5% no-repeat,
    linear-gradient(var(--bg-3), var(--bg-3)) 0 64% / 34% 7% no-repeat,
    linear-gradient(var(--bg-2), var(--bg-2)) 0 80% / 88% 5% no-repeat,
    linear-gradient(var(--bg-2), var(--bg-2)) 0 90% / 56% 4.5% no-repeat;
  animation: shop-pulse 1.3s ease-in-out infinite alternate;
}
@keyframes shop-pulse { from { opacity: 1; } to { opacity: 0.5; } }

/* ---------- Empty / error ---------- */
.shop-empty { margin-top: var(--s-6); padding: var(--s-7) 0 var(--s-6); }
.shop-empty[hidden] { display: none; }
.shop-empty__title {
  max-width: 14ch; margin: 0 0 var(--s-5); overflow-wrap: anywhere;
  font-size: clamp(2.6rem, 1.5rem + 4.4vw, 5.5rem); font-weight: 900; font-stretch: 62%; line-height: 0.9; text-transform: uppercase;
}
.shop-empty__text { color: var(--fg-2); max-width: 46ch; }
.shop-empty__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }
.shop-error { margin-top: var(--s-6); }
.shop-error[hidden] { display: none; }

/* ---------- Show more: full-width bar with a mono readout ---------- */
.shop-more { margin-top: var(--s-8); }
.shop-more[hidden] { display: none; }
.shop-more__btn {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  width: 100%; min-height: 84px; padding: 0.75rem clamp(1rem, 0.6rem + 1.5vw, 2rem);
  border: var(--rule); border-top-width: 6px; background: transparent; color: var(--fg); text-align: left;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.1s var(--ease);
}
.shop-more__btn[hidden] { display: none; }
.shop-more__btn:hover { background: var(--fg); color: var(--bg); }
.shop-more__btn:active { transform: translateY(1px); }
.shop-more__label {
  font-family: var(--font-display); font-stretch: 62%; font-weight: 900; text-transform: uppercase;
  font-size: clamp(1.9rem, 1.3rem + 2vw, 3rem); line-height: 1; letter-spacing: -0.01em;
}
.shop-more__label::after { content: "\2193"; display: inline-block; margin-left: 0.3em; font-stretch: 100%; font-weight: 600; transition: transform 0.25s var(--ease); }
.shop-more__btn:hover .shop-more__label::after { transform: translateY(4px); }
.shop-more__readout { flex: 0 0 auto; font-family: var(--font-mono); font-size: clamp(0.85rem, 0.8rem + 0.3vw, 1.05rem); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.shop-more__readout span:first-child { font-weight: 500; }
.shop-more__status { margin: var(--s-3) 0 0; font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); }

/* ---------- Mobile: sticky "Filter & sort" bar ---------- */
.shop-filterbar {
  position: sticky; bottom: 0; z-index: 30;
  margin: var(--s-7) calc(var(--gutter) * -1) 0; padding-bottom: env(safe-area-inset-bottom);
  background: var(--fg);
}
.shop-filterbar[hidden] { display: none; }
.shop-filterbar__btn {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 60px;
  padding: 0.6rem var(--gutter); border: 0; background: var(--fg); color: var(--bg); text-align: left;
  font-family: var(--font-display); font-stretch: 75%; font-weight: 800; font-size: 1.2rem; letter-spacing: 0.02em; text-transform: uppercase;
}
.shop-filterbar__btn svg { width: 22px; height: 22px; flex: 0 0 auto; }
.shop-filterbar__btn:focus-visible { outline: 3px solid var(--focus); outline-offset: -5px; }
.shop-filterbar__btn:active { transform: translateY(1px); }
.shop-filterbar__n { margin-left: 0.35em; font-family: var(--font-mono); font-stretch: 100%; font-weight: 500; font-size: 0.85em; }
.shop-filterbar__n[hidden] { display: none; }
.shop-filterbar__count { margin-left: auto; font-family: var(--font-mono); font-stretch: 100%; font-weight: 400; font-size: 0.78rem; letter-spacing: 0.02em; text-transform: none; color: var(--bg-3); }
@media (min-width: 1000px) { .shop-filterbar { display: none; } }

/* ---------- Filter drawer (mobile / tablet) ---------- */
html:has(.filter-dialog[open]) { overflow: hidden; }
.filter-dialog {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0; border-left: var(--rule);
  width: min(440px, 100vw); max-width: 100vw; height: 100%; max-height: 100%;
  background: var(--bg); color: var(--fg-2); box-shadow: var(--shadow-pop);
}
.filter-dialog[open] { animation: shop-drawer 0.32s var(--ease); }
.filter-dialog::backdrop { background: rgba(20, 20, 19, 0.55); }
@keyframes shop-drawer { from { transform: translateX(100%); } to { transform: none; } }
.filter-dialog__panel { display: flex; flex-direction: column; height: 100%; }
.filter-dialog__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--gutter); border-bottom: var(--rule);
}
.filter-dialog__head h2 { margin: 0; font-size: 2rem; font-weight: 900; font-stretch: 62%; text-transform: uppercase; line-height: 1; }
.filter-dialog__close { width: 48px; height: 48px; border: 2px solid var(--fg); }
.filter-dialog__body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: var(--s-5) var(--gutter) var(--s-6); }
.filter-dialog__foot {
  display: grid; grid-template-columns: auto 1fr; gap: var(--s-3);
  padding: var(--s-3) var(--gutter) max(var(--s-3), env(safe-area-inset-bottom));
  border-top: var(--rule); background: var(--bg);
}
.filter-dialog__foot .btn { padding-inline: 1rem; }
.shop-sort[hidden] { display: none !important; }
@media (max-width: 599px) { .shop-head__intro { font-size: 0.95rem; } .shop-head__grid { gap: var(--s-4); } .rooms { margin-top: var(--s-5); } }
