/* ============================================================
   podguznik.ru v3 — дизайн-система
   Токены: README макета «Podguznik Design 29.07.2026» (менять нельзя)
   ============================================================ */
:root {
  --bg: #faf6ef;
  --surface: #fff;
  --line: #eee4d6;
  --line-soft: #f2ebdf;
  --ink: #3d3229;
  --ink-2: #6b5c4c;
  --ink-3: #8d7c68;
  --muted: #a5947e;
  --terra: #c96f4a;
  --terra-bg: #faf3e8;
  --green: #8aab8a;
  --green-bg: #e4ecdf;
  --green-bg-soft: #f2f6ef;
  --green-ink: #5d7d5d;
  --pastel-cream: #f3e3cf;
  --pastel-peach: #fbe9d9;
  --pastel-lilac: #e9e4f2;
  --pastel-rose: #f6e0e0;
  --pastel-blue: #e0edf2;
  --dark-ink-on: #cbbba7;   /* текст на тёмном #3d3229 */
  --price-old: #b7a68f;
  --star: #e8a13c;
  --r-block: 28px;
  --r-card: 22px;
  --r-mini: 14px;
  --r-pill: 999px;
  --shadow-cta: 0 6px 16px rgba(201, 111, 74, .3);
  --shadow-pop: 0 12px 30px rgba(61, 50, 41, .12);
  --container: 1240px;
  --pad-x: 48px;
}

/* ---- база ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 Nunito, system-ui, -apple-system, sans-serif;
}
img { max-width: 100%; display: block; }
iframe { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.container { max-width: calc(var(--container) + var(--pad-x) * 2); margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); }
.section { margin-bottom: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-title { font-size: 26px; font-weight: 900; }
.section-link { font-size: 13.5px; font-weight: 800; color: var(--terra); flex: none; }
.divider { height: 1px; background: var(--line-soft); border: 0; }

/* ---- кнопки ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-pill); font-weight: 800; font-size: 14.5px;
  padding: 13px 26px; transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn--terra { background: var(--terra); color: #fff; box-shadow: var(--shadow-cta); }
.btn--green { background: var(--green); color: #fff; }
.btn--white { background: #fff; color: var(--green-ink); }
.btn--outline { background: #fff; border: 2px solid #e8d9c5; color: var(--ink-2); }
.btn--sm { padding: 10px 18px; font-size: 13px; }
.btn[disabled], .btn--disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn[disabled]:hover, .btn--disabled:hover { transform: none; }

/* ---- чипы ---- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  background: var(--terra-bg); border-radius: var(--r-pill);
  padding: 9px 18px; font-size: 13px; font-weight: 800; color: var(--ink-3);
}
.chip--on { background: var(--terra); color: #fff; }
.chip--dark { background: var(--ink); color: #fff; }
.chip--white { background: #fff; color: var(--ink-3); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }

/* ---- карточки, поля, бейджи ---- */
.card { background: var(--surface); border-radius: var(--r-card); }
.card--pad { padding: 22px 24px; }
.pill-input {
  width: 100%; background: #fff; border: 1.5px solid #eee0cf; border-radius: var(--r-pill);
  padding: 10px 18px; font-size: 13.5px;
}
.pill-input::placeholder { color: #b0a08c; }
.pill-input:focus { outline: 2px solid var(--terra); outline-offset: -1px; border-color: transparent; }
.badge {
  display: inline-block; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 800; padding: 4px 10px;
}
.badge--terra { background: var(--terra); color: #fff; }
.price { font-weight: 900; font-size: 17px; }
.price-old { font-size: 12px; color: var(--price-old); text-decoration: line-through; }
.rating-line { font-size: 12px; color: var(--green); font-weight: 800; }
.stars { color: var(--star); }
.ph { /* заглушка вместо фото: мягкий градиент в тонах дизайна (не полосатый) */
  background: linear-gradient(135deg, #f0e6d7, #f6efe3);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; font-weight: 700;
}

/* ---- шапка (макет 2a: строки 768–778) ---- */
.site-header {
  display: flex; align-items: center; gap: 28px;
  padding: 18px var(--pad-x); border-bottom: 1px solid var(--line);
}
.logo { font-weight: 900; font-size: 22px; color: var(--terra); flex: none; }
.logo span { color: var(--green); }
.site-nav { display: flex; gap: 24px; font-size: 14.5px; font-weight: 800; color: var(--ink-2); }
.nav-item { position: relative; }
.nav-item > a:hover, .nav-item > a.is-active { color: var(--terra); }
.nav-drop {
  display: none; position: absolute; top: 100%; left: -16px; z-index: 40;
  min-width: 210px; padding: 10px 0; margin-top: 8px;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-pop);
}
.nav-drop a { display: block; padding: 8px 20px; font-size: 13.5px; font-weight: 700; }
.nav-drop a:hover { color: var(--terra); background: var(--terra-bg); }
.nav-item:hover .nav-drop { display: block; }
.nav-item::after { /* мостик, чтобы дропдаун не закрывался в зазоре */
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px;
}
.header-search { flex: 1; max-width: 260px; }
.header-actions { display: flex; gap: 20px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.header-action { display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; }
.header-action:hover { color: var(--terra); }
.cart-badge {
  position: absolute; top: -6px; right: -10px;
  background: var(--terra); color: #fff; border-radius: var(--r-pill);
  font-size: 10px; padding: 1px 6px;
}
.mobile-search { display: none; margin: 6px 20px 14px; }

/* ---- тост (cart.js: «Добавлено в корзину») ---- */
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 100;
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 700;
  padding: 13px 22px; border-radius: var(--r-mini); box-shadow: var(--shadow-pop);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  pointer-events: none;
}
.toast--visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---- футер (макет 2a: строки 904–911) ---- */
.site-footer { background: var(--ink); color: var(--dark-ink-on); font-size: 13px; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
  padding: 36px var(--pad-x);
}
.footer-brand { font-weight: 900; font-size: 20px; color: #fff; margin-bottom: 10px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col > span:first-child { color: #fff; font-weight: 800; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  padding: 14px var(--pad-x) 18px; border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px;
}

/* ---- мобильный таб-бар (макет 3b: строки 745–753) ---- */
.tabbar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  justify-content: space-around;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--line);
}
.tabbar__item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 800; color: var(--muted);
  min-width: 50px; min-height: 38px;
}
.tabbar__item > span { font-size: 19px; }
.tabbar__item.is-active { color: var(--terra); }

