/* ============================================================
   «Гарант Строй» — стиль по мотивам 24metr.ru и knabakan.ru
   Белый фон, тонкие серые рамки #cbcbcb, острые углы,
   синие ссылки #1a7ebc, оранжевые кнопки #e25124,
   Open Sans / PT Sans.
   ============================================================ */

:root {
  --ink: #3d4457;          /* основной текст (knabakan) */
  --muted: #6e7c90;        /* вторичный текст (24metr) */
  --blue: #1a7ebc;         /* ссылки, акцент (knabakan) */
  --blue-dark: #1d587e;
  --blue-grad-b: #1a7ab2;
  --orange: #e25124;       /* кнопки (knabakan) */
  --orange-hover: #ea673e;
  --line: #cbcbcb;         /* рамки карточек (knabakan) */
  --line-soft: #f0f0f0;    /* разделители внутри карточек */
  --line-head: #eaeaea;
  --panel: #f4f4f4;        /* серые панели */
  --panel-blue: #e2e8f0;   /* серо-голубая панель (24metr) */
  --green: #007830;
  --red: #bb0011;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: #fff; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Open Sans', 'PT Sans', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: #fff;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

.hidden { display: none !important; }

/* ------------------------------------------------------------
   Шапка: белая, как на knabakan.ru
   ------------------------------------------------------------ */
.header {
  background: #fff;
  border-bottom: 2px solid var(--line-head);
}
.header__block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 20px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand__logo {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.3px;
  text-transform: uppercase;
}
.brand__accent { color: var(--orange); }
.brand__tag {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 14px;
}
.header__contacts { text-align: right; }
.header__phone {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.header__phone:hover { color: var(--blue); }
.header__addr {
  display: block;
  font-size: 13px;
  color: var(--ink);
  margin: 3px 0 1px;
}
.header__time {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.header__contacts .btn { display: inline-block; }

/* Меню — градиентная полоса, как b_menu_top на 24metr.ru.
   Пункты: слева направо заливаются при наведении; под активным
   пунктом плавает общая оранжевая полоса (menu__bar), которая
   перетекает к новой вкладке при смене выбора. */
.menu {
  background: linear-gradient(to bottom, var(--blue-dark) 0%, var(--blue-grad-b) 100%);
}
.menu .container { display: flex; flex-wrap: wrap; position: relative; padding: 0 8px; }
.menu a {
  color: #fff;
  font-size: 15px;
  padding: 13px 12px;
  margin-right: 0;
  display: inline-block;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16)) no-repeat left bottom;
  background-size: 0% 100%;
  transition: background-size 0.22s ease, color 0.15s ease;
}
.menu a:hover, .menu a.is-active { background-size: 100% 100%; color: #fff; }
/* Кнопка-бургер — видна только на телефоне (в медиазапросе ниже) */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.22s ease, opacity 0.18s ease, background 0.15s ease;
}
.menu-toggle:hover span,
.menu-toggle:focus-visible span { background: var(--blue); }
.menu-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* Крестик в открытом состоянии */
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.menu__bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  background: var(--orange);
  pointer-events: none;
  /* transform/width/top задаются из JS (syncMenuActive) */
  transition: transform 0.28s ease, width 0.28s ease, top 0.28s ease;
  display: block;
}

/* ------------------------------------------------------------
   Герой — синий градиент (knabakan .bluegrad-bg)
   ------------------------------------------------------------ */
.hero {
  background: linear-gradient(to bottom, var(--blue-dark) 0%, var(--blue-grad-b) 100%);
  color: #fff;
  padding: 36px 0 44px;
}
.hero__inner h1 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 10px;
}
.hero__inner p {
  color: #d5e6f2;
  max-width: 620px;
  font-size: 16px;
  line-height: 1.55;
}
.hero__top {
  display: flex;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}
