/* ============================================================
   Груминг-салон — стили
   Организация файла:
   1. Переменные и сброс
   2. Типографика и утилиты
   3. Шапка и навигация
   4. Секции (в порядке следования на странице)
   5. Футер
   6. Адаптив
   ============================================================ */

/* ---------- 1. Переменные и сброс ---------- */
:root {
  /* Палитра: тёплый молочный фон, терракотовый акцент, шалфейный второй акцент */
  --cream: #fbf7f2;
  --cream-dark: #f2ebe1;
  --ink: #2b2622;
  --ink-soft: #6b615a;
  --terra: #c77d5a;
  --terra-dark: #a96343;
  --sage: #6e8b74;
  --white: #fff;
  --line: #e6ddd1;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 4px 24px rgba(43, 38, 34, 0.07);
  --shadow-lg: 0 12px 40px rgba(43, 38, 34, 0.12);

  /* Отступ секции: тянется от 64px на мобиле до 120px на десктопе */
  --section-y: clamp(64px, 9vw, 120px);
  --container: 1180px;
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ---------- 2. Типографика и утилиты ---------- */
h1,
h2,
h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(34px, 6vw, 60px);
}

h2 {
  font-size: clamp(28px, 4.4vw, 44px);
}

h3 {
  font-size: clamp(20px, 2.4vw, 24px);
}

p {
  margin: 0 0 1em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: var(--section-y) 0;
}

.section--tint {
  background: var(--cream-dark);
}

/* Надзаголовок: мелкая капса над h2 */
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 14px;
}

