/* ============================================================
   Вітрина магазину.

   ОКРЕМИЙ ФАЙЛ І ОКРЕМІ ІМЕНА КЛАСІВ (`s-`). Сюди приходять чужі люди,
   і сторінка має бути легкою: жодного портального CSS на 170 КБ заради
   картки товару. Префікс `s-` — щоб класи вітрини ніколи не зіткнулися
   з портальними: у порталі вже є свої `.btn`, `.card`, `.wrap`, і
   випадковий збіг ламав би те чи те.

   ОДНА ТЕМА — СВІТЛА. Магазин не має «темної теми відвідувача»: він має
   виглядати однаково в усіх, і однаково на друку цінника.
   ============================================================ */

:root {
  --s-brand: #3b6ef6;
  --s-brand-text: #2b5fe0;
  --s-on-brand: #fff;
  --s-text: #16181d;
  --s-text-2: #5a6270;
  --s-line: #e4e7ec;
  --s-bg: #fff;
  --s-tint: #f6f8fb;
  --s-r: 12px;
  --s-sh: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--s-bg); color: var(--s-text);
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--s-brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 27px; line-height: 1.25; margin: 0 0 14px; letter-spacing: -.01em; }
h2 { font-size: 21px; margin: 0 0 14px; }

.s-wrap { max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.s-wrap--narrow { max-width: 760px; }

/* ---------- шапка ---------- */
.s-top { border-bottom: 1px solid var(--s-line); background: #fff; position: sticky; top: 0; z-index: 20; }
.s-top__in { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.s-brand { display: flex; align-items: center; gap: 9px; font-weight: 650; color: var(--s-text); font-size: 16px; }
.s-brand:hover { text-decoration: none; }
.s-brand__mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--s-brand); color: var(--s-on-brand);
  display: grid; place-items: center; font-weight: 700;
}
.s-nav { display: flex; gap: 16px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.s-nav a { color: var(--s-text-2); }
.s-nav a.is-active { color: var(--s-text); font-weight: 600; }

/* ---------- блоки ---------- */
.s-hero { padding: 46px 0 38px; background: var(--s-tint); border-bottom: 1px solid var(--s-line); }
.s-hero h1 { font-size: 34px; margin-bottom: 10px; }
.s-hero__sub { color: var(--s-text-2); font-size: 17px; margin: 0 0 18px; max-width: 60ch; }
.s-sec { padding: 32px 0; }
.s-sec--tint { background: var(--s-tint); }
.s-crumbs { padding: 12px 0 0; font-size: 13px; color: var(--s-text-2); }
.s-crumbs a { color: var(--s-text-2); }
.s-count { color: var(--s-text-2); font-size: 13.5px; margin: 0 0 14px; }
.s-empty { color: var(--s-text-2); }

/* ---------- кнопки й поля ---------- */
.s-btn {
  display: inline-block; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--s-line);
  background: #fff; color: var(--s-text); font-weight: 560; cursor: pointer; font-size: 15px;
}
.s-btn:hover { text-decoration: none; border-color: #cfd4dc; }
.s-btn--primary { background: var(--s-brand); border-color: var(--s-brand); color: var(--s-on-brand); }
.s-input {
  padding: 10px 12px; border: 1px solid var(--s-line); border-radius: 10px; font-size: 15px;
  background: #fff; color: var(--s-text); min-width: 0;
}
.s-filter { display: flex; gap: 9px; margin: 0 0 18px; flex-wrap: wrap; }
.s-filter .s-input[type=search] { flex: 1; min-width: 200px; }

/* ---------- категорії ---------- */
.s-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.s-cat {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 14px 16px; border: 1px solid var(--s-line); border-radius: var(--s-r);
  background: #fff; color: var(--s-text); font-weight: 560;
}
.s-cat:hover { text-decoration: none; border-color: var(--s-brand); }
.s-cat b { color: var(--s-text-2); font-weight: 500; font-size: 13px; }

/* Плитка з фото (1.6). Картинка окремим рядком, а не тлом: тло не
   можна ані підвантажити ліниво, ані підписати для пошуковика — а
   картинка категорії це саме та річ, яку Google показує у видачі. */
.s-cat--pic { flex-direction: column; align-items: stretch; gap: 8px; padding: 0 0 12px; overflow: hidden; }
.s-cat--pic img {
  display: block; width: 100%; height: 132px; object-fit: cover;
  background: var(--s-tint); border-radius: var(--s-r) var(--s-r) 0 0;
}
.s-cat--pic span { padding: 0 14px; }
.s-cat--pic b { padding: 0 14px; }

/* Банер угорі сторінки категорії. Висота обмежена: вертикальне фото на
   весь екран відсунуло б товар за нижній край, і покупець вирішив би,
   що категорія порожня. */
.s-catban { margin: 0 0 18px; border-radius: var(--s-r); overflow: hidden; background: var(--s-tint); }
.s-catban img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
@media (max-width: 720px) {
  .s-catban img { max-height: 150px; }
  .s-cat--pic img { height: 110px; }
}

/* ---------- сітка товарів ---------- */
.s-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.s-card {
  border: 1px solid var(--s-line); border-radius: var(--s-r); background: #fff;
  padding: 12px; color: var(--s-text); display: flex; flex-direction: column; gap: 7px;
}
.s-card:hover { text-decoration: none; box-shadow: var(--s-sh); border-color: #cfd4dc; }
.s-card__pic {
  aspect-ratio: 1 / 1; display: grid; place-items: center; background: var(--s-tint);
  border-radius: 9px; overflow: hidden; position: relative;
}

/* Позначки «Новинка» й «Акція» (1.7). Поверх фото, а не під ним:
   покупець гортає каталог очима по картинках, і позначка під назвою
   просто не потрапляє в поле зору. */
.s-badges { position: absolute; top: 6px; left: 6px; display: flex; flex-wrap: wrap; gap: 4px; z-index: 1; }
.s-badges--row { position: static; margin: 0 0 8px; }
.s-badge {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 620; line-height: 1.4; color: #fff; white-space: nowrap;
}
.s-badge--new { background: #1f9d55; }
.s-badge--promo { background: #d64545; }
.s-card__pic img { width: 100%; height: 100%; object-fit: contain; }
.s-card__nopic, .s-prod__nopic { color: var(--s-text-2); font-size: 13px; }
.s-card__name {
  font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.s-card__price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.s-card__price b { font-size: 16.5px; }
.s-card__price s, .s-price s { color: var(--s-text-2); font-size: 13px; }
.s-card__stock { font-size: 12.5px; }
.s-card__stock.is-in, .s-stock.is-in { color: #1a7f45; }
.s-card__stock.is-out, .s-stock.is-out { color: #b42318; }

/* ---------- картка товару ---------- */
.s-prod { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; }
.s-prod__main {
  width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: var(--s-tint);
  border-radius: var(--s-r);
}
.s-prod__nopic {
  aspect-ratio: 1 / 1; display: grid; place-items: center; background: var(--s-tint);
  border-radius: var(--s-r);
}
.s-prod__thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.s-prod__thumbs img {
  width: 72px; height: 72px; object-fit: contain; background: var(--s-tint); border-radius: 8px;
}
.s-prod__sku, .s-prod__brand { color: var(--s-text-2); font-size: 13.5px; }
.s-price { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 8px; }
.s-price b { font-size: 30px; letter-spacing: -.02em; }
.s-stock { font-weight: 560; margin-bottom: 14px; }
.s-prod__short { color: var(--s-text-2); }
.s-prod__note {
  margin-top: 18px; padding: 12px 14px; background: var(--s-tint); border-radius: 10px; font-size: 14px;
}
.s-prose { margin-top: 26px; max-width: 72ch; }
.s-prose img { border-radius: 8px; }

/* ---------- гортання ---------- */
.s-pager { display: flex; gap: 14px; align-items: center; margin-top: 24px; color: var(--s-text-2); font-size: 14px; }

/* ---------- підвал ---------- */
.s-foot { border-top: 1px solid var(--s-line); background: var(--s-tint); padding: 26px 0; margin-top: 40px; }
.s-foot__cols { display: flex; gap: 40px; flex-wrap: wrap; font-size: 14px; }
.s-foot__cols > div { display: flex; flex-direction: column; gap: 5px; }
.s-foot__cols a { color: var(--s-text-2); }
.s-foot__bottom { margin-top: 18px; color: var(--s-text-2); font-size: 13px; }

/* ---------- телефон ---------- */
@media (max-width: 720px) {
  h1 { font-size: 23px; }
  .s-hero { padding: 30px 0 26px; }
  .s-hero h1 { font-size: 26px; }
  .s-prod { grid-template-columns: 1fr; gap: 18px; }
  .s-price b { font-size: 25px; }
  .s-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .s-nav { gap: 12px; font-size: 14px; }
}

/* ---------- кошик, оформлення, замовлення (1.2) ---------- */
.s-cart-link { position: relative; font-weight: 560; }
.s-cart-n {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px;
  background: var(--s-brand); color: var(--s-on-brand);
  border-radius: 9px; font-size: 12px; line-height: 18px; text-align: center;
}
.s-msg { padding: 11px 14px; border-radius: 10px; margin: 0 0 18px; font-size: 14px; }
.s-msg--bad { background: #fdecec; color: #8a1c1c; }
.s-msg--good { background: #e9f6ec; color: #1c6b32; }

.s-buy { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.s-buy__qty { width: 84px; text-align: center; }

.s-cart { border-top: 1px solid var(--s-line); }
.s-cart__row {
  display: grid; grid-template-columns: 64px 1fr 96px 120px 34px;
  gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--s-line);
}
.s-cart__pic img { border-radius: 8px; object-fit: cover; }
.s-cart__name { display: flex; flex-direction: column; gap: 3px; }
.s-cart__sku { color: var(--s-text-2); font-size: 12px; }
.s-cart__warn { color: #a2401a; font-size: 12px; font-weight: 560; }
.s-cart__sum { text-align: right; font-weight: 620; }
.s-x {
  border: 0; background: none; cursor: pointer; font-size: 22px; line-height: 1;
  color: var(--s-text-2); padding: 2px 6px; border-radius: 6px;
}
.s-x:hover { background: var(--s-tint); color: #8a1c1c; }
.s-cart__foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 0; flex-wrap: wrap;
}
.s-cart__total { font-size: 19px; }
.s-cart__go { display: flex; gap: 10px; flex-wrap: wrap; }

.s-sum { background: var(--s-tint); border-radius: 12px; padding: 14px 16px; margin-bottom: 22px; }
.s-sum__row { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; font-size: 14px; }
.s-sum__row--total {
  border-top: 1px solid var(--s-line); margin-top: 6px; padding-top: 10px; font-size: 17px;
}

.s-form { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.s-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 560; font-size: 14px; }
.s-form textarea.s-input { resize: vertical; font: inherit; }
.s-fs { border: 1px solid var(--s-line); border-radius: 12px; padding: 12px 14px; }
.s-fs legend { padding: 0 6px; font-weight: 620; font-size: 14px; }
.s-radio { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 400 !important; }
.s-btn--wide { justify-content: center; padding: 12px 20px; font-size: 16px; }
.s-hint { color: var(--s-text-2); font-size: 13px; font-weight: 400; }
.s-pay { margin: 16px 0; }

.s-def { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14px; margin: 0 0 20px; }
.s-def dt { color: var(--s-text-2); }
.s-def dd { margin: 0; font-weight: 560; }

/* Пропозиція підписатись на бота (1.5). Рамкою, а не суцільною
   заливкою: це доповнення до сторінки, а не її головна дія — кнопка
   «Оплатити» під ним має лишатись помітнішою. */
.s-tg { border: 1px solid var(--s-line); border-radius: 12px; padding: 14px 16px; margin: 0 0 20px; }
.s-tg p { margin: 0 0 8px; }
.s-tg p:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
  /* Кнопку «прибрати» на телефоні НЕ ховаємо: кошик, з якого не можна
     нічого викинути, доводиться очищати повністю. */
  .s-cart__row {
    grid-template-columns: 48px 1fr 74px 34px;
    grid-template-areas: "pic name name del" "pic qty sum del";
  }
  .s-cart__pic  { grid-area: pic; }
  .s-cart__name { grid-area: name; }
  .s-cart__qty  { grid-area: qty; }
  .s-cart__sum  { grid-area: sum; }
  .s-cart__del  { grid-area: del; }
}

/* ---------- кабінет покупця (1.3) ---------- */
.s-acc-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.s-back { font-size: 14px; margin: 0 0 10px; }
.s-orders { border-top: 1px solid var(--s-line); }
.s-order {
  display: grid; grid-template-columns: 90px 1fr 150px 130px; gap: 12px; align-items: center;
  padding: 13px 0; border-bottom: 1px solid var(--s-line); color: inherit;
}
.s-order:hover { background: var(--s-tint); }
.s-order__n { font-weight: 620; }
.s-order__d, .s-order__s { color: var(--s-text-2); font-size: 14px; }
.s-order__t { text-align: right; font-weight: 620; }
.s-google { margin: 0 0 6px; max-width: 520px; }
.s-or {
  display: flex; align-items: center; gap: 12px; max-width: 520px;
  color: var(--s-text-2); font-size: 13px; margin: 14px 0;
}
.s-or::before, .s-or::after { content: ""; flex: 1; height: 1px; background: var(--s-line); }

@media (max-width: 720px) {
  .s-order { grid-template-columns: 1fr auto; grid-template-areas: "n t" "d s"; }
  .s-order__n { grid-area: n; } .s-order__t { grid-area: t; }
  .s-order__d { grid-area: d; } .s-order__s { grid-area: s; text-align: right; }
}

/* ---------- вибір відділення Нової пошти (1.4) ---------- */
.s-np { border: 1px solid var(--s-line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.s-np__find { display: flex; gap: 8px; }
.s-np__find .s-input { flex: 1; min-width: 0; }
.s-np__city { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.s-np__list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.s-np__opt {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--s-line); border-radius: 9px;
  background: #fff; cursor: pointer; text-align: left; font: inherit; color: var(--s-text);
}
.s-np__opt:hover { border-color: var(--s-brand); background: var(--s-tint); }
.s-np__opt span { color: var(--s-text-2); font-size: 13px; }
.s-link {
  border: 0; background: none; padding: 0; cursor: pointer; font: inherit;
  color: var(--s-brand-text); text-decoration: underline;
}
/* Кнопка, яку натискає Enter. Не показується, але існує — див. коментар
   у формі оформлення. */
.s-enter { position: absolute; width: 0; height: 0; padding: 0; border: 0; opacity: 0; }

/* ---------- характеристики (1.7) ---------- */
.s-h2 { font-size: 19px; margin: 26px 0 12px; }
.s-specs { width: 100%; border-collapse: collapse; font-size: 14.5px; max-width: 720px; }
.s-specs th, .s-specs td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--s-line); vertical-align: top; }
.s-specs th { color: var(--s-text-2); font-weight: 500; width: 40%; }
