/* jee.com.ua — головна. Статичний HTML + CSS, адаптив через медіазапити.
   Точки зламу: 1024px, 760px, 480px. */

/* Self-hosted fonts (was Google Fonts <link>s in layout.html) — avoids the
   render-blocking googleapis.com -> gstatic.com chain PageSpeed flagged.
   Only the cyrillic and latin subsets are kept (site is Ukrainian + digits/
   punctuation); Commissioner and Unbounded ship as variable fonts, so one
   file per subset covers every weight used on the site. */
@font-face {
  font-family: 'Commissioner';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('fonts/commissioner-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Commissioner';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('fonts/commissioner-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/unbounded-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/unbounded-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Material Symbols Rounded';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('fonts/material-symbols-rounded.woff2') format('woff2');
}

:root {
  --ink: #3a3228;
  --ink-soft: #5f584d;
  --ink-muted: #7b7367;
  --bg: #f8f4ec;
  --white: #ffffff; /* = --surface, лишено для сумісності */
  --line: #e4dcd0;
  --accent: #c25a33;
  --accent-dark: #a2472a;
  --sand: #f1e4c8;
  --sand-soft: #f4ead3;
  --dark: #3a3228;
  --ok: #2f9e64;
  --hero-eyebrow: #7a6a4f;
  --surface: #ffffff;
  --surface-2: #faf6ee;
  --surface-3: #efe7d8;
  --hatch-a: #f4eee4;
  --hatch-b: #ece5d9;
  --chip-bg: #f6eedd;
  --chip-line: #ded2be;
  --ghost-line: #9b9285;
  --reset-line: #b6ab9b;
  --fill-bg: #3a3228;
  --fill-fg: #ffffff;
  --on-accent: #ffffff;
  --accent-soft: #f8ebe2;
  --on-dark: #f6f2ea;
  --on-dark-soft: #cfc7bb;
  --on-dark-muted: #d6cec2;
  --dark-accent: #e8b27c;
  --star: #d59c3c;
  --ok-text: #3d8a5e;
  --warn-text: #9a6a57;
  --status-bg: #eef0ea;
  --status-done-bg: #e3f1e7;
  --status-done-fg: #2f6f47;
  --status-way-bg: #f6eedd;
  --status-way-fg: #92601f;
  --bar-bg: rgba(255, 255, 255, 0.94);
  --glass: rgba(255, 255, 255, 0.92);
  --shadow-soft: rgba(58, 50, 40, 0.16);
  --shadow-fab: rgba(58, 50, 40, 0.22);
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-text: 'Commissioner', system-ui, -apple-system, sans-serif;
  --r-lg: 20px;
  --r-md: 16px;
  --r-sm: 14px;
  --pad: 20px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
input, button, select, textarea { font: inherit; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; margin: 0; }

.ms {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  display: block;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Каркас ---------- */

.page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--pad) 80px;
}

.section { margin-top: 64px; }
.section--tight { margin-top: 20px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.section-title { font-size: 30px; line-height: 1.15; text-wrap: balance; }
.section-link { font-size: 15px; white-space: nowrap; }

/* ---------- Верхня плашка ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  row-gap: 3px;
  padding: 10px 14px;
  margin: 0 calc(var(--pad) * -1);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13.5px;
  line-height: 1.45;
  text-align: center;
}
.topbar span + span { position: relative; }
.topbar .dot { opacity: 0.55; }

/* ---------- Хедер ---------- */

.header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  flex-wrap: wrap;
  row-gap: 12px;
}

.logo { display: flex; flex-direction: column; gap: 3px; color: var(--ink); flex: none; margin-right: auto; }
.logo:hover { color: var(--ink); }
.logo__word { font-family: var(--font-display); font-weight: 700; font-size: 30px; letter-spacing: -0.045em; line-height: 1; }
.logo__word i { color: var(--accent); font-style: normal; }
.logo__sub { font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-muted); }

.search {
  flex: 1 1 240px;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 18px;
}
.search .ms { font-size: 20px; color: var(--ink-muted); flex: none; }
.search input {
  flex: 1; min-width: 0; border: none; outline: none;
  background: transparent; color: inherit; font-size: 16px; /* див. коментар біля .chat-panel__input input — iOS zoom-on-focus */
}

.nav { display: flex; align-items: center; gap: 20px; font-size: 15px; flex: none; }
.nav__link { color: var(--ink-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  background: none;
  color: inherit;
}
.btn--dark { background: var(--fill-bg); color: var(--fill-fg); }
.btn--dark:hover { background: var(--accent); color: var(--on-accent); }
.btn--ghost { border-color: var(--ghost-line); color: var(--ink); }
.btn--ghost:hover { background: var(--sand-soft); color: var(--ink); }
.btn .ms { font-size: 20px; transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--cart { min-height: 44px; padding: 11px 18px; }
.cart-count {
  background: var(--fill-fg); color: var(--fill-bg); border-radius: 999px;
  min-width: 20px; height: 20px; display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}

/* Кнопка теми: у .nav на десктопі, у .icon-actions на мобільному */
.nav .icon-btn { width: 44px; height: 44px; }
.nav .icon-btn .ms { color: var(--ink-soft); }

/* Іконкові кнопки — тільки для мобільного хедера */
.icon-actions { display: none; gap: 8px; flex: none; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  padding: 0; cursor: pointer; position: relative;
}
.icon-btn .ms { font-size: 21px; color: var(--accent); transform: translateY(1px); }
.icon-btn--dark { background: var(--fill-bg); border-color: var(--fill-bg); }
.icon-btn--dark .ms { color: var(--fill-fg); }
.icon-btn__badge {
  position: absolute; top: -2px; right: -3px;
  background: var(--accent); color: var(--on-accent);
  border-radius: 999px; min-width: 19px; height: 19px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; border: 2px solid var(--bg);
}

/* ---------- Герой ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 8px;
  align-items: stretch;
}

.hero__text {
  background: var(--sand);
  border-radius: var(--r-lg);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 400px;
}
.hero__eyebrow {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--hero-eyebrow); margin-bottom: 16px;
}
.hero__title { font-size: 46px; line-height: 1.08; letter-spacing: -0.025em; margin-bottom: 14px; text-wrap: balance; }
.hero__lead { margin: 0; font-size: 17px; line-height: 1.55; color: var(--ink-soft); max-width: 40ch; text-wrap: pretty; }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.slider {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 400px;
  background: var(--hatch-b);
}
.slider__slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.slider__slide.is-active { opacity: 1; }
.slider__dots { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 7px; }
.slider__dots span {
  width: 8px; height: 8px; border-radius: 50%; background: #fff;
  opacity: 0.4; box-shadow: 0 1px 4px var(--shadow-fab);
  border: none; padding: 0; cursor: pointer;
}
.slider__dots span.is-active { opacity: 1; }

/* ---------- Переваги ---------- */

.usps {
  background: var(--sand-soft);
  border-radius: var(--r-md);
  padding: 22px 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 36px;
}
.usp { display: flex; gap: 13px; align-items: flex-start; }
.usp .ms { font-size: 25px; color: var(--accent); flex: none; transform: translateY(-1px); }
.usp__title { font-weight: 600; font-size: 15px; margin-bottom: 3px; }
.usp__text { font-size: 13.5px; color: var(--ink-muted); line-height: 1.45; }

/* ---------- Категорії ---------- */

.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat { display: flex; flex-direction: column; gap: 9px; color: inherit; }
.cat:hover { color: inherit; }
.cat:hover .cat__name { color: var(--accent); }
.cat__media {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--hatch-a) 0 10px, var(--hatch-b) 10px 20px);
}
.cat__media img { width: 100%; height: 100%; object-fit: cover; }
.cat__label { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.cat__name { font-weight: 600; font-size: 16px; line-height: 1.3; }
.cat__count { font-size: 12.5px; color: var(--ink-muted); }

/* ---------- Товари ---------- */

.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card__media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--hatch-a) 0 12px, var(--hatch-b) 12px 24px);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__fav {
  position: absolute; top: 8px; right: 8px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--glass);
  display: flex; align-items: center; justify-content: center;
  padding: 0; cursor: pointer;
}
.card__fav:hover { border-color: var(--accent); }
.card__fav .ms { font-size: 19px; color: var(--accent); transform: translateY(1px); }
.card__badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--accent); color: var(--on-accent);
  font-size: 11.5px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px;
}
.card__body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__cat { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); }
.card__name { font-size: 16px; line-height: 1.35; font-weight: 500; flex: 1; color: inherit; text-wrap: pretty; }
.card__name:hover { color: var(--accent); }
.card__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; row-gap: 8px; flex-wrap: wrap; margin-top: 2px;
}
.card__price { font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.card__add {
  border: none; background: var(--surface-3); color: var(--ink);
  font-size: 13.5px; font-weight: 500;
  padding: 0 14px; min-height: 40px; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
}
.card__add:hover { background: var(--accent); color: var(--on-accent); }

/* ---------- Як замовити ---------- */

.steps {
  background: var(--dark);
  color: var(--on-dark);
  border-radius: var(--r-lg);
  padding: 44px 40px;
}
.steps h2 { font-size: 30px; margin-bottom: 8px; }
.steps__lead { margin: 0 0 30px; font-size: 16px; color: var(--on-dark-soft); max-width: 56ch; text-wrap: pretty; }
.steps__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step .ms { font-size: 28px; color: var(--dark-accent); flex: none; }
.step__title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.step__text { font-size: 15px; line-height: 1.55; color: var(--on-dark-muted); text-wrap: pretty; }

/* ---------- Заклик ---------- */

.help {
  background: var(--sand);
  border-radius: var(--r-lg);
  padding: 32px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.help__title { font-family: var(--font-display); font-weight: 600; font-size: 22px; margin-bottom: 8px; text-wrap: balance; }
.help__text { font-size: 16px; line-height: 1.5; color: var(--ink-soft); max-width: 46ch; text-wrap: pretty; }
.help__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Футер ---------- */

.footer {
  margin-top: 56px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 36px;
  font-size: 14.5px;
  color: var(--ink-muted);
}
.footer__col { display: flex; flex-direction: column; gap: 9px; }
.footer__brand { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--ink); }
.footer__title { font-weight: 600; color: var(--ink-soft); }
.footer__hours { font-size: 13.5px; }

/* ---------- Чат ---------- */

.chat-dock {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  max-width: calc(100vw - 24px);
}

.chat-panel {
  width: min(330px, calc(100vw - 28px));
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 40px var(--shadow-soft);
}
.chat-panel[hidden] { display: none; }
.chat-panel__head { background: var(--dark); color: var(--on-dark); padding: 15px 18px; }
.chat-panel__title { font-weight: 600; font-size: 16px; }
.chat-panel__status { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--on-dark-soft); margin-top: 4px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: block; }
.status-dot.is-offline { background: var(--ink-muted); }
.chat-panel__body {
  padding: 16px; display: flex; flex-direction: column; gap: 11px; background: var(--surface-2);
  min-height: 320px; max-height: 50vh; overflow-y: auto;
}
.bubble { font-size: 14px; line-height: 1.5; max-width: 86%; padding: 12px 14px; text-wrap: pretty; }
.bubble--in { background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; }
.bubble--out { align-self: flex-end; background: var(--sand); border-radius: 14px 14px 4px 14px; }
.chat-panel__channels {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-muted);
}
.chat-panel__channels a { font-weight: 500; }
.chat-panel__input { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
/* 16px, не 14px: iOS Safari/WebKit (і Brave на ньому) масштабує сторінку
   при фокусі на полі з font-size < 16px і не скидає той zoom назад —
   саме це і виглядало як "зум", що зникав лише після повороту екрана. */
.chat-panel__input input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 16px; color: inherit; }
.chat-send {
  width: 40px; height: 40px; border-radius: 50%; border: none; flex: none;
  background: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.chat-send .ms { font-size: 20px; color: var(--on-accent); }

.chat-fab {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--fill-bg); color: var(--fill-fg); border: none;
  font-size: 16px; font-weight: 500;
  padding: 14px 22px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 10px 24px var(--shadow-fab);
}
.chat-fab:hover { background: var(--accent); color: var(--on-accent); }
.chat-fab .ms { font-size: 21px; transform: translateY(1px); }
.chat-fab__label { display: inline-flex; align-items: center; gap: 9px; }
.chat-fab__online { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 400; color: currentColor; opacity: 0.75; }
.chat-fab.is-open .chat-fab__label { display: none; }

