/* Public price board — mobile first (frame 3a, 390px), desktop from 1024px (frame 4a, 1440px). */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-black);
  color: var(--color-white);
  font-family: var(--font-numeric);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--color-yellow-500); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1440px; margin-inline: auto; }

@media (max-width: 1023.98px) { .only-d { display: none !important; } }
@media (min-width: 1024px) { .only-m { display: none !important; } }

/* ── Scroll progress ───────────────────────── */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 20;
  background: var(--color-yellow-500);
  transform-origin: right center; transform: scaleX(0);
  pointer-events: none;
}

/* ── Header ────────────────────────────────── */
.hdr { background: var(--color-yellow-500); color: var(--color-black); }
.hdr__in {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 28px 20px 24px;
}
.hdr__logo { order: 2; width: 96px; height: 90px; object-fit: contain; flex: none; }
.hdr__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hdr__title { font-size: 30px; font-weight: 700; line-height: 1.3; }
.hdr__sub { font-size: 14px; color: var(--color-dark-700); }
.hdr__badges { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.hdr__badge {
  font-size: 12px; font-weight: 700; color: var(--color-yellow-500); background: var(--color-black);
  padding: 4px 10px; border-radius: 6px;
}
.hdr__date { font-size: 12px; color: var(--color-dark-700); }

/* ── Tabs ──────────────────────────────────── */
.tabs {
  position: sticky; top: 0; z-index: 10;
  background: var(--color-black);
  border-bottom: 1px solid var(--color-dark-800);
}
.tabs__track {
  position: relative; overflow-x: auto; padding: 16px;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.tabs__track::-webkit-scrollbar { display: none; }
.tabs__list { display: flex; gap: 8px; width: max-content; }
.tabs__indicator {
  position: absolute; top: 0; right: 0; width: 0; height: 0; z-index: 0;
  background: var(--color-yellow-500); border-radius: 999px;
  pointer-events: none; opacity: 0;
}
.tab {
  position: relative; z-index: 1; flex: none;
  height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--color-dark-600);
  background: var(--color-dark-800); color: var(--color-white);
  font-family: var(--font-numeric); font-size: 14px; font-weight: 400;
  cursor: pointer; white-space: nowrap;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.tab__count {
  font-size: 11px; font-weight: 700; color: var(--color-gray-400); background: var(--color-dark-700);
  border-radius: 999px; padding: 1px 7px; min-width: 24px; text-align: center;
  transition: background 200ms ease, color 200ms ease;
}
.tab[aria-pressed="true"] { color: var(--color-black); font-weight: 700; background: var(--color-yellow-500); border-color: var(--color-yellow-500); }
.tab[aria-pressed="true"] .tab__count { color: var(--color-black); background: rgba(0, 0, 0, .12); }
.has-indicator .tab[aria-pressed="true"] { background: transparent; border-color: transparent; }
.has-indicator .tabs__indicator { opacity: 1; }

/* ── Content ───────────────────────────────── */
.content { display: flex; flex-direction: column; gap: 16px; padding: 20px 16px 28px; min-width: 0; }
.sections { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--color-dark-800); border-radius: 12px; padding: 16px; }
.sec { scroll-margin-top: 90px; }
.sec__head { padding-bottom: 12px; }
.sec__title { font-size: 18px; font-weight: 700; color: var(--color-yellow-500); }
.sec__count { font-size: 13px; color: var(--color-gray-400); }

.price { font-weight: 700; white-space: nowrap; }
.price--ask { font-size: 13px !important; color: var(--color-gray-400) !important; }
.price--out {
  font-size: 12px !important; color: var(--color-gray-400) !important;
  border: 1px solid var(--color-dark-600); border-radius: 999px; padding: 2px 10px; line-height: 1.6;
}
.item.is-out .item__name { color: var(--color-gray-400); }
.carton { font-size: 11px; font-weight: 400; color: var(--color-gray-400); white-space: nowrap; }

/* Matrix (cabinet legs) */
.mx__row {
  display: grid; grid-template-columns: 56px repeat(var(--cols, 2), minmax(0, 1fr)); gap: 8px;
  align-items: center; min-height: 46px; border-bottom: 1px solid var(--color-dark-700);
}
.mx__row--head { min-height: 0; padding: 8px 0; border-bottom-color: var(--color-dark-600); }
.mx__row--head span { font-size: 12px; color: var(--color-gray-400); }
.mx__size { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 3px; padding-block: 6px; }
.mx__carton { flex-basis: 100%; line-height: 1.4; }
.mx__size b { font-size: 18px; font-weight: 700; }
.mx__size small { font-size: 11px; color: var(--color-gray-400); }
.mx .price { font-size: 15px; }

/* List (hinges) */
.sec--list .sec__head { padding-bottom: 4px; }
.item {
  min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--color-dark-700);
}
.item__main { display: flex; flex-direction: column; min-width: 0; padding-block: 6px; }
.item__name { font-size: 14px; line-height: 1.5; }
.item__dots { display: none; }
.item__tag { display: none; }
.item__price { font-size: 15px; color: var(--color-yellow-500); }