.section__head {
  max-width: 620px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section__head--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Заголовок пошире, чтобы «Отзывы о зоосалоне «New Йорк»» влезал в одну строку;
   подзаголовок под ним остаётся узким и читаемым. */
.section__head--roomy {
  max-width: 860px;
}
.section__head--roomy .lead {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.nowrap {
  white-space: nowrap;
}

.lead {
  color: var(--ink-soft);
  font-size: clamp(17px, 1.6vw, 19px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  border: 1px solid transparent;
  border-radius: 100px;
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--terra);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(199, 125, 90, 0.32);
}

.btn--primary:hover {
  background: var(--terra-dark);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn--ghost:hover {
  border-color: var(--ink);
}

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

/* Появление секций при скролле — включается классом is-visible из main.js */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- 3. Шапка ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 247, 242, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 2px 16px rgba(43, 38, 34, 0.05);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 74px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  white-space: nowrap;
}

.logo__mark {
  width: auto;
  height: 42px;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
  white-space: nowrap;
}

.nav a {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.nav a:hover {
  color: var(--ink);
}

.nav__phone {
  display: none;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Два номера в столбик: в строку они не влезают рядом с навигацией */
.header__phones {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.header__phone {
  font-weight: 700;
  white-space: nowrap;
}

/* Второй номер — тот же вид, что и основной: одинаковый размер, вес и цвет. */
.header__phone--second {
  font-size: inherit;
  font-weight: 700;
  color: inherit;
}

.burger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  margin-left: auto;
}

.burger span {
  position: relative;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: background-color 0.15s ease;
}

.burger span::before,
.burger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease;
}

.burger span::before {
  top: -6px;
}

.burger span::after {
  top: 6px;
}

.burger[aria-expanded="true"] span {
  background: transparent;
}

.burger[aria-expanded="true"] span::before {
  transform: translateY(6px) rotate(45deg);
}

.burger[aria-expanded="true"] span::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- 4. Секции ---------- */

/* Hero */
.hero {
  padding: clamp(40px, 6vw, 80px) 0 var(--section-y);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 22px;
}

.hero__badge b {
  color: var(--terra);
}

/* Плашка — ссылка на карточку Яндекса, поэтому реагирует на наведение */
a.hero__badge:hover {
  border-color: var(--ink);
}

.hero p.lead {
  max-width: 46ch;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.fact__num {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 32px;
  line-height: 1;
  color: var(--terra);
}

.fact__label {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.hero__media {
  position: relative;
}

.hero__media img {
  width: 100%;
  /* height:auto обязателен — иначе атрибут height в разметке перебьёт aspect-ratio */
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  /* Смещаем кадр вверх: на мобиле фото режется в 4:3, так морда не обрезается */
  object-position: 50% 22%;
  border-radius: calc(var(--radius) * 2);
  box-shadow: var(--shadow-lg);
}

/* Плашка поверх фото — «сегодня свободно N окон» */
.hero__float {
  position: absolute;
  left: -18px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 600;
  max-width: 240px;
}

.hero__float .dot {
  width: 10px;
  height: 10px;
  flex: none;
  background: var(--sage);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(110, 139, 116, 0.18);
}

/* Преимущества */
.perks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.perk {
  padding: 30px 26px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.perk__icon {
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  color: var(--terra);
}

.perk h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.perk p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
}

/* Услуги */
.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.service {
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service--featured {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.service--featured .service__price,
.service--featured h3 {
  color: var(--white);
}

.service__tag {
  align-self: flex-start;
  padding: 5px 12px;
  background: var(--terra);
  color: var(--white);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.service__price {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 34px;
  line-height: 1;
  margin: 4px 0 20px;
}

.service__desc {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 6px 0 20px;
}

.service--featured .service__desc {
  color: rgba(251, 247, 242, 0.82);
}

/* Строка вместо цены: у большинства услуг цена появится позже */
.service__meta {
  margin: 0 0 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--terra);
}

.service--featured .service__meta {
  color: rgba(251, 247, 242, 0.72);
}

.service .btn {
  margin-top: auto;
}

/* Калькулятор */
.calc {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  padding: clamp(28px, 4vw, 46px);
  background: var(--white);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow);
}

.calc__field {
  margin-bottom: 24px;
}

.calc__field > label {
  display: block;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: block;
  padding: 10px 18px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.chip input:focus-visible + span {
  outline: 2px solid var(--terra);
  outline-offset: 2px;
}

/* Поле выбора породы с подсказками */
.breed {
  position: relative;
}

.breed__input {
  width: 100%;
  padding: 14px 44px 14px 16px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.breed__input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(199, 125, 90, 0.16);
}

.breed__clear {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  /* 44px — минимальная зона, в которую уверенно попадает палец */
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
}

.breed__clear:hover {
  background: var(--cream-dark);
  color: var(--ink);
}

.breed__list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 296px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.breed__option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

.breed__option span {
  flex: none;
  font-size: 12px;
  color: var(--ink-soft);
}

.breed__option.is-active,
.breed__option:hover {
  background: var(--cream);
}

.breed__hint {
  margin: 10px 0 0;
  padding-left: 14px;
  border-left: 2px solid var(--sage);
  font-size: 14px;
  color: var(--ink-soft);
}

.breed__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.breed__quick-btn {
  /* 11px по вертикали дают кнопке 44px высоты — размер под палец */
  padding: 11px 16px;
  background: none;
  border: 1px dashed var(--line);
  border-radius: 100px;
  font-size: 14px;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}

.breed__quick-btn:hover {
  border-style: solid;
  border-color: var(--ink);
  color: var(--ink);
}

/* Свёрнутый список всех пород под калькулятором. Он нужен прежде всего
   поисковику (в JS-списке породы не видны), поэтому по умолчанию свёрнут
   и не отвлекает от самого расчёта. */
.breed__all {
  margin-top: 14px;
  font-size: 14px;
  color: var(--ink-soft);
}

.breed__all summary {
  cursor: pointer;
  /* 12px по вертикали — палец попадает по строке, а не мимо */
  padding: 12px 0;
  color: var(--ink);
  border-bottom: 1px dashed var(--line);
}

.breed__all p {
  margin: 12px 0 0;
  line-height: 1.6;
}

.calc__result {
  padding: 28px;
  background: var(--cream);
  border-radius: var(--radius);
  text-align: center;
  position: sticky;
  top: 96px;
}

.calc__sum {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 44px;
  line-height: 1;
  color: var(--ink);
  margin: 10px 0 6px;
}

.calc__hint {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

/* Пояснение под суммой: почему вилка или «при записи» */
.calc__note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: -2px 0 10px;
}

/* Галерея — горизонтальная лента с прокруткой */
.gallery-wrap {
  position: relative;
}

.gallery {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px;
  /* Прячем полосу прокрутки — листаем свайпом и стрелками */
  scrollbar-width: none;
}

.gallery::-webkit-scrollbar {
  display: none;
}

.gallery figure {
  flex: 0 0 auto;
  width: clamp(230px, 30vw, 300px);
  margin: 0;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: zoom-in;
}

.gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.4s ease;
}

/* Стрелки листания — на десктопе поверх краёв ленты */
.gallery-arrow {
  position: absolute;
  top: calc(50% - 24px);
  z-index: 5;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.gallery-arrow:hover {
  border-color: var(--ink);
}

.gallery-arrow[hidden] {
  display: none;
}

.gallery-arrow svg {
  width: 22px;
  height: 22px;
}

.gallery-arrow--prev {
  left: -12px;
}

.gallery-arrow--next {
  right: -12px;
}

.gallery-foot {
  margin: 22px 0 0;
  text-align: center;
}

.gallery-foot a {
  font-weight: 700;
  color: var(--terra);
}

.gallery-foot a:hover {
  color: var(--terra-dark);
}

/* На мобиле стрелок нет — листается пальцем */
@media (max-width: 860px) {
  .gallery-arrow {
    display: none;
  }
}

.gallery figure:hover img {
  transform: scale(1.05);
}

.gallery figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 16px 14px;
  background: linear-gradient(transparent, rgba(43, 38, 34, 0.72));
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
}

/* Лайтбокс */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(43, 38, 34, 0.9);
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: min(900px, 92vw);
  max-height: 88vh;
  border-radius: var(--radius);
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  border-radius: 50%;
  color: var(--white);
  font-size: 26px;
  line-height: 1;
}

/* Мастера — две карточки рядом */
.masters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 820px;
  margin: 0 auto;
}

.master-card {
  overflow: hidden;
  margin: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.master-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.master-card__body {
  padding: 22px 26px 26px;
  font-size: 15px;
  color: var(--ink-soft);
}

.master-card h3 {
  margin: 0;
}

.masters__note {
  max-width: 560px;
  margin: 28px auto 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
}

/* Виджет отзывов Яндекса */
.reviews-widget {
  max-width: 760px;
  margin: 0 auto;
}

.reviews-widget iframe {
  width: 100%;
  height: 620px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  /* Виджет грузится с Яндекса и рисует свой скролл — рамкой прячем стык */
  box-shadow: var(--shadow);
}

.reviews-widget__link {
  display: block;
  margin-top: 18px;
  text-align: center;
  font-weight: 700;
  color: var(--terra);
}

.reviews-widget__link:hover {
  color: var(--terra-dark);
}

/* FAQ */
.faq {
  max-width: 800px;
  margin: 0 auto;
}

.faq__item {
  border-bottom: 1px solid var(--line);
}

.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
  background: none;
  border: none;
  text-align: left;
  font-size: clamp(17px, 2vw, 19px);
  font-weight: 700;
  color: var(--ink);
}

.faq__q::after {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--terra);
  border-bottom: 2px solid var(--terra);
  transform: rotate(45deg) translate(-3px, -3px);
  transition: transform 0.25s ease;
}

.faq__q[aria-expanded="true"]::after {
  transform: rotate(225deg) translate(-3px, -3px);
}

/* Ответ схлопывается по grid-строке — анимируется без фиксированной высоты */
.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.faq__a > div {
  overflow: hidden;
}

.faq__item.is-open .faq__a {
  grid-template-rows: 1fr;
}

.faq__a p {
  margin: 0 0 24px;
  color: var(--ink-soft);
  max-width: 68ch;
}

/* Запись и контакты */
.booking {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form__field {
  margin-bottom: 18px;
}

.form__field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 7px;
}

.form__field input,
.form__field select,
.form__field textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form__field input:focus,
.form__field select:focus,
.form__field textarea:focus {
  outline: none;
  border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(199, 125, 90, 0.16);
}

.form__field textarea {
  resize: vertical;
  min-height: 92px;
}

.form__consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 4px 0 20px;
}

.form__consent input {
  margin-top: 3px;
  flex: none;
  width: 17px;
  height: 17px;
  accent-color: var(--terra);
}

.form__error {
  display: none;
  color: #b3402c;
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
}

.form__field.has-error input {
  border-color: #b3402c;
}

.form__field.has-error .form__error {
  display: block;
}

/* Запасные каналы записи — появляются после отправки формы */
.form__fallback {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--cream);
  animation: fallbackIn .3s ease;
}

@keyframes fallbackIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form__fallback-head {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.form__fallback-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form__fallback-row .btn {
  flex: 1 1 auto;
  min-width: 130px;
  text-align: center;
}

.contacts {
  display: grid;
  gap: 22px;
}

.contact-card {
  padding: 26px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact-card h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.contact-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.contact-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: 15px;
}

.contact-row:last-child {
  margin-bottom: 0;
}

.contact-row svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--terra);
  margin-top: 2px;
}