/* ---------- Нижнє меню (моб.) ---------- */

.tabbar { display: none; }

/* =========================================================
   Медіазапити
   ========================================================= */

@media (max-width: 1024px) {
  .section { margin-top: 52px; }
  .section-title, .steps h2 { font-size: 26px; }
  .hero { grid-template-columns: 1fr 1fr; }
  .hero__text { padding: 32px 28px; min-height: 340px; }
  .hero__title { font-size: 36px; }
  .slider { min-height: 340px; }
  .cats, .products { grid-template-columns: repeat(3, 1fr); }
  .usps { grid-template-columns: repeat(3, 1fr); gap: 18px 24px; padding: 20px 22px; }
  .steps { padding: 34px 28px; }
  .steps__grid { grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .help { padding: 28px; }
  .footer { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  :root { --pad: 16px; --r-lg: 18px; }

  .page { padding-bottom: 110px; } /* місце під нижнє меню */

  .section { margin-top: 40px; }
  .section--tight { margin-top: 14px; }
  .section-head { margin-bottom: 14px; }
  .section-title, .steps h2 { font-size: 21px; }
  .section-link { font-size: 14px; }

  /* хедер: логотип + іконки, пошук окремим рядком */
  .header { padding: 14px 0; gap: 12px; }
  .logo__word { font-size: 24px; }
  .nav { display: none; }
  .icon-actions { display: flex; }
  .search { flex: 1 1 100%; order: 3; padding: 11px 16px; }

  /* герой в один стовпець, картинка першою */
  .hero { grid-template-columns: 1fr; gap: 12px; }
  .hero__text { padding: 22px; min-height: 0; gap: 18px; order: 2; }
  .hero__eyebrow { font-size: 11px; margin-bottom: 10px; }
  .hero__title { font-size: 28px; }
  .hero__lead { font-size: 15px; }
  .hero__actions .btn { flex: 1 1 auto; font-size: 15px; padding: 13px 18px; }
  .slider { order: 1; min-height: 0; aspect-ratio: 16 / 10; }

  .usps { grid-template-columns: 1fr; gap: 14px; padding: 18px; }

  .cats, .products { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat__name { font-size: 14px; }
  .card__body { padding: 12px; }
  .card__name { font-size: 14px; }
  .card__price { font-size: 16px; }

  .steps { padding: 24px 22px; }
  .steps__lead { font-size: 14.5px; margin-bottom: 20px; }
  .steps__grid { grid-template-columns: 1fr; gap: 18px; }
  .step__title { font-size: 16px; }
  .step__text { font-size: 14px; }

  .help { padding: 22px; }
  .help__title { font-size: 18px; }
  .help__text { font-size: 14.5px; }
  .help__actions { width: 100%; }
  .help__actions .btn { flex: 1 1 auto; }

  .footer { margin-top: 40px; gap: 20px; }

  /* чат: кругла кнопка над нижнім меню */
  .chat-dock { right: 14px; bottom: 92px; }
  .chat-fab {
    width: 54px; height: 54px; padding: 0;
    border-radius: 50%; justify-content: center;
  }
  .chat-fab__label { display: none; }
  .chat-fab .ms { font-size: 24px; }

  /* Панель чату на весь екран: маленьке плаваюче вікно (330px) на
     телефоні незручне саме через свою рухливість — при появі клавіатури
     фіксовані елементи в мобільних браузерах перераховують позицію
     відносно viewport, і плаваюча панель у кутку візуально "стрибає".
     На весь екран того ефекту немає, а 100dvh сам звужується під
     клавіатуру (де браузер це підтримує). */
  .chat-panel {
    position: fixed; inset: 0; z-index: 30;
    width: 100%; max-width: 100%; height: 100dvh;
    border-radius: 0; border: none;
    display: flex; flex-direction: column;
  }
  .chat-panel__body { flex: 1; min-height: 0; max-height: none; }


  /* нижнє меню */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 19;
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px 6px 10px;
    background: var(--bar-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 6px 0; min-height: 48px;
    color: var(--ink-muted); font-size: 11px;
  }
  .tabbar a .ms { font-size: 23px; }
  .tabbar a.is-active { color: var(--ink); }
}

@media (max-width: 480px) {
  .topbar { font-size: 12.5px; }
  .hero__title { font-size: 26px; }
  .footer { grid-template-columns: 1fr; }
  .cats, .products { gap: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .slider__slide { transition: none; }
}

@media print {
  .chat-dock, .tabbar { display: none !important; }
}

/* =========================================================
   Внутрішні сторінки: каталог, товар, кошик, кабінет, текст
   ========================================================= */

/* ---------- Хлібні крихти ---------- */

.crumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; color: var(--ink-muted);
  padding: 18px 0 14px;
}
.crumbs span[aria-hidden] { opacity: 0.6; }

/* ---------- Шапка сторінки ---------- */

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-title { font-size: 36px; line-height: 1.12; margin-bottom: 6px; text-wrap: balance; }
.page-sub { font-size: 15px; color: var(--ink-muted); }

.sort { display: flex; align-items: center; gap: 10px; }
.sort > span { font-size: 14px; color: var(--ink-muted); }
.select { position: relative; display: inline-flex; align-items: center; }
.select select {
  font-size: 15px; padding: 11px 42px 11px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); color: inherit; cursor: pointer;
  appearance: none; -webkit-appearance: none;
}
.select .ms { position: absolute; right: 14px; font-size: 20px; color: var(--ink-soft); pointer-events: none; }

/* ---------- Каталог ---------- */

.catalog { display: grid; grid-template-columns: 262px minmax(0, 1fr); gap: 28px; align-items: start; }
.catalog:not(:has(.filters)) { grid-template-columns: minmax(0, 1fr); }

.filters { display: flex; flex-direction: column; gap: 26px; position: sticky; top: 20px; }
.filters__head { display: none; }
.filters__group { display: flex; flex-direction: column; gap: 12px; }
.filters__title { font-weight: 600; font-size: 15px; }
.filters__list { display: flex; flex-direction: column; gap: 9px; }
.filters__flags { border-top: 1px solid var(--line); padding-top: 14px; }

.price-row { display: flex; align-items: center; gap: 10px; }
.price-row input {
  width: 88px; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: inherit;
}
.price-row span { color: var(--ink-muted); }
.range { width: 100%; accent-color: var(--accent); }

.swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid var(--line);
}
.swatch.is-active { border: 3px solid var(--ink); }

.size-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.size-chip {
  font-size: 14px; padding: 9px 14px; border-radius: 10px; cursor: pointer;
  background: var(--white); color: var(--ink-soft); border: 1px solid var(--line);
  white-space: nowrap;
}
.size-chip.is-active { background: var(--fill-bg); color: var(--fill-fg); border-color: var(--fill-bg); }

.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-soft); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; flex: none; }
.check__count { margin-left: auto; font-size: 13px; color: var(--ink-muted); }
/* .check as a plain toggle link (faceted-nav href, not a form checkbox) —
   a CSS-drawn box standing in for the native checkbox, since an actual
   <input> can't be the clickable target of an <a>. */
