/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  line-height: 24px;
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn--primary {
  background: var(--color-orange);
  color: var(--color-black);
  padding: 12px 20px;

  &:hover {
    color: var(--color-black);
    background: var(--color-orange-light);
    box-shadow: 2px 2px 8.2px 0px rgba(27, 22, 7, 0.25);
  }

  &:disabled {
    background: var(--color-gray-light);
    color: var(--color-gray);
    cursor: not-allowed;
  }
}

.btn--secondary {
  background: transparent;
  color: var(--color-white);
  border: 1px solid var(--color-white);
  padding: 8px 12px;

  &:hover {
    color: var(--color-white);
    border-color: var(--color-orange);
    background: var(--color-orange);
    box-shadow: 2px 2px 8.2px 0px rgba(27, 22, 7, 0.25);
  }

  &:disabled {
    background: var(--color-gray-light);
    border-color: var(--color-gray-light);
    color: var(--color-gray);
    cursor: not-allowed;
  }
}

.btn--text {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-white);
  font-weight: 400;
  text-decoration: underline;

  &:hover {
    color: var(--color-orange);
  }
}

/* White filled button for dark backgrounds */
body .btn--white {
  background: var(--color-white);
  color: var(--color-black);
  border: 1px solid var(--color-black);
  padding: 8px 12px;

  &:hover {
    background: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
  }
}

/* Dark outline button (light background) */
.btn--outline {
  background: transparent;
  border: 1px solid var(--color-black);
  color: var(--color-black);
  padding: 12px;
  width: 100%;
  justify-content: center;

  &:hover {
    background: var(--color-black);
    color: var(--color-white);
  }
}

/* ===== Section header ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  @media (max-width: 1200px) {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  @media (max-width: 767px) {
    gap: 12px;
  }
}

.section-header__heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-header__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 40px;
  line-height: 48px;
  text-transform: uppercase;
  color: var(--color-black);

  /* Акцент из WP-редактора: «B» (жирный) или <span> — оранжевый */
  strong,
  b,
  span {
    font-weight: inherit;
    color: var(--color-orange);
  }

  @media (max-width: 1200px) {
    font-size: 32px;
    line-height: 40px;
  }

  @media (max-width: 767px) {
    font-size: 22px;
    line-height: 28px;
  }
}

.section-header__link {
  color: var(--color-gray);
  text-decoration: underline;

  &:hover {
    color: var(--color-orange);
  }
}

.section-header__desc {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  line-height: 100%;
  color: var(--color-black);
  max-width: 387px;

  @media (max-width: 1024px) {
    max-width: none;
  }

  @media (max-width: 767px) {
    color: var(--color-gray);
    max-width: none;
  }
}

/* Описание под заголовком (блок «Каталог (слайдер)», поле «Положение описания») */
.section-header--desc-below {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;

  .section-header__desc {
    max-width: none;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.4;
    color: var(--color-gray);

    @media (max-width: 767px) {
      font-size: 14px;
    }
  }
}

/* Описание мельче (15 / 14px) — «Тарифы», «Карточки + картинка» */
.section-header--desc-below .section-header__desc--sm {
  font-size: 15px;

  @media (max-width: 767px) {
    font-size: 14px;
  }
}

/* ===== Текст из WP-редактора (stealbox_rich_text) ===== */
.rich-text {
  p + p,
  p + ul,
  p + ol,
  ul + p,
  ol + p {
    margin-top: 0.6em;
  }

  ul,
  ol {
    padding-left: 1.2em;
  }

  strong,
  b {
    font-weight: 600;
  }

  a {
    color: inherit;
    text-decoration: underline;

    &:hover {
      color: var(--color-orange);
    }
  }
}

/* ===== Серая плашка (template-parts/parts/notes.php) ===== */
.notes {
  display: flex;
  gap: 30px;
  padding: 30px;
  list-style: none;
  border-radius: 5px;
  background: var(--color-gray-light);

  @media (max-width: 1200px) {
    gap: 20px;
    padding: 20px;
  }

  @media (max-width: 767px) {
    flex-direction: column;
  }
}

.notes__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* С заголовком — иконка по верху, как в макете */
.notes__item--titled {
  align-items: flex-start;
}

.notes__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.notes__item--titled .notes__icon {
  width: 48px;
  height: 56px;
  object-position: top;

  @media (max-width: 767px) {
    width: 40px;
    height: 48px;
  }
}

.notes__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.notes__title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.4;
  color: var(--color-black);

  @media (max-width: 767px) {
    font-size: 16px;
  }
}

.notes__text {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.4;
  color: var(--color-black);

  a,
  span {
    text-decoration: underline;
  }

  a {
    color: inherit;

    &:hover {
      color: var(--color-orange);
    }
  }

  @media (max-width: 1200px) {
    font-size: 16px;
  }

  @media (max-width: 767px) {
    font-size: 14px;
  }
}

