/* ==========================================================================
   Layer 47 — дизайн-система з макета 2a (design/1.png, design/2.png).
   Секції: tokens · reset · layout · components · header · footer · home ·
   catalog · product · cms/leads · states · responsive.
   Сторінкові стилі кошика/checkout/трекінгу — static/css/shop.css.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */

:root {
  --bg: #f5efe0;
  --text: #3b332a;
  --accent: #f08a3c;
  --accent-deep: #e0762a;
  --yellow: #f2c94c; /* теплий жовтий під крем/помаранч — смайлик у hero */
  --card: #fbf7ec;
  --muted: #6b6152;
  --muted-2: #9a8e79;
  --line: #e6d9bd;
  --line-2: #d8cdb6;
  --hero: #efe6d0;
  --footer: #3b332a;
  --footer-line: #57493c;
  --footer-text: #b8ad9a;
  --danger: #c0392b;
  --ok: #2f6b45;

  --r-card: 1.2857rem;
  --r-hero: 1.7143rem;
  --r-btn: 0.7143rem;
  --r-btn-dark: 0.5714rem;
  --r-thumb: 0.8571rem;

  --font-body: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-logo: "Press Start 2P", var(--font-body);

  /* Контейнер тягнеться разом з екраном, але має жорсткий стелю-ліміт: довгі рядки
     не мають розповзатися на 4K, а на 1920 сторінка не має виглядати вузькою смужкою. */
  --container: none; /* на всю ширину вікна; відступи — тільки --gutter */
  --gutter: clamp(1.1429rem, 3vw, 5rem);
  --shadow: 0 1px 0 rgba(59, 51, 42, 0.04);
}

/* --- Reset ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

/* Fluid root: 1rem @1080 → 1.1429rem @1440 → 1.2857rem від ~1800. Усі розміри в rem, тож макет
   масштабується пропорційно (підхід як у pet/iridium), а не лише розсуває контейнер. */
html { font-size: clamp(13px, .5556vw + 8px, 18px); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; width: 100%; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.2; overflow-wrap: break-word; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }
s { text-decoration-thickness: 1.5px; }

.accent { color: var(--accent); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --- Layout --------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: 3.1429rem 0 0.5714rem; }
.section + .section { padding-top: 2.5714rem; }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.1429rem;
  margin-bottom: 1.5714rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.8571rem;
  font-size: 1.7143rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}
.section-title::before {
  content: "";
  flex: none;
  width: 1.1429rem;
  height: 1.1429rem;
  background: var(--accent);
}

.section__link {
  font-size: 0.8571rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.section__link:hover { color: var(--accent-deep); }

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.1429rem;
  padding: 2rem 0 0;
}
.page-head .section-title { font-size: 1.8571rem; }
.page-head__aside { font-size: 0.8571rem; color: var(--muted-2); white-space: nowrap; }

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2857rem;
}

.panel {
  background: var(--card);
  border-radius: var(--r-card);
  padding: 1.7143rem;
}

/* --- Buttons -------------------------------------------------------------- */

/* Мінімальна висота тач-таргетів — у px навмисно: на планшеті root 13px, а 40px мають лишатись 40px */
.btn, .cart-button, .stepper__btn { min-height: 40px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5714rem;
  padding: 0.9286rem 1.7143rem;
  border: 2px solid transparent;
  border-radius: 71.3571rem;
  background: transparent;
  color: var(--text);
  font-size: 0.9286rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }

.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--text); }
.btn--primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.btn--dark {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  border-radius: var(--r-btn-dark);
  padding: 0.7857rem 1.2857rem;
  font-weight: 500;
}
.btn--dark:hover { background: #2c2620; border-color: #2c2620; }

.btn--ghost { border-color: var(--line-2); background: transparent; font-weight: 500; }
.btn--ghost:hover { border-color: var(--text); }

.btn--sm { padding: 0.6429rem 1rem; font-size: 0.7857rem; }
.btn--block { display: flex; width: 100%; }
.btn.is-disabled, .btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn.is-in-cart { background: var(--hero); border-color: var(--hero); color: var(--text); }
.btn.is-in-cart:hover { border-color: var(--line-2); }

.add-form { display: inline-block; margin: 0; }
.add-form.htmx-request .btn { opacity: .6; }

.link-muted { color: var(--muted-2); font-size: 0.8571rem; text-decoration: underline; }
.link-muted:hover { color: var(--text); }

/* --- Card ----------------------------------------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 0.5714rem 1.7143rem rgba(59, 51, 42, .08); }

/* Фото — квадрат на всю ширину картки: високі та квадратні вироби не обрізаються,
   а висота росте разом із колонкою (замість фіксованої в rem). Текстова частина — компактна. */
.card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  text-decoration: none;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__placeholder { font-size: 0.7143rem; letter-spacing: .02em; }

.card__body { display: flex; flex-direction: column; gap: 0.4286rem; padding: 0.8571rem 1rem 1rem; flex: 1; }
.card__title { font-size: 0.9286rem; font-weight: 700; text-decoration: none; line-height: 1.35; }
.card__title:hover { color: var(--accent-deep); }
.card__meta { font-size: 0.7857rem; color: var(--muted-2); }
.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5714rem;
  margin-top: 0.4286rem;
}