.check__box {
  width: 18px; height: 18px; flex: none;
  border: 1px solid var(--ghost-line); border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
}
.check__box .ms { font-size: 14px; color: var(--on-accent); opacity: 0; }
.check.is-active { color: var(--ink); font-weight: 500; }
.check.is-active .check__box { background: var(--accent); border-color: var(--accent); }
.check.is-active .check__box .ms { opacity: 1; }

.btn--reset {
  border: 1px solid var(--reset-line); color: var(--ink-soft);
  background: transparent; padding: 12px; width: 100%;
}
.btn--reset:hover { background: var(--sand-soft); }

.filters-bar { display: none; }

/* Чіпи вибраних фільтрів */
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.chips__label { font-size: 14px; color: var(--ink-muted); }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; padding: 8px 8px 8px 14px; border-radius: 999px;
  border: 1px solid var(--chip-line); background: var(--chip-bg); color: var(--ink-soft); cursor: pointer;
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); }
.chip .ms { font-size: 17px; color: var(--accent); }
.chips__clear {
  font-size: 14px; padding: 8px 6px; border: none; background: transparent;
  color: var(--accent); cursor: pointer; text-decoration: underline;
}

/* Наявність у картці */
.card__stock { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ok-text); }
.card__stock i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: block; }
.card__stock--out { color: var(--warn-text); }
.card__old { font-size: 14px; color: var(--ink-muted); text-decoration: line-through; }
.card__buy {
  border: none; background: var(--fill-bg); color: var(--fill-fg);
  font-size: 15px; font-weight: 500; padding: 12px; border-radius: 999px;
  cursor: pointer; min-height: 44px; width: 100%;
}
.card__buy:hover { background: var(--accent); color: var(--on-accent); }

