:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --text: #17201b;
  --muted: #6b746e;
  --line: #e3e6e1;
  --brand: #13804a;
  --brand-ink: #ffffff;
  --brand-soft: #e3f3e9;
  --accent: #f2b705;
  --danger: #c8372d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 14px rgba(20, 30, 25, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.02em; }
h2 { font-size: 20px; margin: 36px 0 14px; letter-spacing: -.01em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main > h1 { margin-top: 28px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 8px; letter-spacing: -.02em; white-space: nowrap; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 18px; }
.search { flex: 1; display: flex; max-width: 560px; }
.search input {
  flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 1.5px solid var(--line); border-right: 0;
  border-radius: 10px 0 0 10px; font: inherit; background: var(--bg); outline: none;
}
.search input:focus { border-color: var(--brand); background: #fff; }
.search button {
  height: 42px; padding: 0 18px; border: 0; border-radius: 0 10px 10px 0; background: var(--brand);
  color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer;
}
.top-nav { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.basket-link { font-weight: 600; white-space: nowrap; }
.badge { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); font-size: 12px; text-align: center; line-height: 22px; }
.langs a { font-size: 13px; font-weight: 600; color: var(--muted); padding: 4px 6px; border-radius: 6px; }
.langs a.on { color: var(--text); background: var(--bg); }

/* Hero */
.hero { text-align: center; padding: 56px 0 24px; }
.hero h1 { font-size: 40px; }
.search-lg { margin: 22px auto 16px; max-width: 640px; }
.search-lg input, .search-lg button { height: 54px; font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.chip { padding: 6px 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.chip:hover { border-color: var(--brand); color: var(--brand); }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(20,30,25,.08), 0 10px 24px rgba(20,30,25,.08); }
.card-img { position: relative; aspect-ratio: 1; display: grid; place-items: center; padding: 14px; background: #fff; }
.card-img img { max-height: 100%; object-fit: contain; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; border-top: 1px solid var(--line); }
.card h3 { font-size: 14px; font-weight: 500; margin: 0; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.card-price { margin-top: auto; }
.card-price strong { font-size: 19px; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--bg); color: var(--muted); }
.pill-on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.save { font-size: 12px; font-weight: 700; color: var(--brand); }
.tag-disc { position: absolute; top: 10px; left: 10px; background: var(--danger); color: #fff; font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 8px; }
.store-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 0; }

/* Search toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 24px 0 16px; }
.h-sm { font-size: 20px; margin: 0; }
.filters { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.filters select { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; background: #fff; }
.empty { padding: 48px 0; text-align: center; color: var(--muted); }
.pager { display: flex; justify-content: center; gap: 18px; align-items: center; margin: 28px 0; }
.pager a { font-weight: 600; color: var(--brand); }

/* Product */
.product { display: grid; grid-template-columns: 320px 1fr; gap: 32px; margin-top: 28px; background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.product-img { display: grid; place-items: center; }
.product-img img { max-height: 300px; object-fit: contain; }
.product h1 { font-size: 24px; }
.big-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.big-price strong { font-size: 32px; letter-spacing: -.02em; }
.big-price .save { font-size: 14px; background: var(--brand-soft); padding: 3px 10px; border-radius: 10px; }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 10px 18px; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer; transition: transform .1s ease; }
.btn:active { transform: scale(.97); }
.btn-sm { padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.btn-done { background: var(--brand-soft); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.offers { width: 100%; border-collapse: collapse; margin: 20px 0 8px; }
.offers th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
.offers th.r { text-align: right; }
.offers td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.offers tr.best td { background: var(--brand-soft); }
.offers tr.best td:first-child { border-radius: 10px 0 0 10px; }
.offers tr.best td:last-child { border-radius: 0 10px 10px 0; }
.diff { color: var(--danger); }
.chart-box { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.chart { width: 100%; height: auto; }
.grid-line { stroke: var(--line); }
.axis { font-size: 11px; fill: var(--muted); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; margin-top: 8px; }

/* Basket */
.totals { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.total-card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 2px solid transparent; }
.total-card.best { border-color: var(--brand); }
.total-sum { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.warn { color: var(--danger); }
.mix { background: var(--surface); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); }
.basket-table { background: var(--surface); border-radius: var(--radius); }
.basket-table td.cheap { color: var(--brand); font-weight: 700; }
.qty { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty button { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; }
.link { background: none; border: 0; color: var(--danger); cursor: pointer; font: inherit; font-size: 13px; }

/* Footer */
.foot { margin-top: 56px; padding: 24px 0 40px; border-top: 1px solid var(--line); font-size: 14px; }
.foot a { margin-right: 12px; color: var(--brand); font-weight: 500; }

@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .top .search { order: 3; flex-basis: 100%; max-width: none; }
  .hero { padding: 32px 0 12px; }
  .hero h1 { font-size: 28px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .product-img img { max-height: 220px; }
  .offers td:nth-child(2) { display: none; }
  .basket-table { display: block; overflow-x: auto; }
}
