/*
  styles.css
  Единая визуальная система проекта:
  - публичная витрина (каталог/карточка)
  - админ-панель (таблицы/формы/канбан)
  - адаптив под desktop/tablet/mobile
*/

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f0f4fa;
  --text: #1f2532;
  --muted: #667284;
  --line: #dce4ef;
  --primary: #1f6fff;
  --primary-strong: #1558d6;
  --success: #0f9d78;
  --danger: #df4759;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 8px 24px rgba(15, 27, 44, 0.08);
  --shadow-md: 0 20px 40px rgba(15, 27, 44, 0.12);
  --container: 1240px;
  --header-h: 76px;
  --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, button, input, select, textarea, optgroup, .admin-container, .modal, .menu-item {
  font-family: 'Roboto', sans-serif !important;
}
body {
  margin: 0;
  font-family: 'Roboto', var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select, optgroup {
  font-family: 'Roboto', sans-serif !important;
}
button { cursor: pointer; }

.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}
.page-section { padding: 52px 0; }
.page-section.compact { padding: 40px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 22px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e9f1ff;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 700;
  width: fit-content;
  max-width: 100%;
}
h1, .h1 { margin: 0; font-size: 24px; line-height: 28px; font-weight: 700; color: #2c2c2c; }
h2, .h2 { margin: 0; font-size: 20px; line-height: 24px; font-weight: 700; color: #2c2c2c; }
h3, .h3 { margin: 0; font-size: 18px; line-height: 22px; font-weight: 700; color: #2c2c2c; }
.lead { margin: 0; color: #2c2c2c; font-size: 16px; line-height: 1.4; }
.small { font-size: 14px; color: #828282; }

/* Отступы между заголовками и описаниями */
h1 + p, h1 + .lead, h1 + .small { margin-top: 16px; }
h2 + p, h2 + .lead, h2 + .small { margin-top: 14px; }
h3 + p, h3 + .lead, h3 + .small { margin-top: 10px; }
.eyebrow + h1, .eyebrow + h2, .eyebrow + h3 { margin-top: 8px; }

/* Сохранение форматирования текста описания */
[data-prop-description] { white-space: pre-wrap; word-wrap: break-word; }

.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.info-card, .form-card, .detail-card, .map-card, .slider-card, .sidebar-card, .admin-panel, .preview-panel {
  padding: 24px;
}
.detail-card h2, .map-card h2 {
  margin-bottom: 16px;
}
.detail-card h2 + p,
.detail-card h2 + .lead,
.detail-card h2 + [data-char-grid],
.detail-card h2 + [data-infra] {
  margin-top: 0;
}
.map-card h2 + .map-embed {
  margin-top: 16px;
}

.btn {
  min-height: 46px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  transition: .16s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { 
  background: linear-gradient(135deg, #134e85, #7bb1ff); 
  color: #fff; 
  box-shadow: 0 10px 24px rgba(19, 78, 133, 0.26); 
}
.btn-primary:hover { 
  background: linear-gradient(135deg, #0f3d6a, #6aa0ff); 
}
.btn-secondary { background: #fff; color: var(--text); border-color: var(--line); }
.btn-danger { background: var(--danger); color: #fff; }

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 700;
  color: #445164;
}
.badge.promo { background: #fff0ef; color: #cf3f33; }
.badge.success { background: #e9fff6; color: #108b67; }

.input, .textarea, .select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 0 13px;
}
.textarea {
  min-height: 110px;
  padding: 12px 13px;
  resize: vertical;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: #95b9ff;
  box-shadow: 0 0 0 4px rgba(31, 111, 255, 0.12);
}
.form-grid { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 13px; color: #3f4b5e; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-start; }
.inline-actions-tight { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-start; }

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 247, 251, .94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(220, 228, 239, .9);
}
.header-inner {
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: 230px 1fr auto;
  gap: 16px;
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #1f6fff, #7bb1ff);
}
.brand-mark-img {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  object-fit: cover;
  background: linear-gradient(135deg, #1f6fff, #7bb1ff);
}

.btn-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}
.btn-telegram .btn-text,
.btn-telegram .btn-text-desktop {
  display: none;
}
.btn-telegram {
  background: linear-gradient(135deg, #134e85, #7bb1ff) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(19, 78, 133, 0.3) !important;
  min-width: 46px;
  padding: 0 14px !important;
}
.btn-telegram .btn-icon {
  width: 22px;
  height: 22px;
}
.btn-telegram:hover {
  background: linear-gradient(135deg, #0f3d6a, #6aa0ff) !important;
  box-shadow: 0 6px 16px rgba(19, 78, 133, 0.4) !important;
}
.btn-phone .btn-text {
  display: inline;
}
.nav { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.nav a {
  padding: 10px 12px;
  border-radius: 10px;
  color: #4b586c;
  font-weight: 600;
}
.nav a.active, .nav a:hover { color: var(--text); background: #fff; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.burger {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
}

.hero-cover {
  position: relative;
  min-height: 100vh;
  width: 100%;
  padding: 80px 32px 60px;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.hero-cover-media {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(17, 30, 49, .46), rgba(17, 30, 49, .3)),
    var(--hero-image, url('/uploads/hero-fox-mountain.jpg'));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero-cover-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 12% 68%, rgba(15, 157, 120, .18), transparent 34%), radial-gradient(circle at 88% 20%, rgba(31, 111, 255, .2), transparent 33%);
}
.hero-grid-lead {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: stretch;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
}
.hero-panel-overlay {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  width: 100%;
}
.hero-form-card {
  background: var(--surface);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  width: 100%;
  padding: 24px;
}
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.home-mobile-image { display: none; }
.home-mobile-image img { width: 100%; height: auto; border-radius: 12px; }
.mobile-hero-banner { display: none; position: relative; z-index: 2; }
.mobile-hero-banner img { width: 100%; border-radius: 12px; margin: 20px 0; display: block; }
.hero-stat {
  min-width: 132px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  transition: .16s ease;
}
.hero-stat:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.hero-stat a {
  color: inherit;
  text-decoration: none;
  display: block;
}
.hero-stat a:hover {
  text-decoration: none;
}

.workflow-item { padding: 20px; }
.workflow-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  font-weight: 900;
  color: var(--primary-strong);
  background: #e9f1ff;
}
.product-link { color: var(--primary); display: inline-flex; margin-top: 14px; font-weight: 700; }

.catalog-toolbar {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 12;
  margin-bottom: 18px;
}
.catalog-toolbar-card {
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 14px;
}
.catalog-mobile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.catalog-meta-desktop { display: block; margin-top: 10px; }
.btn-filter-toggle { display: none; }
.filters {
  display: grid;
  gap: 10px;
  align-items: center;
}
.filters-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.filters .input { grid-column: span 2; }
.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  font-weight: 700;
  color: #415065;
}
.checkbox-pill input { accent-color: var(--primary); }

.property-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.property-card { overflow: hidden; }
.property-media {
  position: relative;
  height: 220px;
  background: linear-gradient(135deg, #cfe0ff, #edf4ff 58%, #ffffff);
}
.property-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.property-top-badges {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.property-body { padding: 16px; display: grid; gap: 14px; }
.property-title { font-size: 19px; font-weight: 800; line-height: 1.2; margin-bottom: 6px; }
.property-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.price-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.price-main { font-size: 24px; font-weight: 700; white-space: nowrap; color: #2c2c2c; font-family: 'Roboto', sans-serif; }
.price-old { color: var(--muted); text-decoration: line-through; white-space: nowrap; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 18px;
  background: #fff;
  color: var(--muted);
}

.property-layout-fixed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 18px;
  align-items: end;
}
.property-main { min-width: 0; }
.property-sidebar { min-width: 0; }
.sticky-card {
  position: sticky;
  top: calc(var(--header-h) + 14px);
}
.slider-shell {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #edf3fc;
}
.slider-track {
  display: flex;
  transition: transform .25s ease;
  touch-action: pan-y;
}
.slide {
  min-width: 100%;
  height: 400px;
  background: #edf3fc;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 18px rgba(15, 27, 44, .16);
}
.slider-arrow.prev { left: 10px; }
.slider-arrow.next { right: 10px; }
.slider-dots { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.slider-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: #c5d2e6;
}
.slider-dot.active { background: var(--primary); }
.char-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.char-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
}
.char-item .small {
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.char-item div[style*="font-weight:900"] {
  font-size: 13px !important;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-embed {
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0;
}
.map-embed iframe {
  width: 100%;
  height: 320px;
  border: 0;
  display: block;
}
.horizontal-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.horizontal-scroll .property-card { min-width: 280px; }
.sticky-call {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 45;
}

.footer {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 20px 0 30px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 14px;
  background: linear-gradient(180deg, #eef4ff, #f5f7fb);
}
.auth-card {
  width: min(100%, 450px);
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-md);
  padding: 22px;
}
.auth-brand { margin-bottom: 14px; }
.auth-head { display: grid; gap: 10px; margin-bottom: 14px; }
.auth-form { display: grid; gap: 12px; }
.auth-submit { width: 100%; }
.auth-error { min-height: 18px; color: var(--danger); font-size: 13px; }

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: #0f172a;
  border-right: 1px solid #1e2a44;
}
.admin-brand { color: #fff; margin-bottom: 16px; }
.admin-menu { display: grid; gap: 6px; }
.admin-link {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #c8d4ea;
  text-align: left;
  padding: 0 12px;
  font-weight: 700;
}
.admin-link.active,
.admin-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}
.admin-main { padding: 18px; }
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 14px;
}
.block-list { display: grid; gap: 10px; }
.block-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.preview-phone {
  max-width: 380px;
  margin: 0 auto;
  border-radius: 26px;
  padding: 10px;
  background: #0f172a;
}
.preview-screen {
  min-height: 620px;
  border-radius: 18px;
  background: #f5f7fb;
  padding: 12px;
}
.preview-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  margin-bottom: 10px;
  padding: 14px;
}
.preview-hero {
  background: linear-gradient(180deg, #eef4ff, #fff);
}
.preview-overlay {
  border-radius: 12px;
  background: rgba(255, 255, 255, .9);
  padding: 12px;
}
.preview-button {
  display: inline-flex;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.table-wrap { overflow: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}
.admin-table th, .admin-table td {
  text-align: left;
  vertical-align: top;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
}
.admin-table th {
  font-size: 12px;
  color: #59657a;
  text-transform: uppercase;
  letter-spacing: .02em;
  background: #f8fbff;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.kanban-col {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  color: #35507a;
  background: #eaf2ff;
}
.lead-card {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 19, 29, .46);
  padding: 18px;
}
.modal.open { display: flex; }
.modal-card {
  width: min(100%, 760px);
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-md);
  padding: 20px;
}
.modal-grid { display: grid; gap: 12px; }
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4f8ff;
}
.switch {
  width: 52px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #d3ddec;
  position: relative;
}
.switch::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: .2s ease;
}
.switch.active { background: var(--primary); }
.switch.active::after { left: 25px; }

/* Большие экраны (2K+) */
@media (min-width: 1920px) {
  .hero-cover { min-height: 90vh; }
  .hero-grid-lead { max-width: 1600px; gap: 60px; }
  .hero-panel-overlay { padding: 40px; }
  .hero-form-card { padding: 36px; }
  h1 { font-size: 32px; line-height: 36px; }
  .lead { font-size: 18px; line-height: 1.5; }
}

/* Экраны 1440px - 1919px */
@media (min-width: 1440px) and (max-width: 1919px) {
  .hero-cover { min-height: 95vh; }
  .hero-grid-lead { max-width: 1400px; gap: 48px; }
  .hero-panel-overlay { padding: 36px; }
  .hero-form-card { padding: 32px; }
}

/* Экраны 1200px - 1439px */
@media (min-width: 1200px) and (max-width: 1439px) {
  .hero-cover { min-height: 100vh; }
  .hero-grid-lead { max-width: 1200px; gap: 36px; padding: 0 24px; }
  .hero-panel-overlay { padding: 28px; }
  .hero-form-card { padding: 24px; }
}

/* Стандартные медиа-запросы для адаптации */
@media (max-width: 1180px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .property-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: 1fr; }
  .property-layout-fixed { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
  .hero-grid-lead { max-width: 100%; padding: 0 20px; gap: 28px; }
  .hero-panel-overlay { padding: 24px; min-height: 380px; }
  .hero-form-card { padding: 22px; min-height: 380px; }
}

@media (max-width: 920px) {
  .header-inner { grid-template-columns: 1fr auto auto; }
  .nav {
    display: none;
    position: absolute;
    left: 14px;
    right: 14px;
    top: calc(var(--header-h) - 8px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
  }
  .nav.open { display: flex; }
  .burger { display: grid; place-items: center; }
  .header-actions .btn-secondary { display: none; }
  .header-actions .btn-secondary.btn-phone { display: inline-flex !important; }
  .header-actions .btn-secondary.btn-phone .btn-text { display: none; }
  .hero-grid-lead { grid-template-columns: 1fr; gap: 24px; }
  .hero-panel-overlay { padding: 24px; }
  .hero-form-card { padding: 22px; }
  .filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .input { grid-column: span 2; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #1e2a44;
  }
}

@media (max-width: 760px) {
  :root { --header-h: 68px; }
  .container { width: min(100% - 20px, var(--container)); }
  .page-section { padding: 38px 0; }
  .grid-2, .grid-3, .grid-4, .property-grid, .filters-grid, .kanban { grid-template-columns: 1fr; }
  .filters .input { grid-column: span 1; }
  .card-actions { grid-template-columns: 1fr; }
  .hero-cover { min-height: auto; padding: 38px 0 30px; }
  .btn-filter-toggle { display: inline-flex; }
  .catalog-meta-desktop { display: none; }
  [data-filter-panel][hidden] { display: none !important; }
  .slide { height: 230px; }
  .slider-arrow { width: 38px; height: 38px; } 
  .map-embed iframe { height: 230px; }
  .char-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .char-item { padding: 12px; }
  .property-side-price { font-size: 32px; }
  .price-main { font-size: 24px; }
  .horizontal-scroll .property-card { min-width: 260px; }
  .admin-main { padding: 14px; }
  .admin-topbar { flex-direction: column; }
  .preview-screen { min-height: 520px; }
  .sticky-call { display: block; }
  .hero-stat-office { display: none; }
  /* Show mobile image only on mobile */
  .home-mobile-image { display: block !important; }
  /* Show mobile hero banner on mobile */
  .mobile-hero-banner { display: block !important; }
  /* Buttons in one row on mobile - side by side */
  .inline-actions { 
    justify-content: center; 
    flex-direction: row;
  }
  .inline-actions .btn { 
    flex: 1; 
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 8px;
    white-space: nowrap;
  }
  .inline-actions-tight { 
    justify-content: center; 
    flex-direction: row;
  }
  .inline-actions-tight .btn { 
    flex: 1; 
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 8px;
    white-space: nowrap;
  }
  /* Улучшенная адаптивность hero-секции для мобильных */
  .hero-panel-overlay, .hero-form-card { 
    min-height: 320px; 
    padding: 20px;
    border-radius: 20px;
  }
  .hero-stats { justify-content: center; }
  .hero-stat { min-width: 120px; }
  /* Выравнивание счетчиков по левому краю кнопок в мобильной версии */
  .hero-stats {
    justify-content: flex-start;
    align-items: flex-start;
    gap: 16px;
  }
  .hero-stat {
    text-align: left;
    min-width: 120px;
  }
  .hero-stat .small {
    text-align: left;
  }
  .hero-stat div[style*="font-size:26px"] {
    text-align: left;
  }
  /* Отступы для карточек с характеристиками, инфраструктурой и картой на мобильных */
  .detail-card, .map-card {
    padding: 18px;
  }
  .detail-card h2, .map-card h2 {
    margin-bottom: 12px;
    font-size: 18px;
  }
  .char-grid { grid-template-columns: 1fr; gap: 8px; }
  .char-item { padding: 12px; }
  .tag {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* UX-элементы каталога и уведомлений */
.filter-chips {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.chip {
  border: 1px solid #bfd3ff;
  background: #eef4ff;
  color: #2454a3;
  border-radius: 999px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}
.skeleton-card {
  min-height: 358px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #f2f6fc, #ffffff);
}
.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.65) 48%, transparent 100%);
  animation: skeleton-shimmer 1.2s infinite;
}
.toast-host {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 90;
  display: grid;
  gap: 8px;
  max-width: min(360px, calc(100vw - 28px));
}
.toast {
  background: #1f2532;
  color: #fff;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast-success { background: #0e8e6a; }
.toast-error { background: #c53c4b; }

/* Мобильный формат меню админки как в кабинете */
@media (max-width: 920px) {
  .admin-sidebar { padding: 10px 14px; }
  .admin-menu {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
  }
  .admin-link {
    white-space: nowrap;
    min-height: 38px;
  }
}

@media (max-width: 760px) {
  .toast-host {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }
  .toast { font-size: 12px; }
}

@keyframes skeleton-shimmer {
  to { transform: translateX(100%); }
}

/* LightBox галерея */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}
.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-arrow:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-arrow.prev { left: -60px; }
.lightbox-arrow.next { right: -60px; }
.lightbox-counter {
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  white-space: nowrap;
}
.slide img { cursor: zoom-in; }

@media (max-width: 760px) {
  .lightbox-arrow.prev { left: 10px; }
  .lightbox-arrow.next { right: 10px; }
  .lightbox-close { top: 10px; right: 10px; position: fixed; }
}