/* Порожній результат */
.empty {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 40px; text-align: center;
}
.empty__title { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin-bottom: 8px; }
.empty__text { font-size: 15px; color: var(--ink-soft); margin: 0 0 18px; }

/* Пагінація */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 34px; }
.pager a, .pager span {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); color: var(--ink-soft); font-size: 15px;
}
.pager .is-active { background: var(--fill-bg); border-color: var(--fill-bg); color: var(--fill-fg); font-weight: 600; }
.pager a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Сторінка товару ---------- */

.product { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr); gap: 40px; align-items: start; }

.gallery { display: flex; flex-direction: column; gap: 12px; }
.gallery__main {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--hatch-a) 0 14px, var(--hatch-b) 14px 28px);
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__hint {
  position: absolute; left: 20px; bottom: 20px;
  font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  background: var(--glass); padding: 7px 11px; border-radius: 8px; color: var(--ink-soft);
}
.gallery__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery__thumb {
  position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  padding: 0; cursor: pointer; border: 1px solid var(--line);
  background: repeating-linear-gradient(135deg, var(--hatch-a) 0 10px, var(--hatch-b) 10px 20px);
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb.is-active { border: 2px solid var(--ink); }

.pd { display: flex; flex-direction: column; gap: 18px; }
.pd__meta { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-muted); margin-bottom: 10px; }
.pd__title { font-size: 32px; line-height: 1.15; margin-bottom: 12px; text-wrap: pretty; }
.pd__facts-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14.5px; }
.rating { display: flex; align-items: center; gap: 5px; }
.rating b { font-weight: 600; }
.rating a { white-space: nowrap; }
.stars { display: inline-flex; align-items: center; font-family: 'Material Symbols Rounded'; font-size: 17px; line-height: 1; color: var(--star);
         letter-spacing: 1px; font-variation-settings: 'FILL' 1; }