.price {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4286rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-deep);
  white-space: nowrap;
}
.price--old { font-size: 0.7857rem; font-weight: 500; color: var(--muted-2); }
.price--lg { font-size: 1.7143rem; }

.badge {
  position: absolute;
  top: 0.7143rem;
  left: 0.7143rem;
  padding: 0.2857rem 0.5714rem;
  border-radius: 0.4286rem;
  background: var(--card);
  color: var(--text);
  font-size: 0.7143rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
}
.badge--hit { background: var(--accent); }
.badge--sale { background: var(--text); color: var(--bg); }
.product__price .badge { position: static; }

/* --- Pixels --------------------------------------------------------------- */

.pixels { position: absolute; inset: 0; pointer-events: none; }
.pixel { position: absolute; display: block; }

/* --- Header --------------------------------------------------------------- */

.site-header { position: relative; }
.site-header__inner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4286rem;
  padding-top: 1.2857rem;
  padding-bottom: 1.2857rem;
}
.site-header__inner > :not(.pixels) { position: relative; }

.logo {
  font-family: var(--font-logo);
  font-size: 1.7rem; /* помітніше в шапці на всю ширину: ~24px на макеті, ~31px на широкому екрані */
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.logo--light { color: var(--bg); }
.logo--sm { font-size: 1rem; }

.site-nav { display: flex; align-items: center; gap: 1.8571rem; font-size: 0.9286rem; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease;
}
.site-nav a:hover { color: var(--text); }
.site-nav a.is-active { color: var(--text); font-weight: 700; }

.cart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7143rem;
  min-height: 40px;
  padding: 0.6429rem 1.1429rem;
  border-radius: var(--r-btn);
  background: var(--accent);
  color: var(--text);
  font-size: 0.8571rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease;
}
.cart-button:hover { background: var(--accent-deep); }
.cart-button svg { flex: none; }
#cart-badge { min-width: 1ch; display: inline-block; text-align: center; }

/* --- Footer --------------------------------------------------------------- */