.hero__text { flex: 1 1 460px; max-width: 680px; }
.hero__contacts {
  background: #fff;
  border: none;
  border-radius: 0;
  padding: 16px 20px;
  min-width: 250px;
  color: var(--ink);
}
.hero__contacts-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.hero__contact {
  display: block;
  color: var(--blue);
  margin-bottom: 8px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px dashed var(--blue);
  width: fit-content;
}
.hero__addr {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.hero__addr svg { width: 16px; height: 16px; fill: var(--orange); flex: 0 0 auto; margin-top: 1px; }
.hero__addr:hover { color: var(--blue); }
.hero__addr:hover svg { fill: var(--blue); }
.hero__contact:last-child {
  margin-bottom: 0;
  border-bottom: none;
  color: var(--muted);
  font-weight: 400;
  font-family: Arial, sans-serif;
  font-size: 13px;
}
a.hero__contact:hover { border-bottom-color: transparent; color: var(--blue-dark); }

/* Блоки статистики — как index-4block на knabakan:
   белые плашки с цветной рамкой */
.hero__facts {
  display: flex;
  gap: 14px;
  flex-wrap: nowrap;
  margin-top: 28px;
  max-width: 1000px;
}
.hero__facts .fact-two {
  background: #fff;
  border: 1px solid;
  border-radius: 0;
  padding: 14px 10px;
  flex: 1 1 0;
  color: var(--ink);
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
  line-height: 1.3;
}
.fact--red { border-color: #c83329; }
.fact--blue { border-color: #2f7cc2; }
.fact--green { border-color: #36b148; }
.fact--crimson { border-color: #c02b40; }
.fact-two b {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}
.fact-two small { font-size: 13px; color: var(--muted); font-weight: 400; }

/* ------------------------------------------------------------
   Фильтры — панель как catFilter на knabakan
   ------------------------------------------------------------ */
.filters {
  margin: -26px 0 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 16px 18px;
  position: relative;
}
.filter-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.filter-field { display: flex; flex-direction: column; gap: 5px; }
.filter-field--search { flex: 2 1 240px; }
.filter-field:not(.filter-field--search):not(.filter-field--btns) { flex: 1 1 160px; }
.filter-field--btns { flex: 0 0 auto; }
.filter-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.filter-field input[type="search"],
.filter-field select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  width: 100%;
}
.filter-field select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236e7c90'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 26px;
}
.filter-field input:focus, .filter-field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(26, 126, 188, 0.15);
}
.filter-btns { display: flex; gap: 8px; }

/* Кнопка «Фильтры» — иконка-воронка, показывается только на телефоне
   (в шапке объявлений, см. медиазапрос ниже) */
.filters__toggle { display: none; position: relative; }
.filters__icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}
.filters__toggle-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border-radius: 9px;
}
.filters__toggle-count[hidden] { display: none; }

/* Кнопки — оранжевые, как .btn-red / .link a на knabakan */
.btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 0;
  height: 34px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  background: var(--orange-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(226, 81, 36, 0.35);
}
.btn:active {
  background: var(--orange);
  transform: translateY(0);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
}
.btn--ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover {
  background: var(--panel);
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(61, 68, 87, 0.12);
}
.btn--ghost:active {
  background: #fff;
  transform: translateY(0);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.12);
}
.btn--big { display: flex; width: 100%; height: auto; padding: 12px 30px; font-size: 15px; margin: 0 0 12px; }

/* ------------------------------------------------------------
   Заголовок секции + счётчик «N предложений» (24metr)
   ------------------------------------------------------------ */
.listings__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.section-title { font-size: 20px; font-weight: 700; color: var(--ink); }
.listings__count { color: var(--muted); font-size: 14px; }
.listings__count b { color: var(--ink); font-weight: 700; }

/* Переключатель «Списком / На карте» (как на 24metr.ru) */
.view-switch { margin-left: auto; display: flex; gap: 6px; }
.view-btn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 13px;
  font-family: inherit;
  color: var(--muted);
  padding: 5px 14px;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.view-btn:hover { border-color: var(--blue); color: var(--blue); }
.view-btn.active {
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 700;
}

/* ------------------------------------------------------------
   Карточки — как .catalog .item на knabakan:
   рамка #cbcbcb, острые углы, серое свечение при наведении
   ------------------------------------------------------------ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  transition: box-shadow 0.15s ease;
}
.card:hover { box-shadow: 0 0 10px 5px rgba(221, 221, 221, 1); }

.card__img {
  height: 210px;
  /* Запас под заглушку, пока картинка не загрузилась */
  background-color: #d6e0eb;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

/* Объявление без фотографии: на карточке картинка-заглушка
   (генерируется скриптом tools/make-no-photo.py) */