.stars .is-empty { color: var(--line); }
.instock { display: flex; align-items: center; gap: 7px; color: var(--ok-text); white-space: nowrap; }
.instock i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: block; }

.pd__price-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pd__prices { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.pd__price { font-family: var(--font-display); font-weight: 700; font-size: 38px; letter-spacing: -0.02em; }
.pd__old { font-size: 18px; color: var(--ink-muted); text-decoration: line-through; }
.pd__save { background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.fav-btn {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: var(--white); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.fav-btn:hover { border-color: var(--accent); }
.fav-btn .ms { font-size: 22px; color: var(--accent); transform: translateY(1px); }

.pd__bullets { display: flex; flex-direction: column; gap: 9px; font-size: 15.5px; color: var(--ink-soft); }
.pd__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.pd__actions .btn { flex: 1 1 180px; min-height: 54px; font-size: 17px; }
.btn--outline-accent { border-color: var(--accent); color: var(--accent); }
.btn--outline-accent:hover { background: var(--accent-soft); color: var(--accent-dark); }
.pd__note { font-size: 14px; line-height: 1.5; color: var(--ink-muted); margin: -6px 0 0; }
.pd__delivery { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.pd__delivery div { display: flex; gap: 13px; align-items: flex-start; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.pd__delivery .ms { font-size: 24px; color: var(--accent); flex: none; }

/* Варіанти товару (колір, розмір) — блок необов'язковий */
.variants { display: flex; flex-direction: column; gap: 16px; }
.variant { display: flex; flex-direction: column; gap: 10px; }
.variant__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.variant__label { font-weight: 600; font-size: 15px; }
.variant__value { font-size: 14.5px; color: var(--ink-muted); }
.variant .swatch { width: 40px; height: 40px; }
.variant .size-chip { min-height: 44px; font-size: 15px; }
.variant .swatch[disabled], .variant .size-chip[disabled] { opacity: 0.4; cursor: not-allowed; }
.variant__note { font-size: 13.5px; color: var(--warn-text); }

/* Повноекранні стани: порожній кошик, успіх, 404 */
.state {
  max-width: 560px; margin: clamp(30px, 8vw, 80px) auto;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.state > * { flex: none; max-width: 100%; }
.state__icon {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--sand); display: flex; align-items: center; justify-content: center;
}
.state__icon .ms { font-size: 38px; color: var(--accent); }
.state__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(22px, 3vw, 30px); margin: 0; text-wrap: balance; }
.state__text { font-size: 16px; line-height: 1.6; color: var(--ink-soft); margin: 0; text-wrap: pretty; }
.state__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.state__card {
  width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 20px; display: flex; flex-direction: column; gap: 10px; margin-top: 8px;
}
.state__row { display: flex; justify-content: space-between; gap: 14px; font-size: 15px; color: var(--ink-soft); }
.state__row b { color: var(--ink); text-align: right; }

/* Білі панелі (опис, характеристики, форми) */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 30px 32px;
}
.panel__title { font-family: var(--font-display); font-weight: 600; font-size: 24px; margin: 0 0 16px; }
.panel__text { font-size: 16px; line-height: 1.65; color: var(--ink-soft); display: flex; flex-direction: column; gap: 14px; text-wrap: pretty; }
.panel__text p { margin: 0; }

.auth-wrap { max-width: 420px; margin: 0 auto; padding: 48px 0; }
.auth-foot { text-align: center; font-size: 14.5px; color: var(--ink-muted); margin: 14px 0 0; }
.auth-foot a { color: var(--accent); }

.spec { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.spec:last-child { border-bottom: none; }
.spec dt { color: var(--ink-muted); margin: 0; }
.spec dd { font-weight: 500; text-align: right; margin: 0; }
dl.specs { margin: 0; }

/* Відгуки */
.reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.review {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 20px; display: flex; flex-direction: column; gap: 11px;
}
.review__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review__name { font-weight: 600; font-size: 15.5px; }
.review__date { font-size: 13px; color: var(--ink-muted); }
.review__text { font-size: 15px; line-height: 1.55; color: var(--ink-soft); text-wrap: pretty; }

/* ---------- Кошик ---------- */

.cart { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.cart-list { display: flex; flex-direction: column; gap: 12px; }
.cart-row {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px;
}
.cart-row__media { width: 96px; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--hatch-b); }
.cart-row__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-row__name { font-size: 16px; font-weight: 500; line-height: 1.35; margin-bottom: 6px; color: inherit; display: block; }
.cart-row__meta { font-size: 13.5px; color: var(--ink-muted); }
.cart-row__side { display: flex; align-items: center; gap: 14px; }
.cart-row__price { font-family: var(--font-display); font-weight: 600; font-size: 18px; white-space: nowrap; }
.cart-row__del {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.cart-row__del:hover { border-color: var(--accent); }
.cart-row__del .ms { font-size: 19px; color: var(--ink-muted); }
.cart-row__del:hover .ms { color: var(--accent); }

.summary {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px; position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px;
}
.summary__title { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin: 0; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--ink-soft); }
.summary__total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-top: 1px solid var(--line); padding-top: 14px; font-size: 16px;
}
.summary__total b { font-family: var(--font-display); font-size: 26px; }
.summary__note { font-size: 13.5px; color: var(--ink-muted); line-height: 1.5; }

/* Форми оформлення */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 14px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font-size: 15px; padding: 13px 15px; min-height: 48px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: inherit; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field--wide { grid-column: 1 / -1; }
.form-error { color: var(--warn-text); font-size: 14px; min-height: 1.2em; }

/* Delivery-point autocomplete (checkout's Nova Poshta city/warehouse
   pickers) — a plain positioned dropdown under a .field's input. */
.autocomplete-list {
  position: absolute; z-index: 5; top: 100%; left: 0; right: 0; margin-top: 4px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: 0 12px 28px var(--shadow-soft); max-height: 260px; overflow-y: auto;
}
.autocomplete-item { padding: 11px 15px; font-size: 14.5px; cursor: pointer; }
.autocomplete-item:hover, .autocomplete-item.is-active { background: var(--sand-soft); }
.autocomplete-item + .autocomplete-item { border-top: 1px solid var(--line); }
.autocomplete-empty { padding: 11px 15px; font-size: 14px; color: var(--ink-muted); }

.star-picker { display: flex; gap: 4px; }
.star-picker-btn { background: none; border: none; padding: 0; cursor: pointer; color: var(--line); }
.star-picker-btn .ms { font-size: 26px; }
.star-picker-btn.is-filled { color: var(--star); font-variation-settings: 'FILL' 1; }

/* Bridge style for sections not yet ported to their own component (Cart,
   Account, chat history) — a plain muted note, same role as .empty__text. */
.empty-note { color: var(--ink-muted); font-size: 15px; padding: 12px 0; }
.loading-note { color: var(--ink-muted); font-size: 14px; padding: 8px 0; }

.radio-list { display: flex; flex-direction: column; gap: 10px; }
.radio {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--white);
}
.radio:hover { border-color: var(--accent); }
.radio input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 2px; flex: none; }
.radio > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.radio__title { font-size: 15.5px; font-weight: 500; display: block; }
.radio__text { font-size: 13.5px; color: var(--ink-muted); line-height: 1.45; display: block; }

/* ---------- Кабінет ---------- */

.account { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.side-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 20px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px;
  border-radius: 12px; color: var(--ink-soft); font-size: 15px;
}
.side-nav a:hover { background: var(--sand-soft); color: var(--ink); }
.side-nav a.is-active { background: var(--fill-bg); color: var(--fill-fg); }
.side-nav .ms { font-size: 21px; }
.account-avatar {
  width: 62px; height: 62px; border-radius: 50%; flex: none;
  background: var(--sand); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 20px;
}

.order {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.order__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.order__head > div { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.order__num { font-weight: 600; font-size: 16px; white-space: nowrap; }
.order__date { font-size: 13.5px; color: var(--ink-muted); white-space: nowrap; }
.status {
  font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  background: var(--status-bg); color: var(--ink-soft);
}
.status--done { background: var(--status-done-bg); color: var(--status-done-fg); }
.status--way { background: var(--status-way-bg); color: var(--status-way-fg); }
.order__items { display: flex; gap: 10px; flex-wrap: wrap; }
.order__thumb { width: 54px; height: 54px; border-radius: 10px; overflow: hidden; background: var(--hatch-b); flex: none; }
.order__thumb img { width: 100%; height: 100%; object-fit: cover; }
.order__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
               border-top: 1px solid var(--line); padding-top: 14px; font-size: 15px; color: var(--ink-soft);
               cursor: pointer; }
.order__sum { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink); }
.order__foot .ms { font-size: 22px; transition: transform .15s ease; }

/* ---------- Текстові сторінки ---------- */

.prose { max-width: 70ch; font-size: 16px; line-height: 1.7; color: var(--ink-soft); }
.prose h2 { font-size: 24px; color: var(--ink); margin: 32px 0 12px; }
.prose h3 { font-size: 18px; color: var(--ink); margin: 24px 0 8px; }
.prose p { margin: 0 0 14px; text-wrap: pretty; }
.prose ul { margin: 0 0 16px; padding-left: 20px; }
.prose li { margin-bottom: 7px; }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 20px;
}
.faq summary { font-weight: 600; font-size: 16px; cursor: pointer; list-style: none; display: flex;
               align-items: center; justify-content: space-between; gap: 14px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: 'expand_more'; font-family: 'Material Symbols Rounded'; font-size: 22px; color: var(--ink-muted); }
