/* ==========================================================================
   Шапка и подвал сайта по макету 2026 (tpl/blocks/header.tpl, tpl/blocks/footer.tpl, javascript/layout.js)
   и общие элементы, которые использует главная (styles/home.css).
   Перенесено из вёрстки task3/style.css: всё внутри .hp, классы с приставкой hp-,
   чтобы не пересекаться со стилями сайта (main.css, Bootstrap). Подключается на всех страницах.
   ========================================================================== */

.hp {
  /* палитра из ТЗ */
  --green: #99c45a;
  --dark: #333333;
  --light: #f4f4f4;
  --line: #d5d5d5;

  --green-dark: #7ab83a;
  --dark-green: #373d2f;
  --gray-bg: var(--light);
  --text: var(--dark);
  --white: #ffffff;
  --error: #e53935;

  --container: 1300px; /* общий для шапки и блоков главной: правый край контента совпадает с шапкой */
  --gutter: 30px;
  --radius: 6px;
  --font: "Roboto", Arial, sans-serif;
}

/* ---------- База ---------- */

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

.hp {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
  background: var(--gray-bg);
}

.hp img {
  display: block;
  max-width: 100%;
  height: auto;
}

.hp ul,
.hp ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hp h1,
.hp h2,
.hp h3,
.hp p {
  margin: 0;
}

/* заголовки сайта (main.css) задают свой шрифт, цвет и прописные — внутри .hp берём из макета */
.hp h1,
.hp h2,
.hp h3 {
  font-family: inherit;
  color: inherit;
  text-transform: none;
  letter-spacing: normal;
}

.hp input,
.hp button {
  font: inherit;
}

.hp .hp-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hp a {
  color: inherit;
}

/* фокус с клавиатуры для всех интерактивных элементов */
.hp a:focus-visible,
.hp button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

body.is-locked {
  overflow: hidden;
}

.hp .hp-container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Общие элементы ---------- */

.hp .hp-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--green);
  color: var(--dark);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.hp .hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 28px;
  border: 0;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s, transform 0.1s, filter 0.2s;
}

.hp .hp-btn:active {
  transform: translateY(1px);
  filter: brightness(0.94);
}

.hp .hp-btn:disabled,
.hp .hp-btn.is-loading {
  cursor: default;
  opacity: 0.7;
}

.hp .hp-btn--green {
  background: var(--green);
  color: var(--dark);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.hp .hp-btn--green:hover {
  color: var(--light);
}

.hp .hp-btn--dark {
  background: var(--dark);
  border: 1.5px solid #8a8a8a;
  color: var(--light);
}

.hp .hp-btn--dark:hover {
  color: var(--green);
}

.hp .hp-btn--flat {
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--green);
  color: var(--dark);
  font-size: 18px;
  font-weight: 400;
}

.hp .hp-btn--flat:hover {
  color: var(--light);
}

.hp .hp-btn--block {
  width: 100%;
}

.hp .hp-section-title {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.hp .hp-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hp .hp-more-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, gap 0.2s;
}

.hp .hp-more-link:hover {
  gap: 12px;
  color: var(--dark);
}

/* Круглая стрелка в карточках */
.hp .hp-circle-arrow {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--green);
  transition: color 0.2s;
}

.hp .hp-circle-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translate(-70%, -50%) rotate(45deg);
}

.hp .hp-circle-arrow--sm {
  width: 24px;
  height: 24px;
}

/* Поля форм */
.hp .hp-field {
  position: relative;
  display: block;
}

.hp .hp-field__input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hp .hp-field__input::placeholder {
  color: #a5a5a5;
}

.hp .hp-field__input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(153, 196, 89, 0.25);
}

.hp .hp-field--file .hp-field__input {
  padding-right: 46px;
}

.hp .hp-field__attach {
  position: absolute;
  top: 50%;
  right: 12px;
  display: flex;
  color: #6f6f6f;
  cursor: pointer;
  transform: translateY(-50%);
}

.hp .hp-field__attach:hover {
  color: var(--green-dark);
}

/* Согласие с политикой */
.hp .hp-consent {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
}