.site-footer-wrap { margin-top: 1.7143rem; }
.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--footer);
  color: var(--bg);
  border-radius: var(--r-hero) var(--r-hero) 0 0;
  padding: 2.5714rem 2.8571rem 2rem;
}
.site-footer__cols {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2.8571rem;
}
.site-footer__col {
  display: flex; flex-direction: column; gap: 0.5714rem;
  font-size: 0.8571rem; line-height: 1.7; color: var(--footer-text);
}
.site-footer__col a { color: inherit; text-decoration: none; transition: color .15s ease; }
.site-footer__col a:hover { color: var(--accent); }
.site-footer__brand { gap: 0.8571rem; }
/* Колонки контактів/соцмереж — заголовок і вміст по центру колонки */
.site-footer__col--center { align-items: center; text-align: center; }
.site-footer__col--center .site-footer__socials { justify-content: center; margin-top: 0.4286rem; }
/* Троє гусей ідуть один за одним замість підпису «віу-віу-віу» */
.site-footer__geese { display: inline-flex; align-items: flex-end; gap: 0.5714rem; }
.site-footer__geese .pixel-goose { height: 1.5714rem; margin: 0; }
.site-footer__geese .pixel-goose:nth-child(2) { transform: translateY(-0.1429rem); } /* крок */
/* Заголовки колонок — як section-title: помаранчевий квадратик + акцентний колір */
.site-footer__heading {
  display: flex; align-items: center; gap: 0.5714rem;
  font-size: 0.7857rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.2857rem;
}
.site-footer__heading::before { content: ""; flex: none; width: 0.5714rem; height: 0.5714rem; background: var(--accent); }
/* Гусак під слоганом: піксель-арт у палітрі футера */
/* Висота підібрана так, щоб низ гусака збігався з низом третього посилання сусідньої колонки */
.pixel-goose { display: block; width: auto; height: 5.5714rem; margin-top: 0.2857rem; }
.pixel-goose .w { fill: var(--bg); }
.pixel-goose .s { fill: var(--line-2); }
.pixel-goose .o { fill: var(--accent); }
.pixel-goose .p { fill: var(--accent-deep); }
.pixel-goose .d { fill: #221c16; }          /* контур темніший за фон футера, щоб читався */
.pixel-goose .t { fill: var(--footer-line); } /* тінь під лапами */
.site-footer__muted { color: var(--muted-2); }
.site-footer__socials { display: flex; flex-wrap: wrap; gap: 0.8571rem; margin-top: 0.2857rem; }
.site-footer__social {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; min-width: 44px; min-height: 44px;
  border-radius: 0.5714rem; color: var(--accent); background: rgba(255, 255, 255, .04);
  transition: background-color .15s ease, color .15s ease, transform .05s ease;
}
.site-footer__col a.site-footer__social { color: var(--accent); }
.site-footer__col a.site-footer__social:hover { background: var(--accent); color: var(--footer); }
.site-footer__social:active { transform: translateY(1px); }
.pixel-icon { width: 1.7143rem; height: 1.7143rem; display: block; }

/* Пікселі між секціями — тонка смуга з розсипом квадратиків, як у шапці/футері */
.pixels-band { position: relative; height: 2.8571rem; overflow: hidden; pointer-events: none; }
.pixels--band { inset: 0; }
.site-footer__bottom {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.1429rem;
  margin-top: 2.2857rem;
  padding-top: 1.2857rem;
  border-top: 1px solid var(--footer-line);
  font-size: 0.7857rem;
  color: var(--muted-2);
}

/* --- Messages ------------------------------------------------------------- */

.messages { margin: 1.1429rem 0 0; display: flex; flex-direction: column; gap: 0.5714rem; }
.message {
  padding: 0.7143rem 1rem;
  border-radius: var(--r-btn);
  background: var(--card);
  border: 2px solid var(--line);
  font-size: 0.9286rem;
}
.message--success { border-color: #bcd8c2; }
.message--error { border-color: var(--accent-deep); }
.message--warning { border-color: #e8b98a; }

/* --- Home: hero ----------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5714rem;
  align-items: center;
  margin-top: 0.7143rem;
  /* Бічні поля ростуть із шириною вікна (~96px @1440, ~146px @2000): текст і телевізор
     тримаються ближче до центру, а не розбігаються по краях широкої картки */
  padding: 3.7143rem max(3.1429rem, 10vw - 3rem);
  background: var(--hero);
  border-radius: var(--r-hero);
}
.hero__text { display: flex; flex-direction: column; gap: 1.4286rem; }
.hero__pixels { display: flex; gap: 0.4286rem; }
.hero__pixels i { display: block; width: 0.8571rem; height: 0.8571rem; background: var(--accent); }
.hero__pixels i:nth-child(2) { opacity: .7; }
.hero__pixels i:nth-child(3) { opacity: .45; }
.hero__pixels i:nth-child(4) { opacity: .22; }
.hero__title { font-size: 2.8571rem; font-weight: 700; line-height: 1.15; }
.hero__lead { font-size: 1rem; line-height: 1.7; color: var(--muted); max-width: 28.5714rem; }
/* 8-бітний смайлик наприкінці підзаголовка — у кольорах сторінки, розмір як у великої літери */
.pixel-smile { display: inline-block; width: 1.5em; height: 1.5em; vertical-align: -0.35em; }
.pixel-smile .f { fill: var(--yellow); }
.pixel-smile .d { fill: var(--text); }
.pixel-smile .w { fill: var(--bg); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8571rem; }
.hero__media { position: relative; height: 21.4286rem; }
.hero__image { display: block; height: 100%; border-radius: 1.2857rem; overflow: hidden; }
.hero__image img { width: 100%; height: 100%; object-fit: cover; }

/* Ретро-телевізор — вільний об'єкт без рамки, вписується у висоту слота */
.hero__tv {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* до правого поля картки: відступ як у тексту зліва */
  height: 100%;
}
.hero__tv img {
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1.2857rem 2rem rgba(59, 51, 42, .18));
}
/* Коли герой стекається, слот стає на всю ширину — телевізор не має роздуватися */
@media (max-width: 1024px) {
  .hero__tv { justify-content: center; }
  .hero__tv img { max-width: min(100%, 32.8571rem); }
}
@media (max-width: 560px) {
  .hero__tv img { max-width: min(100%, 22.8571rem); filter: drop-shadow(0 0.8571rem 1.4286rem rgba(59, 51, 42, .16)); }
}
.hero__placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8571rem;
  border: 2px dashed var(--line-2);
  border-radius: 1.2857rem;
  background: rgba(230, 217, 189, .35);
  color: var(--muted-2);
  font-size: 0.8571rem;
  text-align: center;
  padding: 1.7143rem;
}

