/* Светлый минималистичный стиль. Сначала мобильная версия, потом планшет/десктоп. */
:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --text: #1c2a22;
  --muted: #6b786f;
  --accent: #2f6b4f;
  --accent-dark: #265a42;
  --accent-soft: #e9f1ec;
  --sand: #f2eee4;
  --border: #e7e3d8;
  --danger: #b3382c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 42, 34, 0.04), 0 6px 18px rgba(28, 42, 34, 0.05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 680px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.section { padding: 28px 0; }
.section-title { font-size: 22px; margin-bottom: 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.page-title { font-size: 28px; margin-bottom: 18px; }
.h3 { font-size: 18px; margin: 24px 0 8px; }
.link { color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.hint { color: var(--muted); font-size: 14px; }
.loading { color: var(--muted); }
.big-emoji { font-size: 64px; margin-bottom: 8px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  background: var(--accent); color: #fff; border: 1.5px solid var(--accent);
  border-radius: 12px; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:active { transform: scale(0.98); }
.btn:disabled { background: #cfd6d1; border-color: #cfd6d1; color: #fff; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); color: var(--accent-dark); }
.btn-lg { min-height: 54px; font-size: 17px; }
.btn-block { display: flex; width: 100%; }
.btn.loading { opacity: .8; cursor: progress; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 6px 0; font-size: 14px; }

/* Шапка */
.header { position: sticky; top: 0; z-index: 30; background: rgba(250, 249, 245, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 18px; min-width: 0; }
.logo-mark { font-size: 24px; }
.logo-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo img { height: 32px; width: auto; }
.header-actions { display: flex; align-items: center; gap: 4px; }
.cart-link { position: relative; display: grid; place-items: center; width: 48px; height: 48px; text-decoration: none; }
.cart-badge {
  position: absolute; top: 4px; right: 2px; min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; border-radius: 10px;
  display: grid; place-items: center;
}
.burger { width: 48px; height: 48px; background: none; border: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; cursor: pointer; }
.burger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .burger span:nth-child(2) { opacity: 0; }
.nav-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav {
  position: absolute; left: 0; right: 0; top: 60px; display: none; flex-direction: column;
  background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 16px 16px; box-shadow: var(--shadow);
}
.nav-open .nav { display: flex; }
.nav a { padding: 14px 4px; text-decoration: none; font-size: 18px; border-bottom: 1px solid var(--border); }
.nav a:last-child { border-bottom: 0; }

/* Главная */
.hero { padding: 36px 0 20px; background: linear-gradient(180deg, var(--sand) 0%, var(--bg) 100%); }
.hero h1 { font-size: 32px; max-width: 640px; }
.lead { font-size: 18px; color: var(--muted); max-width: 640px; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cat-tile {
  display: flex; align-items: center; gap: 10px; padding: 14px; min-height: 64px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; font-weight: 600; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.cat-tile:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.cat-emoji { font-size: 26px; }

.promo { background: var(--accent-soft); border-radius: 20px; padding: 28px 22px; }
.promo h2 { font-size: 24px; }
.promo p { color: #3d5a4b; }
.tiktok-block { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px 22px; }
.tiktok-links { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

/* Каталог */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 9px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: 15px; white-space: nowrap; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-img { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--sand); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.img-empty { display: grid; place-items: center; width: 100%; height: 100%; font-size: 40px; background: var(--sand); }
.img-empty.big { font-size: 96px; aspect-ratio: 1; }
.badge { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.badge-sale { background: #fff; color: var(--danger); }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: 0; }
.card-title a { text-decoration: none; }
.card-desc { margin: 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-price { margin-top: auto; padding-top: 6px; }
.card .btn { margin-top: 8px; min-height: 44px; font-size: 15px; padding: 0 12px; }
.price { font-weight: 700; font-size: 17px; }
.price.big { font-size: 28px; }
.old-price { color: var(--muted); margin-left: 6px; font-size: 14px; }
.stock { font-size: 13px; font-weight: 600; }
.stock.in { color: var(--accent); }
.stock.out { color: var(--danger); }
.empty { text-align: center; padding: 48px 0; color: var(--muted); font-size: 18px; }
.empty .btn { margin-top: 8px; }

/* Товар */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { text-decoration: none; }
.product { display: grid; gap: 24px; }
.gallery-main { background: var(--sand); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1 / 1; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.thumb { flex: 0 0 64px; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--sand); cursor: pointer; }
.thumb.active { border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info h1 { font-size: 28px; }
.product-price { margin: 8px 0; display: flex; align-items: baseline; gap: 8px; }
.variants { border: 0; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.variants legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.variant { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.variant:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.variant.disabled { opacity: .5; cursor: not-allowed; }
.variant input { accent-color: var(--accent); width: 18px; height: 18px; }
.buybox { display: flex; gap: 10px; margin: 14px 0 6px; }
.buybox .btn { flex: 1; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.qty button { width: 44px; height: 52px; border: 0; background: none; font-size: 22px; cursor: pointer; }
.qty button:disabled { color: #c3c9c5; cursor: not-allowed; }
.qty input { width: 48px; text-align: center; border: 0; background: none; font-weight: 600; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty.sm button { width: 38px; height: 38px; }
.qty-val { min-width: 28px; text-align: center; font-weight: 600; }
.facts { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 8px; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.facts span { color: var(--muted); }
.prose p { margin-bottom: 14px; }
.prose h2 { font-size: 20px; margin-top: 24px; }
.specs { margin: 0; }
.specs > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; text-align: right; }

/* Корзина */
.cart-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.cart-item { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.cart-item.bad { opacity: .75; }
.ci-img { width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--sand); display: block; }
.ci-img img { width: 100%; height: 100%; object-fit: cover; }
.ci-name { font-weight: 600; text-decoration: none; }
.ci-problem { color: var(--danger); font-size: 14px; margin-top: 2px; }
.ci-side { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ci-sum { margin-left: auto; font-size: 17px; }
.cart-summary { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.cart-summary .row:first-child { font-size: 19px; }
.cart-summary .btn { margin-top: 8px; }

/* Оформление */
.co-summary, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.order-lines { list-style: none; margin: 0 0 8px; padding: 0; }
.order-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.form { display: grid; gap: 16px; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.field input[type=text], .field input[type=tel], .field input[type=email], .field input[type=number], .field textarea, .field select {
  width: 100%; min-height: 50px; padding: 12px 14px; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 12px; font-size: 16px; /* 16px — чтобы iOS не зумил */
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.err { color: var(--danger); font-size: 14px; margin-top: 4px; min-height: 0; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; min-height: 52px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { accent-color: var(--accent); width: 20px; height: 20px; }
.card-details, .ship-note { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; }
.card-details > div, .ship-note p { margin: 4px 0; }
.ship-note { background: var(--sand); }
.form-error { background: #fbeceb; color: var(--danger); border-radius: 12px; padding: 12px 14px; font-weight: 600; margin: 8px 0; }
.success h1 { font-size: 30px; }
.success .btn { margin-top: 12px; }
.success .card-details, .success .ship-note { margin-bottom: 16px; }

.ship-tiers { display: grid; gap: 8px; margin: 14px 0 8px; }
.ship-tiers div { display: flex; justify-content: space-between; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.contact-list { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 8px; }
.contact-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.contact-list span { color: var(--muted); }
.contact-list a { color: var(--accent); font-weight: 600; }

/* Футер */
.footer { margin-top: 40px; padding: 32px 0 48px; background: var(--surface); border-top: 1px solid var(--border); }
.footer-grid { display: grid; gap: 22px; }
.footer-title { font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { text-decoration: none; color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; z-index: 50;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Планшет */
@media (min-width: 640px) {
  .container { padding: 0 24px; }
  .chips { margin: 0 0 8px; padding-left: 0; padding-right: 0; flex-wrap: wrap; overflow: visible; }
  .hero { padding: 56px 0 32px; }
  .hero h1 { font-size: 44px; }
  .hero-actions { flex-direction: row; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .tiktok-links { flex-direction: row; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .cart-item { grid-template-columns: 88px 1fr auto; }
  .ci-img { width: 88px; height: 88px; }
  .ci-side { grid-column: auto; flex-direction: column; align-items: flex-end; flex-wrap: nowrap; }
  .ci-sum { margin-left: 0; }
}

/* Десктоп */
@media (min-width: 900px) {
  .burger { display: none; }
  .nav { position: static; display: flex; flex-direction: row; gap: 4px; padding: 0; border: 0; background: none; box-shadow: none; }
  .nav a { padding: 8px 14px; font-size: 15px; border: 0; border-radius: 10px; }
  .nav a:hover { background: var(--accent-soft); }
  .header-row { height: 68px; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .product { grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: start; }
  .gallery { position: sticky; top: 88px; }
  .section { padding: 40px 0; }
  .page-title { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Переключатель языка */
.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; border: 1px solid var(--line, #dfe6e1); border-radius: 999px; overflow: hidden; font-size: 13px; font-weight: 600; }
.lang-switch a { padding: 6px 10px; color: inherit; text-decoration: none; line-height: 1; }
.lang-switch a.on { background: #2f6b4f; color: #fff; }
