/* ПРАЙМ — дизайн-система (ShopCart-стиль: светлый, скруглённый, технологичный).
   Оранжевый бренд (9 точек), белые карточки, мягкие тени, крупная типографика.
   Mobile-first: база — телефон, @media (min-width) — расширение. */

:root {
  /* бренд */
  --brand: #F55B0F;
  --brand-hot: #E14A00;
  --brand-soft: #FFF1E9;
  --brand-glow: rgba(245, 91, 15, .30);

  /* чернила и поверхности */
  --ink: #14181D;             /* тёмные блоки, заголовки */
  --ink-2: #1F262E;
  --bg: #FFFFFF;              /* фон страницы */
  --bg-soft: #F5F6F8;         /* секции, hero-карта, плитки */
  --bg-soft-2: #EEF0F3;
  --paper: #FFFFFF;           /* карточки */
  --line: #E9ECF0;           /* границы */
  --line-2: #D7DCE2;

  --txt: #191E24;
  --txt-2: #5B6572;
  --txt-3: #9AA3AE;
  --star: #F5A623;            /* рейтинг-жёлтый (декор) */

  --ok: #17A34A;
  --ok-soft: #E7F7ED;
  --warn: #B7791F;
  --warn-soft: #FDF3DF;
  --bad: #DC2626;
  --bad-soft: #FDECEC;

  --font-d: "Oswald", "Arial Narrow", sans-serif;      /* дисплей: заголовки, цены */
  --font-b: "Inter", system-ui, sans-serif;             /* текст */
  --font-m: "JetBrains Mono", ui-monospace, monospace;  /* артикулы */

  --r: 14px;                  /* карточки */
  --r-s: 10px;                /* кнопки/инпуты */
  --r-lg: 24px;               /* hero, крупные блоки */
  --shadow-sm: 0 1px 2px rgba(20,24,29,.04), 0 1px 3px rgba(20,24,29,.05);
  --shadow: 0 2px 6px rgba(20,24,29,.05), 0 8px 24px rgba(20,24,29,.06);
  --shadow-up: 0 6px 14px rgba(20,24,29,.08), 0 18px 40px rgba(20,24,29,.12);
  --wrap: 1280px;
  --hdr-h: 128px;             /* высота шапки (для sticky-расчётов) */
}

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font: 400 15px/1.55 var(--font-b);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-hot); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
h1, h2, h3 { font-family: var(--font-d); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(24px, 4.5vw, 34px); text-transform: uppercase; letter-spacing: .02em; }
h2 { font-size: clamp(20px, 3.5vw, 28px); text-transform: uppercase; letter-spacing: .02em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 14px; }
@media (min-width: 768px) { .wrap { padding: 0 22px; } }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 8px 16px; border-radius: 0 0 var(--r-s) 0;
}
.skip-link:focus { left: 0; color: #fff; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- заголовки секций ---------- */
.sec-title { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 16px; }
.sec-title h2 { margin: 0; font-weight: 700; }
.sec-title h2 em { font-style: normal; color: var(--brand); }
.sec-title .more {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--txt-2); white-space: nowrap;
}
.sec-title .more::after { content: "→"; transition: transform .15s; }
.sec-title .more:hover { color: var(--brand-hot); }
.sec-title .more:hover::after { transform: translateX(3px); }

/* ================= ШАПКА ================= */
.hdr { position: sticky; top: 0; z-index: 50; background: var(--bg); }

