/* ==========================================================================
   Главная. Подключается только здесь (extraHead в src/index.njk), как
   category.css у категории и info.css у сервисных страниц.

   Мир тот же (DESIGN.md): бумажно-белый фон, структуру рисуют волосяные
   линии, скругления 4/6/10px, синим залито только действие и блок заявки,
   светло-голубое означает «выбрано». Опорный прием — шильдик: подпись
   микро-капителью сверху, величина снизу, линия между полями.
   ========================================================================== */

:root {
  --hm-rule: #E5E4E1;
  --hm-rule-2: #D1D0CC;
  --hm-ink: #1B1C1B;
  --hm-ink-2: #45463F;
  --hm-ink-3: #66665F;
  --hm-well: #F5F5F3;
  --hm-sky: #EFEFEC;
  --hm-sky-line: #A9A8A2;
  --hm-blue: var(--primary, #C94F08);
  --hm-blue-deep: var(--primary-dark, #AD4206);
  --hm-on-blue: #BAB9B4;
  --hm-r-xs: 4px;
  --hm-r-sm: 6px;
  --hm-r-md: 10px;
  --hm-sec: 84px;
}

.hm { background: var(--white, #fff); color: var(--hm-ink); padding-bottom: 96px; }
.hm .container { max-width: 1360px; padding-inline: 32px; }
.hm [hidden] { display: none !important; }

.hm-micro {
  display: block;
  font-family: var(--font, Inter, sans-serif);
  font-size: .6875rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--hm-ink-3);
}

.hm a { color: var(--hm-blue); text-decoration-color: rgba(201, 79, 8, .32); text-underline-offset: 2px; }
.hm a:hover { text-decoration-color: currentColor; }
.hm a:focus-visible, .hm button:focus-visible, .hm summary:focus-visible {
  outline: 2px solid var(--hm-blue);
  outline-offset: 2px;
  border-radius: var(--hm-r-xs);
}

/* ------------------------------------------------------------- ПЕРВЫЙ ЭКРАН */

.hm-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .82fr);
  gap: 64px;
  align-items: center;
  padding: 44px 0 40px;
}
.hm-hero__title {
  margin: 0;
  font-family: var(--font-heading, Onest, sans-serif);
  font-size: clamp(2rem, 1.2rem + 2.4vw, 3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hm-hero__lead {
  margin: 18px 0 0;
  max-width: 54ch;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--hm-ink-2);
}
.hm-hero__pic { border: 1px solid var(--hm-rule); border-radius: var(--hm-r-md); overflow: hidden; }
.hm-hero__pic img { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* Поиск: поле и кнопка одной высоты, подсказки падают под поле */
.hm-search { position: relative; display: flex; gap: 10px; margin-top: 28px; max-width: 620px; }
.hm-search__box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 16px;
  border: 1px solid var(--hm-rule-2);
  border-radius: var(--hm-r-sm);
  background: var(--white, #fff);
}
.hm-search__box:focus-within { border-color: var(--hm-blue); box-shadow: inset 0 0 0 1px var(--hm-blue); }
.hm-search__box svg { flex: none; width: 18px; height: 18px; color: var(--hm-ink-3); }
.hm-search__box input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 54px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 1rem;
  color: var(--hm-ink);
  outline: none;
}
.hm-search__sug {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--hm-rule-2);
  border-radius: var(--hm-r-md);
  background: var(--white, #fff);
  box-shadow: 0 16px 40px rgba(27, 28, 27, .12);
}
.hm-sug__item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--hm-r-sm);
  text-decoration: none;
  color: inherit;
}
.hm-sug__item:hover, .hm-sug__item.is-active { background: var(--hm-sky); }
.hm-sug__pic { width: 44px; height: 44px; display: grid; place-items: center; }
.hm-sug__pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hm-sug__name { display: block; font-size: .9375rem; line-height: 1.35; color: var(--hm-ink); }
.hm-sug__meta { display: block; margin-top: 2px; font-size: .75rem; color: var(--hm-ink-3); }
.hm-sug__price { font-size: .875rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--hm-ink); }
.hm-sug__empty { padding: 12px 10px; font-size: .9375rem; color: var(--hm-ink-3); }

.hm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.hm-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--hm-rule-2);
  border-radius: var(--hm-r-sm);
  font-size: .875rem;
  color: var(--hm-ink-2);
  text-decoration: none;
}
.hm-chips a:hover { background: var(--hm-well); color: var(--hm-ink); }