/* --- Home: strip ---------------------------------------------------------- */

.strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.7143rem;
  margin: 3.1429rem 0 0;
  padding: 1.8571rem 2.2857rem;
  background: var(--card);
  border: 2px dashed var(--line-2);
  border-radius: var(--r-card);
}
.strip__text { display: flex; flex-direction: column; gap: 0.4286rem; }
.strip__title { font-size: 1.2143rem; font-weight: 700; line-height: 1.35; }
.strip__sub { font-size: 0.8571rem; color: var(--muted); }

/* --- Catalog: filters ----------------------------------------------------- */

.filters { display: flex; flex-direction: column; gap: 1rem; margin: 1.5714rem 0 1.2857rem; }
.filters__row { display: flex; flex-wrap: wrap; gap: 0.7143rem; align-items: center; }
.filters__search { flex: 1 1 18.5714rem; }
.filters__select { flex: 0 1 14.2857rem; }
.filters .field__input { width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5714rem; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.5714rem 1rem;
  border: 2px solid var(--line);
  border-radius: 71.3571rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.8571rem;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 700; }

.catalog-grid { position: relative; min-height: 14.2857rem; transition: opacity .15s ease; }
.catalog-grid.htmx-request { opacity: .5; }
.catalog-grid__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.8571rem;
  margin-bottom: 1rem;
  font-size: 0.7857rem;
  color: var(--muted-2);
}

.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4286rem; margin-top: 2rem; }
.pagination__page, .pagination__btn, .pagination__gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5714rem;
  height: 2.5714rem;
  padding: 0 0.8571rem;
  border-radius: var(--r-btn);
  font-size: 0.8571rem;
  text-decoration: none;
  color: var(--muted);
}
.pagination__page:hover, .pagination__btn:hover { background: var(--card); color: var(--text); }
.pagination__page.is-active { background: var(--text); color: var(--bg); font-weight: 700; }
.pagination__gap { color: var(--muted-2); }

/* --- Product page --------------------------------------------------------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5714rem;
  padding: 1.5714rem 0 0;
  font-size: 0.7857rem;
  color: var(--muted-2);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs span:last-child { color: var(--text); }

.product {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5714rem;
  align-items: start;
  margin-top: 1.2857rem;
}

.gallery { display: flex; flex-direction: column; gap: 0.7143rem; }
.gallery__main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-card);
  overflow: hidden;
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__main .card__placeholder { font-size: 0.9286rem; }
.gallery__thumbs { display: flex; flex-wrap: wrap; gap: 0.5714rem; }
.gallery__thumb {
  width: 5.1429rem;
  height: 3.8571rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--r-thumb);
  overflow: hidden;
  background: var(--card);
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb.is-active, .gallery__thumb:hover { border-color: var(--accent); }

.product__info { display: flex; flex-direction: column; gap: 1.2857rem; }
.product__title { font-size: 2rem; line-height: 1.2; }
.product__spec { font-size: 0.9286rem; color: var(--muted-2); margin-top: -0.7143rem; }
.product__price { display: flex; align-items: baseline; gap: 0.8571rem; }
.product__price .price--old { font-size: 1rem; }
.product__buy { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.product__buy .btn { padding: 0.9286rem 1.7143rem; font-size: 0.9286rem; }
.product__stock { font-size: 0.8571rem; color: var(--ok); }
.product__stock--backorder { color: var(--muted); }

.spec-table { width: 100%; font-size: 0.9286rem; }
.spec-table th, .spec-table td { padding: 0.6429rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec-table th { width: 38%; font-weight: 500; color: var(--muted-2); }
.spec-table a { color: var(--text); }

.prose { font-size: 1rem; line-height: 1.75; }
.prose p { margin: 0 0 0.8571rem; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 0.8571rem; padding-left: 1.5714rem; }
.prose li { margin-bottom: 0.2857rem; }
.prose h2, .prose h3 { margin: 1.4286rem 0 0.5714rem; }
.prose h2 { font-size: 1.2857rem; }
.prose h3 { font-size: 1.0714rem; }
.prose a { color: var(--accent-deep); }
/* Широкий контент із rich text не має розсувати сторінку — скролиться всередині себе */
.prose table, .prose pre { display: block; max-width: 100%; overflow-x: auto; }
.prose img { height: auto; }
.prose { overflow-wrap: break-word; }
.product__description { padding-top: 0.2857rem; }