/* Cards layout on mobile (rollers & magnets) */
@media (max-width: 1023.98px) {
  .sec--cards { background: none; padding: 0; }
  .sec--cards .sec__head { padding: 4px 0 12px; }
  .sec--cards .list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .sec--cards .item {
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 8px;
    background: var(--color-dark-800); border-radius: 12px; padding: 16px; border: 0; min-height: 0;
  }
  .sec--cards .item__tag { display: block; font-size: 12px; font-weight: 700; color: var(--color-yellow-500); }
  .sec--cards .item__main { padding: 0; }
  .sec--cards .item__price { font-size: 18px; color: var(--color-white); }
}

/* Tablet: two columns for lists */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .sec--list:not(.sec--cards) .list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .sec--cards .list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Error / empty state ───────────────────── */
.state { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 48px 16px; text-align: center; }
.state__text { color: var(--color-gray-400); font-size: 15px; }
.state__retry {
  height: 44px; padding: 0 24px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--color-yellow-500); color: var(--color-black); font-weight: 700;
}
.is-loading .sections::before {
  content: ''; display: block; height: 320px; border-radius: 12px;
  background: linear-gradient(90deg, var(--color-dark-800) 0%, var(--color-dark-700) 50%, var(--color-dark-800) 100%);
  background-size: 200% 100%;
}

/* ── Footer ────────────────────────────────── */
.ftr { border-top: 3px solid var(--color-yellow-500); }
.ftr__in { display: flex; flex-direction: column; gap: 18px; padding: 24px 20px calc(32px + env(safe-area-inset-bottom)); }
.ftr__heading { font-size: 20px; font-weight: 700; }
.ftr__blurb { font-size: 14px; color: var(--color-gray-400); line-height: 1.7; }
.ftr__col { display: flex; flex-direction: column; gap: 4px; }
.ftr__label { font-size: 12px; color: var(--color-gray-400); }
.ftr__text { font-size: 14px; line-height: 1.7; }
.ftr__site { font-size: 15px; font-weight: 700; text-decoration: none; direction: ltr; text-align: right; }
.ftr__phones { gap: 10px; }
.phone {
  height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 8px; text-decoration: none; font-size: 18px; font-weight: 700;
  border: 1px solid var(--color-yellow-500); color: var(--color-yellow-500);
  transition: transform 150ms ease, box-shadow 200ms ease;
}
.phone:first-of-type { background: var(--color-yellow-500); color: var(--color-black); }
.phone:active { transform: scale(.97); }
.phone__num { direction: ltr; }