.contact-phone {
  font-weight: 700;
  font-size: 17px;
}

.messengers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.messengers a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 700;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.messengers a:hover {
  background: var(--cream);
  border-color: var(--ink);
}

/* Кнопка MAX стоит в разметке скрытой, пока нет персональной ссылки.
   Без этого правила display у .messengers a перебил бы атрибут hidden. */
.messengers a[hidden] {
  display: none;
}

.map {
  border: 0;
  width: 100%;
  height: 280px;
  border-radius: var(--radius);
  filter: grayscale(0.25);
}

/* ---------- 5. Футер ---------- */
.footer {
  background: var(--ink);
  color: rgba(251, 247, 242, 0.72);
  padding: clamp(48px, 6vw, 72px) 0 32px;
  font-size: 15px;
}

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

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(251, 247, 242, 0.14);
}

.footer .logo {
  color: var(--cream);
  margin-bottom: 14px;
}

/* Логотип-локап в футере: морда йорка над названием */
.footer-logo__mark {
  width: auto;
  height: 64px;
  margin-bottom: 12px;
}

.footer-logo__name {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: 30px;
  line-height: 1;
  color: var(--cream);
}

.footer-logo__name span {
  color: var(--terra);
  font-weight: 700;
}

.footer-logo__sub {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(251, 247, 242, 0.62);
}