.notes__item--titled .notes__text {
  font-size: 15px;
  color: var(--color-gray);

  @media (max-width: 767px) {
    font-size: 14px;
  }
}

/* ===== Input ===== */
.input-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.input {
  width: 100%;
  height: 48px;
  padding: 12px 20px;
  border-radius: 4px;
  border: 1px solid var(--color-gray-light);
  background: var(--color-white);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 24px;
  color: var(--color-black);
  outline: none;
  transition:
    border-color 0.2s,
    background 0.2s;

  &::placeholder {
    color: var(--color-gray);
  }

  &:hover {
    background: var(--color-gray-light);
    border-color: var(--color-gray);
  }

  &:focus {
    border: 2px solid var(--color-orange);
    background: var(--color-white);
  }

  &.input--error {
    border-color: var(--color-red);
    color: var(--color-red);
  }
}

.input-error {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-red);
  font-size: 14px;
  line-height: 14px;

  img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
}

/* Form consent validation */
.consent--error input[type='checkbox'] {
  border-color: var(--color-red) !important;
  box-shadow: 0 0 0 1px var(--color-red);
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-black);
  box-shadow: 0px 4px 20px 0px rgba(29, 38, 46, 0.2);
}

/* Админ-панель WordPress (для вошедших): шапка прилипает под ней. ≤600px панель не фиксирована */
.admin-bar .header {
  top: 32px;

  @media (max-width: 782px) {
    top: 46px;
  }

  @media (max-width: 600px) {
    top: 0;
  }
}

/* Одна строка: логотип · адрес и почта · меню · иконки и кнопка.
   1201–1440: адрес скрыт, меню мельче; ≤1200: логотип, кнопка, бургер (остальное — в панели). */
.header__content {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 16px 0;
  transition: padding 0.3s ease;

  @media (max-width: 1200px) {
    gap: 12px;
    padding: 12px 0;
  }

  /* Страница прокручена — шапка компактнее (класс ставит js/header-menu.js) */
  .header--scrolled & {
    padding: 6px 0;
  }
}

.header__logo {
  flex-shrink: 0;

  img {
    display: block;
    width: auto;
    height: 50px;
  }
}

.header__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: normal;
  color: #c0c0c0;
  white-space: nowrap;

  @media (max-width: 1540px) {
    display: none;
  }
}

.header__address {
  color: inherit;
  text-decoration: none;

  &:hover {
    color: var(--color-orange);
  }
}

.header__email {
  color: inherit;
  text-decoration: underline;

  &:hover {
    color: var(--color-orange);
  }
}

/* ── Меню ── */
.header__nav {
  margin-left: auto;

  @media (max-width: 1200px) {
    display: none;
  }
}

.header__menu {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;

  a {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: normal;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--color-white);
    text-decoration: none;
    transition: color 0.2s;

    &:hover {
      color: var(--color-orange);
    }
  }

  .current-menu-item > a,
  .current_page_item > a {
    color: var(--color-orange);
  }

  /* Якорный пункт: подсветку ведёт скролл (js/header-menu.js), не застрявший курсор */
  .menu-item--hover-off:not(.current-menu-item) > a:hover,
  .menu-item--muted > a,
  .menu-item--muted > a:hover {
    color: var(--color-white);
  }

  @media (max-width: 1440px) {
    gap: 20px;

    a {
      font-size: 15px;
    }
  }
}

/* ── Телефон, соцсети, кнопка, бургер ── */
.header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;

  .btn--primary {
    height: 40px;
    padding: 0 16px;
    border-radius: 5px;
    font-size: 16px;
  }

  @media (max-width: 1440px) {
    .btn--primary {
      font-size: 15px;
    }
  }

  @media (max-width: 1200px) {
    gap: 12px;

    .btn--primary {
      font-size: 14px;
    }
  }

  /* Телефон: кнопка занимает всё место между логотипом и бургером, как в макете */
  @media (max-width: 767px) {
    flex: 1;

    .btn--primary {
      flex: 1;
      padding: 0 12px;
    }
  }
}

.header__nav + .header__actions {
  margin-left: 0;

  /* Меню скрыто — кнопку и бургер прижимаем вправо */
  @media (max-width: 1200px) {
    margin-left: auto;
  }
}

.header__icon-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-white);
  border-radius: 5px;
  color: var(--color-white);
  transition:
    border-color 0.2s,
    background-color 0.2s;

  img {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
  }

  &:hover {
    border-color: var(--color-orange);
  }
}

.header__phone img {
  width: 20px;
  height: 20px;
}

/* На планшете и мобильном телефон и соцсети — в панели */
@media (max-width: 1200px) {
  .header__actions .header__phone,
  .header__actions .header__social {
    display: none;
  }
}

