/* Хозтрейд — витрина. Без сборщиков и внешних шрифтов: один файл, системный шрифт. */

:root {
  --brand: #0a8a3f;
  --brand-dark: #066a2f;
  --brand-tint: #e8f5ec;
  --accent: #ffb400;
  --accent-tint: #fff4d6;
  --text: #1c242d;
  --muted: #6a7480;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --line: #e2e6eb;
  --danger: #c2410c;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 4px 16px rgba(16, 24, 32, .06);
  --wrap: 1240px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--text); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 3.4vw, 40px); }
h2 { font-size: clamp(22px, 2.4vw, 30px); }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.icon { flex: none; }

/* Кнопки и ссылки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--primary:disabled { background: #9fb8a8; cursor: not-allowed; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn--block { width: 100%; }
.link { color: var(--brand-dark); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Верхняя полоса */
.topbar { background: #12301f; color: #cfe3d6; font-size: 14px; }
.topbar__in { display: flex; align-items: center; gap: 24px; min-height: 38px; }
.topbar__city { display: inline-flex; align-items: center; gap: 6px; }
.topbar__nav { display: flex; gap: 20px; margin-right: auto; }
.topbar a { color: #e9f4ed; text-decoration: none; }
.topbar a:hover { color: #fff; text-decoration: underline; }
.topbar__phone { font-weight: 700; }

/* Шапка */
.header { background: var(--surface); position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 var(--line); }
.header__in { display: flex; align-items: center; gap: 16px; min-height: 76px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.logo__text { display: flex; flex-direction: column; line-height: 1.05; }
.logo__text b { font-size: 22px; letter-spacing: -.02em; }
.logo__text small { color: var(--muted); font-size: 12px; }
.logo--light { color: #fff; }
.logo--light small { color: #a9c7b4; }

.catalog-btn {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  height: 48px; padding: 0 18px; border: 0; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; font: 700 16px/1 var(--font); cursor: pointer;
}
.catalog-btn:hover { background: var(--brand-dark); }
.burger { display: inline-grid; gap: 4px; width: 18px; }
.burger i { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.catalog-btn[aria-expanded="true"] .burger i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.catalog-btn[aria-expanded="true"] .burger i:nth-child(2) { opacity: 0; }
.catalog-btn[aria-expanded="true"] .burger i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.search { flex: 1; display: flex; min-width: 0; height: 48px; border: 2px solid var(--brand); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.search input { flex: 1; min-width: 0; border: 0; padding: 0 14px; font: 16px var(--font); color: var(--text); background: transparent; }
.search input:focus { outline: none; }
.search button { width: 56px; border: 0; background: var(--brand); color: #fff; cursor: pointer; display: grid; place-items: center; }

.header__actions { display: flex; gap: 6px; flex: none; }
.hact { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); font-size: 12px; }
.hact:hover { background: var(--bg); color: var(--brand-dark); }

.catnav { border-top: 1px solid var(--line); }
.catnav__in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.catnav__in::-webkit-scrollbar { display: none; }
.catnav a { padding: 11px 12px; white-space: nowrap; text-decoration: none; font-size: 15px; font-weight: 500; color: var(--text); border-bottom: 2px solid transparent; }
.catnav a:hover { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* Мегаменю */
.megamenu { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); box-shadow: 0 16px 40px rgba(16, 24, 32, .16); border-top: 1px solid var(--line); max-height: calc(100vh - 140px); overflow: auto; }
.megamenu__in { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 32px; padding-top: 24px; padding-bottom: 28px; }
.mm-root { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; color: var(--text); margin-bottom: 8px; }
.mm-root .icon { color: var(--brand); }
.mm-root:hover span { color: var(--brand-dark); }
.mm-col ul { list-style: none; margin: 0; padding: 0 0 0 32px; }
.mm-col li a { display: block; padding: 3px 0; color: var(--muted); text-decoration: none; font-size: 15px; }
.mm-col li a:hover { color: var(--brand-dark); }

/* Главная: первый экран */
.hero { padding: 24px 0 8px; }
.hero__grid { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 16px; }
.hero__main {
  grid-row: span 2; border-radius: var(--radius); padding: clamp(24px, 4vw, 48px); color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 180, 0, .35), transparent 40%),
    linear-gradient(135deg, #0a8a3f 0%, #075f2c 60%, #0b3d22 100%);
}
.hero__main h1 { max-width: 16ch; }
.hero__lead { max-width: 52ch; color: #dcefe3; font-size: 17px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero__main .btn--primary { background: var(--accent); color: #2a1d00; }
.hero__main .btn--primary:hover { background: #ffc633; }
.hero__main .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .45); }
.hero__main .btn--ghost:hover { border-color: #fff; color: #fff; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 700; color: var(--brand); margin-bottom: 8px; }
.hero__main .eyebrow { color: var(--accent); }
.hero__side {
  position: relative; display: flex; flex-direction: column; gap: 6px; justify-content: flex-end;
  padding: 24px; border-radius: var(--radius); text-decoration: none; color: var(--text); min-height: 160px;
  transition: transform .15s, box-shadow .15s;
}
.hero__side:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.hero__side b { font-size: 20px; }
.hero__side span { color: #3d4650; max-width: 34ch; }
.hero__side--list { background: var(--accent-tint); }
.hero__side--b2b { background: #e6eef8; }
.arrow { position: absolute; top: 20px; right: 22px; font-style: normal; font-size: 22px; }

.perks { padding: 16px 0; }
.perks__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.perk { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; }
.perk b { font-size: 22px; color: var(--brand-dark); }
.perk span { color: var(--muted); }

/* Секции */
.section { padding: 40px 0; }
.section--alt { background: var(--surface); }
.section-sm { margin-top: 40px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section__head h2 { margin: 0; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cat {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto; column-gap: 14px;
  background: var(--surface); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--text);
  border: 1px solid transparent; transition: border-color .15s, box-shadow .15s;
}
.cat:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.cat__icon { grid-row: span 3; width: 56px; height: 56px; border-radius: 12px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; }
.cat__name { font-weight: 700; font-size: 18px; }
.cat__subs { color: var(--muted); font-size: 14px; margin: 4px 0 8px; }
.cat__count { font-size: 13px; font-weight: 600; color: var(--brand-dark); }

/* Карточки товаров */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); padding: 12px; border: 1px solid var(--line); transition: box-shadow .15s; }
.card:hover { box-shadow: var(--shadow); }
.card__img { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); background: var(--bg); display: grid; place-items: center; overflow: hidden; margin-bottom: 12px; }
.card__img img { width: 100%; height: 100%; object-fit: contain; }
.ph { color: #b9c6bf; display: grid; place-items: center; width: 100%; height: 100%; }
.ph--lg { min-height: 360px; }
.card__body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card__price b { font-size: 20px; }
.card__price span { color: var(--muted); font-size: 14px; margin-left: 2px; }
.card__b2b { font-size: 13px; color: #1e4f8a; }
.card__name { text-decoration: none; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 4.5em; }
.card__name:hover { color: var(--brand-dark); }
.card__btn { margin-top: 12px; }
.stock { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock--yes { color: var(--brand); }
.stock--no { color: var(--muted); }

/* Доставка, блоки-разделители */
.delivery { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.truck { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.truck svg { width: 64px; height: 32px; fill: var(--brand-tint); stroke: var(--brand); stroke-width: 2; margin-bottom: 6px; }
.truck b { font-size: 22px; }
.truck span { color: var(--muted); font-size: 14px; }
.checks { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.checks li { padding-left: 30px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.split { display: grid; grid-template-columns: 3fr 2fr; gap: 40px; align-items: center; }
.note { background: var(--bg); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.section--alt .note { background: var(--bg); }
.section:not(.section--alt) .note { background: var(--surface); }
.note b { font-size: 18px; }
.note span { color: var(--muted); }

/* Внутренние страницы */
.page { padding-top: 16px; padding-bottom: 56px; }
.page__title { margin-bottom: 16px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 14px; margin-bottom: 12px; color: var(--muted); }
.crumbs > * + *::before { content: "/"; margin: 0 8px; color: #b4bcc5; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-dark); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; text-decoration: none; font-weight: 500; }
.chip span { color: var(--muted); margin-left: 4px; }
.chip:hover { border-color: var(--brand); color: var(--brand-dark); }

.listing { display: grid; grid-template-columns: 250px 1fr; gap: 24px; align-items: start; }
.filters { background: var(--surface); border-radius: var(--radius); padding: 18px; position: sticky; top: 140px; }
.filters summary { font-weight: 700; cursor: pointer; list-style: none; display: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters__form { display: grid; gap: 14px; }
.filters fieldset { border: 0; padding: 0; margin: 0; }
.filters legend { font-weight: 700; margin-bottom: 8px; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range input, .stepper input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: 15px var(--font); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sorts { display: flex; flex-wrap: wrap; gap: 4px; }
.sorts a { padding: 6px 12px; border-radius: 999px; text-decoration: none; font-size: 14px; color: var(--muted); }
.sorts a:hover { color: var(--text); }
.sorts a.is-active { background: var(--text); color: #fff; }
.pager { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 24px; }
.pager a { font-weight: 600; color: var(--brand-dark); text-decoration: none; }
.empty { background: var(--surface); border-radius: var(--radius); padding: 40px; text-align: center; display: grid; gap: 6px; }

.tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tree__col { background: var(--surface); border-radius: var(--radius); padding: 20px; }
.tree__root { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; text-decoration: none; color: var(--text); margin-bottom: 10px; }
.tree__root .cat__icon { width: 44px; height: 44px; grid-row: auto; }
.tree ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.tree li a { text-decoration: none; }
.tree li a:hover { color: var(--brand-dark); text-decoration: underline; }

/* Карточка товара */
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.pdp__gallery { background: var(--surface); border-radius: var(--radius); display: grid; place-items: center; overflow: hidden; aspect-ratio: 1; }
.pdp__info h1 { font-size: clamp(22px, 2.6vw, 32px); }
.buybox { background: var(--surface); border-radius: var(--radius); padding: 20px; display: grid; gap: 12px; margin: 16px 0; box-shadow: var(--shadow); }
.buybox__price b { font-size: 34px; letter-spacing: -.02em; }
.buybox__price span { color: var(--muted); margin-left: 6px; }
.buybox__b2b { background: #e6eef8; color: #1e4f8a; border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.buybox__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.buybox__actions .btn { flex: 1; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; height: 52px; }
.stepper button { width: 44px; height: 100%; border: 0; background: var(--bg); font-size: 20px; cursor: pointer; color: var(--text); }
.stepper button:hover { background: var(--brand-tint); }
.stepper input { width: 64px; height: 100%; border: 0; border-radius: 0; text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.specs { margin: 0; background: var(--surface); border-radius: var(--radius); padding: 8px 20px; }
.specs div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.specs div:last-child { border-bottom: 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; text-align: right; }
.capacity { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.capacity div { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; display: grid; }
.capacity b { font-size: 20px; }
.capacity span { color: var(--muted); }
.prose { background: var(--surface); border-radius: var(--radius); padding: 20px; max-width: 80ch; }

/* Подвал */
.footer { background: #0f2419; color: #b9cfc1; padding: 48px 0 24px; margin-top: 0; }
.footer a { color: #e3efe7; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; }
.footer h3 { color: #fff; font-size: 16px; margin-bottom: 12px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer__lead { margin: 14px 0; max-width: 40ch; }
.footer__phone { display: block; font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.footer__stores li { display: grid; }
.footer__stores b { color: #fff; font-weight: 600; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 36px; padding-top: 20px; border-top: 1px solid #23402f; font-size: 13px; color: #85a291; }

/* Адаптив */
@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .hero__main { grid-column: span 2; grid-row: auto; }
  .perks__grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .hact span { display: none; }
}
@media (max-width: 860px) {
  .topbar__nav { display: none; }
  .header__in { flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .search { order: 5; flex-basis: 100%; }
  .catalog-btn { margin-left: auto; }
  .listing { grid-template-columns: 1fr; }
  .filters { position: static; padding: 14px 18px; }
  .filters summary { display: flex; justify-content: space-between; }
  .filters summary::after { content: "▾"; color: var(--muted); }
  .filters[open] summary { margin-bottom: 14px; }
  .pdp, .delivery, .split { grid-template-columns: 1fr; gap: 24px; }
  .pdp__gallery { aspect-ratio: 16 / 9; }
  .ph--lg { min-height: 0; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .topbar__city { display: none; }
  .topbar__in { justify-content: flex-end; }
  .logo__text small { display: none; }
  .catalog-btn { padding: 0 14px; order: 3; margin-left: 0; }
  .catalog-btn__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .header__actions { margin-left: auto; }
  .hact { padding: 6px; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__main { grid-column: auto; }
  .hero__side { min-height: 0; }
  .perks__grid { gap: 10px; }
  .perk { padding: 14px; }
  .perk b { font-size: 18px; }
  .grid, .grid--3 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { padding: 10px; }
  .card__price b { font-size: 17px; }
  .footer__grid { grid-template-columns: 1fr; }
  .buybox__actions .btn { flex-basis: 100%; }
}