/* ── Desktop ───────────────────────────────── */
@media (min-width: 1024px) {
  .hdr { background: var(--color-black); color: var(--color-white); border-bottom: 3px solid var(--color-yellow-500); }
  .hdr__in { height: 96px; padding: 0 48px; justify-content: flex-start; gap: 18px; }
  .hdr__logo { order: 0; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
  .hdr__text { gap: 0; }
  .hdr__title { font-size: 24px; line-height: 1.4; }
  .hdr__meta { font-size: 13px; color: var(--color-gray-400); }

  .layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 60vh; }
  .tabs { position: static; border-bottom: 0; border-left: 1px solid var(--color-dark-800); background: none; }
  .tabs__in { position: sticky; top: 0; padding: 32px 24px; display: flex; flex-direction: column; }
  .tabs__label { font-size: 12px; font-weight: 700; color: var(--color-gray-500); padding: 0 14px 10px; }
  .tabs__track { overflow: visible; padding: 0; }
  .tabs__list { flex-direction: column; gap: 6px; width: auto; }
  .tabs__indicator { border-radius: 8px; }
  .tab {
    height: 48px; justify-content: space-between; gap: 10px; border: 0; border-radius: 8px;
    background: transparent; font-size: 15px; text-align: right;
  }
  .tab:hover:not([aria-pressed="true"]) { background: var(--color-dark-800); }
  .tab__count { font-size: 12px; padding: 1px 8px; min-width: 28px; }

  .content { padding: 32px 48px 48px; gap: 24px; }
  .content__head { display: flex; align-items: baseline; gap: 14px; }
  .content__title { font-size: 32px; font-weight: 700; }
  .content__count { font-size: 15px; color: var(--color-gray-400); }
  .sections { gap: 24px; }

  .card { padding: 24px 28px 12px; display: flex; flex-direction: column; }
  .sec__head, .sec--list .sec__head {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 12px; border-bottom: 1px solid var(--color-dark-600);
  }
  .sec__title { font-size: 20px; }

  .mx__row { grid-template-columns: 160px repeat(var(--cols, 2), minmax(0, 1fr)); gap: 24px; min-height: 52px; padding: 0 4px; transition: background 200ms ease; }
  .mx__row:not(.mx__row--head):hover { background: #222; }
  .mx__row--head { padding: 12px 4px; }
  .mx__row--head span { font-size: 13px; }
  .mx__size { gap: 4px; }
  .mx__size small { font-size: 12px; }
  .mx .price { font-size: 18px; }

  .list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
  .item { min-height: 56px; justify-content: flex-start; gap: 14px; padding: 0 4px; transition: background 200ms ease; }
  .item:hover { background: #222; }
  .item__name { font-size: 16px; }
  .carton { font-size: 12px; }
  .item__dots { display: block; flex: 1; min-width: 16px; border-bottom: 1px dotted var(--color-dark-600); }
  .item__price { font-size: 18px; color: var(--color-white); }

  .ftr__in {
    display: grid; grid-template-columns: 272px repeat(3, minmax(0, 1fr)); gap: 32px; align-items: start;
    padding: 40px 48px;
  }
  .ftr__intro { display: flex; flex-direction: column; gap: 6px; }
  .ftr__heading { font-size: 24px; }
  .ftr__col { gap: 8px; }
  .ftr__label { font-size: 13px; }
  .ftr__text { font-size: 15px; }
  .ftr__site { font-size: 18px; transition: color 200ms ease; }
  .ftr__site:hover { color: var(--color-yellow-500); }
  .phone, .phone:first-of-type {
    height: auto; justify-content: flex-start; border: 0; background: none;
    color: var(--color-yellow-500); font-size: 24px;
  }
  .phone__num { text-align: right; }
}

/* ── Motion ─────────────────────────────────
   `.motion` is set by JS only when motion is allowed, so content never stays hidden without JS. */
.tabs__indicator { left: 0; right: auto; }
.price.flash { animation: flash 1.6s ease-out; border-radius: 4px; }
@keyframes flash {
  0%, 25% { background: var(--color-yellow-500); color: var(--color-black); box-shadow: 0 0 0 4px var(--color-yellow-500); }
  100% { background: transparent; box-shadow: 0 0 0 4px transparent; }
}

@media (prefers-reduced-motion: no-preference) {
  .tabs__indicator {
    transition: transform 340ms cubic-bezier(.3, .8, .25, 1), width 340ms cubic-bezier(.3, .8, .25, 1),
      height 340ms cubic-bezier(.3, .8, .25, 1), opacity 200ms ease;
  }
  .tabs__indicator.no-anim { transition: none; }
  .tab:active { transform: scale(.97); }

  .motion .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 500ms cubic-bezier(.2, .7, .2, 1) var(--d, 0ms), transform 600ms cubic-bezier(.2, .7, .2, 1) var(--d, 0ms);
  }
  .motion .sec.reveal { transform: translateY(28px) scale(.985); }
  .motion .reveal.is-in { opacity: 1; transform: none; }

  /* Page entrance */
  .intro .hdr__logo { animation: logo-in 900ms cubic-bezier(.2, .9, .25, 1.2) both; }
  .intro .hdr__text > * { animation: rise 600ms cubic-bezier(.2, .7, .2, 1) both; }
  .intro .hdr__text > :nth-child(2) { animation-delay: 90ms; }
  .intro .hdr__text > :nth-child(3) { animation-delay: 180ms; }
  .intro .hdr__text > :nth-child(4) { animation-delay: 270ms; }
  .intro .tab { animation: rise 500ms cubic-bezier(.2, .7, .2, 1) both; }
  .intro .tab:nth-child(2) { animation-delay: 60ms; }
  .intro .tab:nth-child(3) { animation-delay: 120ms; }
  .intro .tab:nth-child(4) { animation-delay: 180ms; }
  .intro .tab:nth-child(5) { animation-delay: 240ms; }
  .intro .tab:nth-child(n+6) { animation-delay: 300ms; }
  .intro .tabs__indicator { animation: fade-in 500ms 200ms both; }
  .intro .content__head { animation: rise 600ms 150ms cubic-bezier(.2, .7, .2, 1) both; }

  /* Scroll progress (scroll-driven, no JS) */
  @supports (animation-timeline: scroll()) {
    .progress { animation: progress linear both; animation-timeline: scroll(root); }
  }

  /* Category switch */
  :root { view-transition-name: none; }
  .content { view-transition-name: board-content; }
  ::view-transition-old(board-content) { animation: vt-out 180ms ease-in both; }
  ::view-transition-new(board-content) { animation: vt-in 380ms cubic-bezier(.2, .7, .2, 1) both; }
  ::view-transition-group(board-content) { animation-duration: 380ms; }
}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes logo-in { from { opacity: 0; transform: scale(.6) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }
