:root {
  --bg: #f6f7f2;
  --surface: #ffffff;
  --text: #17231a;
  --muted: #6b7a6e;
  --line: #e4e8df;
  --brand: #1f7a4a;
  --brand-dark: #165c37;
  --brand-soft: #e5f2e9;
  --accent: #f2b33d;
  --danger: #d1493f;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 40, 25, .06), 0 4px 16px rgba(20, 40, 25, .06);
  --topbar-h: 68px;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 0;
  font: inherit; font-weight: 700; cursor: pointer; transition: .15s;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { background: var(--brand-soft); color: var(--brand-dark); }
.btn--ghost:hover { background: #d4eadb; }
.btn--lg { height: 52px; padding: 0 24px; font-size: 16px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  border: 0; border-radius: 12px; background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--brand-soft); }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex; align-items: center; gap: 16px;
  height: var(--topbar-h); max-width: 1440px; margin: 0 auto; padding: 0 24px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; white-space: nowrap; }
.logo__mark {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 12px; background: var(--brand-soft); font-size: 20px;
}
.search {
  flex: 1; max-width: 560px; margin-left: 24px;
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 14px; border-radius: 12px; background: #f0f2ec; color: var(--muted);
}
.search:focus-within { background: #fff; box-shadow: 0 0 0 2px var(--brand); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); }
.topbar__right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.langs { display: flex; padding: 3px; border-radius: 12px; background: #f0f2ec; }
.langs__item {
  min-width: 38px; height: 34px; padding: 0 8px; border-radius: 9px;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted);
}
.langs__item:hover { color: var(--text); }
.langs__item.is-active { background: #fff; color: var(--brand-dark); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.menu-btn { display: none; }

.notice {
  text-align: center; padding: 9px 16px; font-size: 14px; font-weight: 600;
  background: var(--brand); color: #fff;
}

/* ---------- Раскладка ---------- */
.layout {
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 32px;
  max-width: 1440px; margin: 0 auto; padding: 24px;
}
.content { min-width: 0; }

.sidebar {
  position: sticky; top: calc(var(--topbar-h) + 24px);
  align-self: start; max-height: calc(100vh - var(--topbar-h) - 48px); overflow-y: auto;
}
.sidebar__head { display: none; }
.catnav { display: flex; flex-direction: column; gap: 2px; }
.catnav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; font-weight: 600; transition: .12s;
}
.catnav__item:hover { background: #ecefe7; }
.catnav__item.is-active { background: var(--brand-soft); color: var(--brand-dark); }
.catnav__icon {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); font-size: 18px;
}
.catnav__name { flex: 1; }
.catnav__count { font-size: 12px; color: var(--muted); font-weight: 600; }
.sidebar__contacts {
  display: flex; flex-direction: column; gap: 8px; margin-top: 24px; padding: 16px;
  border-radius: var(--radius); background: var(--surface); font-size: 14px; color: var(--muted);
}
.sidebar__contacts a:hover { color: var(--brand); }
.backdrop { display: none; }

/* ---------- Карусель ---------- */
.hero { position: relative; margin-bottom: 20px; }
.hero__track {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; scroll-behavior: smooth;
}
.hero__track::-webkit-scrollbar { display: none; }
.slide {
  position: relative; flex: 0 0 calc((100% - 16px) / 2); aspect-ratio: 16 / 8;
  border-radius: 20px; overflow: hidden; scroll-snap-align: start; background: var(--brand-soft);
}
.slide img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.slide:hover img { transform: scale(1.03); }
.slide__text {
  position: absolute; inset: auto 0 0 0; padding: 48px 22px 20px; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
}
.slide__text h2 { font-size: 24px; }
.slide__text p { margin: 4px 0 0; opacity: .92; }
.hero__arrow {
  position: absolute; top: 50%; translate: 0 -50%;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; box-shadow: var(--shadow); font-size: 26px; line-height: 1; color: var(--text);
}
.hero__arrow--prev { left: -14px; }
.hero__arrow--next { right: -14px; }

/* ---------- Чипсы ---------- */
.chips { display: none; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 8px; padding: 0 16px 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow); font-weight: 600; font-size: 14px;
}

/* ---------- Секции и карточки ---------- */
.section { margin-top: 32px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section__more { color: var(--brand); font-weight: 700; white-space: nowrap; }
.section__more:hover { text-decoration: underline; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.row-scroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 220px); gap: 16px;
  overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; scrollbar-width: thin;
}
.row-scroll > * { scroll-snap-align: start; }

.card {
  display: flex; flex-direction: column; background: var(--surface);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(20, 40, 25, .12); }