.hp .hp-consent input {
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 2px solid var(--green);
  border-radius: 3px;
  background: var(--white);
  cursor: pointer;
}

.hp .hp-consent input:checked {
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.5l4.5-5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") center / 10px no-repeat;
}

.hp .hp-consent input:focus-visible {
  outline: 2px solid var(--green-dark);
  outline-offset: 2px;
}

.hp .hp-consent a {
  text-decoration: underline;
}

/* Список «иконка + подпись» с разделителями */
.hp .hp-icon-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 0;
}

.hp .hp-icon-list__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 30px 6px 0;
  font-size: 16px;
  line-height: 1.3;
}

.hp .hp-icon-list__item + .hp-icon-list__item {
  padding-left: 30px;
  border-left: 3px solid var(--line);
}

.hp .hp-icon-list__item img {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.hp .hp-icon-list--lg .hp-icon-list__item {
  font-size: 18px;
}

.hp .hp-icon-list--lg .hp-icon-list__item img {
  width: 56px;
  height: 56px;
}

/* Фото из фона секции — показывается отдельной полосой на мобильных */
.hp .hp-section-media {
  display: none;
}

/* ==========================================================================
   Шапка
   ========================================================================== */

.hp .hp-header {
  position: relative;
  z-index: 40;
  background: var(--light);
  border-bottom: 1px solid #e3e3e3;
}

.hp .hp-header__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
}

.hp .hp-logo.hp-logo--dark {
  color: var(--dark);
}

.hp .hp-header__logo .hp-logo__text {
  font-size: 10px;
  font-weight: 700;
}

.hp .hp-header__sub {
  display: flex;
  align-items: center;
  align-self: center;
  height: 34px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  color: var(--line);
  font-size: 12px;
  white-space: nowrap;
}

.hp .hp-header__nav {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hp .hp-menu {
  display: flex;
  align-items: center;
  gap: 22px;
}

.hp .hp-menu__item {
  position: relative;
}

.hp .hp-menu__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--dark);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}

.hp .hp-menu__link:hover {
  color: var(--green);
}

.hp .hp-menu__link:active,
.hp .hp-dropdown a:active,
.hp .hp-header__contact:active {
  opacity: 0.8;
}

/* Стрелка в белом кружке */
.hp .hp-arrow-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  color: var(--green);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.hp .hp-arrow-circle--outline {
  border: 1.5px solid currentColor;
  color: var(--dark);
}

/* Кнопка «Каталог» */
.hp .hp-menu__item--catalog {
  display: flex;
  align-items: center;
  padding-right: 6px;
  border-radius: 4px;
  background: var(--green);
}

.hp .hp-catalog-btn {
  padding: 7px 6px 7px 12px;
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
}

.hp .hp-catalog-btn__toggle {
  display: flex;
  padding: 4px;
  border: 0;
  background: none;
  cursor: pointer;
}

.hp .hp-menu__item--catalog:hover .hp-catalog-btn,
.hp .hp-menu__item--catalog.is-open .hp-catalog-btn {
  color: var(--dark);
}

.hp .hp-menu__item--catalog:hover .hp-arrow-circle,
.hp .hp-menu__item--catalog.is-open .hp-arrow-circle {
  color: var(--dark);
  transform: rotate(90deg);
}

/* «О компании» */
.hp .hp-menu__item--about:hover .hp-menu__link,
.hp .hp-menu__item--about.is-open .hp-menu__link {
  color: var(--green);
}

.hp .hp-menu__item--about:hover .hp-arrow-circle,
.hp .hp-menu__item--about.is-open .hp-arrow-circle {
  color: var(--green);
  transform: rotate(90deg);
}

/* Выпадающие списки */
.hp .hp-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  min-width: 260px;
  padding: 8px 0;
  border-radius: 8px;
  background: var(--green);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.hp .hp-menu__item--about .hp-dropdown {
  left: auto;
  right: 0;
}