.card__img--empty {
  background-image: url('/img/no-photo.png');
}

/* Плашка-флажок типа объекта (knabakan span.red / span.blue) */
.card__type {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--blue);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 22px 5px 12px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%);
}
/* Акция — красный флажок */
.card__promo {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--orange);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px 5px 22px;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
}
/* Цена — правый нижний угол */
.card__price {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #fff;
  color: var(--ink);
  font-family: Arial, sans-serif;
  padding: 7px 12px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
  text-align: right;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.card__price .per { font-size: 11px; font-weight: 400; color: var(--muted); }
.card__price s {
  display: block;
  text-decoration: line-through;
  color: var(--red);
  font-size: 12px;
  font-weight: 400;
}

.card__body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 10px;
}
.card__title:hover { text-decoration: underline; }

/* Тэги под названием — как .geo на knabakan */
.card__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.card__meta span {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: Arial, sans-serif;
  font-size: 13px;
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.card__meta .tag-geo::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  box-sizing: border-box;
}
.card__meta .tag-area {
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 700;
}

.card__desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  flex: 1;
}

.card__actions { margin-top: auto; display: flex; gap: 8px; }
.card__actions .btn { flex: 1; }
/* Кнопка «Подробнее» — оранжевая плашка 109×31 как на knabakan */
.card__actions .btn--more { background: var(--orange); }

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--muted);
  font-size: 15px;
  border: 1px dashed var(--line);
}

/* ------------------------------------------------------------
   Вид «На карте» (Яндекс.Карты)
   ------------------------------------------------------------ */
.map {
  height: 520px;
  border: 1px solid var(--line);
  background: var(--panel);
  position: relative;
  overflow: hidden;
}
.map iframe { border: 0; display: block; width: 100%; height: 100%; }
.map__error {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  background: #fff;
}
.map__error a { color: var(--blue); border-bottom: 1px dashed var(--blue); }

/* ------------------------------------------------------------
   Соцсети
   ------------------------------------------------------------ */
.socials {
  margin-top: 44px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 22px 0;
}
.socials__note {
  text-align: center;
  font-size: 16px;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 14px;
}
.socials__row { display: flex; gap: 12px; }
.social-chip {
  flex: 1;
  text-align: center;
  padding: 12px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.social-chip img { width: 22px; height: 22px; vertical-align: -5px; margin-right: 8px; }
.social-chip:hover { border-color: var(--blue); color: var(--blue); }

/* ------------------------------------------------------------
   Модалки
   ------------------------------------------------------------ */
.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(61, 68, 87, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  animation: modal-fade 0.2s ease;
}
.modal__box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: modal-pop 0.24s cubic-bezier(0.18, 0.9, 0.32, 1.12);
}
/* Пока открыта модалка, фон на телефоне не прокручивается */
@media (max-width: 768px) {
  .modal-open { overflow: hidden; }
}
/* закрытие: JS добавляет .modal--closing, потом прячет модалку */
.modal--closing { animation: modal-fade-out 0.16s ease forwards; }
.modal--closing .modal__box { animation: modal-pop-out 0.16s ease forwards; }

@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(26px) scale(0.96); }
}
@keyframes modal-fade-out { to { opacity: 0; } }
@keyframes modal-pop-out {
  to { opacity: 0; transform: translateY(18px) scale(0.97); }
}
.modal__img {
  height: 260px;
  background-color: #d6e0eb;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* В модалке у объявления без фото — та же заглушка */
.modal__img--empty {
  background-image: url('/img/no-photo.png');
}

/* Кнопка закрытия поверх фото */
.modal__x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.modal__x:hover { background: #fff; color: var(--orange); }

/* Флажок типа объекта на фото */
.modal__badge {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--blue);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 22px 5px 12px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%);
}

/* Цена — как на карточке: правый нижний угол, цветом как на карточке */
.modal__price-tag {
  position: absolute;
  right: 0;
  bottom: 0;
  background: #fff;
  color: var(--ink);
  font-family: Arial, sans-serif;
  padding: 7px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  text-align: right;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.modal__price-main { display: inline-flex; align-items: baseline; gap: 4px; }
.modal__price-main b { color: var(--ink); font-size: 17px; font-weight: 700; }
.modal__price-main small { color: var(--muted); font-size: 11px; }
.modal__price-tag s { color: var(--red); font-size: 12px; }

.modal__body { padding: 20px 22px 22px; }
.modal__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 12px;
}