.card__img { position: relative; aspect-ratio: 1; background: #eef1ea; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card.is-out .card__img img { opacity: .55; filter: grayscale(.4); }
.card__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.card__price { font-weight: 800; font-size: 18px; color: var(--brand-dark); }
.card__price s { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.card__name { font-weight: 700; }
.card__short {
  font-size: 13px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .stock { margin-top: auto; padding-top: 6px; }

.badge {
  position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; color: #fff;
}
.badge--sale { background: var(--danger); }
.badge--hit { background: var(--accent); color: #3b2a00; }

.stock { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stock--ok { color: var(--brand); }
.stock--low { color: #c27c0e; }
.stock--out { color: var(--muted); }
.stock--lg { font-size: 14px; margin-top: 8px; }

/* ---------- Страницы ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumbs a:hover { color: var(--brand); }
.sort select {
  height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font: inherit; font-weight: 600;
}
.empty { text-align: center; padding: 64px 16px; color: var(--muted); }
.empty a { color: var(--brand); font-weight: 700; }
.empty .btn { color: #fff; }

.product {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px;
  background: var(--surface); border-radius: 24px; padding: 24px; box-shadow: var(--shadow);
}
.product__img { border-radius: 18px; overflow: hidden; background: #eef1ea; aspect-ratio: 1; }
.product__img img { width: 100%; height: 100%; object-fit: cover; }
.product__info { padding: 8px 0; }
.product__short { color: var(--muted); font-size: 17px; margin: 10px 0 0; }
.product__price { font-size: 32px; font-weight: 800; color: var(--brand-dark); margin-top: 20px; }
.product__price s { font-size: 18px; color: var(--muted); font-weight: 600; margin-left: 8px; }
.product__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 8px; }
.product__desc { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.product__desc h3 { margin-bottom: 10px; }
.product__desc p { margin: 0 0 10px; }

.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1440px; margin: 40px auto 0; padding: 24px; color: var(--muted); font-size: 14px;
  border-top: 1px solid var(--line);
}
.footer__links { display: flex; gap: 16px; }
.footer a:hover { color: var(--brand); }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .slide { flex-basis: 78%; }
}

@media (max-width: 900px) {
  :root { --topbar-h: 60px; }
  .topbar__inner { padding: 0 12px; gap: 8px; flex-wrap: wrap; height: auto; min-height: var(--topbar-h); }
  .menu-btn { display: inline-grid; }
  .logo { font-size: 18px; }
  .logo__mark { width: 34px; height: 34px; }
  .topbar__cta span { display: none; }
  .topbar__cta { width: 42px; padding: 0; }
  .topbar__right { gap: 6px; }
  .langs__item { min-width: 32px; height: 30px; padding: 0 4px; font-size: 12px; }
  .search { order: 5; flex-basis: 100%; max-width: none; margin: 0 0 10px; }

  .layout { grid-template-columns: 1fr; gap: 0; padding: 16px; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    width: min(320px, 86vw); max-height: none; padding: 16px;
    background: var(--bg); box-shadow: 8px 0 32px rgba(0, 0, 0, .15);
    transform: translateX(-105%); transition: transform .25s ease;
  }
  .sidebar__head {
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 800; font-size: 20px; margin-bottom: 12px;
  }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open { overflow: hidden; }
  .backdrop {
    display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .35);
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  body.drawer-open .backdrop { opacity: 1; pointer-events: auto; }

  .chips { display: flex; }
  .hero__arrow { display: none; }
  .slide { flex-basis: 88%; aspect-ratio: 16 / 9; border-radius: 16px; }
  .slide__text h2 { font-size: 19px; }
  .slide__text p { font-size: 14px; }

  h1 { font-size: 24px; }
  h2 { font-size: 19px; }
  .section { margin-top: 24px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .row-scroll { grid-auto-columns: 46%; gap: 10px; margin: 0 -16px; padding: 0 16px 6px; }
  .card__body { padding: 10px 12px 12px; }
  .card__price { font-size: 16px; }
  .card__name { font-size: 14px; }

  .product { grid-template-columns: 1fr; gap: 16px; padding: 12px; border-radius: 18px; }
  .product__price { font-size: 26px; margin-top: 14px; }
  .product__actions .btn { flex: 1; }
  .footer { padding: 20px 16px; }
}

/* ---------- Корзина ---------- */
.btn--wa { background: #1fa855; color: #fff; }
.btn--wa:hover { background: #178a45; }
.btn--block { width: 100%; }
.center { text-align: center; }
.sku { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; font-weight: 600; color: var(--muted); letter-spacing: .02em; }

.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px; border-radius: 12px; background: #f0f2ec; font-weight: 700;
}
.cart-btn:hover, .cart-btn.is-active { background: var(--brand-soft); color: var(--brand-dark); }
.cart-btn__count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800;
}
.cart-btn__count[hidden] { display: none; }
.cart-btn__count.is-bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.35); } }

.card { position: relative; }
.card__img > a { display: block; height: 100%; }
.card__add {
  position: absolute; right: 10px; bottom: 10px; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; border: 0; cursor: pointer;
  background: #fff; color: var(--brand-dark); box-shadow: 0 2px 10px rgba(20, 40, 25, .18);
  transition: transform .12s, background .15s, color .15s;
}
.card__add:hover { background: var(--brand); color: #fff; transform: scale(1.06); }
.card__add.is-busy { opacity: .6; pointer-events: none; }
.card__add.is-done { background: var(--brand); color: #fff; }
.card__add.is-done svg { display: none; }
.card__add.is-done::after { content: "✓"; font-size: 20px; font-weight: 800; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; translate: -50% 20px;
  padding: 12px 18px; border-radius: 12px; background: #17231a; color: #fff;
  font-weight: 700; font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  opacity: 0; pointer-events: none; transition: opacity .2s, translate .2s; max-width: calc(100vw - 32px);
}
.toast.is-shown { opacity: 1; translate: -50% 0; }

.stepper { display: inline-flex; align-items: center; border-radius: 12px; background: #f0f2ec; height: 38px; }
.stepper button {
  width: 36px; height: 100%; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 20px; font-weight: 700; color: var(--brand-dark); border-radius: 12px;
}
.stepper button:hover { background: var(--brand-soft); }
.stepper input {
  width: 40px; border: 0; background: transparent; text-align: center; font: inherit; font-weight: 800;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: 0; }
.stepper--lg { height: 52px; }
.stepper--lg button { width: 46px; }
.stepper--lg input { width: 48px; font-size: 17px; }
.buy { display: flex; gap: 10px; margin: 24px 0 0; flex-wrap: wrap; }
.buy__btn { flex: 1; min-width: 180px; }
.buy__btn.is-done { background: var(--brand-dark); }
.product__actions { margin-top: 12px; }

.empty__icon { font-size: 56px; margin-bottom: 8px; }
.empty h2 { color: var(--text); margin-bottom: 6px; }
.empty p { margin: 0 0 20px; }

.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.cart-list { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 8px 20px; }
.cart-item { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item__img { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #eef1ea; }
.cart-item__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__name { font-weight: 700; }
.cart-item__name:hover { color: var(--brand); }
.cart-item__controls { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.cart-item__total { font-weight: 800; font-size: 17px; white-space: nowrap; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--danger); }

.order-form {
  position: sticky; top: calc(var(--topbar-h) + 24px);
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.order-form h2 { margin-bottom: 4px; }
.form-error { padding: 10px 14px; border-radius: 12px; background: #fbe9e7; color: var(--danger); font-weight: 700; font-size: 14px; }
.field-label, .input-field > span { font-weight: 700; font-size: 14px; }
.input-field > span em { font-style: normal; font-weight: 500; color: var(--muted); }
.input-field { display: flex; flex-direction: column; gap: 6px; }
.input-field[hidden] { display: none; }
.input-field input, .input-field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; background: #fff; color: var(--text); resize: vertical;
}
.input-field input:focus, .input-field textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.delivery { display: flex; flex-direction: column; gap: 8px; }
.delivery__opt {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 14px; transition: .12s;
}
.delivery__opt.is-checked { border-color: var(--brand); background: var(--brand-soft); }
.delivery__opt input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.delivery__opt span { flex: 1; display: flex; flex-direction: column; }
.delivery__opt small { color: var(--muted); font-size: 13px; }
.delivery__opt em { font-style: normal; font-weight: 800; color: var(--brand-dark); white-space: nowrap; }
.summary { display: flex; flex-direction: column; gap: 6px; padding: 12px 0 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.summary div { display: flex; justify-content: space-between; color: var(--muted); font-weight: 600; }
.summary .summary__total { color: var(--text); font-size: 20px; font-weight: 800; margin-top: 4px; }
.order-form p { margin: 0; }

.done {
  max-width: 560px; margin: 16px auto; text-align: center; background: var(--surface);
  border-radius: 24px; box-shadow: var(--shadow); padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.done__icon { font-size: 52px; }
.done p { margin: 0; }
.done a b { color: var(--brand-dark); }
.done__order { width: 100%; text-align: left; margin: 16px 0 8px; padding: 16px; border-radius: 16px; background: var(--bg); }
.done__order h3 { margin-bottom: 10px; }
.done__row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 15px; }
.done__total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 18px; }

@media (max-width: 1100px) {
  .checkout { grid-template-columns: 1fr; }
  .order-form { position: static; }
}
@media (max-width: 900px) {
  .cart-btn { padding: 0 10px; }
  .cart-btn__label { display: none; }
  .card__add { width: 36px; height: 36px; right: 8px; bottom: 8px; }
  .cart-list { padding: 4px 14px; border-radius: 16px; }
  .cart-item { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
  .cart-item__total { grid-column: 2; font-size: 15px; }
  .order-form { padding: 16px; border-radius: 16px; }
  .buy__btn { min-width: 0; }
}
.nowrap { white-space: nowrap; }

/* ---------- Текстовые страницы ---------- */
.text-page { max-width: 760px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 28px; }
.text-page h2 { font-size: 19px; margin: 22px 0 8px; }
.text-page p { margin: 0 0 10px; }
@media (max-width: 900px) { .text-page { padding: 18px; border-radius: 16px; } }