.hp .hp-dropdown a {
  display: block;
  padding: 9px 18px;
  color: var(--white);
  font-size: 15px;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.hp .hp-dropdown a:hover,
.hp .hp-dropdown a:focus-visible {
  outline: none;
  background: var(--light);
  color: var(--dark);
}

.hp [data-dropdown].is-open > .hp-dropdown {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (hover: hover) and (min-width: 1241px) {
  .hp [data-dropdown]:hover > .hp-dropdown {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}

/* Контакты */
.hp .hp-header__contacts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hp .hp-header__contact {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dark);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.hp .hp-header__contact:hover {
  color: var(--green);
}

/* Поиск, корзина, бургер */
.hp .hp-header__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hp .hp-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--dark);
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}

.hp .hp-icon-btn:hover,
.hp .hp-icon-btn[aria-expanded="true"] {
  color: var(--green);
}

.hp .hp-icon-btn:active {
  background: rgba(0, 0, 0, 0.06);
}

.hp .hp-cart-link__count {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--error);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.hp .hp-burger {
  display: none;
}

.hp .hp-burger__lines,
.hp .hp-burger__lines::before,
.hp .hp-burger__lines::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s, background-color 0.2s;
}

.hp .hp-burger__lines {
  position: relative;
}

.hp .hp-burger__lines::before,
.hp .hp-burger__lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.hp .hp-burger__lines::before {
  top: -7px;
}

.hp .hp-burger__lines::after {
  top: 7px;
}

.hp .hp-header.is-menu-open .hp-burger__lines {
  background: transparent;
}

.hp .hp-header.is-menu-open .hp-burger__lines::before {
  transform: translateY(7px) rotate(45deg);
}

.hp .hp-header.is-menu-open .hp-burger__lines::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* Строка поиска */
.hp .hp-header-search {
  padding: 12px 0;
  border-top: 1px solid #e3e3e3;
  background: var(--light);
}

.hp .hp-header-search[hidden] {
  display: none;
}

.hp .hp-header-search__inner {
  display: flex;
  gap: 8px;
}

.hp .hp-header-search__btn {
  flex-shrink: 0;
}

/* Шапка: адаптив */
@media (max-width: 1320px) {
  .hp .hp-header__sub {
    display: none;
  }
}

@media (max-width: 1240px) {
  .hp .hp-header__inner {
    justify-content: space-between;
  }

  .hp .hp-burger {
    display: inline-flex;
  }

  /* навигация превращается в раскрывающуюся панель */
  .hp .hp-header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 12px var(--gutter) 24px;
    border-top: 1px solid #e3e3e3;
    background: var(--light);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.15);
  }

  .hp .hp-header.is-menu-open .hp-header__nav {
    display: flex;
  }

  .hp .hp-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .hp .hp-menu__item {
    border-bottom: 1px solid #e3e3e3;
  }

  .hp .hp-menu__link {
    justify-content: space-between;
    width: 100%;
    padding: 14px 0;
    font-size: 16px;
  }

  .hp .hp-menu__item--catalog {
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding-right: 8px;
    border-bottom: 0;
    border-radius: 8px;
  }

  .hp .hp-catalog-btn {
    flex: 1;
    padding: 12px 14px;
    font-size: 16px;
  }

  .hp .hp-dropdown,
  .hp .hp-menu__item--about .hp-dropdown {
    position: static;
    display: none;
    min-width: 0;
    width: 100%;
    margin-bottom: 12px;
    padding: 4px 0;
    border-radius: 8px;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .hp .hp-menu__item--catalog .hp-dropdown {
    margin: 0 -8px 0 0;
    width: calc(100% + 8px);
    border-radius: 0 0 8px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
  }

  .hp [data-dropdown].is-open > .hp-dropdown {
    display: block;
  }

  .hp .hp-header__contacts {
    gap: 10px;
    margin-top: 18px;
  }

  .hp .hp-header__contact {
    font-size: 16px;
  }
}

@media (max-width: 400px) {
  .hp .hp-header__logo .hp-logo__mark {
    width: 29px;
    height: 34px;
  }

  .hp .hp-header__logo .hp-logo__text {
    font-size: 9px;
  }
}