.modal__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.modal__meta span {
  background: #fff;
  border: 1px solid var(--line);
  padding: 3px 10px;
  font-size: 13px;
  font-family: Arial, sans-serif;
  color: var(--ink);
}
.modal__meta .modal__tag-geo { color: var(--blue); border-color: #9ec8e4; }

.modal__text { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 16px; }

.modal__promo {
  background: #fef3c7;
  color: #92400e;
  padding: 9px 12px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #fde68a;
}

.modal__actions { display: flex; gap: 10px; }
.modal__actions .btn { flex: 1; height: 40px; }

.call-btn { text-align: center; }
.modal__phone {
  font-size: 26px;
  text-align: center;
  color: var(--blue);
  font-weight: 700;
  margin: 8px 0 16px;
  font-family: Arial, sans-serif;
}
.modal__close {
  width: 100%;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
}
.modal__close:hover { background: var(--line-head); }

/* ------------------------------------------------------------
   Отзывы — карусель внизу страницы
   ------------------------------------------------------------ */
.reviews { margin: 44px 0 38px; }
.reviews__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.reviews__carousel { display: flex; align-items: center; gap: 12px; }
.carousel__viewport { overflow: hidden; flex: 1; }
.carousel__track { display: flex; transition: transform 0.45s ease; will-change: transform; }

.review-card {
  flex: 0 0 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--line);
  padding: 22px 24px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}
.review-card__stars { color: #f59e0b; font-size: 16px; letter-spacing: 3px; margin-bottom: 10px; }
.review-card__text { color: var(--ink); font-size: 15px; line-height: 1.65; margin: 0 0 14px; flex: 1; }
.review-card__author {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}
.review-card__name { font-weight: 700; font-size: 14px; color: var(--ink); }
.review-card__date { color: var(--muted); font-size: 12px; font-family: Arial, sans-serif; }

.carousel-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.carousel-btn:hover { border-color: var(--blue); color: var(--blue); }

.carousel__dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}
.carousel-dot.is-active { background: var(--orange); border-color: var(--orange); }

/* ------------------------------------------------------------
   Футер — белый с линейкой сверху, как на knabakan
   ------------------------------------------------------------ */