.spec-table td, .spec-table th { overflow-wrap: anywhere; }

/* --- Forms ---------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 0.4286rem; }
.field__label { font-size: 0.8571rem; font-weight: 700; }
.field__input,
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field textarea,
.field select {
  width: 100%;
  padding: 0.7143rem 0.8571rem;
  border: 2px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--card);
  color: var(--text);
  font-size: 0.9286rem;
  line-height: 1.4;
  outline: none;
  transition: border-color .15s ease;
}
.field__input:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field__input::placeholder, .field input::placeholder, .field textarea::placeholder { color: #b3a78f; }
.field textarea { min-height: 7.8571rem; resize: vertical; }
.field input[type="file"] { font-size: 0.8571rem; color: var(--muted); }
.field input[type="file"]::file-selector-button {
  margin-right: 0.7143rem;
  padding: 0.5714rem 0.8571rem;
  border: 2px solid var(--line-2);
  border-radius: 71.3571rem;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.7857rem;
  cursor: pointer;
}
.field--invalid .field__input, .field--invalid input, .field--invalid textarea, .field--invalid select { border-color: var(--danger); }
.field__error { font-size: 0.7857rem; color: var(--danger); }
.field__hint { font-size: 0.7857rem; color: var(--muted-2); }
select.field__input, .field select {
  appearance: none;
  padding-right: 2.2857rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6152' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8571rem center;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1429rem; }
.form-grid .field--wide { grid-column: 1 / -1; }

.stepper {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: var(--r-btn);
  overflow: hidden;
}
.stepper__btn {
  padding: 0.4286rem 0.8571rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  line-height: 1.4;
}
.stepper__btn:first-child { color: var(--muted-2); }
.stepper__btn:hover { background: var(--hero); }
.stepper__btn:disabled { opacity: .4; cursor: not-allowed; }
.stepper__value {
  min-width: 2rem;
  padding: 0.4286rem 0.2857rem;
  text-align: center;
  font-size: 0.9286rem;
  font-weight: 700;
  border: 0;
  background: transparent;
}

/* --- Status badges -------------------------------------------------------- */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4286rem;
  padding: 0.3571rem 0.7143rem;
  border-radius: 71.3571rem;
  background: var(--hero);
  color: var(--muted);
  font-size: 0.7857rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.status-badge::before { content: ""; width: 0.4286rem; height: 0.4286rem; background: currentColor; }
