/* ЖК Emirates — лаконічний стиль */
:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --line: #e8e6e1;
  --accent: #2d4a3e;
  --accent-hover: #1f342c;
  --warn: #b45309;
  --bad: #991b1b;
  --ok: #166534;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --font: "Manrope", system-ui, -apple-system, sans-serif;
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  padding-bottom: 4.5rem;
}

/* iOS Safari: прибираємо "прозору дірку" над sticky header (safe area / адресний рядок). */
html,
body {
  background-color: var(--surface);
}

@media (min-width: 900px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

@supports (padding-top: env(safe-area-inset-top)) {
  .site-header {
    padding-top: env(safe-area-inset-top);
  }
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

@media (min-width: 900px) {
  .site-header__inner {
    flex-wrap: nowrap;
  }
}

.site-header__inner > .logo {
  margin-right: auto;
}

.header-cta {
  font-size: 0.88rem;
  padding: 0.5rem 0.95rem;
  white-space: nowrap;
}

@media (max-width: 899px) {
  .site-header__inner {
    flex-wrap: nowrap;
  }

  /* На мобільному залишаємо тільки: логотип + "Головна/Статуси" + терези в один ряд. */
  .site-header__inner .nav a[data-nav-id="kontakty"] {
    display: none;
  }

  .site-header__inner .header-cta {
    order: 2;
  }

  .site-header__inner .nav-toggle {
    display: none;
  }

  .site-header__inner .nav {
    order: 2;
    display: flex;
    width: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .site-header__inner .nav::-webkit-scrollbar {
    display: none;
  }

  .site-header__inner .nav a {
    font-size: 0.86rem;
    padding: 0.15rem 0;
  }
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.logo span {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.85rem;
  display: block;
}

.nav {
  display: none;
  gap: 0.25rem 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav.is-open {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  padding-bottom: 0.5rem;
}

@media (min-width: 900px) {
  .nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: auto;
    min-width: 0;
    padding-bottom: 0;
  }

  .nav-toggle {
    display: none;
  }
}

/* Глобальне a:hover { underline } не повинно застосовуватись до пунктів меню — підкреслення змінює метрики рядка. */
.site-header .nav a,
.site-header .nav a:hover,
.site-header .nav a:focus,
.site-header .nav a:focus-visible,
.site-header .nav a.is-active {
  text-decoration: none !important;
}

.nav a {
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.25rem 0;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  font-synthesis: none;
}

.nav a:hover,
.nav a.is-active {
  color: var(--accent);
}

.nav-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem;
  font: inherit;
  cursor: pointer;
}

/* Hero */
.hero {
  padding: 2.5rem 0 2rem;
}

.hero--compact {
  padding: 2rem 0 1.5rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 52ch;
}

.tagline {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Full-bleed photo hero (головна + внутрішні сторінки) */
.hero--home,
.hero--page {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.hero--home {
  min-height: clamp(22rem, 70vh, 44rem);
}

.hero--page {
  min-height: clamp(14rem, 36vh, 26rem);
}

.hero--home .hero__backdrop,
.hero--page .hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero--home .hero__photo,
.hero--page .hero__photo {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.hero--home .hero__scrim,
.hero--page .hero__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    var(--bg) 0%,
    rgba(250, 249, 247, 0.94) min(38%, 24rem),
    rgba(250, 249, 247, 0.55) 55%,
    rgba(250, 249, 247, 0.18) 75%,
    transparent 100%
  );
}

.hero--home .hero__content {
  position: relative;
  z-index: 1;
  padding: clamp(2.25rem, 5vw, 3.75rem) 0;
}

.hero--page .hero__content {
  position: relative;
  z-index: 1;
  padding: clamp(1.75rem, 4vw, 2.75rem) 0;
}

/* Політики: без фонового фото hero виглядає як "порожній екран" через min-height. */
body[data-page="privacy-policy"] .hero--page,
body[data-page="policy-materials"] .hero--page {
  min-height: 0;
}

body[data-page="privacy-policy"] .hero--page .hero__content,
body[data-page="policy-materials"] .hero--page .hero__content {
  padding: 2rem 0 1.25rem;
}

body[data-page="privacy-policy"] main > section.hero--page + section,
body[data-page="policy-materials"] main > section.hero--page + section {
  padding-top: 1rem;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  list-style: none;
  margin: 0 0 1.35rem;
  padding: 0;
  max-width: 38rem;
}

.hero-highlights li {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(232, 230, 225, 0.95);
  border-radius: 999px;
  padding: 0.38rem 0.8rem;
  box-shadow: var(--shadow);
}

@media (max-width: 719px) {
  .hero--home {
    min-height: clamp(24rem, 78vh, 36rem);
  }

  .hero--page {
    min-height: clamp(17rem, 42vh, 30rem);
  }

  .hero--home .hero__scrim,
  .hero--page .hero__scrim {
    background: linear-gradient(
      180deg,
      var(--bg) 0%,
      rgba(250, 249, 247, 0.93) 42%,
      rgba(250, 249, 247, 0.55) 70%,
      rgba(250, 249, 247, 0.2) 100%
    );
  }
}

/* Sections */
section {
  padding: 2.5rem 0;
}

section:nth-of-type(even) {
  background: var(--surface);
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.section-lead {
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 60ch;
}

.grid-2 {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}

.card h3,
.card h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

/* Головна: «Про комплекс» — розділи та блоки фото + текст */
.home-about__intro {
  margin-bottom: 0;
}

.home-about__chapter {
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 5rem;
}

.home-about__chapter:first-of-type {
  margin-top: 1.75rem;
  padding-top: 0;
  border-top: none;
}

.home-about__chapter-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1.2;
}

.home-about__chapter-lead {
  margin: 0;
  max-width: 58ch;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
}

/* Ряд: зображення зліва, заголовок і опис справа — кожен пункт окремо */
.home-visual-split {
  --home-split-frame: rgba(255, 193, 120, 0.55);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  align-items: stretch;
  margin: 1.5rem 0 0;
  padding: 1.35rem 1.2rem;
  border-radius: 20px;
  border: 1px solid rgba(232, 230, 225, 0.95);
  background: linear-gradient(135deg, #fff8f2 0%, #ffffff 50%, #f4faf7 100%);
  box-shadow: 0 10px 36px rgba(26, 26, 26, 0.07);
}

.home-visual-split--tone-sun {
  --home-split-frame: rgba(255, 200, 130, 0.65);
  background: linear-gradient(135deg, #fff3e0 0%, #fff 45%, #fff8ed 100%);
}

.home-visual-split--tone-sky {
  --home-split-frame: rgba(140, 190, 255, 0.55);
  background: linear-gradient(135deg, #e8f2ff 0%, #fff 50%, #f0f8ff 100%);
}

.home-visual-split--tone-amber {
  --home-split-frame: rgba(255, 200, 120, 0.6);
  background: linear-gradient(135deg, #fff5e0 0%, #fff 48%, #fff9e8 100%);
}

.home-visual-split--tone-mint {
  --home-split-frame: rgba(120, 210, 170, 0.5);
  background: linear-gradient(135deg, #e8f5ef 0%, #fff 50%, #eef8f2 100%);
}

.home-visual-split--tone-coral {
  --home-split-frame: rgba(255, 170, 150, 0.55);
  background: linear-gradient(135deg, #ffeeea 0%, #fff 50%, #fff5f2 100%);
}

@media (min-width: 768px) {
  .home-visual-split {
    flex-direction: row;
    align-items: stretch;
    gap: 2rem;
    padding: 1.6rem 1.75rem;
    margin-top: 1.75rem;
  }

  .home-visual-split--reverse {
    flex-direction: row-reverse;
  }

  .home-visual-split__media {
    flex: 1.08 1 0;
    min-width: 0;
    align-self: center;
  }

  .home-visual-split__text {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

.home-visual-split__media {
  position: relative;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: 0 16px 48px rgba(26, 26, 26, 0.14);
  outline: 3px solid var(--home-split-frame);
  outline-offset: 0;
  width: 100%;
}

.home-visual-split__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.15) 0%,
    transparent 42%,
    rgba(45, 74, 62, 0.08) 100%
  );
  mix-blend-mode: soft-light;
}

.home-visual-split__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
}

@media (min-width: 768px) {
  .home-visual-split__media {
    width: auto;
  }
}

.home-visual-split__text {
  min-width: 0;
  padding: 0.15rem 0;
}

.home-visual-split__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.12rem, 2.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}

.home-visual-split__desc {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .home-visual-split__media img {
    transition: transform 0.45s ease;
  }

  @media (hover: hover) {
    .home-visual-split:hover .home-visual-split__media img {
      transform: scale(1.05);
    }
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.25s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}

.btn--ghost:hover {
  border-color: var(--accent);
  background: rgba(45, 74, 62, 0.06);
}

/** Другорядна дія поруч із головною CTA (картки доступного житла). */
.btn--soft {
  background: rgba(45, 74, 62, 0.08);
  color: var(--accent);
  border: 1px solid rgba(45, 74, 62, 0.28);
}

.btn--soft:hover {
  background: rgba(45, 74, 62, 0.13);
  border-color: var(--accent);
  color: var(--accent-hover);
}

/** Головний заклик «перегляд» — м'яке світіння (без руху за prefers-reduced-motion). */
.btn--cta-visit {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 4px 22px rgba(45, 74, 62, 0.32);
}

.btn--cta-visit:hover {
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.14) inset,
    0 6px 28px rgba(45, 74, 62, 0.4);
}

@media (prefers-reduced-motion: no-preference) {
  .btn--cta-visit {
    animation: cta-visit-glow 3.5s ease-in-out infinite alternate;
  }
}

@keyframes cta-visit-glow {
  from {
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.06),
      0 0 0 1px rgba(255, 255, 255, 0.1) inset,
      0 3px 16px rgba(45, 74, 62, 0.24);
  }

  to {
    box-shadow:
      0 2px 4px rgba(0, 0, 0, 0.07),
      0 0 0 1px rgba(255, 255, 255, 0.14) inset,
      0 5px 26px rgba(45, 74, 62, 0.36);
  }
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Плаваюча CTA + контакт-хаб (одна форма) */
.contact-hub-fab {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.1),
    0 8px 28px rgba(45, 74, 62, 0.22);
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
}

@media (min-width: 900px) {
  .contact-hub-fab {
    left: auto;
    right: 1.1rem;
    bottom: 1.1rem;
    transform: none;
  }
}

.contact-hub {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.contact-hub[hidden] {
  display: none !important;
}

.contact-hub__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 22, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.contact-hub__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  max-height: min(92vh, 40rem);
  overflow: auto;
  margin: 0;
  padding: 1.5rem 1.4rem 1.35rem;
  border-radius: 14px;
  border: 1px solid rgba(232, 230, 225, 0.95);
  background: var(--surface);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 8px 16px -4px rgba(0, 0, 0, 0.08),
    0 28px 56px -16px rgba(45, 74, 62, 0.22);
}

/* Сторінка Контакти: той самий блок, що у спливаючому вікні */
.contact-hub__dialog.contact-hub__dialog--page {
  max-width: none;
  max-height: none;
  overflow: visible;
  align-self: start;
}

.grid-2--kontakty {
  align-items: start;
}

@media (prefers-reduced-motion: no-preference) {
  .contact-hub:not([hidden]) .contact-hub__dialog {
    animation: contact-hub-dialog-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

@keyframes contact-hub-dialog-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.contact-hub__close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: 999px;
  background: rgba(45, 74, 62, 0.06);
  color: var(--muted);
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.contact-hub__close:hover {
  color: var(--text);
  background: rgba(45, 74, 62, 0.12);
}

.contact-hub__close:active {
  transform: scale(0.96);
}

.contact-hub__title {
  font-size: 1.28rem;
  font-weight: 700;
  margin: 0 2.5rem 0.85rem 0;
  padding: 0;
  letter-spacing: -0.03em;
  line-height: 1.3;
  color: var(--text);
}

.contact-hub__banner {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 1rem;
  padding: 0.5rem 0.65rem;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--line);
}

.contact-hub__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.5rem;
}

.contact-hub__other-wrap {
  margin-top: 1.25rem;
  padding: 1.35rem 1rem 1.15rem;
  border-top: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(45, 74, 62, 0.05) 0%, rgba(250, 249, 247, 0.65) 100%);
}

.contact-hub__other-methods {
  margin: 0 0 1.65rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}

.contact-hub__quick--after-form {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.contact-hub__form-hint {
  margin-top: 1.2rem;
  margin-bottom: 0;
  padding-top: 0.15rem;
}

.contact-hub__form input[type="tel"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font: inherit;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.contact-hub__form input[type="tel"]::placeholder {
  color: #9a9a9a;
}

.contact-hub__form input[type="tel"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(45, 74, 62, 0.14);
}

.contact-hub__submit {
  width: 100%;
  margin-top: 0.35rem;
  margin-bottom: 0;
  box-shadow: 0 2px 8px rgba(45, 74, 62, 0.2);
}

.contact-hub__quick .btn {
  flex: 1 1 auto;
  justify-content: center;
  min-width: 8rem;
}

.contact-hub__quick .btn[data-email] {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.contact-hub__form .form-group {
  margin-bottom: 0.75rem;
}

body.contact-hub-open {
  overflow: hidden;
}

body.lead-toast-open {
  overflow: hidden;
}

.lead-toast {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(18, 20, 22, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lead-toast[hidden] {
  display: none !important;
}

.lead-toast__card {
  width: 100%;
  max-width: 26rem;
  padding: 1.4rem 1.3rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(232, 230, 225, 0.95);
  background: var(--surface);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 8px 16px -4px rgba(0, 0, 0, 0.08),
    0 28px 56px -16px rgba(45, 74, 62, 0.22);
}

.lead-toast__title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
  letter-spacing: -0.03em;
}

.lead-toast__text {
  margin: 0 0 1.1rem;
  color: var(--muted);
}

.lead-toast__close {
  width: 100%;
}

/* Catalog */
.filters-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.filters-toolbar .filters {
  margin-bottom: 0;
}

.catalog-filter-count {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  white-space: nowrap;
  flex: 0 0 auto;
  align-self: flex-end;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.filters select,
.filters input {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 10rem;
  background: var(--surface);
}

/* Grid items default to min-width: auto — wide card content could force horizontal scroll. */
.catalog-grid {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.catalog-grid > * {
  min-width: 0;
}

@media (min-width: 640px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .catalog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

[data-catalog-root] {
  min-width: 0;
}

.lot-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: var(--surface);
}

.lot-card--with-actions {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.lot-card__summary {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

/* Абзац між описом і рядком «Поверх / кімнати / площа» (статуси продаж, компактні картки). */
.lot-card--compact .lot-card__below .lot-card__summary + .lot-card__spec {
  margin-top: 0.85rem;
}

.lot-card--compact .lot-card__prices-compact {
  margin-top: 0.25rem;
}

.lot-card--compact .lot-price--primary {
  margin-top: 0.35rem;
}

.lot-card--compact .lot-card__status-row .badge--hold {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.68rem;
  text-align: left;
}

.lot-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  flex: 1;
  min-width: 0;
}

.lot-card__link:hover {
  background: rgba(45, 74, 62, 0.04);
}

.lot-card__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.lot-card__link-inner {
  padding: 1rem 1.1rem;
}

.lot-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem 1rem;
  border-top: 1px solid var(--line);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.lot-card__main-col .lot-card__actions {
  padding: 0.55rem 0 0;
  margin-top: 0.45rem;
  border-top: 1px solid var(--line);
}

.lot-card__actions .btn {
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
}

.lot-card__actions--inline .btn {
  font-size: 0.74rem;
  padding: 0.38rem 0.5rem;
}

/* Каталог (компактні картки): кнопки в колонку, без виходу за межі картки */
.lot-card--compact .lot-card__actions--inline {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.4rem;
}

.lot-card--compact .lot-card__actions--inline .btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  justify-content: center;
  text-align: center;
  line-height: 1.25;
  min-height: 2.35rem;
}

@media (min-width: 640px) {
  .lot-card:not(.lot-card--compact) .lot-card__actions--inline {
    flex-wrap: wrap;
  }

  .lot-card:not(.lot-card--compact) .lot-card__actions--inline .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (min-width: 1000px) {
  .lot-card:not(.lot-card--compact) .lot-card__actions--inline {
    flex-wrap: nowrap;
  }

  .lot-card:not(.lot-card--compact) .lot-card__actions--inline .btn {
    flex: 1 1 0;
    justify-content: center;
    white-space: nowrap;
  }
}

.lot-card__main-col {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.btn-row--wrap {
  flex-wrap: wrap;
}

.btn--compact {
  font-size: 0.88rem;
  padding: 0.5rem 0.95rem;
}

.lot-card__body {
  margin: 0;
}

.lot-card__layout {
  display: flex;
  gap: 0.25rem;
  align-items: flex-start;
}

.lot-card--compact .lot-card__layout {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  grid-template-areas:
    "media head"
    "below below";
  column-gap: 0.85rem;
  row-gap: 0.5rem;
  align-items: start;
}

.lot-card--compact .lot-card__media-link {
  grid-area: media;
  display: block;
  color: inherit;
  text-decoration: none;
}

.lot-card--compact .lot-card__media-link:hover {
  text-decoration: none;
}

.lot-card--compact .lot-card__media-link .lot-card__carousel {
  width: 100%;
}

.lot-card--compact .lot-card__head-col {
  grid-area: head;
  position: relative;
  min-width: 0;
}

.lot-card--compact .lot-card__below {
  grid-area: below;
  min-width: 0;
}

.lot-card__below-link {
  display: block;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.lot-card__below-link:hover {
  text-decoration: none;
}

.lot-card--compact .lot-compare-toggle--card {
  top: 0;
  right: 0;
}

.lot-card--compact .lot-card__head-col .lot-card__info {
  padding-right: 2.75rem;
}

.lot-card__layout .lot-card__link {
  flex: 1;
  min-width: 0;
}

.lot-card__thumb {
  flex-shrink: 0;
  width: 5.5rem;
  height: 4.1rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}

.lot-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Карусель у картці каталогу */
.lot-card__carousel {
  position: relative;
  flex-shrink: 0;
}

.lot-card__carousel-viewport {
  overflow: hidden;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.lot-card__carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.32s ease;
  will-change: transform;
}

.lot-card__carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  min-width: 0;
}

.lot-card__carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lot-card__carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 1.55rem;
  height: 1.55rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.lot-card__carousel-btn:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transform: translateY(-50%) scale(1.06);
}

.lot-card__carousel-btn--prev {
  left: 3px;
  transform: translateY(-50%);
}

.lot-card__carousel-btn--next {
  right: 3px;
  transform: translateY(-50%);
}

.lot-card__carousel-btn--prev:hover,
.lot-card__carousel-btn--next:hover {
  transform: translateY(-50%) scale(1.06);
}

.lot-card__carousel-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.lot-carousel__icon {
  display: block;
  opacity: 0.88;
}

.lot-card__info {
  min-width: 0;
  flex: 1;
}

.lot-card__top {
  display: block;
  margin-bottom: 0.35rem;
}

.lot-card__status-row {
  margin: 0 0 0.5rem;
  min-width: 0;
}

.lot-card__status-row .badge {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  text-align: left;
  vertical-align: top;
}

.lot-card__head {
  min-width: 0;
}

.lot-card__title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.lot-card__where {
  margin: 0.35rem 0 0;
  max-width: 42ch;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.badge--free {
  background: #dcfce7;
  color: var(--ok);
}

.badge--hold {
  background: #ffedd5;
  color: var(--warn);
}

.badge--sold {
  background: #fee2e2;
  color: var(--bad);
}

.badge--installment {
  background: #ffedd5;
  color: #9a3412;
  white-space: normal;
  max-width: 13rem;
  line-height: 1.25;
  text-align: center;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.7rem;
}

.lot-card__status-row .badge--installment {
  max-width: 100%;
  text-align: left;
}

.lot-meta {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

.lot-meta strong {
  color: var(--text);
  font-weight: 600;
}

.lot-price {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0.65rem 0 0;
  color: var(--accent);
}

.lot-card__finance {
  margin: 0.35rem 0 0.45rem;
  padding: 0.5rem 0 0;
  border-top: 1px solid var(--line);
}

.lot-card__finance-heading {
  margin: 0 0 0.35rem !important;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.lot-price--primary {
  margin: 0 0 0.35rem;
}

.lot-price__suffix {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.2rem;
  letter-spacing: 0.02em;
}

.lot-price--installment {
  margin: 0.45rem 0 0 !important;
  font-size: 1.02rem;
  color: var(--accent);
  line-height: 1.25;
}

.lot-price__suffix--installment {
  margin-top: 0;
  margin-bottom: 0.15rem;
}

.lot-card__install-line {
  margin-bottom: 0.3rem !important;
}

.lot-meta--muted {
  font-size: 0.84rem !important;
  color: var(--muted);
}

.lot-detail__price-block {
  margin: 0;
}

.lot-detail__price-note {
  margin: 0.25rem 0 0;
}

.lot-detail__price-installment {
  margin: 0.65rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.lot-detail__price-installment-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.lot-detail__price-installment-value {
  display: block;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lot-detail__actions--in-price {
  margin: 0.75rem 0 0;
}

@media (min-width: 560px) {
  .lot-detail__actions--in-price.btn-row {
    flex-wrap: nowrap;
    gap: 0.65rem;
  }

  .lot-detail__actions--in-price .btn {
    flex: 1 1 0;
    justify-content: center;
    white-space: nowrap;
    font-size: 0.92rem;
    padding: 0.55rem 0.85rem;
  }
}

.lot-detail__install-calculator {
  margin: 0.85rem 0 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--line);
}

.lot-detail__install-calculator-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.lot-detail__install-select {
  width: 100%;
  max-width: 16rem;
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  appearance: auto;
}

.lot-detail__install-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Рядок «Оплата…» на всю ширину бокової колонки — без вузької комірки для таблиці сум */
.lot-detail__dl > div:has(.lot-detail__pay-wrap) {
  grid-column: 1 / -1;
  grid-template-columns: 1fr !important;
  gap: 0.45rem !important;
  align-items: stretch;
}

.lot-detail__dl > div:has(.lot-detail__pay-wrap) dd {
  min-width: 0;
}

.lot-detail__pay-wrap {
  margin: 0;
  width: 100%;
  min-width: 0;
}

.lot-detail__pay-wrap .lot-detail__dl--compact {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lot-detail__pay-wrap .lot-detail__dl--compact > div {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.lot-detail__pay-wrap .lot-detail__dl--compact > div:first-child {
  padding-top: 0;
}

.lot-detail__pay-wrap .lot-detail__dl--compact > div:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.lot-detail__pay-wrap .lot-detail__dl--compact dt {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 58%;
  line-height: 1.4;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.lot-detail__pay-wrap .lot-detail__dl--compact dd {
  flex: 0 0 auto;
  margin: 0;
  text-align: right;
  line-height: 1.4;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Текстова примітка про розстрочку (без суми в таблиці) — на всю ширину, без «злізання» вправо */
.lot-detail__pay-wrap .lot-detail__dl--compact > div:has(.lot-detail__pay-soft) {
  flex-wrap: wrap;
  align-items: flex-start;
}

.lot-detail__pay-wrap .lot-detail__dl--compact > div:has(.lot-detail__pay-soft) dt {
  flex: 1 1 100%;
  max-width: 100%;
}

.lot-detail__pay-wrap .lot-detail__dl--compact > div:has(.lot-detail__pay-soft) dd.lot-detail__pay-soft {
  flex: 1 1 100%;
  width: 100%;
  text-align: left;
  font-weight: 400;
  color: var(--muted);
  white-space: normal;
  font-variant-numeric: normal;
}

.lot-detail__pay-num {
  white-space: nowrap;
}

.lot-detail__pay-line {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.35rem;
  max-width: 100%;
}

.lot-detail__pay-term {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.88rem;
  white-space: nowrap;
}

.lot-detail__dd--utilities {
  max-width: 100%;
}

.lot-detail__utilities {
  margin: 0;
  padding-left: 1.15rem;
  list-style: disc;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.lot-detail__utilities li {
  margin-bottom: 0.45rem;
}

.lot-detail__utilities li:last-child {
  margin-bottom: 0;
}

.lot-card__utilities-wrap {
  margin: 0.5rem 0 0;
}

.lot-card__utilities-heading {
  margin: 0 0 0.35rem;
}

.lot-card__utilities {
  margin: 0;
  padding-left: 1.1rem;
  list-style: disc;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.lot-card__utilities li {
  margin-bottom: 0.22rem;
}

.lot-card__utilities li:last-child {
  margin-bottom: 0;
}

@media (max-width: 380px) {
  .lot-detail__pay-wrap .lot-detail__dl--compact > div {
    flex-wrap: wrap;
  }

  .lot-detail__pay-wrap .lot-detail__dl--compact dt {
    max-width: 100%;
  }

  .lot-detail__pay-wrap .lot-detail__dl--compact dd {
    width: 100%;
    text-align: left;
  }

  .lot-detail__pay-line {
    justify-content: flex-start;
  }
}

/* Сторінка лота /lot/ */
.lot-detail-page {
  padding: 2rem 0 3rem;
}

.lot-breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.lot-breadcrumb a {
  color: var(--accent);
}

.lot-breadcrumb__current {
  color: var(--text);
  font-weight: 600;
  max-width: 100%;
}

.lot-detail__grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 900px) {
  .lot-detail__grid {
    grid-template-columns: 1fr min(22rem, 34%);
  }

  .lot-detail__visual-col {
    grid-column: 1;
    grid-row: 1;
  }

  .lot-detail__aside {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .lot-detail__description-wrap {
    grid-column: 1;
    grid-row: 2;
  }

  /* На ПК: не даємо фото бути вищим за екран, але ширина — як у сітки */
  .lot-detail__visual {
    max-height: calc(100vh - 8rem);
  }

  .lot-detail__carousel-viewport {
    max-height: calc(100vh - 8rem);
  }

  .lot-detail__carousel-img {
    max-height: calc(100vh - 8rem);
    object-fit: contain;
  }
}

.lot-detail__visual-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.lot-detail__visual {
  padding: 0;
  overflow: hidden;
}

.lot-detail__description-wrap {
  padding: 1.15rem 1.25rem 1.3rem;
  min-width: 0;
}

.lot-detail__description {
  margin: 0;
}

.lot-detail__description-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.lot-detail__description-body {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
}

.lot-detail__description-placeholder {
  margin: 0;
  line-height: 1.55;
}

.lot-detail__description--empty .lot-detail__description-title {
  margin-bottom: 0.45rem;
}

.lot-detail__photo {
  width: 100%;
  height: auto;
  max-height: min(52vh, 28rem);
  object-fit: cover;
  object-position: center;
  display: block;
  background: var(--line);
}

/* Карусель на сторінці лота */
.lot-detail__carousel {
  position: relative;
}

.lot-detail__carousel-viewport {
  overflow: hidden;
  width: 100%;
  background: var(--line);
}

.lot-detail__carousel-track {
  display: flex;
  transition: transform 0.35s ease;
  will-change: transform;
}

.lot-detail__carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
}

.lot-detail__carousel-img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center;
  display: block;
  background: transparent;
}

.lot-detail__carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 2.35rem;
  height: 2.35rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.lot-detail__carousel-btn:hover {
  background: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.14);
  transform: translateY(-50%) scale(1.04);
}

.lot-detail__carousel-btn--prev {
  left: 0.65rem;
  transform: translateY(-50%);
}

.lot-detail__carousel-btn--next {
  right: 0.65rem;
  transform: translateY(-50%);
}

.lot-detail__carousel-btn--prev:hover,
.lot-detail__carousel-btn--next:hover {
  transform: translateY(-50%) scale(1.04);
}

.lot-detail__carousel-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lot-detail__photo-caption {
  padding: 0.85rem 1rem 1rem;
  margin: 0;
}

.lot-detail__aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lot-detail__head {
  margin: 0;
}

.lot-detail__title {
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  line-height: 1.25;
}

.lot-detail__sub {
  margin: 0 0 0.5rem;
}

.lot-detail__status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin: 0 0 0.25rem;
}

.lot-detail__price {
  margin: 0;
}

.lot-detail__dl {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem 1rem;
}

.lot-detail__dl > div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
}

@media (min-width: 420px) {
  .lot-detail__dl > div {
    grid-template-columns: 9.5rem 1fr;
    align-items: baseline;
  }
}

.lot-detail__dl dt {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.lot-detail__dl dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

/* Заявка — контекст лота */
.lp-context-banner {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: rgba(45, 74, 62, 0.08);
  border: 1px solid rgba(45, 74, 62, 0.15);
  font-size: 0.92rem;
  color: var(--text);
}

/* Службова сторінка */
.admin-gate {
  max-width: 24rem;
  margin: 2rem auto;
  padding: 1.5rem;
}

.admin-gate label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.admin-gate input {
  width: 100%;
  font: inherit;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.admin-main {
  padding: 2rem 0 3rem;
}

.admin-main h1 {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
}

.admin-stats-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: var(--text);
  line-height: 1.6;
}

.admin-table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.admin-table th,
.admin-table td {
  border: 1px solid var(--line);
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.admin-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text);
}

.admin-panel {
  margin-top: 1.5rem;
  padding: 1.15rem 1.25rem;
}

.admin-panel h2 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.admin-panel p,
.admin-panel li {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0.35rem 0;
}

.admin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  margin-top: 0.75rem;
}

.admin-controls__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 10rem;
}

.admin-controls select,
.admin-controls input {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.admin-controls__btn {
  padding: 0.55rem 0.95rem;
  white-space: nowrap;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  word-break: normal;
  flex-wrap: nowrap;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
}

.admin-badge::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.65;
  flex: 0 0 auto;
}

.admin-badge--new {
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.08);
  color: #0369a1;
}

.admin-badge--processed {
  border-color: rgba(22, 101, 52, 0.22);
  background: rgba(22, 101, 52, 0.08);
  color: var(--ok);
}

.admin-badge--cancelled {
  border-color: rgba(153, 27, 27, 0.22);
  background: rgba(153, 27, 27, 0.08);
  color: var(--bad);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.admin-actions .btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}

.admin-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.75rem;
}

.admin-pager__pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.admin-pager__btn {
  padding: 0.3rem 0.55rem;
  font-size: 0.82rem;
}

.admin-pager__btn--active {
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.08);
}

.admin-pager__meta {
  margin-left: auto;
  white-space: nowrap;
}

.catalog-error {
  padding: 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  color: var(--bad);
}

/* Instagram block */
.insta-block {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 800px) {
  .insta-block {
    grid-template-columns: 1fr 1fr;
  }
}

.insta-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.insta-photos img {
  border-radius: var(--radius);
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border: 1px solid var(--line);
}

/* Footer */
.site-footer {
  background: #f0eeea;
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  margin-top: 2rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--text);
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.site-footer h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 0.4rem;
}

/* Map embed */
.map-embed {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 280px;
  background: var(--line);
}

.map-embed iframe {
  width: 100%;
  height: 320px;
  border: 0;
}

/* Legal */
.legal-block {
  max-width: 720px;
}

.legal-block h2 {
  font-size: 1.1rem;
  margin-top: 1.75rem;
}

/* LP specific */
.lp-hero {
  text-align: center;
  padding: 2.5rem 0 2rem;
}

.lp-hero h1 {
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}

.lp-hero .lead {
  margin-left: auto;
  margin-right: auto;
}

.lp-form {
  max-width: 420px;
  margin: 2rem auto 0;
  text-align: left;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  font: inherit;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* Порівняння лотів (у шапці — одразу після nav, праворуч від «Контакти») */
.site-header__inner > .header-compare {
  flex-shrink: 0;
}

.header-compare {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}

@media (max-width: 899px) {
  .header-compare {
    padding: 0.28rem 0.4rem;
    border-radius: 999px;
  }

  .header-compare__icon .lot-compare-toggle__icon {
    width: 16px;
    height: 16px;
  }
}

.header-compare:hover {
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent);
}

.header-compare--active {
  border-color: rgba(45, 74, 62, 0.45);
  background: rgba(45, 74, 62, 0.06);
}

.header-compare__icon {
  display: flex;
  color: var(--muted);
}

.header-compare__icon .lot-compare-toggle__icon {
  width: 18px;
  height: 18px;
}

.header-compare--active .header-compare__icon {
  color: var(--accent);
}

@media (max-width: 480px) {
  .header-compare__text {
    display: none;
  }
}

.header-compare__count {
  min-width: 1.15rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.lot-card__layout {
  position: relative;
}

/* Місце під кнопку порівняння (терези) */
.lot-card .lot-card__main-col > .lot-card__link .lot-card__info {
  padding-right: 2.75rem;
}

.lot-compare-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}

.lot-compare-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lot-compare-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lot-compare-toggle--card {
  position: absolute;
  top: 0.35rem;
  right: 0;
  z-index: 5;
  width: 2.35rem;
  height: 2.35rem;
}

.lot-compare-toggle--detail {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
}

.lot-compare-toggle__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.lot-compare-toggle__check {
  position: absolute;
  bottom: -0.05rem;
  right: -0.05rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 0.95rem;
  text-align: center;
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 0.15s,
    transform 0.15s;
}

.lot-compare-toggle.is-on .lot-compare-toggle__check {
  opacity: 1;
  transform: scale(1);
}

.lot-compare-toggle.is-on {
  border-color: rgba(22, 101, 52, 0.55);
  color: var(--accent);
  background: rgba(22, 101, 52, 0.08);
}

.compare-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.compare-toolbar__clear {
  font-size: 0.88rem;
  padding: 0.45rem 0.85rem;
}

.compare-table-wrap {
  overflow-x: auto;
  margin-bottom: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.compare-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.compare-table th,
.compare-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.compare-table th:last-child,
.compare-table td:last-child {
  border-right: none;
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-table thead th {
  background: rgba(45, 74, 62, 0.06);
  font-weight: 700;
  font-size: 0.85rem;
}

.compare-table__corner {
  min-width: 8.5rem;
  width: 28%;
}

.compare-table tbody th[scope="row"] {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.82rem;
  background: var(--bg);
}

.compare-table__row--section th {
  background: rgba(45, 74, 62, 0.06);
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.compare-table__utilities {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text);
}

.compare-table__utilities li {
  margin: 0.15rem 0;
}

.compare-table .compare-installment-select {
  max-width: 100%;
  font-size: 0.85rem;
}

.compare-table__row--photos th[scope="row"] {
  vertical-align: middle;
}

.compare-table__photo-cell {
  padding: 0.5rem 0.65rem !important;
  background: var(--bg);
}

.compare-table__photo-link {
  display: block;
  max-width: 11rem;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
}

.compare-table__photo-link:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.compare-table__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  vertical-align: middle;
}

.compare-table__col-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.compare-table__col-head a {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.compare-table__col-head a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.compare-table__remove {
  margin: 0;
  padding: 0.15rem 0.45rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.compare-table__remove:hover {
  background: rgba(153, 27, 27, 0.08);
  color: var(--bad);
}

.compare-page-hint {
  margin-top: 1rem;
}

.compare-empty__lead {
  margin-bottom: 1rem;
}

/* Utilities */
.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