/* Шильдик под первым экраном: он держит все, что сказано выше */
.hm-plate {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin: 0;
  border: 1px solid var(--hm-rule);
  border-radius: var(--hm-r-md);
}
.hm-plate__field { position: relative; padding: 16px 22px 18px; min-width: 0; }
.hm-plate__field + .hm-plate__field::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--hm-rule);
}
.hm-plate__val {
  margin: 8px 0 0;
  font-family: var(--font-heading, Onest, sans-serif);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.hm-plate__val--sm { font-size: 1.0625rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.012em; font-variant-numeric: normal; }
/* Текстовую величину не рвем по слогам: общий стиль сайта ставит
   overflow-wrap: break-word, и «обращения» переносилось как «обращени/я». */
.hm-plate__val { overflow-wrap: normal; word-break: keep-all; }

/* ------------------------------------------------------------------ СЕКЦИЯ */

.hm-sec { padding-top: var(--hm-sec); }
.hm-sec__head { display: flex; align-items: baseline; gap: 16px; }
.hm-sec__title {
  margin: 0;
  font-family: var(--font-heading, Onest, sans-serif);
  font-size: clamp(1.5rem, 1.2rem + .8vw, 1.875rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.hm-sec__aside { margin-left: auto; font-size: .875rem; color: var(--hm-ink-3); text-decoration: none; white-space: nowrap; }
.hm-sec__aside:hover { color: var(--hm-blue); }
.hm-sec__lead { margin: 14px 0 0; max-width: 72ch; font-size: 1rem; line-height: 1.7; color: var(--hm-ink-2); }
.hm-prose p { margin: 0 0 14px; font-size: 1rem; line-height: 1.7; color: var(--hm-ink-2); }
.hm-prose p:last-child { margin-bottom: 0; }
.hm-note { margin: 18px 0 0; padding: 13px 16px; background: var(--hm-well); border-radius: var(--hm-r-sm); font-size: .875rem; line-height: 1.6; color: var(--hm-ink-3); max-width: 80ch; }

/* ----------------------------------------------------------------- КАТАЛОГ */

.hm-cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--hm-rule);
  border-radius: var(--hm-r-md);
  overflow: hidden;
}
.hm-cat { border-top: 1px solid var(--hm-rule); border-left: 1px solid var(--hm-rule); }
.hm-cat:nth-child(-n+4) { border-top: 0; }
.hm-cat:nth-child(4n+1) { border-left: 0; }
.hm-cat a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  height: 100%;
  padding: 22px 22px 24px;
  text-decoration: none;
  color: inherit;
}
.hm-cat a:hover { background: var(--hm-well); }
.hm-cat__pic { display: block; width: 108px; height: 108px; margin-bottom: 6px; }
.hm-cat__pic img { width: 100%; height: 100%; object-fit: contain; }
.hm-cat__name {
  font-family: var(--font-heading, Onest, sans-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--hm-ink);
}
.hm-cat__count { font-size: .8125rem; color: var(--hm-ink-3); font-variant-numeric: tabular-nums; }
/* Восьмая ячейка — вход в весь каталог: в сетке 4×2 семь разделов иначе
   оставляли пустую клетку с рамкой, и она читалась как дыра. */
.hm-cat--all a { justify-content: center; }
.hm-cat--all .hm-cat__pic { display: grid; place-items: center; color: var(--hm-blue); }
.hm-cat--all .hm-cat__pic svg { width: 44px; height: 44px; }
.hm-cat--all .hm-cat__name { color: var(--hm-blue); }
.hm-cat a:hover .hm-cat__count { color: var(--hm-blue); }

/* ------------------------------------------------------------ СХЕМА РАБОТЫ */

.hm-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}
.hm-step { padding: 0 24px 0 0; border-left: 1px solid var(--hm-rule); padding-left: 20px; }
.hm-step:first-child { border-left: 0; padding-left: 0; }
.hm-step__n {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-heading, Onest, sans-serif);
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--hm-ink-3);
  font-variant-numeric: tabular-nums;
}
.hm-step__t { display: block; margin-bottom: 6px; font-size: 1rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.012em; }
.hm-step__d { display: block; font-size: .9375rem; line-height: 1.6; color: var(--hm-ink-2); }

/* -------------------------------------------------------------- ПОЧЕМУ БЕРУТ */