.footer {
  margin-top: 50px;
  background: #fff;
  border-top: 2px solid #e3e3e3;
  padding: 22px 0;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer__brand {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink);
}
.footer__brand span { color: var(--orange); }
.footer__note { color: var(--muted); font-size: 13px; flex: 1 1 320px; }
.footer__contacts {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}
.footer__contacts a {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  font-family: Arial, sans-serif;
}
.footer__contacts a:hover { color: var(--blue); }
.footer__label { color: var(--muted); }
.footer__addr { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------
   Адаптив
   ------------------------------------------------------------ */

/* Планшеты: карточкам хватает места чуть уже */
@media (max-width: 900px) {
  .header__block { flex-wrap: wrap; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

/* Телефоны и узкие планшеты */
@media (max-width: 768px) {
  .container { padding: 0 16px; }

  /* Шапка: логотип слева, контакты справа — в одну строку */
  .header__block {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
  }
  .brand { width: auto; flex: 0 1 auto; min-width: 0; gap: 8px; }
  .brand__logo { font-size: 20px; white-space: nowrap; }
  .brand__tag { display: none; }
  .header__contacts { text-align: right; flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; margin-left: auto; }
  .header__phone { font-size: 18px; white-space: nowrap; }
  .header__addr { display: none; }
  .header__time { display: none; }

  /* Меню на телефоне — аккуратная выпадающая панель под шапкой.
     Открывается бургером, плавно раскрывается по высоте. Пункты
     крупные, на всю ширину; активный помечен оранжевой полосой
     слева — тот же акцент, что и полоса под меню на десктопе. */
  .menu {
    display: block;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: max-height 0.28s ease, opacity 0.2s ease, visibility 0.28s;
  }
  .menu.is-open {
    max-height: 460px;
    visibility: visible;
    opacity: 1;
    box-shadow: 0 12px 20px rgba(16, 51, 74, 0.28);
  }
  .menu .container {
    flex-direction: column;
    align-items: stretch;
    padding: 6px 0;
  }
  .menu a {
    display: block;
    white-space: nowrap;
    padding: 15px 18px;
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    border-left: 3px solid transparent;
    -webkit-tap-highlight-color: transparent;
  }
  .menu a:last-of-type { border-bottom: none; }
  .menu a.is-active {
    border-left-color: var(--orange);
    background-size: 100% 100%;
  }
  .menu__bar { display: none !important; }

  /* Бургер — рядом с телефоном */
  .menu-toggle { display: flex; }

  /* Герой */
  .hero { padding: 26px 0 32px; }
  .hero__inner h1 { font-size: 22px; }
  .hero__inner p { font-size: 15px; }
  .hero__top { flex-direction: column; gap: 18px; }
  .hero__text { flex: 0 0 auto; max-width: none; }
  .hero__contacts { width: 100%; padding: 14px 16px; }
  .hero__facts { flex-wrap: wrap; gap: 10px; margin-top: 22px; }
  .hero__facts .fact-two {
    flex: 1 1 calc(50% - 10px);
    min-width: 130px;
    white-space: normal;
    padding: 12px 8px;
  }
  .fact-two b { font-size: 21px; }
  .fact-two small { font-size: 12px; }

  /* Фильтры: на телефоне скрыты под иконкой-воронкой в шапке
     объявлений и раскрываются прямо под ней с анимацией.
     Поля внутри — в столбик на всю ширину. */
  .filters {
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    margin: 0;
    padding: 0;
    border-width: 0;
    transition: max-height 0.34s ease, opacity 0.25s ease,
                transform 0.34s ease, padding 0.34s ease,
                border-width 0.34s ease, visibility 0.34s;
  }
  .filters.is-open {
    max-height: 720px;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    margin: 0 0 22px;
    padding: 14px;
    border-width: 1px;
  }
  /* Кнопка-иконка без рамки/фона — «не квадрат» */
  .filters__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--ink);
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .filters__toggle:active { transform: scale(0.9); }
  .filters__toggle.has-active { color: var(--blue); }
  .filters__toggle .filters__icon { width: 22px; height: 22px; }
  .filter-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .filter-field,
  .filter-field--search,
  .filter-field:not(.filter-field--search):not(.filter-field--btns),
  .filter-field--btns {
    width: 100%;
    flex: 0 0 auto;
  }
  .filter-field--btns label { display: none; }
  /* 16px — чтобы iOS Safari не зумил страницу при фокусе на поле */
  .filter-field input[type="search"],
  .filter-field select { height: 42px; font-size: 16px; }
  .filter-btns { width: 100%; }
  .filter-btns .btn { flex: 1; }

  /* Крупные кнопки — удобнее попадать пальцем */
  .btn { height: 42px; padding: 0 18px; }
  .btn--big { height: auto; }

  /* Каталог */
  .cards { grid-template-columns: 1fr; gap: 16px; }
  .card__img { height: 200px; }
  .listings__head { flex-wrap: wrap; gap: 10px; }
  .view-switch { margin-left: 0; width: 100%; }
  .view-switch .view-btn { flex: 1; padding: 8px 12px; }

  .map { height: 380px; }

  /* Соцсети — по две в ряд */
  .socials { margin-top: 36px; padding: 18px 0; }
  .socials__row { flex-wrap: wrap; gap: 10px; }
  .social-chip { flex: 1 1 calc(50% - 5px); }

  /* Отзывы */
  .review-card { padding: 18px 16px; }
  .carousel-btn { width: 36px; height: 36px; font-size: 20px; }

  /* Модалки: на телефоне — карточка строго по центру экрана, с затемнением
     и отступами по краям; высота ограничена видимой областью (--app-vh) */
  .modal {
    padding: 16px;                                   /* запасной вариант */
    padding: calc(16px + env(safe-area-inset-top)) 16px 16px;
    align-items: flex-start;          /* карточка открывается сверху, а не по центру */
    justify-content: center;
    top: 0; bottom: auto;
    height: var(--app-vh, 100vh);
  }
  .modal__box {
    width: 100%; max-width: 540px; height: auto; max-height: 100%;
    margin: 0 auto;
    display: flex; flex-direction: column;
    -webkit-overflow-scrolling: touch;
  }
  .modal__body { flex: 1 0 auto; display: flex; flex-direction: column; }
  /* Кнопки держим у нижнего края карточки */
  .modal__actions { margin-top: auto; }
  .modal__img { height: 200px; flex: 0 0 auto; }
  .modal__x { width: 40px; height: 40px; }

  /* Футер */
  .footer { margin-top: 40px; }
  .footer__inner { flex-direction: column; text-align: center; gap: 12px; }
  .footer__note { flex: 0 0 auto; }
  .footer__contacts { text-align: center; }
}

/* Узкие телефоны */
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .header__block { gap: 8px; }
  .brand__logo { font-size: 17px; }
  .header__phone { font-size: 15px; }
  .menu-toggle { width: 40px; height: 40px; }
  .header__addr { font-size: 11px; }
  .hero { padding: 22px 0 28px; }
  .hero__inner h1 { font-size: 20px; }
  .hero__inner p { font-size: 14px; }
  .hero__contacts { padding: 12px 14px; }

  /* Кнопки фильтра — всегда в строку */
  .filter-btns { flex-direction: row; }
  .filter-btns .btn { padding: 0 14px; }

  .card__img { height: 180px; }
  /* Кнопки карточки — в строку, а не в столбец */
  .card__actions { flex-direction: row; }
  .card__actions .btn { width: auto; }

  /* На телефоне отзывы листаются свайпом — стрелки прячем */
  .reviews__carousel { gap: 0; }
  .carousel-btn { display: none; }

  /* Модалка-карточка: компактнее, кнопки в столбик на всю ширину */
  .modal {
    padding: 12px;                                   /* запасной вариант */
    padding: calc(12px + env(safe-area-inset-top)) 12px 12px;
  }
  .modal__box { max-width: none; }
  .modal__img { height: 160px; }
  .modal__body { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .modal__title { font-size: 18px; margin-bottom: 10px; }
  .modal__meta { margin-bottom: 12px; }
  .modal__text { margin-bottom: 12px; }
  .modal__actions { flex-direction: column; }
  .modal__actions .btn { flex: 0 0 auto; height: 46px; }
  .modal__phone { font-size: 22px; }
}

/* На тач-устройствах :hover «залипает» после тапа — убираем его
   у элементов навигации, оставляя только активное состояние. */
@media (hover: none) {
  .menu a:hover { background-size: 0% 100%; }
  .menu a.is-active { background-size: 100% 100%; }
  .view-btn:hover { border-color: var(--line); color: var(--muted); }
  .view-btn.active { border-color: var(--ink); color: var(--ink); }
  .carousel-btn:hover { border-color: var(--line); color: var(--ink); }
}

/* Пользователь просит без анимаций — отключаем все */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .menu a, .menu, .menu__bar, .filters, .filters__toggle, .btn, .btn--ghost, .modal, .modal__box {
    transition: none;
    animation: none;
  }
}

/* ------------------------------------------------------------
   Страницы ошибок (404 / 500)
   Тот же язык, что на главной: белая шапка с логотипом, серая
   панель вместо контента, карточка с оранжевой кромкой сверху и
   белый футер с линейкой. Сетка — flex-колонка на всю высоту,
   чтобы футер всегда прилипал к низу, даже если контента мало.
   ------------------------------------------------------------ */
body.error-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.error-page {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  background: var(--panel);
}
.error-card {
  width: 100%;
  max-width: 520px;
  padding: 40px 32px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--orange);
}
.error-code {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--blue-dark);
}
.error-title {
  margin: 12px 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}
.error-text {
  margin-bottom: 20px;
  font-size: 15px;
  color: var(--muted);
}
.error-path {
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
}
.error-path code {
  padding: 2px 6px;
  font-family: Consolas, Monaco, monospace;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  color: var(--ink);
}
.error-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
/* .footer тянет 50px воздуха под контентом — на пустой странице ошибки
   это лишнее: отступ задаёт .error-page. */
body.error-layout .footer { margin-top: 0; }

@media (max-width: 480px) {
  .error-code { font-size: 56px; }
  .error-card { padding: 32px 20px; }
  .error-actions .btn { width: 100%; }
}
