:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --text: #2e2a26;
  --muted: #7a726a;
  --primary: #3e6b4f;
  --primary-dark: #315641;
  --accent: #c96f4a;
  --accent-dark: #a85836;
  --border: #e8e0d6;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(46, 42, 38, 0.08);
  --shadow-hover: 0 16px 40px rgba(46, 42, 38, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

img { max-width: 100%; display: block; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

#catalog, #cart { scroll-margin-top: 84px; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav { display: flex; gap: 18px; margin-left: auto; }

.nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--primary); }
.nav a.active { color: var(--primary); font-weight: 600; }

.cart-button {
  position: relative;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.cart-button:hover { background: var(--primary); color: #fff; }
.cart-button:focus-visible { outline: 3px solid rgba(62, 107, 79, 0.4); outline-offset: 2px; }

.cart-count {
  display: inline-block;
  min-width: 22px;
  padding: 1px 7px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: var(--primary);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:focus-visible { outline: 3px solid rgba(62, 107, 79, 0.45); outline-offset: 2px; }

.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }

.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }

.btn-secondary { background: var(--surface); color: var(--muted); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface); box-shadow: none; transform: none; }

.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.65); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.14); box-shadow: none; }

.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Первый экран ---------- */
.hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  color: #fff;
  overflow: hidden;
}

.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(22, 26, 20, 0.38), rgba(22, 26, 20, 0.74));
}

.hero-content { position: relative; z-index: 1; padding: 96px 20px; max-width: 760px; }

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.12;
  margin: 0 0 16px;
}

.hero p {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  margin: 0 0 30px;
  color: #f3ede4;
  max-width: 560px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Секции ---------- */
.section { padding: 72px 0; }
.section-alt { background: #f3ede3; }

.section h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 8px; }
.section-note { color: var(--muted); margin: 0 0 32px; max-width: 640px; }

/* ---------- Каталог ---------- */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.product-photo { aspect-ratio: 4 / 5; overflow: hidden; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; }

.product-info { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-info h3 { margin: 0; font-size: 1.15rem; }
.product-info p { margin: 0; color: var(--muted); font-size: 0.95rem; flex: 1; }

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.price { font-weight: 700; font-size: 1.2rem; color: var(--primary); white-space: nowrap; }
.add-to-cart { padding: 10px 18px; font-size: 0.95rem; }

/* ---------- Доставка: карточки на главной ---------- */
.delivery-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.delivery-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.delivery-card strong { display: block; font-size: 1.6rem; color: var(--primary); margin-bottom: 6px; }
.delivery-card p { margin: 0; color: var(--muted); }
.delivery-cta { margin-top: 28px; }

/* ---------- Корзина ---------- */
.cart-empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  color: var(--muted);
}
.cart-empty p { margin: 0; }

.cart-items { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.cart-item {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.cart-item-name { font-weight: 600; }
.cart-item-price { color: var(--muted); margin-left: 10px; font-size: 0.95rem; }

.cart-item-controls { display: flex; align-items: center; gap: 8px; }
.cart-item-controls .qty { min-width: 24px; text-align: center; font-weight: 600; }

.qty-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.qty-btn:focus-visible { outline: 3px solid rgba(62, 107, 79, 0.4); outline-offset: 2px; }

.remove-btn {
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}
.remove-btn:hover { color: var(--accent-dark); }
.remove-btn:focus-visible { outline: 3px solid rgba(201, 111, 74, 0.4); outline-offset: 2px; }

.cart-total { font-size: 1.25rem; font-weight: 700; text-align: right; margin: 0 0 24px; }

/* ---------- Форма заказа ---------- */
.order-form {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.order-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 0.95rem; }

.order-form input[type="text"] {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fdfbf8;
}

.order-form input[type="text"]:focus-visible { outline: 3px solid rgba(62, 107, 79, 0.35); outline-offset: 1px; border-color: var(--primary); }

.lead-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
}

.lead-consent input { margin-top: 3px; }
.lead-consent a { color: var(--primary); }

.order-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.payment-note { font-size: 0.9rem; color: var(--muted); margin: 0; }

.order-success {
  margin-top: 24px;
  max-width: 640px;
  background: #e9f3ec;
  border: 1px solid #cfe4d6;
  border-radius: var(--radius);
  padding: 24px;
}
.order-success h3 { margin: 0 0 8px; color: var(--primary-dark); }
.order-success p { margin: 8px 0; }
.order-success ul { margin: 8px 0; padding-left: 20px; }

/* ---------- Внутренние страницы ---------- */
.page-head { padding: 64px 0 8px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0 0 12px; }
.page-head p { color: var(--muted); max-width: 640px; margin: 0; }

.info-block {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.info-block h2 { margin: 0 0 12px; font-size: 1.3rem; }
.info-block p { margin: 0 0 10px; color: var(--text); }
.info-block p:last-child { margin-bottom: 0; }

.zones-table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
.zones-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px 10px 0;
  border-bottom: 2px solid var(--border);
}
.zones-table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border); }

.tip-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }

.delivery-photo { margin: 8px 0 32px; }
.delivery-photo img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.page-cta { margin-top: 8px; }

/* ---------- Политика ---------- */
.policy { max-width: 760px; }
.policy h2 { font-size: 1.25rem; margin: 28px 0 10px; }
.policy ul { margin: 8px 0; padding-left: 20px; }
.policy .meta { color: var(--muted); }

/* ---------- Подвал ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: #f3ede3;
  padding: 36px 0;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--primary); }

/* ---------- Адаптив ---------- */
@media (max-width: 640px) {
  .header-inner { gap: 12px; }
  .hero { min-height: 480px; }
  .hero-content { padding: 72px 20px; }
  .section { padding: 56px 0; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .btn:hover, .product-card:hover { transform: none; }
}
