/* Правила привязаны к html:root, а не к классу: ядро Битрикса при загрузке перезаписывает классы на <html>.
   Файл подключается только тем, у кого шапка v2 включена. */
/* Шапка сайта v2 для компьютера (16.11.2026): три строки — служебные ссылки, логотип+поиск+контакты, разделы каталога;
   при прокрутке сверху выезжает уменьшенная шапка. Работает только вместе с /local/js/kf-header-v2.js, который
   переставляет блоки нынешней шапки (сами блоки и их работа не меняются).
   Телефонная шапка (#header_adapt) не затрагивается. */
#kfh-sticky { display: none; }
@media (min-width: 992px) {
  html:root #kfh-sticky { display: block; }
  /* высота задана заранее (37 + 76 + 46), чтобы страница не прыгала, пока скрипт переставляет блоки */
  html:root #header_main { height: 159px; visibility: hidden; animation: kfh-fallback 0s linear 3s forwards; font-family: 'Blogger Sans', Arial, sans-serif; }
  html.kf-hdr2-ready:root #header_main { visibility: visible; }
  html:root #header_main[data-kfh="1"] { animation: none; }
  /* страховка: если скрипт не загрузился, через 3 с показывается прежняя шапка в прежней раскладке */
  @keyframes kfh-fallback { to { visibility: visible; height: auto; } }

  /* ── строка 1: служебные ссылки ── */
  html:root #header_main[data-kfh="1"] .top-line { background: #fff; border-bottom: 1px solid #e6e8e6; padding: 0; }
  html:root #header_main[data-kfh="1"] .top-line .container_full { padding: 0 24px; }
  html:root #header_main[data-kfh="1"] .top-line .row { display: flex; align-items: center; justify-content: space-between; height: 36px; margin: 0; }
  html:root #header_main[data-kfh="1"] .top-line .row::before,
  html:root #header_main[data-kfh="1"] .top-line .row::after { display: none; }
  html:root #header_main[data-kfh="1"] .top-line .row > div { width: auto; float: none; padding: 0; min-height: 0; }
  html:root #header_main[data-kfh="1"] .top-menu { margin: 0; }
  html:root #header_main[data-kfh="1"] .top-menu ul { display: flex; align-items: center; gap: 26px; margin: 0; padding: 0; }
  html:root #header_main[data-kfh="1"] .top-menu li { margin: 0; }
  html:root #header_main[data-kfh="1"] .top-menu a { display: block; position: relative; top: 1.5px; font: 400 15px/1 'Blogger Sans', Arial, sans-serif; color: #6b6b6b; text-decoration: none; }
  html:root #header_main[data-kfh="1"] .top-menu a:hover { color: #111; }
  html:root #header_main[data-kfh="1"] .top-line .row > .kfh-top-r { display: flex; align-items: center; gap: 16px; }
  @media (max-width: 1199px) { html:root .kfh-top-r .kfh-hours { display: none; } }
  html:root .kfh-top-r .h-contacts-social { display: flex; align-items: center; gap: 14px; width: auto; float: none; padding: 0; position: static; }
  html:root .kfh-top-r .h-contacts-social a { display: block; margin: 0; padding: 0; line-height: 0; opacity: .8; transform-origin: center; transition: transform .16s ease, opacity .16s ease; }
  html:root .kfh-top-r .h-contacts-social a:hover, html:root .kfh-top-r .h-contacts-social a:focus-visible { opacity: 1; transform: scale(1.22); }
  html:root .kfh-top-r .h-contacts-social img { width: 18px; height: 18px; display: block; }
  @media (prefers-reduced-motion: reduce) { html:root .kfh-top-r .h-contacts-social a { transition: none; } html:root .kfh-top-r .h-contacts-social a:hover { transform: none; } }
  /* текст служебной строки опущен на 1–1,5 точки: у цифр и заглавных нет нижних хвостиков, и без сдвига они стоят выше середины значков */
  html:root .kfh-hours { position: relative; top: 1.5px; font: 400 15px/1 'Blogger Sans', Arial, sans-serif; color: #6b6b6b; white-space: nowrap; }

  /* ── строка 2: логотип, поиск, контакты и значки ── */
  html:root #header_main[data-kfh="1"] .head-line { padding: 0; }
  html:root #header_main[data-kfh="1"] .head-line .container_full { padding: 0 24px; }
  html:root #header_main[data-kfh="1"] .head-line .row { display: none; }
  html:root .kfh-main { display: flex; align-items: center; gap: 36px; height: 76px; }
  html:root .kfh-main .logo,
  html:root .kfh-s-logo { display: block; flex: none; margin: 0; background: url(/bitrix/templates/flora/images/logo-word.svg) left center / contain no-repeat; }
  html:root .kfh-main .logo { width: 224px; height: 36px; }
  html:root .kfh-main .logo picture { display: none; }
  html:root .kfh-main .logo a { display: block; width: 100%; height: 100%; }

  html:root .kfh-slot-search { flex: 1 1 auto; min-width: 0; }
  html:root #header_main[data-kfh="1"] .header_search,
  html:root #kfh-sticky .header_search { padding: 0; width: 100%; float: none; }
  html:root .kf-smart-search--desktop .kf-smart-search__field { background: #fff; border: 1px solid #d5d9d6; border-radius: 12px; height: 48px; box-sizing: border-box; transition: border-color .15s ease; }
  html:root .kf-smart-search--desktop .kf-smart-search__input { height: 46px; width: 100%; border: 0 !important; background: transparent; padding: 0 16px 0 46px; font: 400 17px/46px 'Blogger Sans', Arial, sans-serif; color: #111; box-shadow: none; outline: none; }
  html:root .kf-smart-search--desktop .kf-smart-search__input::placeholder { color: #6b6b6b; font-style: normal; opacity: 1; }
  html:root .kf-smart-search--desktop .kf-smart-search__field:focus-within { border-color: #3f7a44; }
  html:root .kf-smart-search--desktop .kf-smart-search__button { left: 14px; top: 0; bottom: 0; margin: auto 0; transform: none; width: 22px; height: 22px; opacity: .6; }

  /* панель подсказок: на всю ширину поля */
  html:root .kf-smart-search--desktop .kf-smart-search-panel { left: 0; right: 0; width: auto; border-radius: 12px; border-color: #e6e8e6; box-shadow: 0 12px 32px rgba(0, 0, 0, .10); }
  html:root .kfh-chips { padding: 6px 0 10px; }
  html:root .kfh-chips .kf-smart-search-title { padding: 10px 18px 8px; font: 400 14px/1.2 'Blogger Sans', Arial, sans-serif; color: #6b6b6b; text-transform: none; }
  html:root .kfh-chips-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px; }
  html:root .kfh-chip { display: block; padding: 8px 14px; border: 1px solid #d5d9d6; border-radius: 999px; font: 400 16px/1.2 'Blogger Sans', Arial, sans-serif; color: #111; text-decoration: none; white-space: nowrap; }
  html:root .kfh-chip:hover, html:root .kfh-chip:focus-visible { border-color: #3f7a44; color: #3f7a44; text-decoration: none; }
  html:root .kfh-chips--season .kf-smart-search-title { color: #3f7a44; }
  html:root .kfh-chips--season .kfh-chip { border-color: #3f7a44; }

  html:root .kfh-right { display: flex; align-items: center; gap: 28px; flex: none; }
  html:root .kfh-tel { display: flex; align-items: center; margin: 0; padding: 0; }
  html:root .kfh-tel a { display: block; position: relative; top: 1.5px; font: 500 15px/1 'Blogger Sans', Arial, sans-serif; color: #111; text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
  html:root .kfh-icons { display: flex; align-items: center; gap: 20px; flex: none; }
  html:root .kfh-icons .favorite-general { position: relative; top: auto; left: auto; margin: 0; }
  html:root .kfh-icons #basket-line-flora { padding: 0; width: auto; min-width: 0; height: auto; display: flex; align-items: center; gap: 8px; }
  html:root .kfh-icons #basket-line-flora img { margin: 0; display: block; }
  html:root .kfh-icons #basket-line-flora .h-basket-info { display: flex; align-items: center; margin: 0; padding: 0; }
  html:root .kfh-icons #basket-line-flora .h-basket-count,
  html:root .kfh-icons #basket-line-flora .h-basket-delivery-price { display: none; }
  html:root .kfh-icons #basket-line-flora .h-basket-price { font: 400 18px/1 'Blogger Sans', Arial, sans-serif; color: #111; white-space: nowrap; font-variant-numeric: tabular-nums; margin: 0; padding: 0; }
  html:root .kfh-icons .cabinet { margin: 0; position: relative; }
  html:root .kfh-icons .cabinet.kfh-guest > a.kf-account-trigger { display: block; width: 25px; height: 25px; font-size: 0; line-height: 0; text-decoration: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8.5' r='3.7'/%3E%3Cpath d='M4.5 20.5c.8-3.8 3.9-5.8 7.5-5.800s6.700 2 7.500 5.800'/%3E%3C/svg%3E") center / 25px no-repeat; }
  html:root .kfh-icons .cabinet:not(.kfh-guest) > a.kf-account-trigger { font: 500 16px/1 'Blogger Sans', Arial, sans-serif; color: #111; white-space: nowrap; }

  /* ── строка 3: разделы каталога ── */
  /* линия под разделами оставлена только в уменьшенной шапке; в большой шапке одна линия — под служебной строкой */
  html:root #header_main[data-kfh="1"] .h-catalog-menu-container { border-bottom: 0; background: #fff; }
  html:root #kfh-sticky .h-catalog-menu-container { border-bottom: 1px solid #e6e8e6; background: #fff; }
  html:root .h-catalog-menu-container .row { margin: 0; overflow: visible !important; }
  html:root .h-catalog-menu-container .container_full { padding: 0 24px; }
  html:root .h-catalog-menu-container nav { padding: 0; }
  html:root .h-catalog-menu-container .h-catalog-menu { justify-content: center; gap: 52px; height: 46px; align-items: center; padding: 0; margin: 0 auto; width: auto; max-width: none; }
  html:root .h-catalog-menu-container .h-catalog-menu > li { padding: 12px 0; margin: 0; }

  /* ── уменьшенная шапка при прокрутке ── */
  html:root #kfh-sticky { position: fixed; left: 0; right: 0; top: 0; z-index: 900; background: #fff; font-family: 'Blogger Sans', Arial, sans-serif;
    transform: translateY(-110%); transition: transform .22s ease; box-shadow: 0 1px 0 #e6e8e6; visibility: hidden; }
  html:root #kfh-sticky.kfh-on { transform: translateY(0); visibility: visible; }
  html:root #kfh-sticky .kfh-s-bar { display: flex; align-items: center; gap: 24px; height: 58px; padding: 0 24px; }
  html:root .kfh-s-logo { width: 132px; height: 10px; background-image: url(/bitrix/templates/flora/images/logo-word-s.svg); }
  html:root .kfh-s-cat { display: flex; align-items: center; gap: 10px; flex: none; border: 0; background: none; padding: 8px 0; cursor: pointer; font: 500 19px/1 'Blogger Sans', Arial, sans-serif; color: #111; }
  html:root .kfh-s-cat i { display: block; width: 18px; height: 14px; background: linear-gradient(#111, #111) 0 0 / 100% 1.7px no-repeat, linear-gradient(#111, #111) 0 50% / 100% 1.7px no-repeat, linear-gradient(#111, #111) 0 100% / 100% 1.7px no-repeat; }
  html:root .kfh-s-cat:hover { color: #3f7a44; }
  html:root #kfh-sticky .kf-smart-search--desktop .kf-smart-search__field,
  html:root #kfh-sticky .kf-smart-search--desktop .kf-smart-search__input { height: 38px; line-height: 38px; }
  html:root #kfh-sticky .kf-smart-search--desktop .kf-smart-search__input { font-size: 16px; }
  html:root #kfh-sticky .kfh-s-menu { display: none; }
  html:root #kfh-sticky.kfh-menu .kfh-s-menu { display: block; }
  @media (prefers-reduced-motion: reduce) { html:root #kfh-sticky { transition: none; } }
}