/* ---- мобильная шапка + таб-бар (HIGH-2, финальная ревизия этапа 2) ----
   На 769–1023px (планшет/узкий десктоп без .site-nav — навигации там больше
   нет никакой) шапка и таб-бар обязаны вести себя так же, как на телефоне:
   раньше порог был 768px, и в диапазоне 769–1023 шапка ещё пробовала
   показать текстовые header-actions + site-nav, из-за чего документ
   распирало по ширине (scrollWidth > clientWidth на 800px и т.п.).
   Остальная мобильная вёрстка страниц (пункт «прочие страничные @media(768)»
   ниже) порог не меняет — тронута только шапка/таб-бар. */
@media (max-width: 1023px) {
  body { padding-bottom: 74px; }
  .tabbar { display: flex; }
  .site-nav { display: none; }
  .site-header { gap: 8px; padding: 16px 20px 10px; justify-content: space-between; border-bottom: 0; }
  .logo { font-size: 19px; }
  .header-search { display: none; }
  .mobile-search { display: block; }
  .header-actions { gap: 8px; font-size: 0; } /* подписи скрыть, круглые кнопки */
  .header-action {
    width: 38px; height: 38px; border-radius: var(--r-pill); background: #fff;
    justify-content: center; gap: 0;
  }
  .header-action > span:not(.cart-badge) { font-size: 15px; }
  .cart-badge { top: -4px; right: -4px; font-size: 10px; }
}

/* ---- мобильная версия (макет 3b: строки 689–704) ---- */
@media (max-width: 768px) {
  :root { --pad-x: 20px; }
  .section-title { font-size: 19px; }
  .section { margin-bottom: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; padding: 28px var(--pad-x); }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .site-footer { overflow-wrap: anywhere; }
  .toast { left: 16px; right: 16px; bottom: calc(74px + 14px); text-align: center; }
}