.header__burger {
  display: none;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-white);
  border-radius: 5px;
  background: none;
  cursor: pointer;

  span {
    display: block;
    width: 24px;
    height: 2px;
    border-radius: 2px;
    background: var(--color-white);
    transition:
      transform 0.25s,
      opacity 0.25s;
  }

  /* Открыто: крестик */
  &[aria-expanded='true'] {
    span:nth-child(1) {
      transform: translateY(8px) rotate(45deg);
    }

    span:nth-child(2) {
      opacity: 0;
    }

    span:nth-child(3) {
      transform: translateY(-8px) rotate(-45deg);
    }
  }

  @media (max-width: 1200px) {
    display: flex;
  }
}

/* ── Выпадающая панель (≤1200px) ── */
.header__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: calc(100vh - 100%);
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--color-black);
  box-shadow: 0 20px 20px rgba(29, 38, 46, 0.25);

  &[hidden] {
    display: none;
  }

  @media (min-width: 1201px) {
    display: none;
  }
}

.header__panel-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 0 32px;
}

.header__panel-menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
  list-style: none;

  a {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.3;
    text-transform: uppercase;
    color: var(--color-white);
    text-decoration: none;
  }

  .current-menu-item > a,
  .current_page_item > a {
    color: var(--color-orange);
  }

  .menu-item--muted > a {
    color: var(--color-white);
  }
}

.header__panel-contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-body);
  font-size: 14px;
  color: #c0c0c0;
}

.header__panel-phone {
  font-weight: 600;
  font-size: 20px;
  color: var(--color-white);
  text-decoration: none;
}

.header__panel-socials {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* ===== Footer ===== */
.footer {
  background: var(--color-black);
  color: var(--color-white);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 32px 0;

  @media (max-width: 767px) {
    gap: 20px;
  }
}

.footer__nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;

  @media (max-width: 767px) {
    grid-template-columns: 1fr;
  }
}

.footer__nav-label {
  color: var(--color-gray);
  font-size: 14px;
  font-weight: 600;
  line-height: 14px;
}

.footer__nav-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;

  a {
    color: var(--color-black-light);
    font-size: 15px;
    font-weight: 600;
    line-height: 24px;
    text-decoration: none;

    &:hover {
      color: var(--color-orange);
    }
  }
}

.footer__contacts-label {
  color: var(--color-gray);
  font-size: 14px;
  font-weight: 600;
  line-height: 14px;
}

.footer__contacts {
  display: flex;
  flex-direction: column;
  gap: 16px;

  p,
  a {
    color: var(--color-black-light);
    font-size: 15px;
    font-weight: 600;
    line-height: 24px;
    text-decoration: none;
  }

  a:hover {
    color: var(--color-orange);
  }
}

.footer__socials {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 0;

  img {
    width: 32px;
    height: 32px;
  }
}

.footer__bottom {
  display: flex;
  flex-direction: column;
  gap: 32px;

  @media (max-width: 767px) {
    gap: 16px;
  }
}

.footer__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  width: 100%;
}

.footer__bottom-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: flex-end;

  @media (max-width: 1024px) {
    grid-template-columns: repeat(3, 1fr);
  }

  @media (max-width: 767px) {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.footer__meta {
  display: flex;
  align-items: center;
  gap: 20px;

  p {
    color: var(--color-black-light);
    font-size: 14px;
    line-height: 20px;
    width: 285px;
  }
}

.footer__privacy {
  color: var(--color-black-light);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: underline;

  &:hover {
    color: var(--color-orange);
  }
}

/* ===== Page content (the_content fallback) ===== */
.page-content {
  padding: 60px 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 24px;
  color: var(--color-black);

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
  }

  h1 {
    font-size: 40px;
    line-height: 48px;
  }

  h2 {
    font-size: 28px;
    line-height: 36px;
  }

  h3 {
    font-size: 22px;
    line-height: 30px;
  }

  p {
    margin-bottom: 16px;
  }

  ul,
  ol {
    padding-left: 24px;
    margin-bottom: 16px;
  }

  ul {
    list-style: disc;
  }

  ol {
    list-style: decimal;
  }

  li {
    margin-bottom: 6px;
  }

  a {
    color: var(--color-orange);
    text-decoration: underline;
  }

  strong {
    font-weight: 600;
  }

  @media (max-width: 767px) {
    padding: 40px 0;

    h1 {
      font-size: 24px;
      line-height: 32px;
    }

    h2 {
      font-size: 20px;
      line-height: 28px;
    }
  }
}

.section-header {
  margin-bottom: 60px;

  @media (max-width: 767px) {
    margin-bottom: 20px;
  }
}

/* ===== Подсказки адресов (js/address-suggest.js) ===== */
.address-suggest-wrap {
  position: relative;
}

.address-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 280px;
  margin: 0;
  padding: 6px 0;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--color-gray-light);
  border-radius: 5px;
  background: var(--color-white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);

  &[hidden] {
    display: none;
  }
}

.address-suggest__item {
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--color-black);
  cursor: pointer;

  &:hover,
  &.is-active {
    background: var(--color-gray-light);
  }

  @media (max-width: 767px) {
    font-size: 14px;
  }
}