.faq details[open] summary::after { content: 'expand_less'; }
.faq p { margin: 12px 0 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); }

/* ---------- Адаптив внутрішніх сторінок ---------- */

@media (max-width: 1024px) {
  .page-title { font-size: 28px; }
  .catalog { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
  .product { grid-template-columns: 1fr 1fr; gap: 24px; }
  .pd__title { font-size: 26px; }
  .pd__price { font-size: 32px; }
  .panel { padding: 24px; }
  .cart { grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
  .account { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
}

@media (max-width: 760px) {
  .crumbs { font-size: 13px; padding: 12px 0 10px; }
  .page-head { margin-bottom: 14px; gap: 12px; }
  .page-title { font-size: 23px; }
  .sort { width: 100%; }
  .sort .select, .sort select { flex: 1; width: 100%; }

  /* Каталог: фільтри — висувна панель */
  .catalog { grid-template-columns: 1fr; gap: 0; }
  .filters-bar { display: flex; gap: 10px; margin-bottom: 14px; }
  .filters-bar .btn { flex: 1; }
  .filters {
    position: fixed; inset: 0; z-index: 30; display: none;
    background: var(--bg); overflow-y: auto; gap: 22px;
    padding: 16px 16px 24px; border-radius: 0;
  }
  .filters.is-open { display: flex; }
  .filters__head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; position: sticky; top: -16px; background: var(--bg);
    padding: 6px 0 10px; margin: -6px 0 0;
  }
  .filters__head b { font-family: var(--font-display); font-size: 19px; }

  .product { grid-template-columns: 1fr; gap: 20px; }
  .gallery__main { aspect-ratio: 1; border-radius: var(--r-md); }
  .pd__title { font-size: 22px; }
  .pd__price { font-size: 28px; }
  .pd__actions .btn { flex: 1 1 100%; }
  .panels { grid-template-columns: 1fr; gap: 12px; }
  .panel { padding: 20px; border-radius: var(--r-md); }
  .panel__title { font-size: 19px; }
  .prose { font-size: 15.5px; }
  .prose h2 { font-size: 20px; }

  .cart { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .cart-row__media { width: 72px; }
  .cart-row__side { grid-column: 1 / -1; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; }
  .summary { position: static; padding: 18px; }

  .account { grid-template-columns: 1fr; }
  .side-nav { position: static; flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .side-nav a { white-space: nowrap; padding: 11px 14px; }
  .side-nav span:not(.ms) { display: inline; }

  .pager { margin-top: 24px; }
  .state { margin: 24px auto; }
  .state__icon { width: 68px; height: 68px; }
  .state__icon .ms { font-size: 32px; }
  .state__actions { width: 100%; }
  .state__actions .btn { flex: 1 1 100%; }
}



/* =========================================================
   Темна тема
   Вмикається автоматично за системним налаштуванням,
   або примусово: <html data-theme="dark"> / <html data-theme="light">.
   Уся тема — це перевизначення токенів, правила не дублюються.
   ========================================================= */

:root {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --ink: #ece5da;
    --ink-soft: #c3baab;
    --ink-muted: #9a9183;
    --bg: #1f1b17;
    --white: #2a2520;
    --line: #3d362e;

    --accent: #e08a5f;
    --accent-dark: #f0a67e;

    --sand: #3a3026;
    --sand-soft: #322b23;
    --dark: #151210;

    --surface: #2a2520;
    --surface-2: #232019;
    --surface-3: #3a332b;
    --hatch-a: #332d26;
    --hatch-b: #2c2721;
    --chip-bg: #3a3128;
    --chip-line: #4d4238;
    --ghost-line: #6d6357;
    --reset-line: #5c5348;

    --fill-bg: #ece5da;
    --fill-fg: #221e19;
    --on-accent: #201a15;
    --accent-soft: #3b2b22;

    --hero-eyebrow: #c2a97f;
    --star: #e0ae55;
    --ok-text: #74c193;
    --warn-text: #d6a189;

    --status-bg: #34302a;
    --status-done-bg: #25382c;
    --status-done-fg: #8ed0a7;
    --status-way-bg: #3a3124;
    --status-way-fg: #dcb271;

    --bar-bg: rgba(31, 27, 23, 0.94);
    --glass: rgba(42, 37, 32, 0.92);
    --shadow-soft: rgba(0, 0, 0, 0.5);
    --shadow-fab: rgba(0, 0, 0, 0.55);
  }

  /* Знімки товарів у темряві світяться — трохи приглушуємо */
  :root:not([data-theme="light"]) .card__media img,
  :root:not([data-theme="light"]) .cat__media img,
  :root:not([data-theme="light"]) .gallery__main img,
  :root:not([data-theme="light"]) .gallery__thumb img,
  :root:not([data-theme="light"]) .cart-row__media img,
  :root:not([data-theme="light"]) .order__thumb img,
  :root:not([data-theme="light"]) .slider__slide {
    filter: brightness(0.88) saturate(0.95);
  }
}

/* Примусово темна — ті самі токени */
:root[data-theme="dark"] {
  color-scheme: dark;

  --ink: #ece5da;
  --ink-soft: #c3baab;
  --ink-muted: #9a9183;
  --bg: #1f1b17;
  --white: #2a2520;
  --line: #3d362e;

  --accent: #e08a5f;
  --accent-dark: #f0a67e;

  --sand: #3a3026;
  --sand-soft: #322b23;
  --dark: #151210;

  --surface: #2a2520;
  --surface-2: #232019;
  --surface-3: #3a332b;
  --hatch-a: #332d26;
  --hatch-b: #2c2721;
  --chip-bg: #3a3128;
  --chip-line: #4d4238;
  --ghost-line: #6d6357;
  --reset-line: #5c5348;

  --fill-bg: #ece5da;
  --fill-fg: #221e19;
  --on-accent: #201a15;
  --accent-soft: #3b2b22;

  --hero-eyebrow: #c2a97f;
  --star: #e0ae55;
  --ok-text: #74c193;
  --warn-text: #d6a189;

  --status-bg: #34302a;
  --status-done-bg: #25382c;
  --status-done-fg: #8ed0a7;
  --status-way-bg: #3a3124;
  --status-way-fg: #dcb271;

  --bar-bg: rgba(31, 27, 23, 0.94);
  --glass: rgba(42, 37, 32, 0.92);
  --shadow-soft: rgba(0, 0, 0, 0.5);
  --shadow-fab: rgba(0, 0, 0, 0.55);
}

:root[data-theme="dark"] .card__media img,
:root[data-theme="dark"] .cat__media img,
:root[data-theme="dark"] .gallery__main img,
:root[data-theme="dark"] .gallery__thumb img,
:root[data-theme="dark"] .cart-row__media img,
:root[data-theme="dark"] .order__thumb img,
:root[data-theme="dark"] .slider__slide {
  filter: brightness(0.88) saturate(0.95);
}

/* Друк — завжди світла */
@media print {
  :root { color-scheme: light; }
}