.status-badge--new { background: var(--hero); color: var(--muted); }
.status-badge--paid { background: #bcd8c2; color: #2f5238; }
.status-badge--in_production { background: #f6c6a0; color: #8c5a33; }
.status-badge--shipped { background: #a9cbd8; color: #3f6270; }
.status-badge--delivered { background: #3b332a; color: #f5efe0; }
.status-badge--cancelled { background: var(--line); color: var(--muted-2); }

/* --- CMS / leads ---------------------------------------------------------- */

.page-head + .panel, .page-head + .contacts, .page-head + .lead { margin-top: 1.5714rem; }

/* CMS-сторінки («Про нас», «Доставка та оплата»): вузька колонка по центру, а не текст на всю ширину */
.cms-page { max-width: 52rem; margin: 0 auto; }
.page-head--center { justify-content: center; }
.cms-page .prose { padding: 2.2857rem 2.5714rem; }
.cms-page .prose > :first-child { margin-top: 0; }

.contacts { display: flex; flex-direction: column; gap: 1.2857rem; }
.contacts__cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2857rem; }
/* Картки контактів: одна типографіка для всього вмісту — підпис (дрібний uppercase) і значення
   (1.0714rem, жирне, колір тексту); посилання (телефон, email, соцмережі) виглядають як значення,
   помаранчевими стають лише при наведенні */
.contact-card { display: flex; flex-direction: column; gap: 0.5714rem; text-decoration: none; color: var(--text); }
.contact-card__label { font-size: 0.7857rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted-2); }
.contact-card__value { font-size: 1.0714rem; font-weight: 700; line-height: 1.5; color: var(--text); }
.contact-card__note { font-size: 1.0714rem; line-height: 1.5; color: var(--muted); }
.contact-card__links { display: flex; flex-wrap: wrap; gap: 0.4286rem 1.4286rem; font-size: 1.0714rem; font-weight: 700; line-height: 1.5; }
.contact-card__links a { color: var(--text); text-decoration: none; transition: color .15s ease; }
.contact-card__links a:hover { color: var(--accent-deep); }
a.contact-card:hover .contact-card__value { color: var(--accent-deep); }

.lead { display: grid; grid-template-columns: 21.4286rem 1fr; gap: 1.7143rem; align-items: start; }
.lead__aside { display: flex; flex-direction: column; gap: 1rem; }
.lead__steps { display: flex; flex-direction: column; gap: 1rem; }
.lead__step { display: flex; gap: 0.8571rem; align-items: flex-start; font-size: 0.8571rem; line-height: 1.6; }
.lead__step b {
  flex: none;
  width: 1.7143rem;
  height: 1.7143rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--text);
  font-size: 0.7857rem;
  border-radius: 0.4286rem;
}
.lead__note { font-size: 0.7857rem; color: var(--muted-2); line-height: 1.6; padding: 0 0.4286rem; }
.lead-form { display: flex; flex-direction: column; gap: 1.2857rem; }
.lead-form__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.lead-form__note { font-size: 0.7857rem; color: var(--muted-2); }
.lead-form.htmx-request { opacity: .6; }
.lead-success { display: flex; flex-direction: column; gap: 1.1429rem; align-items: flex-start; }
.lead-success__title { font-size: 1.7143rem; }
.lead-success p { color: var(--muted); line-height: 1.7; }

/* --- States --------------------------------------------------------------- */

.empty {
  padding: 2.8571rem 1.7143rem;
  border: 2px dashed var(--line-2);
  border-radius: var(--r-card);
  text-align: center;
  color: var(--muted);
  font-size: 0.9286rem;
  line-height: 1.7;
}
.empty a:not(.btn) { color: var(--accent-deep); }

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 5.1429rem 0 2.8571rem;
  text-align: center;
}
.error-page__code { font-size: 5.1429rem; font-weight: 700; line-height: 1; }
.error-page__title { font-size: 1.7143rem; }
.error-page__lead { color: var(--muted); max-width: 30rem; line-height: 1.7; margin-bottom: 0.7143rem; }