/* трест-бар */
.hdr-top { background: var(--ink); color: #C7CED6; font-size: 12.5px; }
.hdr-top-in {
  display: flex; align-items: center; gap: 18px;
  padding-top: 8px; padding-bottom: 8px; overflow-x: auto; scrollbar-width: none;
}
.hdr-top-in::-webkit-scrollbar { display: none; }
.trust { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.trust svg { color: var(--brand); flex: none; }
.hdr-top-r { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.hdr-phone { font-weight: 700; color: #fff; white-space: nowrap; }
.hdr-phone:hover { color: var(--brand); }

/* основная строка */
.hdr-main { border-bottom: 1px solid var(--line); }
.hdr-main-in {
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center;
  gap: 10px; padding-top: 12px; padding-bottom: 12px;
}
@media (min-width: 768px) {
  .hdr-main-in { grid-template-columns: auto minmax(280px, 620px) auto; gap: 22px; padding-top: 15px; padding-bottom: 15px; }
}

/* --- логотип: ПРАЙМ по ширине подписи (буквы распределены) --- */
.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo:hover { color: inherit; }
.logo-dots { width: 40px; height: 40px; flex: none; }
.logo-text { display: inline-flex; flex-direction: column; }
.logo-text b {
  display: flex; justify-content: space-between;  /* распределить буквы на ширину подписи */
  font-family: var(--font-b); font-weight: 800; font-size: 21px; line-height: 1;
  color: var(--ink);
}
.logo-text b span { display: block; }
.logo-text i {
  display: block; font-style: normal; font-size: 9.2px; line-height: 1;
  letter-spacing: .02em; color: var(--txt-3); margin-top: 4px; white-space: nowrap;
}
@media (min-width: 768px) {
  .logo-dots { width: 46px; height: 46px; }
  .logo-text b { font-size: 25px; }
  .logo-text i { font-size: 11px; }
}

/* бургер */
.nav-burger {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 4.5px;
  width: 44px; height: 44px; padding: 11px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--r-s);
}
.nav-burger span { height: 2px; background: var(--ink); border-radius: 1px; transition: transform .2s, opacity .2s; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
@media (min-width: 1024px) { .nav-burger { display: none; } }

/* поиск */
.search { position: relative; grid-column: 1 / -1; order: 5; display: flex; }
@media (min-width: 768px) { .search { grid-column: auto; order: 0; } }
.search input {
  flex: 1; min-width: 0; height: 46px; padding: 0 50px 0 16px;
  background: var(--bg-soft); border: 1.5px solid var(--line); border-radius: 999px;
  color: var(--txt); transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input::placeholder { color: var(--txt-3); }
.search input:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(245,91,15,.14); }
.search button {
  position: absolute; right: 5px; top: 5px; width: 42px; height: 36px;
  display: grid; place-items: center; background: var(--brand); color: #fff;
  border: 0; border-radius: 999px; transition: background .15s;
}
.search button:hover { background: var(--brand-hot); }

/* корзина */
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  height: 46px; padding: 0 15px; background: var(--bg-soft);
  border: 1.5px solid var(--line); border-radius: 999px; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.cart-btn:hover { border-color: var(--brand); color: var(--ink); background: #fff; }
.cart-badge {
  position: absolute; top: -5px; left: 26px; min-width: 20px; height: 20px;
  display: grid; place-items: center; padding: 0 5px;
  background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700;
  border-radius: 10px; border: 2px solid #fff;
}
.cart-sum { font-family: var(--font-d); font-weight: 600; font-size: 15px; letter-spacing: .03em; }
@media (max-width: 420px) { .cart-sum { display: none; } .cart-btn { padding: 0 12px; } }

/* полоса категорий */
.hdr-nav { background: var(--bg); border-bottom: 1px solid var(--line); }

/* ================= КНОПКИ ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 22px; border: 0; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 14.5px;
  transition: background .16s, transform .06s, box-shadow .16s;
}
.btn:hover { background: var(--brand-hot); color: #fff; box-shadow: 0 6px 18px var(--brand-glow); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--txt-3); cursor: not-allowed; box-shadow: none; }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: var(--ink-2); box-shadow: 0 6px 18px rgba(20,24,29,.22); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-ghost:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-hot); box-shadow: none; }
.btn-lg { min-height: 52px; font-size: 16px; padding: 12px 30px; }
.btn-sm { min-height: 38px; padding: 6px 16px; font-size: 13px; }

/* ================= БЕЙДЖИ НАЛИЧИЯ ================= */
.stock { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stock-ok { background: var(--ok-soft); color: var(--ok); }
.stock-few { background: var(--warn-soft); color: var(--warn); }
.stock-no { background: var(--bad-soft); color: var(--bad); }

/* ================= СЕТКА + КАРТОЧКА ТОВАРА ================= */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1180px) { .grid { grid-template-columns: repeat(5, 1fr); } }

.card {
  position: relative; display: flex; flex-direction: column; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-up); transform: translateY(-3px); border-color: transparent; }
/* Слот фото — ЖЁСТКИЙ квадрат. Фото абсолютом внутри: вертикальные снимки
   (холодильники) больше не раздувают слот — высота контейнера не зависит от
   контента, max-% считаются от квадрата, пропорции всегда сохраняются. */
.card-img { position: relative; display: block; aspect-ratio: 1; background: #fff; }
.card-img img {
  position: absolute; inset: 0; margin: auto;
  max-width: calc(100% - 28px); max-height: calc(100% - 28px);
  width: auto; height: auto;
}
/* без зума картинки на hover — она не должна выходить за посадочное место */
.card-disc {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; letter-spacing: .02em;
}
.card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; flex: 1; padding: 12px 13px 13px; border-top: 1px solid var(--line); }
.card-vendor { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-3); font-weight: 700; }
.card-name {
  align-self: stretch; font-size: 13.5px; line-height: 1.38; font-weight: 500; color: var(--txt);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(1.38em * 2);
}
.card:hover .card-name { color: var(--brand-hot); }
.card-price { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.price { font-family: var(--font-d); font-weight: 700; font-size: 19px; letter-spacing: .01em; white-space: nowrap; color: var(--ink); }
.price small { font-size: 12px; font-weight: 500; }
.price-old { font-size: 12.5px; color: var(--txt-3); text-decoration: line-through; font-weight: 400; }

/* форма — флекс-элемент карточки: на всю ширину и прижата к низу,
   чтобы кнопки «В корзину» стояли на одном уровне во всех карточках */
.card-body form { align-self: stretch; width: 100%; margin-top: auto; }
.card-body .card-foot { margin-top: auto; }
/* кнопка «в корзину» на всю ширину (как в референсе) */
.card-add {
  width: 100%; margin-top: 4px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 8px 12px; border: 0; border-radius: var(--r-s);
  background: var(--ink); color: #fff; font-weight: 600; font-size: 13.5px;
  transition: background .15s, transform .06s;
}
.card-add:hover { background: var(--brand); color: #fff; }
.card-add:active { transform: translateY(1px); }
.card-add svg { flex: none; }

/* ================= ХЛЕБНЫЕ КРОШКИ ================= */
.crumbs { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 14px 0 4px; padding-left: 0; font-size: 12.5px; color: var(--txt-3); }
.crumbs a { color: var(--txt-2); }
.crumbs a:hover { color: var(--brand-hot); }
.crumbs li { list-style: none; display: flex; gap: 5px; }
.crumbs li + li::before { content: "›"; color: var(--txt-3); }

/* ================= ПАГИНАЦИЯ ================= */
.pager { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin: 26px 0; }
.pager a, .pager span {
  min-width: 42px; height: 42px; display: inline-grid; place-items: center; padding: 0 10px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-s);
  font-weight: 600; font-size: 14px; color: var(--txt-2);
}
.pager a:hover { border-color: var(--brand); color: var(--brand-hot); }
.pager .cur { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .gap { border: 0; background: transparent; color: var(--txt-3); }

/* ================= ФОРМЫ ================= */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.field label { font-size: 13px; font-weight: 600; color: var(--txt-2); }
.field input, .field select, .field textarea {
  min-height: 46px; padding: 11px 14px; background: var(--paper);
  border: 1.5px solid var(--line-2); border-radius: var(--r-s); color: var(--txt);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(245,91,15,.13);
}
.field .err { color: var(--bad); font-size: 12.5px; }

/* степпер количества */
.qty-box { display: inline-flex; align-items: stretch; border: 1.5px solid var(--line-2); border-radius: var(--r-s); overflow: hidden; background: var(--paper); }
.qty-box button { width: 42px; border: 0; background: transparent; font-size: 20px; font-weight: 600; color: var(--txt-2); }
.qty-box button:hover { background: var(--brand-soft); color: var(--brand-hot); }
.qty-box input {
  width: 58px; border: 0; text-align: center; font-weight: 600; font-size: 15px;
  -moz-appearance: textfield; appearance: textfield;
}
.qty-box input::-webkit-outer-spin-button, .qty-box input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty-box input:focus { outline: none; background: var(--brand-soft); }

/* ================= ТОСТЫ ================= */
.toasts { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 15px; border-radius: var(--r-s); font-weight: 500; font-size: 14px; }
.toast-success { background: var(--ok-soft); color: var(--ok); }
.toast-error { background: var(--bad-soft); color: var(--bad); }
.toast-info, .toast-warning { background: var(--warn-soft); color: var(--warn); }

/* ================= ПАНЕЛИ ================= */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
@media (min-width: 768px) { .panel { padding: 24px; } }

.mono { font-family: var(--font-m); font-size: .92em; }

/* ================= ФУТЕР ================= */
.ftr { background: var(--ink); color: #C7CED6; margin-top: 52px; }
.ftr-in { display: grid; gap: 28px; padding: 40px 14px 30px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .ftr-in { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .ftr-in { grid-template-columns: 1.6fr 1fr 1fr; gap: 48px; padding: 48px 22px 34px; } }
.ftr-brand-blk { max-width: 340px; }
.ftr-brand { display: inline-flex; gap: 11px; align-items: center; margin-bottom: 14px; }
.ftr-brand .logo-text b { color: #fff; }
.ftr-brand .logo-text i { color: var(--txt-3); }
.ftr-about { font-size: 13.5px; line-height: 1.6; color: #97A0AB; margin: 0 0 16px; }
.ftr-contacts { font-size: 13.5px; line-height: 1.9; }
.ftr-contacts a { color: #fff; font-weight: 600; }
.ftr-contacts a:hover { color: var(--brand); }
.ftr-col h4 { margin: 0 0 14px; font-family: var(--font-d); text-transform: uppercase; letter-spacing: .05em; font-size: 14px; color: #fff; }
.ftr-col a { display: block; padding: 5px 0; color: #A7B0BA; font-size: 14px; }
.ftr-col a:hover { color: var(--brand); }
.ftr-col p { margin: 0; font-size: 13.5px; color: #97A0AB; }
.ftr-bottom { border-top: 1px solid var(--ink-2); padding: 16px 0; font-size: 12.5px; color: var(--txt-3); }
.ftr-bottom .wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }

/* ================= УТИЛИТЫ ================= */
.muted { color: var(--txt-2); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.hide-m { display: none; }
@media (min-width: 768px) { .hide-m { display: initial; } }
.hide-d { display: initial; }
@media (min-width: 768px) { .hide-d { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