.hm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 28px 0 0; padding: 0; list-style: none; }
.hm-grid__cell { padding: 24px 32px 26px 0; border-top: 1px solid var(--hm-rule); }
.hm-grid__cell:nth-child(-n+3) { border-top: 0; padding-top: 4px; }
.hm-grid__cell:not(:nth-child(3n+1)) { padding-left: 32px; border-left: 1px solid var(--hm-rule); }
.hm-grid__t {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-heading, Onest, sans-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.hm-grid__d { display: block; font-size: .9375rem; line-height: 1.65; color: var(--hm-ink-2); }
/* «Проверить»: каждое утверждение блока ведет туда, где его видно на сайте */
.hm-grid__proof { display: inline-block; margin-top: 10px; font-size: .875rem; font-weight: 500; }

/* -------------------------------------------------------------- ПОСТАВКА #}

/* Иллюстрация — в волосяной рамке, как сцена товара */
.hm-figure { margin: 28px 0 0; border: 1px solid var(--hm-rule); border-radius: var(--hm-r-md); overflow: hidden; }
.hm-figure img { display: block; width: 100%; height: auto; }
.hm-figure--wide img { aspect-ratio: 21 / 9; object-fit: cover; }

.hm-cities { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 28px; margin: 32px 0 0; padding: 0; list-style: none; }
.hm-cities li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hm-rule); }
.hm-cities__city { font-size: .875rem; color: var(--hm-ink); }
.hm-cities__n { font-size: .875rem; font-weight: 600; color: var(--hm-ink-3); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- О КОМПАНИИ */

.hm-about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 56px; align-items: center; }
.hm-about__text .hm-prose { margin-top: 16px; max-width: 64ch; }
.hm-about__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hm-about .hm-figure { margin: 0; }
.hm-about .hm-figure img { aspect-ratio: 4 / 3; object-fit: cover; }

/* ------------------------------------------------------------------- ЗАЯВКА */