.htmx-indicator { opacity: 0; transition: opacity .15s ease; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* --- Responsive ------------------------------------------------------------
   Карта брейкпоінтів (desktop-first, окрім двох min-width для широких екранів):
     ≥ 1920  контейнер 111.4286rem, найбільший герой і картки
     ≥ 1440  контейнер 102.8571rem, збільшені кегль/паддінги/висота ТБ
       ≤1240 сітка товарів 4 → 3
       ≤1024 планшет: герой стекається, сітка 3 → 2, кошик/checkout/трекінг в одну колонку
       ≤ 720 мобільна шапка: лого + кошик в один ряд, навігація — горизонтальна стрічка
       ≤ 560 телефон: усе в одну колонку, 3.1429rem тач-таргети, 1.1429rem в інпутах
   -------------------------------------------------------------------------- */

/* --- ≤ 1240: 4 → 3 у сітці товарів ---------------------------------------- */

@media (max-width: 1240px) {
  .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- ≤ 1024: планшет ------------------------------------------------------ */

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .hero { grid-template-columns: 1fr; gap: 2rem; padding: 3.1429rem 2.5714rem; }
  .hero__title { font-size: 2.4286rem; }
  .hero__lead { max-width: none; }
  .hero__media { height: 21.4286rem; }

  .site-nav { gap: 1.2857rem; }

  .site-footer__cols { flex-wrap: wrap; gap: 2rem 2.8571rem; }
  .site-footer__col { flex: 1 1 40%; }
  .site-footer__brand { flex-basis: 100%; }

  .product { grid-template-columns: 1fr; gap: 1.7143rem; }
  .gallery { max-width: 40rem; }
  .lead { grid-template-columns: 1fr; }
  .strip { flex-direction: column; align-items: flex-start; }
}

/* --- ≤ 860: щільні планшети ----------------------------------------------- */

@media (max-width: 860px) {
  .contacts__cards { grid-template-columns: 1fr; }
}

/* --- ≤ 720: мобільна шапка ------------------------------------------------
   Лого + кошик — один ряд; навігація — горизонтальна стрічка під ними.
   Стрічка обрана замість бургера: чотири пункти видно одразу, без JS. */

@media (max-width: 720px) {
  .site-header__inner {
    flex-wrap: wrap;
    gap: 0.2857rem 1.1429rem;
    padding-top: 0.8571rem;
    padding-bottom: 0.5714rem;
  }

  .site-nav {
    order: 3;
    width: 100%;
    gap: 1.4286rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { display: inline-flex; align-items: center; min-height: 44px; }

  .cart-button { min-height: 44px; }
  .cart-button svg { width: 1.4286rem; height: 1.4286rem; }

  .hero__media { height: 18.5714rem; }
}

/* --- ≤ 560: телефон ------------------------------------------------------- */

@media (max-width: 560px) {

  .grid-4 { grid-template-columns: 1fr; gap: 1rem; }

  .hero { padding: 2.1429rem 1.4286rem; gap: 1.7143rem; border-radius: 1.4286rem; }
  .hero__title { font-size: 2rem; }
  .hero__lead { font-size: 0.9286rem; }
  .hero__actions { gap: 0.7143rem; }
  .hero__actions .btn { flex: 1 1 100%; }
  .hero__media { height: 14.2857rem; }

  .section-title, .page-head .section-title { font-size: 1.4286rem; }
  .section { padding-top: 2.2857rem; }
  .section__head { gap: 0.7143rem; }

  /* Декоративні пікселі розкладені під ширину макета — на телефоні лише шум */
  .pixels { display: none; }
  .pixels-band { display: none; }

  .site-header__inner { padding-top: 0.8571rem; padding-bottom: 0.4286rem; }
  .site-nav { gap: 1.2857rem; font-size: 0.8571rem; }
  .cart-button__label { display: none; }
  .cart-button { gap: 0.4286rem; padding: 0.6429rem 1rem; }

  .page-head { flex-direction: column; align-items: flex-start; gap: 0.4286rem; }
  .page-head--center { align-items: center; }
  .page-head__aside { white-space: normal; }

  .site-footer-wrap { padding: 0; }
  .site-footer { padding: 2rem 1.5714rem 1.5714rem; border-radius: 1.4286rem 1.4286rem 0 0; }
  .site-footer__col { flex-basis: 100%; }
  .site-footer__bottom { flex-direction: column; align-items: flex-start; gap: 0.4286rem; }
  .site-footer__col--center { align-items: flex-start; text-align: left; }
  .site-footer__col--center .site-footer__socials { justify-content: flex-start; }

  .panel { padding: 1.2857rem; }

  /* 1.1429rem в полях уводу — інакше iOS Safari зумить сторінку при фокусі */
  .field__input,
  .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  .field textarea,
  .field select { font-size: 1.1429rem; }
  .field input[type="file"] { font-size: 0.9286rem; }
  .form-grid { grid-template-columns: 1fr; gap: 1rem; }
  .filters__search, .filters__select { flex-basis: 100%; }

  .stepper__btn { min-width: 3.1429rem; min-height: 44px; padding: 0.4286rem 0.7143rem; }
  .stepper__value { min-width: 2.4286rem; }

  .product__title { font-size: 1.5714rem; }
  .product__buy { gap: 0.8571rem; }
  .product__buy .btn { flex: 1 1 100%; }
  .gallery__thumb { width: 4.5714rem; height: 3.4286rem; }

  .lead-form__actions .btn { flex: 1 1 100%; }

  .error-page { padding: 4rem 0 2.2857rem; }
  .error-page__code { font-size: 4rem; }
}

@media (max-width: 380px) {
  .site-nav { gap: 1rem; }
  .hero__title { font-size: 1.7857rem; }
}

@media print {
  .site-header, .site-footer-wrap, .messages, .strip { display: none; }
}
