/* rvd174.ru — главная страница (шаблон «Главная», чанки home.*, сниппет homeBlocks, home.js).
   Вёрстка с нуля (16.11.2026) по замерам старого шаблона 40 RD_home (1440 и 390 px): колонка 1360 (поля 40), серый #f4f4f4,
   скругления 8, заголовки блоков 28/500 прописными с красной стрелкой, текст #2f2f2f.
   Отличия от старого: баннер листается и свайпом, у автопрокрутки есть пауза (наведение, фокус, кнопка «Остановить») — WCAG 2.2.2;
   H1 скрыт так же, как на старом, но доступен экранному диктору; плитка «БРС и шаровые краны» ведёт в раздел БРС (на старом —
   в «Комплектующие»); заголовки слайдов — абзацы, а не H2 (7 одинаковых по смыслу H2 подряд мешали структуре страницы);
   у новостей в карточке есть заголовок для экранного диктора; исправлены опечатки («производста», «еропейских», «однин», «Континеталь»). */
@layer components {
  .home { --hm-grey: #f4f4f4; --hm-text: #2f2f2f; --hm-red: #b71513; color: var(--hm-text); }
  .home__wrap { max-width: 1440px; padding-inline: clamp(var(--gutter), 2.8vw, 40px); }
  .hb { margin-top: clamp(50px, 5.5vw, 80px); }
  .home-h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: clamp(20px, 1.2vw + 11px, 28px); font-weight: 500; line-height: 1.2; text-transform: uppercase; }
  .home-h2::after { content: ""; flex: none; width: 20px; height: 20px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 4l8 8-8 8' fill='none' stroke='%23b71513' stroke-width='2.6'/%3E%3C/svg%3E") center / contain no-repeat; }
  .home-h2--plain::after { display: none; }
  .home-lead { max-width: 1360px; margin-bottom: 20px; font-size: clamp(15px, .3vw + 14px, 18px); line-height: 1.25; }
  .home-dots { display: grid; gap: 18px; padding: 0; list-style: none; }
  .home-dots li { position: relative; padding-left: 35px; font-size: clamp(14px, .5vw + 11px, 18px); line-height: 1.2; }
  .home-dots li::before { content: ""; position: absolute; left: 0; top: -2px; width: 24px; height: 24px;
    background: radial-gradient(circle at 30% 30%, var(--hm-red) 4px, transparent 4.5px), radial-gradient(circle at 70% 30%, var(--hm-red) 4px, transparent 4.5px), radial-gradient(circle at 30% 70%, var(--hm-red) 4px, transparent 4.5px); }
  .home-more { display: inline-flex; align-items: center; gap: 6px; color: var(--hm-text); font-size: 18px; text-decoration: none; }
  .home-more:hover { color: var(--hm-red); }
  .home-more .icon { width: 16px; height: 16px; transform: rotate(-90deg); color: var(--hm-red); }

  /* ---------- баннер ---------- */
  .hs { position: relative; }
  .hs__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .hs__track::-webkit-scrollbar { display: none; }
  /* как на старом: высота 650 на 1440 (пропорционально ширине), картинка 1242 px прижата вправо, текст поверх фона слева */
  .hs-slide { position: relative; flex: 0 0 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, min(86.25%, 1242px)); height: clamp(430px, 45.14vw, 650px); scroll-snap-align: start;
    background: var(--hs-bg, #e9e9e9) center / cover no-repeat; overflow: hidden; }
  .hs-slide__text { position: relative; z-index: 1; align-self: center; width: min(595px, 45vw); margin-left: max(40px, calc((100vw - 1360px) / 2)); grid-column: 1 / -1; grid-row: 1; }
  .hs-slide__logo { display: block; max-width: 260px; height: auto; margin-bottom: 20px; }
  .hs-slide__title { margin-bottom: 20px; font-size: clamp(16px, 2.36vw, 34px); font-weight: 700; line-height: 1.4; text-transform: uppercase; }
  .hs-slide__lead { margin-bottom: 25px; font-size: clamp(12px, 1.39vw, 20px); line-height: 1.4; }
  .hs-slide__btn { min-width: 250px; min-height: 48px; border-radius: 8px; font-size: clamp(12px, 1.39vw, 20px); font-weight: 400; }
  .hs-slide--light { color: #fff; }
  .hs-slide__pic--d { grid-column: 2; grid-row: 1; align-self: stretch; min-height: 0; }
  .hs-slide__pic--d picture { display: block; height: 100%; }
  .hs-slide__pic--d .hs-slide__img { width: 100%; height: 100%; object-fit: cover; object-position: left center; }
  .hs-slide__pic--m { display: none; }
  .hs__nav { position: absolute; right: max(40px, calc((100vw - 1360px) / 2)); bottom: 30px; display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 30px; background: rgb(255 255 255 / .85); }
  .hs__btn { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: #000; box-shadow: 0 0 4px rgb(0 0 0 / .2); }
  .hs__btn .icon { width: 16px; height: 16px; }
  .hs__btn--prev .icon { transform: rotate(90deg); }
  .hs__btn--next .icon { transform: rotate(-90deg); }
  .hs__btn:hover { color: var(--hm-red); }
  .hs__btn:focus-visible, .hs__dot:focus-visible { outline: 2px solid var(--hm-red); outline-offset: 2px; }
  .hs__pause-ico { width: 10px; height: 12px; border-inline: 3px solid currentColor; }
  .hs__btn--pause[aria-pressed="true"] .hs__pause-ico { width: 0; height: 0; border: 0; border-left: 11px solid currentColor; border-block: 7px solid transparent; margin-left: 3px; }
  .hs__dots { display: flex; gap: 6px; }
  .hs__dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: #c4c4c4; }
  .hs__dot[aria-current="true"] { background: var(--hm-red); }

  /* ---------- каталог: 4 колонки, последняя плитка — на 2 колонки ---------- */
  .hc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
  .hc__item--wide { grid-column: span 2; }
  .hc__link { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid #ddd; border-radius: 8px;
    background: var(--hm-grey) url("/assets/redis/img/main/cbg.webp") center / cover no-repeat; color: var(--hm-text); text-decoration: none; transition: border-color var(--t); }
  .hc__link::after { content: ""; position: absolute; right: 12px; top: 12px; width: 18px; height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 4h6v6M20 4l-9 9M18 14v6H4V6h6' fill='none' stroke='%23b71513' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat; opacity: .8; }
  .hc__link picture { flex: 1; display: grid; place-items: end center; }
  .hc__img { width: auto; max-width: 100%; height: 232px; object-fit: contain; }
  .hc__name { display: flex; align-items: center; justify-content: center; min-height: 70px; padding: 6px 18px; border-radius: 0 0 8px 8px; background: #fff;
    font-size: clamp(14px, .6vw + 11px, 20px); font-weight: 600; line-height: 1.2; text-align: center; }
  .hc__link:hover { border-color: var(--hm-red); }
  .hc__link:hover .hc__name { color: var(--hm-red); }
  .hc__link:focus-visible { outline: 2px solid var(--hm-red); outline-offset: 2px; }

  /* ---------- бренды и поставщики ---------- */
  .hbr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .hbr__item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 235px); gap: 5px; overflow: hidden; border-radius: 8px; background: var(--hm-grey); }
  .hbr__text { padding: 24px; }
  .hbr__name { margin-bottom: 20px; font-size: clamp(20px, .4vw + 18px, 24px); font-weight: 500; line-height: 1.2; }
  .hbr__link { color: inherit; text-decoration: none; }
  .hbr__link::after { content: ""; position: absolute; inset: 0; }   /* вся карточка — ссылка */
  .hbr__item:hover .hbr__name { color: var(--hm-red); }
  .hbr__link:focus-visible { outline: none; }
  .hbr__item:has(.hbr__link:focus-visible) { outline: 2px solid var(--hm-red); outline-offset: 2px; }
  .hbr__img { align-self: end; width: 100%; height: auto; }
  .hpt { display: grid; gap: 32px; }
  .hpt__item { display: grid; grid-template-columns: minmax(0, 884fr) minmax(0, 476fr); gap: 5px; overflow: hidden; border-radius: 8px; background: var(--hm-grey); }
  .hpt__text { padding: 24px 10px 24px 24px; }
  .hpt__logo { width: auto; height: 40px; }
  .hpt__text p { margin: 22px 0; font-size: clamp(14px, .5vw + 11px, 18px); line-height: 1.2; }
  .hpt__btn { min-height: 42px; padding: 9px 16px; border-radius: 8px; font-size: 18px; font-weight: 400; }
  .hpt__img { width: 100%; height: 100%; object-fit: cover; }

  /* популярные товары (сниппет catalog, стили карточек — catalog.css) */
  .home .popular { margin-top: clamp(50px, 5.5vw, 80px); }
  .home .popular__title { margin-bottom: 20px; font-size: clamp(20px, 1.2vw + 11px, 28px); font-weight: 500; text-transform: uppercase; }

  /* ---------- экосистема ---------- */
  /* «Экосистема завода», как на живом сайте: без наведения — шесть тёмных плиток в ряд; при наведении на блок (или фокусе с клавиатуры)
     появляются красная рамка и кнопка, плитки светлеют и разъезжаются по рамке: 1-я и 6-я стоят на боковых сторонах,
     2-я и 4-я уходят на верхнюю, 3-я и 5-я — на нижнюю. Сдвиг вбок задан в долях ширины плитки — расстановка одинакова на любой ширине.
     Отступы 176 px сверху и снизу — место под разъезд. На телефоне (до 959 px) — список, см. ниже */
  .he { position: relative; padding: 176px 0; }
  .he::after { content: ""; position: absolute; left: 7.5%; right: 7.5%; top: 80px; height: 400px; border: 2px solid var(--hm-red); border-radius: 8px;
    opacity: 0; pointer-events: none; transition: opacity .5s ease; }
  .he__list { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 2%; }
  .he__item { position: relative; display: grid; justify-items: center; align-content: start; gap: 10px; min-height: 155px; margin-top: 50px; padding: 0 8px 10px;
    border-radius: 0 0 8px 8px; background: #333; color: #fff; font-size: 16px; font-weight: 500; line-height: 1.2; text-align: center;
    transition: background-color .5s ease, color .5s ease, translate .5s ease; }
  /* скошенный верх плитки — как на старом */
  .he__item::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 45px; background: inherit; clip-path: polygon(0 100%, 30% 0, 100% 0, 100% 100%); border-radius: 8px 8px 0 0; }
  .he__ico { position: relative; width: 80px; height: 80px; margin-top: -6px; background: center / contain no-repeat; }   /* значок у верхнего края плитки, подпись под ним — как на живом */
  .he__item--1 .he__ico { background-image: url("/assets/redis/img/main/e1.webp"); }
  .he__item--2 .he__ico { background-image: url("/assets/redis/img/main/e2.webp"); }
  .he__item--3 .he__ico { background-image: url("/assets/redis/img/main/e3.webp"); }
  .he__item--4 .he__ico { background-image: url("/assets/redis/img/main/e4.webp"); }
  .he__item--5 .he__ico { background-image: url("/assets/redis/img/main/e5.webp"); }
  .he__item--6 .he__ico { background-image: url("/assets/redis/img/main/e6.webp"); }
  .he__btn { position: absolute; left: 50%; top: 50%; z-index: 2; min-width: 400px; min-height: 74px; padding: 20px; border-radius: 8px; font-size: 28px; font-weight: 400;
    text-transform: uppercase; translate: -50% -50%; opacity: 0; transition: opacity .5s ease; }
  .he:hover::after, .he:focus-within::after { opacity: 1; }
  .he:hover .he__btn, .he:focus-within .he__btn { opacity: 1; }
  /* на живом подписи при наведении остаются белыми на светлом и почти не видны — здесь тёмные, читаемые */
  .he:hover .he__item, .he:focus-within .he__item { background: var(--hm-grey); color: #333; }
  .he:hover .he__item--2, .he:focus-within .he__item--2 { translate: 61.3% -175px; }
  .he:hover .he__item--3, .he:focus-within .he__item--3 { translate: -34.3% 168px; }
  .he:hover .he__item--4, .he:focus-within .he__item--4 { translate: 43.1% -176px; }
  .he:hover .he__item--5, .he:focus-within .he__item--5 { translate: -51% 170px; }
  .he:hover .he__item--1 .he__ico { background-image: url("/assets/redis/img/main/hover-e1.webp"); }
  .he:hover .he__item--2 .he__ico { background-image: url("/assets/redis/img/main/hover-e2.webp"); }
  .he:hover .he__item--3 .he__ico { background-image: url("/assets/redis/img/main/hover-e3.webp"); }
  .he:hover .he__item--4 .he__ico { background-image: url("/assets/redis/img/main/hover-e4.webp"); }
  .he:hover .he__item--5 .he__ico { background-image: url("/assets/redis/img/main/hover-e5.webp"); }
  .he:hover .he__item--6 .he__ico { background-image: url("/assets/redis/img/main/hover-e6.webp"); }

  /* ---------- новости / статьи ---------- */
  .hn__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 30px; margin-bottom: 20px; }
  .hn__tabs { display: flex; gap: 20px; }
  .hn__tab { position: relative; padding: 0 0 4px; border: 0; background: none; color: var(--hm-text); font-size: clamp(20px, 1.2vw + 11px, 28px); font-weight: 500; line-height: 1.2; text-transform: uppercase; }
  .hn__tab[aria-selected="true"] { color: var(--hm-red); box-shadow: inset 0 -2px 0 var(--hm-red); }
  .hn__tab:hover { color: var(--hm-red); }
  .hn__tab:focus-visible, .hm__tab:focus-visible { outline: 2px solid var(--hm-red); outline-offset: 2px; }
  .hn__list, .hv__list { display: flex; gap: 20px; overflow: auto hidden; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px; }
  .hn__list::-webkit-scrollbar, .hv__list::-webkit-scrollbar { display: none; }
  .hn-card { flex: 0 0 calc((100% - 40px) / 3); min-width: 260px; scroll-snap-align: start; }
  .hn-card__link { position: relative; display: flex; flex-direction: column; height: 100%; padding: 20px 22px; border-radius: 8px; background: var(--hm-grey); color: #000; text-decoration: none; }
  .hn-card__link:hover .hn-card__text { color: var(--hm-red); }
  .hn-card__link:focus-visible { outline: 2px solid var(--hm-red); outline-offset: 2px; }
  .hn-card__pic { display: block; margin-bottom: 20px; }
  .hn-card__img { width: 100%; height: auto; aspect-ratio: 338 / 147; object-fit: cover; border-radius: 4px; }
  .hn-card__text { flex: 1; font-size: clamp(15px, .3vw + 13px, 18px); font-weight: 300; line-height: 1.4; }
  .hn-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; color: #767676; font-size: 16px; font-weight: 300; }
  .hn-card__arrow { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #fff; color: #000; }
  .hn-card__arrow .icon { width: 14px; height: 14px; transform: rotate(-90deg); }
  .strip-nav { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }
  .strip-nav__btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid #ddd; border-radius: 50%; background: #fff; color: #000; }
  .strip-nav__btn .icon { width: 16px; height: 16px; }
  .strip-nav__btn--prev .icon { transform: rotate(90deg); }
  .strip-nav__btn--next .icon { transform: rotate(-90deg); }
  .strip-nav__btn:hover:not(:disabled) { border-color: var(--hm-red); color: var(--hm-red); }
  .strip-nav__btn:disabled { opacity: .35; cursor: default; }
  .strip-nav__btn:focus-visible { outline: 2px solid var(--hm-red); outline-offset: 2px; }

  /* ---------- видео ---------- */
  .hv__item { flex: 0 0 calc((100% - 20px) / 2); min-width: 260px; scroll-snap-align: start; }
  .hv__video { --svc-radius: 8px; aspect-ratio: 652 / 335; }

  /* ---------- филиалы: вкладки городов, карта и карточка поверх ---------- */
  .hm__tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 20px 40px; }
  .hm__tab { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 10px 14px 10px 20px; border: 0; border-radius: 8px; background: none; color: var(--hm-text); font-size: 18px; text-align: left; }
  .hm__tab::before { content: "★"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: currentColor; font-size: 16px; }
  .hm__tab[aria-selected="true"] { background: var(--hm-red); color: #fff; }
  .hm__tab[aria-selected="true"]::before { background: #fff; color: var(--hm-red); }
  .hm__panel { position: relative; }
  .hm__frame { display: block; width: 100%; height: 512px; border: 0; background: var(--hm-grey); }
  .hm__card { position: absolute; right: 45px; top: 70px; width: 435px; max-width: calc(100% - 20px); padding: 12px 16px; border-radius: 8px; background: #fff; box-shadow: 0 0 5px #ccc; font-size: 14px; line-height: 1.3; }
  .hm__company { margin-bottom: 14px; font-size: 16px; font-weight: 500; }
  .hm__list { margin: 0; }
  .hm__row { margin-bottom: 12px; }
  .hm__row dt { margin-bottom: 4px; color: #555; font-size: 15px; }
  .hm__row dd { margin: 0; color: #767676; }
  .hm__contacts { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid #ddd; }
  .hm__phone, .hm__mail { color: #555; text-decoration: none; }
  .hm__phone:hover, .hm__mail:hover { color: var(--hm-red); }
  .hm { margin-bottom: 80px; }

  @media (max-width: 1199px) {
    .hc { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hc__item--wide { grid-column: span 1; }
    .he__item { font-size: 14px; padding-inline: 4px; }
    .he__btn { min-width: 320px; min-height: 64px; font-size: 26px; }
    .hn-card { flex-basis: calc((100% - 20px) / 2); }
  }
  @media (max-width: 959px) {
    .hs-slide { grid-template-columns: minmax(0, 1fr); height: auto; background: #383838; color: #fff; }
    .hs-slide__pic--d { display: none; }
    .hs-slide__pic--m { display: block; grid-row: 1; }
    .hs-slide__pic--m .hs-slide__img { width: 100%; height: auto; }
    .hs-slide__text { grid-row: 2; align-self: start; width: auto; margin: 0; padding: 20px var(--gutter) 70px; }
    .hs__nav { right: var(--gutter); bottom: 14px; }
    .hc { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .hc__img { height: auto; max-height: 160px; }
    .hc__name { min-height: 56px; padding: 6px 8px; }
    .hbr, .hpt__item { grid-template-columns: minmax(0, 1fr); }
    .hbr__item { grid-template-columns: minmax(0, 1fr); }
    .hbr__img { justify-self: stretch; }
    .hpt__img { height: auto; }
    /* телефон: плитки списком, рамки и разъезда нет. Как на живом: у плитки скошенный верх, а когда она в средней части экрана
       (дальше 180 px от верха и низа) — становится красной (класс is-active ставит home.js); вышла из неё — снова тёмная */
    .he { padding: 0; margin-top: 30px; }
    .he::after { display: none; }
    .he__list { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .he__item { grid-template-columns: 80px minmax(0, 1fr); align-items: center; align-content: center; justify-items: end; gap: 8px; min-height: 80px; margin-top: 26px; padding: 6px 14px 10px; text-align: right; }
    .he__br { display: none; }   /* переносы строк в подписях — только для плиток на компьютере */
    .he__item::before { height: 26px; clip-path: polygon(0 100%, 7% 0, 100% 0, 100% 100%); border-radius: 0 8px 0 0; }
    .he:hover .he__item, .he:focus-within .he__item { background: #333; color: #fff; translate: none; }
    .he .he__item.is-active { background: var(--hm-red); color: #fff; }
    .he:hover .he__item--1 .he__ico { background-image: url("/assets/redis/img/main/e1.webp"); }
    .he:hover .he__item--2 .he__ico { background-image: url("/assets/redis/img/main/e2.webp"); }
    .he:hover .he__item--3 .he__ico { background-image: url("/assets/redis/img/main/e3.webp"); }
    .he:hover .he__item--4 .he__ico { background-image: url("/assets/redis/img/main/e4.webp"); }
    .he:hover .he__item--5 .he__ico { background-image: url("/assets/redis/img/main/e5.webp"); }
    .he:hover .he__item--6 .he__ico { background-image: url("/assets/redis/img/main/e6.webp"); }
    .he__ico { margin-top: -14px; justify-self: start; }
    .he__btn { position: static; display: flex; min-width: 0; width: 100%; margin-top: 16px; font-size: 20px; translate: none; opacity: 1; }
    .hm__tabs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin: 16px 0; }
    .hm__tab { font-size: 15px; padding-left: 10px; }
    .hm__frame { height: 320px; }
    .hm__card { position: static; width: auto; max-width: none; margin-top: 12px; }
    .hv__item { flex-basis: 100%; }
  }
  @media (max-width: 639px) {
    .hn-card { flex-basis: 100%; }
  }
  @media (prefers-reduced-motion: reduce) {
    .he__btn, .he__item, .he::after, .hc__link { transition: none; }
  }
}