.hm-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  gap: 56px;
  margin-top: var(--hm-sec);
  padding: 44px 48px 48px;
  border-radius: var(--hm-r-md);
  background: var(--hm-blue);
  color: #fff;
}
.hm-cta__title {
  margin: 0;
  font-family: var(--font-heading, Onest, sans-serif);
  font-size: clamp(1.5rem, 1.2rem + .8vw, 1.875rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.hm-cta__lead { margin: 16px 0 0; font-size: 1rem; line-height: 1.65; color: var(--hm-on-blue); }
.hm-cta__note { margin: 16px 0 0; font-size: .875rem; line-height: 1.6; color: var(--hm-on-blue); }
.hm-cta__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.hm-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.hm-field { display: block; margin-bottom: 14px; }
.hm-field .hm-micro { margin-bottom: 7px; color: var(--hm-on-blue); }
.hm-field input, .hm-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: var(--hm-r-sm);
  background: rgba(255, 255, 255, .1);
  font-family: inherit;
  font-size: .9375rem;
  color: #fff;
}
.hm-field textarea { resize: vertical; min-height: 88px; line-height: 1.6; }
.hm-field input::placeholder, .hm-field textarea::placeholder { color: rgba(255, 255, 255, .6); }
.hm-field input:focus, .hm-field textarea:focus { outline: 2px solid #fff; outline-offset: -1px; background: rgba(255, 255, 255, .16); }
.hm-field.is-error input { border-color: #FFD4D0; }
.hm-form__legal { margin: 12px 0 0; font-size: .8125rem; line-height: 1.5; color: var(--hm-on-blue); }
.hm-form__legal a { color: #fff; }
.hm-form__msg { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--hm-r-sm); background: rgba(255, 255, 255, .16); font-size: .9375rem; color: #fff; }
.hm-form__msg.is-error { background: #FDF0EF; color: #8A2A23; }

/* ------------------------------------------------------------------ ВОПРОСЫ */

.hm-faq { margin-top: 26px; border-top: 1px solid var(--hm-rule); max-width: 78ch; }
.hm-faq__item { border-bottom: 1px solid var(--hm-rule); }
.hm-faq__item summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 8px 16px 0;
  cursor: pointer;
  font-family: var(--font-heading, Onest, sans-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.015em;
  list-style: none;
}
.hm-faq__item summary::-webkit-details-marker { display: none; }
.hm-faq__item summary:hover { color: var(--hm-blue); }
.hm-faq__sign { position: relative; flex: none; width: 13px; height: 13px; margin-top: 6px; }
.hm-faq__sign::before, .hm-faq__sign::after { content: ""; position: absolute; background: var(--hm-ink-3); }
.hm-faq__sign::before { left: 0; right: 0; top: 6px; height: 1.5px; }
.hm-faq__sign::after { top: 0; bottom: 0; left: 6px; width: 1.5px; transition: transform .16s ease; }
.hm-faq__item[open] .hm-faq__sign::after { transform: scaleY(0); }
.hm-faq__a { padding: 0 8px 18px 0; }
.hm-faq__a p { margin: 0; font-size: .9375rem; line-height: 1.7; color: var(--hm-ink-2); }
.hm-faq__src { display: inline-block; margin-top: 10px; font-size: .8125rem; color: var(--hm-ink-3); text-decoration: none; border-bottom: 1px solid var(--hm-rule-2); }
.hm-faq__src:hover { color: var(--hm-blue); }

/* ------------------------------------------------------------------ КНОПКИ */

.hm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 26px;
  border: 1px solid var(--hm-rule-2);
  border-radius: var(--hm-r-sm);
  background: var(--white, #fff);
  font-family: inherit;
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--hm-ink);
  text-decoration: none;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.hm-btn--primary { border-color: var(--hm-blue); background: var(--hm-blue); color: #fff; }
.hm-btn--primary:hover { background: var(--hm-blue-deep); border-color: var(--hm-blue-deep); }
.hm-btn--ghost { min-height: 46px; padding: 0 20px; }
.hm-btn--ghost:hover { background: var(--hm-well); }
.hm-btn--invert { border-color: #fff; background: #fff; color: var(--hm-blue); }
.hm-btn--invert:hover { background: var(--hm-sky); }
.hm-btn--outline { border-color: rgba(255, 255, 255, .5); background: none; color: #fff; }
.hm-btn--outline:hover { background: rgba(255, 255, 255, .12); }
.hm-btn--wide { width: 100%; margin-top: 6px; }
/* Цвет кнопки-ссылки задаем с той же силой, что и общий стиль ссылок:
   иначе `.hm a` красит контурную кнопку на синем в синий, и она пропадает. */
.hm a.hm-btn { text-decoration: none; color: var(--hm-ink); }
.hm a.hm-btn--primary { color: #fff; }
.hm a.hm-btn--invert { color: var(--hm-blue); }
.hm a.hm-btn--outline { color: #fff; }

/* ------------------------------------------------------------------ АДАПТИВ */

@media (max-width: 1240px) {
  .hm-cities { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hm-hero { gap: 40px; }
}
@media (max-width: 1100px) {
  :root { --hm-sec: 64px; }
  .hm-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hm-cat:nth-child(-n+4) { border-top: 1px solid var(--hm-rule); }
  .hm-cat:nth-child(-n+3) { border-top: 0; }
  .hm-cat:nth-child(4n+1) { border-left: 1px solid var(--hm-rule); }
  .hm-cat:nth-child(3n+1) { border-left: 0; }
  .hm-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 0; }
  .hm-step:nth-child(3n+1) { border-left: 0; padding-left: 0; }
}
@media (max-width: 1000px) {
  .hm-hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 32px; }
  .hm-hero__pic { order: -1; }
  .hm-hero__pic img { aspect-ratio: 16 / 9; }
  .hm-about { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hm-cta { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 32px 28px 34px; }
  .hm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-grid__cell:nth-child(-n+3) { border-top: 1px solid var(--hm-rule); padding-top: 24px; }
  .hm-grid__cell:nth-child(-n+2) { border-top: 0; padding-top: 4px; }
  .hm-grid__cell:not(:nth-child(3n+1)) { padding-left: 0; border-left: 0; }
  .hm-grid__cell:nth-child(even) { padding-left: 32px; border-left: 1px solid var(--hm-rule); }
  .hm-grid__cell:nth-child(odd) { padding-right: 32px; }
}
@media (max-width: 768px) {
  :root { --hm-sec: 52px; }
  .hm .container { padding-inline: 20px; }
  .hm-plate { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-plate__field + .hm-plate__field::before { display: none; }
  .hm-plate__field:nth-child(n+3) { border-top: 1px solid var(--hm-rule); }
  .hm-plate__field:nth-child(even) { border-left: 1px solid var(--hm-rule); }
  .hm-plate__val { font-size: 1.5rem; }
  .hm-plate__val--sm { font-size: .9375rem; }
  .hm-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-cat:nth-child(-n+3) { border-top: 1px solid var(--hm-rule); }
  .hm-cat:nth-child(-n+2) { border-top: 0; }
  .hm-cat:nth-child(3n+1) { border-left: 1px solid var(--hm-rule); }
  .hm-cat:nth-child(odd) { border-left: 0; }
  .hm-cat a { padding: 18px 16px 20px; }
  .hm-cat__pic { width: 76px; height: 76px; }
  .hm-steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hm-step { border-left: 0; padding: 16px 0; border-top: 1px solid var(--hm-rule); }
  .hm-step:first-child { border-top: 0; padding-top: 0; }
  .hm-step:nth-child(3n+1) { padding-left: 0; }
  .hm-grid { grid-template-columns: minmax(0, 1fr); }
  .hm-grid__cell, .hm-grid__cell:nth-child(-n+3), .hm-grid__cell:nth-child(even), .hm-grid__cell:nth-child(odd) {
    padding: 22px 0 22px;
    border-top: 1px solid var(--hm-rule);
    border-left: 0;
  }
  .hm-grid__cell:first-child { border-top: 0; padding-top: 4px; }
  .hm-cities { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
  .hm-search { flex-direction: column; }
  .hm-search__box input { min-height: 50px; }
  .hm-form__row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hm-figure--wide img { aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-faq__sign::after, .hm-btn { transition: none; }
}