/* ==========================================================================
   Подвал
   ========================================================================== */

.hp .hp-footer {
  color: var(--white);
}

.hp .hp-footer__main {
  padding: 30px 0 26px;
  background: var(--dark) url("/images/home/footer-bg.jpg") left center / cover no-repeat;
}

.hp .hp-footer__inner,
.hp .hp-footer__bottom .hp-container {
  padding-left: calc(var(--gutter) + 96px);
}

.hp .hp-footer__inner {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
}

.hp .hp-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  text-decoration: none;
}

.hp .hp-logo__mark {
  flex-shrink: 0;
}

.hp .hp-logo__text {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
}

.hp .hp-socials {
  display: flex;
  gap: 10px;
  margin: 12px 0 6px;
}

.hp .hp-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--white);
  border-radius: 50%;
  color: var(--white);
  transition: border-color 0.2s, color 0.2s;
}

.hp .hp-socials a:hover {
  border-color: var(--green);
  color: var(--green);
}

.hp .hp-footer__contact {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--white);
  text-decoration: none;
}

.hp .hp-footer__nav {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 24px 30px;
}

.hp .hp-footer__col li + li {
  margin-top: 9px;
}

.hp .hp-footer__col a {
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
}

.hp .hp-footer__col a:hover {
  color: var(--green);
}

.hp .hp-footer__legal {
  margin-top: 44px;
}

.hp .hp-footer__legal a {
  color: #a9a9a9;
  font-weight: 400;
}

.hp .hp-footer__bottom {
  padding: 14px 0;
  background: #585858;
  font-size: 12px;
}

/* Кнопка онлайн-чата */

/* ==========================================================================
   Адаптив блоков 2–7 и подвала
   ========================================================================== */

@media (max-width: 1100px) {

  .hp .hp-footer__inner,
  .hp .hp-footer__bottom .hp-container {
    padding-left: var(--gutter);
  }

  .hp .hp-footer__inner {
    grid-template-columns: 1fr;
  }
}

/* На планшетах и телефонах фото из фона выносится отдельной полосой,
   а секция получает спокойный однотонный фон */

@media (max-width: 768px) {

  .hp .hp-footer__nav {
    grid-template-columns: 1fr 1fr;
  }

  .hp .hp-footer__nav .hp-footer__col:last-child {
    grid-column: 1 / -1;
  }

  .hp .hp-footer__legal {
    margin-top: 16px;
  }

  .hp .hp-footer__main {
    background-size: auto 220px;
    background-position: left top;
  }

  .hp .hp-footer__bottom {
    padding-bottom: 56px;
  }

}

/* ==========================================================================
   Дополнения для сайта (нет в вёрстке)
   ========================================================================== */

/* корзина в шапке: старые правила #shop-cart (main.css) красят её в белый и сдвигают вниз */
.hp #shop-cart {
  display: flex;
  padding-top: 0;
  color: var(--dark);
}

.hp #shop-cart a {
  color: var(--dark);
}

.hp #shop-cart a:hover {
  color: var(--green);
}

/* шапка закреплена сверху при прокрутке; z-index ниже всплывающих окон сайта (.popupPhone — 101) */
.hp.hp-header-wrap {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 99;
}

/* внутренние страницы: шапка по ширине контейнера контента сайта (.container из Bootstrap);
   его clearfix-псевдоэлементы во flex-шапке давали бы лишние отступы */
.hp .container.hp-header__inner::before,
.hp .container.hp-header__inner::after,
.hp .container.hp-header-search__inner::before,
.hp .container.hp-header-search__inner::after {
  content: none;
}

/* контейнер контента сайта до 1440px уже контейнера главной — шапка не должна вылезать за него */
@media (min-width: 1241px) and (max-width: 1439px) {
  .hp .container.hp-header__inner .hp-header__sub {
    display: none;
  }
}

@media (min-width: 1241px) and (max-width: 1365px) {
  .hp .hp-header__inner,
  .hp .hp-header__nav {
    gap: 14px;
  }

  .hp .hp-menu {
    gap: 16px;
  }
}
