/* Шрифт лежит на сервере сайта — браузер не обращается к зарубежным сервисам */
@font-face { font-family: 'Manrope'; font-weight: 400 800; font-display: swap; src: url(fonts/manrope-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 400 800; font-display: swap; src: url(fonts/manrope-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink:       #1c2024;
  --ink-soft:  #5e6875;
  --line:      #e3e7eb;
  --line-dark: #cbd2d9;
  --bg:        #ffffff;
  --bg-alt:    #f6f8f9;
  --brand:     #8a5a2b;
  --brand-dark:#6d4520;
  --brand-soft:#f6eee5;
  --ok:        #2f7d4f;
  --err:       #b3261e;
  --radius:    12px;
  --shadow:    0 3px 16px rgba(28, 32, 36, .07);
}

*, *::before, *::after { box-sizing: border-box; }

/* Атрибут hidden должен побеждать любые display в стилях ниже */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Manrope', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px; line-height: 1.55;
  color: var(--ink); background: var(--bg);
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
p  { margin: 0 0 8px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a  { color: var(--brand-dark); }
code { font-size: .92em; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 18px; }

/* ===== Плашка «демо» ===== */
.demo-note { padding: 11px 0; font-size: 14px; color: #634b1f; background: #fbf1df; border-bottom: 1px solid #eddcb8; }
.demo-note b { color: #43310e; }
.demo-note a { color: #634b1f; }

/* ===== Шапка ===== */
.topbar { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); }
.topbar__inner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); text-decoration: none; }
.logo span { font-size: 18px; font-weight: 600; color: var(--ink); }
.logo b { font-weight: 800; color: var(--brand); }
.topbar__nav { display: flex; gap: 18px; margin-left: auto; font-size: 15px; font-weight: 700; }
.topbar__nav a { text-decoration: none; color: var(--ink-soft); }
.topbar__nav a:hover { color: var(--brand-dark); }

.search { flex: 1 1 220px; order: 3; width: 100%; }
.search input {
  width: 100%; padding: 11px 15px;
  font: inherit; color: var(--ink);
  background: var(--bg-alt);
  border: 1.5px solid var(--line); border-radius: 100px;
  transition: border-color .18s, background .18s;
}
.search input:hover { border-color: var(--line-dark); }
.search input:focus { outline: none; background: #fff; border-color: var(--brand); }

/* ===== Первый экран ===== */
.hero { background: linear-gradient(160deg, #fbf7f2, var(--brand-soft)); border-bottom: 1px solid #ecdfd0; }
.hero__inner { display: grid; gap: 22px; padding-top: 30px; padding-bottom: 30px; align-items: center; }
.hero__tag { margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.hero h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: -.01em; max-width: 20ch; }
.hero__lead { margin: 10px 0 0; color: var(--ink-soft); max-width: 58ch; }
.hero__facts { display: grid; gap: 10px; }
.hero__facts li { position: relative; padding: 12px 14px 12px 42px; background: #fff; border: 1px solid #ecdfd0; border-radius: var(--radius); font-size: 15px; }
.hero__facts li::before { content: '✓'; position: absolute; left: 14px; top: 11px; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }

/* ===== Раскладка ===== */
.layout { display: grid; gap: 20px; padding: 26px 18px 56px; align-items: start; scroll-margin-top: 70px; }

.filters-toggle {
  padding: 12px 18px;
  font: inherit; font-weight: 700;
  color: var(--ink); background: #fff;
  border: 1.5px solid var(--line-dark); border-radius: 100px; cursor: pointer;
}
.filters-toggle:hover { border-color: var(--brand); }

.sidebar { display: none; }
.sidebar.is-open { display: block; }

.block { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.block__title { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); }

.sections li + li { margin-top: 2px; }
.sections button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 9px 12px;
  font: inherit; text-align: left;
  color: var(--ink); background: none;
  border: 0; border-radius: 9px; cursor: pointer;
  transition: background .16s, color .16s;
}
.sections button:hover { background: var(--bg-alt); }
.sections button.is-active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.sections .num { font-size: 13px; color: var(--ink-soft); }
.sections button.is-active .num { color: var(--brand); }

.checks li { margin-bottom: 6px; }
.checks--two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
.checks--two label { font-size: 14px; }
.checks label { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 15px; }
.checks input { width: 17px; height: 17px; accent-color: var(--brand); }

.price { display: flex; gap: 10px; }
.price label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-soft); }
.price input { width: 100%; min-width: 0; padding: 9px 10px; font: inherit; border: 1.5px solid var(--line); border-radius: 9px; }
.price input:focus { outline: none; border-color: var(--brand); }

.reset {
  width: 100%; padding: 11px;
  font: inherit; font-weight: 700;
  color: var(--brand-dark); background: none;
  border: 1.5px solid var(--line-dark); border-radius: 100px; cursor: pointer;
  transition: border-color .18s, background .18s;
}
.reset:hover { border-color: var(--brand); background: var(--brand-soft); }

/* ===== Товары ===== */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.found { margin: 0; color: var(--ink-soft); }
.found b { color: var(--ink); }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.sort select { padding: 8px 12px; font: inherit; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.sort select:focus { outline: none; border-color: var(--brand); }

.source { margin: 0 0 14px; font-size: 13px; color: var(--ok); font-weight: 600; }
.source.is-error { color: var(--err); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; } }

.card {
  display: flex; flex-direction: column;
  text-align: left; font: inherit; color: inherit;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-3px); }
.card__shot { position: relative; display: grid; place-items: center; padding: 14px; background: var(--bg-alt); aspect-ratio: 4 / 3.4; }
.card__shot svg { width: 100%; max-width: 118px; height: auto; }
.card__shot img { width: 100%; height: 100%; object-fit: cover; }
.card__hit { position: absolute; top: 10px; left: 10px; padding: 3px 10px; font-size: 11px; font-weight: 800; color: #fff; background: var(--brand); border-radius: 100px; }
.card__body { display: flex; flex-direction: column; flex: 1; padding: 14px; }
.card__name { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.card__meta { flex: 1; font-size: 13px; color: var(--ink-soft); }
.card__price { margin: 10px 0 0; font-size: 19px; font-weight: 800; }

.empty { padding: 40px 0; text-align: center; color: var(--ink-soft); }

/* ===== Как обновить каталог ===== */
.howto { padding: 56px 0 64px; background: var(--bg-alt); border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.howto__tag { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.howto h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; }
.howto__lead { color: var(--ink-soft); max-width: 62ch; margin-bottom: 26px; }
.steps { display: grid; gap: 14px; counter-reset: s; }
.step { position: relative; padding: 20px 20px 20px 66px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); counter-increment: s; }
.step::before { content: counter(s); position: absolute; left: 20px; top: 18px; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; display: grid; place-items: center; }
.step h3 { font-size: 17px; font-weight: 800; }
.step p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.step b { color: var(--ink); }
.honest { margin-top: 18px; padding: 16px 18px; background: #fff; border-left: 4px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; font-size: 15px; color: #3b434c; }
.try { margin-top: 18px; padding: 22px; display: grid; gap: 16px; align-items: center; background: #fff; border: 1.5px dashed var(--line-dark); border-radius: var(--radius); }
.try h3 { font-size: 18px; font-weight: 800; }
.try p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.try__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.link { font: inherit; font-weight: 700; color: var(--brand-dark); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ===== Модальное окно ===== */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(20, 24, 28, .55); }
.modal__body { position: relative; z-index: 1; width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; padding: 24px; background: #fff; border-radius: 18px; }
.modal__close { position: absolute; top: 12px; right: 14px; width: 36px; height: 36px; font-size: 26px; line-height: 1; color: var(--ink-soft); background: none; border: 0; border-radius: 50%; cursor: pointer; }
.modal__close:hover { background: var(--bg-alt); color: var(--ink); }
.modal__grid { display: grid; gap: 20px; }
.modal__shot { display: grid; place-items: center; padding: 18px; background: var(--bg-alt); border-radius: var(--radius); align-self: start; }
.modal__shot svg { width: 100%; max-width: 160px; height: auto; }
.modal__shot img { width: 100%; border-radius: 8px; }
.modal__section { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .03em; }
.modal__title { font-size: 24px; font-weight: 800; padding-right: 30px; }
.modal__desc { margin: 8px 0 0; color: #3b434c; }
.modal__price { margin: 14px 0 0; font-size: 28px; font-weight: 800; }

.specs { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 14px 0 0; font-size: 15px; }
.specs dt { color: var(--ink-soft); }
.specs dd { margin: 0; font-weight: 600; }

.ask { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.ask__label { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.ask__row { display: grid; gap: 8px; }
.ask__row input { width: 100%; min-width: 0; padding: 12px 14px; font: inherit; border: 1.5px solid var(--line); border-radius: 100px; }
.ask__row input:focus { outline: none; border-color: var(--brand); }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: 13px; color: var(--ink-soft); cursor: pointer; line-height: 1.45; }
.consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); }
.ask__error { display: block; margin-top: 8px; font-size: 13px; color: var(--err); font-weight: 600; }
.ask__ok    { display: block; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--ok); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px;
  font: inherit; font-weight: 800; text-decoration: none;
  color: #fff; background: var(--brand);
  border: 0; border-radius: 100px; cursor: pointer;
  transition: background .18s, opacity .18s;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--wide { width: 100%; }
.btn--ghost { color: var(--brand-dark); background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-dark); }
.btn--ghost:hover { background: var(--brand-soft); }

/* ===== Подвал ===== */
.footer { padding: 22px 0 34px; border-top: 1px solid var(--line); }
.footer p { margin: 0 0 4px; font-size: 13px; color: var(--ink-soft); }

/* ===== Планшет ===== */
@media (min-width: 700px) {
  .search { order: 0; width: auto; max-width: 360px; }
  .modal__grid { grid-template-columns: 210px 1fr; }
  .ask__row { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .try { grid-template-columns: 1fr auto; }
}

/* ===== Десктоп ===== */
@media (min-width: 960px) {
  .hero__inner { grid-template-columns: 1.3fr .7fr; gap: 40px; }
  .layout { grid-template-columns: 264px 1fr; gap: 32px; }
  .filters-toggle { display: none; }
  .sidebar { display: block; position: sticky; top: 88px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .steps { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 699px) {
  .topbar__nav { display: none; }
  .modal__body { padding: 20px 18px; }
  .modal__shot { padding: 12px; }
  .modal__shot svg { max-width: 92px; }
}

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