:root {
  --bg: #ffffff;
  --soft: #f4f6f4;
  --ink: #1f2723;
  --muted: #5f6964;
  --line: #e2e6e3;
  --green: #4e6e5d;
  --green-dark: #3e5a4b;
  --green-soft: #eef3ef;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
a { color: inherit; }
h1, h2 { font-weight: 700; letter-spacing: -0.02em; margin: 0; line-height: 1.1; }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
[hidden] { display: none !important; }

/* Шапка */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px max(20px, calc((100vw - 1160px) / 2));
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; text-decoration: none; }
.logo svg { width: 30px; height: 30px; fill: var(--green); }
.top nav { display: flex; gap: 24px; margin-left: auto; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }
.fav-count { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--green); font-weight: 600; }
.fav-count svg { width: 18px; height: 18px; fill: currentColor; }
.login-open { border: 0; background: none; color: var(--green); font: inherit; font-size: 15px; font-weight: 600; padding: 8px 0; cursor: pointer; }
.login-open:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 4px; }

main { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Первый экран */
.hero { display: grid; gap: 28px; padding: 40px 0 56px; }
.hero h1 { font-size: clamp(34px, 5.6vw, 64px); max-width: 12ch; }
.lead { font-size: 18px; color: var(--muted); margin: 20px 0 28px; max-width: 34em; }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.btn { display: inline-block; padding: 14px 26px; border-radius: 8px; background: var(--green); color: #fff; text-decoration: none; font-weight: 600; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--green-dark); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.btn[disabled] { opacity: 0.6; cursor: default; }
.more { color: var(--green); font-weight: 600; text-decoration: none; }
.more::after { content: ' →'; }
.more:hover { text-decoration: underline; text-underline-offset: 4px; }
.hero-pic { margin: 0; background: var(--green-soft); border-radius: var(--radius); aspect-ratio: 4 / 3; display: grid; place-items: center; }
.hero-pic svg { width: 78%; height: auto; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.facts div { padding: 16px 16px 0 0; }
.facts div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.facts dt { font-size: clamp(18px, 2.4vw, 24px); font-weight: 700; color: var(--green); }
.facts dd { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.05fr 1fr; align-items: center; column-gap: 56px; padding: 64px 0 72px; }
  .facts { grid-column: 1 / -1; }
}

/* Каталог */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; margin-bottom: 24px; }
.section-head p { margin: 0; color: var(--muted); max-width: 480px; }
.catalog { padding: 24px 0 56px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px 14px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 32px 20px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card { position: relative; display: flex; flex-direction: column; gap: 10px; }
.card .art { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--tone); border-radius: var(--radius); transition: background-color 0.2s ease; }
.card .art svg { width: 78%; height: auto; }
.card .info { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; padding: 0 2px; }
.card .name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.card .price { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.heart {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
  box-shadow: 0 1px 2px rgb(31 39 35 / 0.12);
  transition: transform 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.heart svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.heart:hover { color: var(--green); }
.heart:active { transform: scale(0.9); }
.heart[aria-pressed='true'] { color: var(--green); }
.heart[aria-pressed='true'] svg { fill: currentColor; }

/* Как заказать */
.how { padding: 48px 0 64px; }
.how ol { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 28px; }
@media (min-width: 800px) { .how ol { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.how li { display: grid; gap: 6px; padding-top: 16px; border-top: 2px solid var(--green); }
.how .step { font-size: 13px; font-weight: 600; color: var(--green); }
.how li b { font-size: 18px; }
.how li > span:last-child { color: var(--muted); }

/* Контакты */
.contacts { background: var(--green); color: #fff; }
.contacts-in { max-width: 1200px; margin: 0 auto; padding: 56px 20px; }
.contacts dl { margin: 28px 0 0; display: grid; gap: 20px; }
@media (min-width: 800px) { .contacts dl { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.contacts dt { font-size: 14px; color: rgb(255 255 255 / 0.9); }
.contacts dd { margin: 4px 0 0; font-size: 18px; }
.contacts a { text-underline-offset: 4px; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 20px max(20px, calc((100vw - 1160px) / 2)); color: var(--muted); font-size: 13px; }

/* Вход для сотрудников */
.login { width: min(400px, calc(100vw - 32px)); border: 0; border-radius: 14px; padding: 28px 24px 24px; background: #fff; color: var(--ink); box-shadow: 0 24px 60px rgb(31 39 35 / 0.22); }
.login::backdrop { background: rgb(31 39 35 / 0.45); }
.login form { display: grid; gap: 14px; }
.login h2 { font-size: 24px; }
.login p { margin: 0; color: var(--muted); font-size: 15px; }
.login label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.login input { font: inherit; font-size: 16px; color: var(--ink); padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.login input:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: transparent; }
.login .login-error { color: #b3261e; min-height: 1.5em; }
.login .login-error:empty { min-height: 0; }
.login-row { display: flex; gap: 10px; justify-content: flex-end; }
.login-row .btn { padding: 12px 20px; }

/* Капча по ссылке */
.captcha { width: min(440px, calc(100vw - 24px)); border: 0; border-radius: 14px; padding: 22px 18px 18px; background: #fff; color: var(--ink); box-shadow: 0 24px 60px rgb(31 39 35 / 0.22); }
.captcha::backdrop { background: rgb(31 39 35 / 0.55); }
.captcha h2 { font-size: 22px; outline: none; }
.captcha > p { margin: 8px 0 14px; color: var(--muted); font-size: 15px; }
.captcha .captcha-state { margin: 10px 0 0; color: #b3261e; min-height: 1.5em; }
.captcha .captcha-note { margin: 4px 0 0; font-size: 13px; color: #6b6f6c; }
.captcha .login-row { margin-top: 6px; }
.captcha.shake { animation: shake 0.4s ease; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.captcha-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.captcha-cell { position: relative; padding: 0; border: 2px solid transparent; border-radius: 12px; background: none; cursor: pointer; aspect-ratio: 1; -webkit-tap-highlight-color: transparent; }
.captcha-cell svg { display: block; width: 100%; height: 100%; }
.captcha-cell.on { border-color: var(--ink); }
.captcha-step { position: absolute; top: 6px; right: 6px; min-width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 15px; }
.captcha-step:empty { display: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .top { gap: 16px; }
  .top nav { display: none; }
  .fav-count { margin-left: auto; }
  .fav-count[hidden] + .login-open { margin-left: auto; }
  .hero { padding: 24px 0 40px; }
  .facts { grid-template-columns: 1fr; }
  .facts div, .facts div + div { padding: 12px 0; border-left: 0; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 10px; }
  .facts dd { margin: 0; }
  .card .info { flex-direction: column; }
  .card .name { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .heart, .toast { transition: none; }
  .captcha.shake { animation: none; }
}