.footer h4 {
  color: var(--white);
  font-size: 15px;
  margin: 0 0 14px;
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

/* Ссылки в футере — строчные и потому низкие: без padding в них тяжело
   попасть пальцем, соседние пункты стоят слишком близко. */
.footer ul a {
  display: inline-block;
  padding: 5px 0;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  font-size: 13px;
  color: rgba(251, 247, 242, 0.5);
}

/* Плавающая кнопка записи на мобиле */
.fab {
  display: none;
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Класс ставит main.js, когда на экране сама форма записи */
.fab.is-hidden {
  opacity: 0;
  transform: translateY(90px);
  pointer-events: none;
}

/* Кнопка «наверх» в правом нижнем углу */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 55;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--white);
  color: var(--terra);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  /* Скрыта, пока не прокрутили: не мешает и не ловит клики */
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.15s ease, color 0.15s ease;
}

.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover {
  border-color: var(--ink);
  color: var(--terra-dark);
}

.to-top svg {
  width: 22px;
  height: 22px;
}

@media (prefers-reduced-motion: reduce) {
  .to-top {
    transition: opacity 0.2s ease;
    transform: none;
  }
}

/* ---------- 6. Адаптив ---------- */
@media (max-width: 1024px) {
  .perks {
    grid-template-columns: repeat(2, 1fr);
  }

  .services {
    grid-template-columns: repeat(2, 1fr);
  }

  .calc {
    grid-template-columns: 1fr;
  }

  .calc__result {
    position: static;
  }
}

/* Шапка сворачивается в бургер раньше остального макета: логотип, шесть пунктов,
   два телефона и кнопка перестают помещаться в строку уже около 1000px. */
@media (max-width: 1024px) {
  .nav,
  .header__phone {
    display: none;
  }

  .burger {
    display: flex;
  }

  /* Мобильное меню — выпадает под шапкой */
  .nav.is-open {
    display: flex;
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 20px;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .nav.is-open a {
    padding: 14px 0;
    font-size: 17px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
  }

  .nav.is-open .nav__phone {
    display: block;
    border-bottom: 0;
    color: var(--terra);
    font-weight: 700;
  }

  .header__actions {
    display: none;
  }
}

@media (max-width: 860px) {
  .hero__grid,
  .master,
  .booking {
    grid-template-columns: 1fr;
  }

  /* Порядок оставляем как в разметке: сначала заголовок и кнопка, потом фото.
     Иначе на телефоне первый экран занимает одна картинка. */
  .hero__media img {
    aspect-ratio: 4 / 3;
  }

  .hero__float {
    left: 12px;
    bottom: 12px;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .fab {
    display: flex;
  }

  /* Поднимаем «наверх» над полосой «Записаться», чтобы не перекрывались */
  .to-top {
    right: 16px;
    bottom: 94px;
    width: 44px;
    height: 44px;
  }

  body {
    padding-bottom: 80px;
  }
}

@media (max-width: 560px) {
  .perks,
  .services,
  .masters,
  .form__row,
  .footer__grid {
    grid-template-columns: 1fr;
  }

  .reviews-widget iframe {
    height: 560px;
  }

  .hero__facts {
    gap: 24px;
  }
}
