/* ============================================================
   AMBER AVENUE — Real Estate Navigator
   Design System & Component Styles
   ============================================================ */

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

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --color-primary:       #1B3C6E;
  --color-primary-dark:  #122a52;
  --color-accent:        #F5A623;
  --color-accent-hover:  #e0911a;
  --color-accent-light:  #FFF8EC;
  --color-accent-border: #F5C870;
  --color-navy-light:    #EEF3FB;
  --color-text:          #1A1A2E;
  --color-text-secondary:#4B5563;
  --color-muted:         #9CA3AF;
  --color-border:        #E5E7EB;
  --color-border-light:  #F3F4F6;
  --color-surface:       #FFFFFF;
  --color-bg:            #F0F3F8;
  --color-success:       #10B981;
  --color-warning:       #F59E0B;
  --color-info:          #3B82F6;
  --color-green:         #22C55E;
  --color-tag-family:    #FEF3C7;
  --color-tag-family-text:#92400E;
  --color-tag-comfort:   #EFF6FF;
  --color-tag-comfort-text:#1D4ED8;
  --color-tag-mortgage:  #F0FDF4;
  --color-tag-mortgage-text:#166534;

  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   18px;
  --radius-card: 14px;

  --shadow-xs:   0 1px 3px rgba(0,0,0,0.06);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
  --shadow-card: 0 2px 12px rgba(27,60,110,0.08);

  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  --connector-color: #F5A623;
  --connector-width: 2px;

  --feed-max-width: 960px;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-primary);
  box-shadow: 0 2px 16px rgba(27,60,110,0.25);
}

.header-inner {
  max-width: var(--feed-max-width);
  margin: 0 auto;
  padding: 0 16px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--color-primary);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.logo-tagline {
  font-size: 9px;
  color: rgba(255,255,255,0.55);
  text-transform: none;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.header-search {
  flex: 1;
  position: relative;
  max-width: 520px;
}

.header-search input {
  width: 100%;
  height: 38px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 0 14px 0 38px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.header-search input::placeholder { color: rgba(255,255,255,0.5); }
.header-search input:focus {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
}

.header-search .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.5);
  pointer-events: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn-header {
  height: 34px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.btn-header-ghost {
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-header-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

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

/* ── Filter Bar ────────────────────────────────────────────── */
.filter-bar {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 60px;
  z-index: 90;
  box-shadow: var(--shadow-xs);
}

.filter-bar-inner {
  max-width: var(--feed-max-width);
  margin: 0 auto;
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.filter-bar-inner::-webkit-scrollbar { display: none; }

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 4px;
}

.filter-chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.filter-chip:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.filter-chip.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary);
  font-weight: 600;
}

.filter-chip .chip-count {
  background: rgba(0,0,0,0.12);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
}

.filter-chip.active .chip-count {
  background: rgba(27,60,110,0.15);
}

/* ── Page Layout ───────────────────────────────────────────── */
.page-content {
  max-width: var(--feed-max-width);
  margin: 0 auto;
  padding: 20px 16px 40px;
  overflow-x: hidden;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.feed-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.feed-count {
  font-size: 13px;
  color: var(--color-muted);
}

.feed-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.feed-sort select {
  border: 1px solid var(--color-border);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  font-family: inherit;
  color: var(--color-text);
  background: #fff;
  outline: none;
  cursor: pointer;
}

/* ── Feed Container ────────────────────────────────────────── */
.listing-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Property Card Wrapper ─────────────────────────────────────── */
.property-card-wrapper {
  position: relative;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border-light);
  /* Prevent any child from causing horizontal overflow */
  max-width: 100%;
  overflow: hidden;
}
.property-card-wrapper:last-child { border-bottom: none; }

/* Card row: main card + optional promo */
.card-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
}

/* ── Property Card ─────────────────────────────────────────── */
.property-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}
.property-card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 50%, transparent);
  box-shadow: 0 10px 30px rgba(27, 60, 110, 0.16);
  transform: translateY(-3px);
}

/* ── Card Main Body (image left + content right) ── */
.card-main {
  display: flex;
  flex-direction: row;
  min-height: 0;
}

/* ── Card Image Column — SQUARE ── */
.card-image-col {
  position: relative;
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  min-height: 200px;
  flex-shrink: 0;
  overflow: hidden;
  background: #1a1a2e;
  cursor: pointer;
}
.card-image-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.property-card:hover .card-image-col img {
  transform: scale(1.04);
}

/* Secondary image — hidden on desktop, visible on mobile */
.card-image-secondary {
  display: none;
}

/* Partner badge */
.card-badge-partner {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(18,42,82,0.90);
  color: var(--color-accent);
  font-size: 9px; font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  display: flex; align-items: center; gap: 4px;
  backdrop-filter: blur(6px);
  z-index: 2;
}

/* Photo count badge */
.card-photo-count {
  position: absolute;
  bottom: 8px; left: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px; font-weight: 600;
  padding: 3px 8px;
  border-radius: 16px;
  display: flex; align-items: center; gap: 4px;
  backdrop-filter: blur(4px);
  cursor: pointer; z-index: 2;
  transition: background var(--transition);
}
.card-photo-count:hover { background: rgba(0,0,0,0.75); }

/* ── Card Content Column ── */
.card-content-col {
  flex: 1;
  min-width: 0;
  width: 0; /* prevents flex child from overflowing */
  display: flex;
  flex-direction: column;
  padding: 16px 18px 14px 18px;
}

/* Top row: title + save + rating */
.card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  padding-bottom: 7px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
}
.card-title-group {
  display: flex; align-items: center; gap: 6px;
  min-width: 0; flex: 1;
}
.card-title {
  font-size: 16px; font-weight: 700;
  color: var(--color-text); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-save {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
  border: none; background: transparent;
  flex-shrink: 0; color: var(--color-muted);
}
.card-save:hover { color: #EF4444; transform: scale(1.15); }
.card-save.saved { color: #EF4444; }

/* Rating block */
.card-rating {
  display: flex; flex-direction: column;
  align-items: flex-end; flex-shrink: 0; gap: 1px;
}
.amber-index-label {
  font-size: 9px; color: var(--color-muted);
  display: flex; align-items: center; gap: 3px; white-space: nowrap;
}
.rating-score {
  display: flex; align-items: baseline; gap: 3px;
}
.rating-star { color: var(--color-accent); font-size: 18px; line-height: 1; }
.rating-num { font-size: 20px; font-weight: 800; color: var(--color-primary); line-height: 1; }
.rating-max { font-size: 11px; color: var(--color-muted); font-weight: 500; }
.rating-reviews {
  font-size: 9px; color: var(--color-muted);
  text-align: right; line-height: 1.3;
}

/* Location */
.card-location {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  font-size: 11px; color: var(--color-text-secondary);
  margin-bottom: 1px;
  overflow: hidden;
}
.card-location svg { color: var(--color-primary); flex-shrink: 0; }
.loc-dot { color: var(--color-muted); }
.card-map-link {
  font-size: 10px; font-weight: 500; color: #2563EB;
  cursor: pointer; margin-bottom: 8px;
  display: inline-block; line-height: 1;
  letter-spacing: 0.01em;
}
.card-map-link:hover { text-decoration: underline; }

/* Meta info row */
.card-meta-row {
  display: flex; align-items: center;
  flex-wrap: wrap; gap: 0;
  margin-bottom: 0; row-gap: 4px;
  background: color-mix(in srgb, var(--color-primary) 3%, var(--color-surface));
  margin-left: -18px; margin-right: -18px;
  padding: 7px 18px;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
}
.card-price-block {
  display: flex; flex-direction: column;
  padding-right: 10px; margin-right: 10px;
  border-right: 1px solid var(--color-border);
}
.price-main { font-size: 12px; font-weight: 700; color: var(--color-text); line-height: 1.2; }
.price-secondary { font-size: 10px; color: var(--color-text-secondary); line-height: 1.2; }
.card-delivery-block {
  display: flex; flex-direction: column;
  padding-right: 10px; margin-right: 10px;
  border-right: 1px solid var(--color-border);
}
.card-delivery-label { font-size: 9px; color: var(--color-muted); line-height: 1.2; }
.card-delivery-value { font-size: 12px; font-weight: 700; color: var(--color-text); line-height: 1.2; }
.card-meta-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* Description */
.card-description {
  font-size: 11px; color: var(--color-text-secondary);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  margin: 0; flex: 1;
  padding-top: 8px;
}

/* Tags */
.tag {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 5px;
  font-size: 10px; font-weight: 500;
  white-space: nowrap; line-height: 1;
}
.tag-class { background: transparent; border: 1px solid var(--color-border); color: var(--color-text-secondary); }
.tag-comfort    { background: #F0F4FF; color: #3B4FA8; border: 1px solid #D0DAFF; }
.tag-family     { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.tag-mortgage   { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.tag-author     { background: #F5F3FF; color: #5B21B6; border: 1px solid #DDD6FE; }
.tag-autonomous { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.tag-it         { background: #F0F9FF; color: #0369A1; border: 1px solid #BAE6FD; }

/* ── Nav Icons Row ─────────────────────────────────────────── */
.card-nav {
  display: flex;
  border-top: 1px solid var(--color-border-light);
  overflow-x: auto; scrollbar-width: none;
}
.card-nav::-webkit-scrollbar { display: none; }
.card-nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 12px 10px; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  flex-shrink: 0; min-width: 56px;
  white-space: nowrap; position: relative;
  filter: grayscale(1); opacity: 0.55;
}
.card-nav-item:hover {
  background: var(--color-bg);
  filter: grayscale(0); opacity: 1;
}
.card-nav-item.active {
  border-bottom-color: var(--color-accent);
  filter: grayscale(0); opacity: 1;
}
.card-nav-item.active .nav-icon { color: var(--color-primary); }
.card-nav-item.active .nav-label { color: var(--color-primary); font-weight: 600; }
.nav-icon {
  color: var(--color-text-secondary); transition: color var(--transition);
  font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
}
.nav-label {
  font-size: 9px; color: var(--color-text-secondary);
  text-align: center; line-height: 1.2;
}

/* ── Inline Expandable Panel (below nav) ── */
.card-inline-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.45s cubic-bezier(0.4,0,0.2,1);
  border-top: none;
  background: transparent;
}
.card-inline-panel.open {
  max-height: 1200px; /* increased for mobile vertical stacking */
  border-top: 1px solid var(--color-border-light);
}
.card-inline-panel-content {
  padding: 14px 18px;
  overflow-x: hidden; /* prevent banner overflow */
}

/* Map services panel (Location tab) */
.map-services-panel { }
.map-address-line {
  font-size: 12px; color: var(--color-text-secondary);
  line-height: 1.5; margin-bottom: 12px;
}
.map-services-list {
  display: flex; flex-direction: column; gap: 6px;
}
.map-service-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none; color: var(--color-text);
  font-size: 13px; font-weight: 600;
  transition: var(--transition);
}
.map-service-link:hover {
  border-color: var(--color-primary);
  background: var(--color-navy-light);
}
.map-service-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

/* Inline panel content sections (hidden by default) */
.inline-section { display: none; }
.inline-section.active { display: block; }

/* Price table in inline panel */
.price-panel .price-range {
  font-size: 13px; font-weight: 700;
  color: var(--color-primary); margin-bottom: 2px;
}
.price-panel .price-sqm {
  font-size: 11px; color: var(--color-muted); margin-bottom: 8px;
}
.price-table { width: 100%; border-collapse: collapse; }
.price-table tr { border-bottom: 1px solid var(--color-border-light); }
.price-table tr:last-child { border-bottom: none; }
.price-table td { padding: 5px 0; font-size: 11px; vertical-align: top; }
.price-table td:first-child { color: var(--color-text); font-weight: 500; width: 100px; }
.price-table td:nth-child(2) { color: var(--color-primary); font-weight: 600; padding-left: 8px; }
.price-table td:last-child { color: var(--color-muted); text-align: right; font-size: 10px; }

/* Mortgage in inline panel */
.mortgage-tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 10px; overflow-x: auto; scrollbar-width: none;
}
.mortgage-tabs::-webkit-scrollbar { display: none; }
.mtab {
  padding: 6px 10px; font-size: 11px; font-weight: 600;
  color: var(--color-muted); cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap; transition: var(--transition);
  background: none; border-top: none; border-left: none; border-right: none;
  margin-bottom: -1px;
}
.mtab:hover { color: var(--color-primary); }
.mtab.active { color: var(--color-primary); border-bottom-color: var(--color-accent); }
.mortgage-content { display: none; }
.mortgage-content.active { display: block; }
.mortgage-bank-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  color: var(--color-muted); letter-spacing: 0.06em; margin-bottom: 6px;
}
.bank-logos { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.bank-logo {
  height: 22px; padding: 0 8px;
  border: 1px solid var(--color-border); border-radius: 5px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; white-space: nowrap; background: #fff;
}
.bank-logo.sber { color: #21A038; border-color: #21A038; }
.bank-logo.vtb { color: #003D9D; border-color: #003D9D; }
.bank-logo.domrf { color: #0060AA; border-color: #0060AA; }
.bank-logo.rshb { color: #007A33; border-color: #007A33; }
.bank-logo.more { color: var(--color-muted); }
.mortgage-stat {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 5px 0; border-bottom: 1px solid var(--color-border-light); font-size: 11px;
}
.mortgage-stat:last-of-type { border-bottom: none; }
.mortgage-stat .label { color: var(--color-text-secondary); }
.mortgage-stat .value { font-weight: 700; color: var(--color-primary); }
.mortgage-note { font-size: 10px; color: var(--color-muted); margin-top: 6px; line-height: 1.4; }

/* Characteristics grid */
.chars-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.char-item {
  padding: 8px; background: var(--color-bg);
  border-radius: var(--radius-sm);
}
.char-label { font-size: 10px; color: var(--color-text); font-weight: 700; line-height: 1.2; margin-bottom: 2px; }
.char-value { font-size: 11px; font-weight: 600; color: var(--color-text); }

/* Location grid */
.location-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.location-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; background: var(--color-bg);
  border-radius: var(--radius-sm);
}
.location-icon { font-size: 16px; flex-shrink: 0; }
.location-text { display: flex; flex-direction: column; }
.location-name { font-size: 11px; font-weight: 600; color: var(--color-text); }
.location-dist { font-size: 10px; color: var(--color-muted); }

/* Infrastructure grid */
.infra-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.infra-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; background: var(--color-bg);
  border-radius: var(--radius-sm);
}
.infra-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.infra-name { font-size: 11px; font-weight: 600; color: var(--color-text); }
.infra-desc { font-size: 11px; color: #4E5B70; line-height: 1.3; }

/* Documents list */
.doc-list { display: flex; flex-direction: column; gap: 4px; }
.doc-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: var(--transition);
}
.doc-item:hover { border-color: var(--color-primary); background: var(--color-navy-light); }
.doc-icon { font-size: 16px; flex-shrink: 0; }
.doc-name { font-size: 11px; font-weight: 600; color: var(--color-text); }
.doc-meta { font-size: 10px; color: var(--color-muted); }
.doc-item.doc-present {
  border-color: color-mix(in srgb, #10B981 30%, var(--color-border));
}
.doc-item.doc-present:hover {
  border-color: #10B981;
  background: #F0FDF4;
}
.doc-item.doc-refused {
  border-color: color-mix(in srgb, #F59E0B 40%, var(--color-border));
}
.doc-item.doc-refused:hover {
  border-color: #F59E0B;
  background: #FFFBEB;
}
.doc-item.doc-refused .doc-meta {
  color: #B45309;
}
.doc-item.doc-missing {
  opacity: 0.55;
}
.doc-item.doc-missing:hover {
  opacity: 0.85;
  border-color: var(--color-border);
  background: var(--color-bg);
}

/* ── CTA Buttons ───────────────────────────────────────────── */
.card-actions {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border-light);
  background: transparent;
  overflow-x: auto; scrollbar-width: none;
}
.card-actions::-webkit-scrollbar { display: none; }
.btn {
  height: 34px; border-radius: 8px;
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  gap: 5px; transition: var(--transition);
  white-space: nowrap; cursor: pointer;
  border: none; font-family: inherit; flex-shrink: 0;
}
.btn-primary {
  background: var(--color-primary); color: #fff; padding: 0 16px;
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(27,60,110,0.32);
}
.btn-outline {
  background: #fff; color: var(--color-text);
  border: 1px solid var(--color-border); padding: 0 12px;
}
.btn-outline:hover {
  border-color: var(--color-primary); color: var(--color-primary);
  background: var(--color-navy-light);
}
.btn-expert { flex: 1; min-width: 0; }

/* ── Special Offer Promo Card ──────────────────────────────── */
.card-promo {
  width: 220px; min-width: 220px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, #2a5298 100%);
  border-radius: var(--radius-card);
  padding: 18px 16px;
  color: #fff;
  display: flex; flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-md);
  align-self: stretch;
}
.promo-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(245,166,35,0.2);
  border: 1px solid rgba(245,166,35,0.4);
  color: var(--color-accent);
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 4px;
  width: fit-content; text-transform: uppercase; letter-spacing: 0.04em;
}
.promo-title {
  font-size: 15px; font-weight: 700; line-height: 1.3;
}
.promo-text {
  font-size: 11px; color: rgba(255,255,255,0.75);
  line-height: 1.5; flex: 1;
}
.promo-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 14px;
  background: var(--color-accent);
  color: var(--color-primary-dark);
  border: none; border-radius: 8px;
  font-size: 12px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  font-family: inherit;
}
.promo-btn:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.promo-discount {
  font-size: 28px; font-weight: 800; line-height: 1;
  color: var(--color-accent);
}

/* ── Gallery Popup (Full Screen) ───────────────────────────── */
.gallery-popup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  display: none; /* shown via JS */
  align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.gallery-popup-overlay.open { display: flex; }
.gallery-popup {
  position: relative;
  width: 90vw; max-width: 1000px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.gallery-popup-close {
  position: absolute; top: -40px; right: 0;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15); border: none;
  border-radius: 50%; color: #fff;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.gallery-popup-close:hover { background: rgba(255,255,255,0.3); }
.gallery-popup-main {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.gallery-popup-main img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.gallery-popup-arrow {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.15);
  border: none; border-radius: 50%;
  color: #fff; font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.gallery-popup-arrow:hover { background: rgba(255,255,255,0.3); }
.gallery-popup-arrow.prev { left: -60px; }
.gallery-popup-arrow.next { right: -60px; }
.gallery-popup-thumbs {
  display: flex; gap: 6px;
  overflow-x: auto; scrollbar-width: none;
  padding: 4px 0;
}
.gallery-popup-thumbs::-webkit-scrollbar { display: none; }
.gallery-popup-thumb {
  flex-shrink: 0; width: 64px; height: 48px;
  border-radius: 6px; overflow: hidden;
  cursor: pointer; border: 2px solid transparent;
  transition: var(--transition); opacity: 0.6;
}
.gallery-popup-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-popup-thumb.active { border-color: var(--color-accent); opacity: 1; }
.gallery-popup-thumb:hover { opacity: 1; }
.gallery-popup-counter {
  font-size: 13px; color: rgba(255,255,255,0.6); font-weight: 500;
}
.gallery-popup-title {
  font-size: 15px; color: #fff; font-weight: 600;
}

/* ── Banner Card ───────────────────────────────────────────── */
.banner-card {
  display: flex; align-items: center; gap: 24px;
  background: linear-gradient(135deg, #1B3C6E 0%, #2a5298 60%, #3b6cc5 100%);
  border-radius: var(--radius-card);
  padding: 24px 28px;
  color: #fff;
  min-height: 120px;
  position: relative; overflow: hidden;
}
.banner-card::before {
  content: ''; position: absolute; top: -30%; right: -10%;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(245,166,35,0.12) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.banner-icon {
  font-size: 38px; flex-shrink: 0; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}
.banner-body { flex: 1; z-index: 1; }
.banner-headline {
  font-size: 18px; font-weight: 800; line-height: 1.3; margin-bottom: 4px;
}
.banner-sub { font-size: 12px; color: rgba(255,255,255,0.75); line-height: 1.5; }
.banner-cta {
  margin-top: 10px;
  padding: 8px 18px; background: var(--color-accent);
  color: var(--color-primary-dark); border: none; border-radius: 8px;
  font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: var(--transition);
}
.banner-cta:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.banner-stats {
  display: flex; flex-direction: column; gap: 10px; z-index: 1; flex-shrink: 0;
}
.banner-stat { text-align: center; }
.banner-stat .num { font-size: 20px; font-weight: 800; display: block; }
.banner-stat .label { font-size: 10px; color: rgba(255,255,255,0.6); }

/* ── Load More Button ──────────────────────────────────────── */
.load-more-wrapper {
  display: flex; justify-content: center;
  padding: 24px 0 32px;
}
.btn-load-more {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 48px;
  font-size: 14px; font-weight: 700; font-family: inherit;
  color: var(--color-primary);
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
}
.btn-load-more:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(27,60,110,0.25);
}
.btn-load-more svg { transition: transform 0.2s ease; }
.btn-load-more:hover svg { transform: translateY(2px); }

/* ── Site Footer ───────────────────────────────────────────── */
.site-footer {
  background: var(--color-surface);
  position: relative;
  z-index: 10;
}
.footer-inner {
  max-width: var(--feed-max-width);
  margin: 0 auto; padding: 0 16px;
}

/* Trust Bar */
.footer-trust-bar {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 18px 0;
}
.footer-trust-bar .trust-items {
  display: flex; align-items: center; justify-content: center;
  gap: 0; flex-wrap: wrap;
}
.trust-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 18px;
  border-right: 1px solid var(--color-border);
}
.trust-item:last-child { border-right: none; }
.trust-icon { font-size: 18px; flex-shrink: 0; color: var(--color-accent); }
.trust-text { display: flex; flex-direction: column; }
.trust-title { font-size: 12px; font-weight: 600; color: var(--color-text); line-height: 1.3; }
.trust-sub { font-size: 10px; color: var(--color-muted); line-height: 1.3; }

/* Main Footer Grid */
.footer-main { padding: 36px 0 28px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 32px;
}
.footer-col { }
.footer-col-title {
  font-size: 13px; font-weight: 700; color: var(--color-text);
  margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.04em;
}

/* Footer Logo */
.footer-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; margin-bottom: 14px;
}
.footer-logo-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary), #2a5298);
  color: #fff; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.footer-logo-name {
  font-size: 15px; font-weight: 800; color: var(--color-primary); line-height: 1.2;
}
.footer-logo-tagline {
  font-size: 10px; color: var(--color-muted); line-height: 1.2;
}
.footer-brand-desc {
  font-size: 11px; color: var(--color-text-secondary);
  line-height: 1.6; margin-bottom: 16px;
}

/* Social Links */
.footer-socials { display: flex; gap: 8px; }
.social-link {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--color-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-secondary);
  transition: var(--transition); text-decoration: none;
}
.social-link:hover {
  background: var(--color-primary); color: #fff;
  transform: translateY(-2px);
}

/* Footer Nav Links */
.footer-links {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.footer-links a {
  font-size: 12px; color: var(--color-text-secondary);
  text-decoration: none; transition: var(--transition);
  line-height: 1.4;
}
.footer-links a:hover { color: var(--color-primary); }

/* Footer Contacts */
.footer-contacts {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.footer-contacts li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: var(--color-text-secondary); line-height: 1.4;
}
.footer-contacts svg {
  color: var(--color-primary); flex-shrink: 0; margin-top: 1px;
}
.footer-contacts a {
  color: var(--color-text-secondary); text-decoration: none;
  transition: var(--transition);
}
.footer-contacts a:hover { color: var(--color-primary); }
.contact-phone {
  font-size: 14px; font-weight: 700; color: var(--color-text) !important;
  display: block;
}
.contact-hours {
  font-size: 10px; color: var(--color-muted); display: block;
}

/* Newsletter */
.footer-newsletter { margin-top: 18px; }
.newsletter-title {
  font-size: 12px; font-weight: 600; color: var(--color-text);
  margin-bottom: 8px;
}
.newsletter-form {
  display: flex; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--color-border);
}
.newsletter-input {
  flex: 1; padding: 8px 12px; border: none; outline: none;
  font-size: 12px; font-family: inherit;
  background: var(--color-bg); color: var(--color-text);
  min-width: 0;
}
.newsletter-input::placeholder { color: var(--color-muted); }
.newsletter-btn {
  padding: 8px 14px; border: none;
  background: var(--color-primary); color: #fff;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: var(--transition); font-family: inherit;
}
.newsletter-btn:hover { background: var(--color-primary-dark); }

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding: 10px 0;
  background: var(--color-bg);
}
.footer-bottom-inner {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap;
  gap: 12px;
}
.footer-copyright {
  font-size: 10px; color: var(--color-muted); white-space: nowrap;
}
.footer-legal {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.footer-legal a {
  font-size: 10px; color: var(--color-text-secondary);
  text-decoration: none; transition: var(--transition); white-space: nowrap;
}
.footer-legal a:hover { color: var(--color-primary); }
.legal-dot { color: var(--color-muted); font-size: 8px; }
.footer-disclaimer {
  font-size: 9px; color: var(--color-muted);
}

/* ── Burger Button ─────────────────────────────────────────── */
.burger-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.18s ease;
}
.burger-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.38);
}
.burger-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 14px;
}
.burger-line {
  display: block;
  width: 14px;
  height: 1.5px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}
.burger-btn.open .burger-line:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger-btn.open .burger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger-btn.open .burger-line:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ── Mobile Drawer ────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 299;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 300px; max-width: 85vw;
  z-index: 300;
  background: var(--color-surface);
  box-shadow: -8px 0 30px rgba(0,0,0,0.2);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.mobile-drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-primary);
  flex-shrink: 0;
}
.drawer-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.drawer-close {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.15); border: none;
  color: #fff; font-size: 16px; cursor: pointer;
  transition: background 0.2s ease;
}
.drawer-close:hover { background: rgba(255,255,255,0.3); }

.drawer-body {
  flex: 1; padding: 12px 0;
  overflow-y: auto;
}

.drawer-section {
  padding: 8px 20px 12px;
}
.drawer-section + .drawer-section {
  border-top: 1px solid var(--color-border-light);
}
.drawer-section-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin-bottom: 6px;
}
.drawer-link {
  display: block;
  padding: 9px 0;
  font-size: 14px; font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.15s ease;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 40%, transparent);
}
.drawer-link:last-child { border-bottom: none; }
.drawer-link:hover { color: var(--color-primary); }

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .drawer-footer {
    padding: 16px 20px calc(60px + env(safe-area-inset-bottom));
  }
}
.drawer-cta {
  width: 100%; padding: 12px;
  background: var(--color-primary);
  color: #fff; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: background 0.2s ease;
  box-shadow: 0 2px 8px rgba(27,60,110,0.25);
}
.drawer-cta:hover { background: var(--color-primary-dark); }

/* ── Toast ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 90px; left: 50%;
  transform: translateX(-50%); z-index: 500;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
}
.toast {
  background: var(--color-primary);
  color: #fff; padding: 10px 20px;
  border-radius: 10px; font-size: 12px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(10px);
  transition: all 0.3s ease;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .card-promo { width: 180px; min-width: 180px; }
  .chars-grid { grid-template-columns: 1fr 1fr; }
  .location-grid { grid-template-columns: 1fr 1fr; }
  .infra-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .header-search { display: none; }
  .btn-header-ghost { display: none; }
  .filter-bar-inner { height: 46px; }

  /* Promo tucks under card on mobile */
  .card-row { flex-direction: column; gap: 0; }
  .card-promo {
    width: 100%; min-width: 100%;
    margin-top: -14px;
    border-radius: 0 0 14px 14px;
    padding: 24px 16px 16px;
    flex-direction: row; flex-wrap: wrap;
    align-items: center; gap: 10px;
    position: relative; z-index: 0;
  }
  .card-promo .promo-discount { font-size: 22px; }
  .card-promo .promo-title { font-size: 13px; flex: 1; min-width: 120px; }
  .card-promo .promo-text { display: none; }
  .card-promo .promo-btn { flex: 0 0 auto; }
  .property-card { position: relative; z-index: 1; }

  /* Stack card image on top — 2-photo mobile gallery */
  .card-main { flex-direction: column; width: 100%; }
  .card-image-col {
    width: 100%; min-width: 0; max-width: 100%;
    height: 180px; min-height: unset; aspect-ratio: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
  }
  .card-image-col > img {
    width: 100%; height: 100%;
    object-fit: cover;
    min-height: 0;
  }
  .card-image-col > img:first-child {
    border-radius: var(--radius-card) 0 0 0;
  }
  .card-image-secondary {
    display: block !important;
    border-radius: 0 var(--radius-card) 0 0;
  }
  .card-content-col {
    padding: 10px 12px 6px;
    width: 100%; /* explicit full width in column layout */
    min-width: 0;
  }
  .card-title {
    font-size: 14px;
    white-space: normal; /* allow wrap on mobile */
  }

  /* Fix negative-margin meta row on mobile */
  .card-meta-row {
    margin-left: -12px;
    margin-right: -12px;
    padding: 7px 12px;
  }

  /* CTA wraps */
  .card-actions { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .btn-primary { flex: 1 1 100%; }
  .btn-outline { flex: 1 1 calc(50% - 3px); }
  .btn-expert { flex: 1 1 100%; }

  /* Inline panel full width */
  .chars-grid { grid-template-columns: 1fr 1fr; }
  .location-grid { grid-template-columns: 1fr; }
  .infra-grid { grid-template-columns: 1fr; }

  /* Price table scroll on very small screens */
  .price-panel { overflow-x: auto; }
  .price-table { min-width: 260px; }

  /* Feed header mobile */
  .feed-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .feed-sort {
    width: 100%;
    gap: 8px;
  }
  .feed-sort select {
    flex: 1;
    min-width: 0;
    height: 34px;
    font-size: 11px;
  }

  /* Footer mobile */
  .footer-trust-bar .trust-items {
    flex-direction: column; gap: 10px;
  }
  .trust-item {
    border-right: none; border-bottom: 1px solid var(--color-border);
    padding: 8px 0; width: 100%;
  }
  .trust-item:last-child { border-bottom: none; }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer-bottom-inner {
    flex-direction: column; text-align: center;
  }
  .footer-legal {
    justify-content: center;
  }
  .footer-bottom { padding-bottom: 16px; }

  /* Burger menu — mobile: icon only, no border */
  .burger-btn {
    display: flex;
    padding: 0;
    width: 28px;
    height: 28px;
    justify-content: center;
    border: none;
    background: transparent;
    box-shadow: none;
    letter-spacing: 0;
  }
  .burger-txt { display: none; }
  .burger-lines { width: 20px; gap: 5px; }
  .burger-lines .burger-line { width: 20px; height: 2px; }
  .banner-card {
    flex-direction: column; align-items: flex-start;
    min-height: auto; padding: 20px 18px;
  }
  .banner-stats { flex-direction: row; gap: 20px; margin-top: 8px; }

  /* Gallery popup mobile */
  .gallery-popup-arrow.prev { left: 10px; }
  .gallery-popup-arrow.next { right: 10px; }
  .gallery-popup { width: 95vw; }

}

@media (max-width: 480px) {
  .card-title { font-size: 13px; }
  .banner-headline { font-size: 16px; }
  .card-meta-row { gap: 5px; margin-left: -12px; margin-right: -12px; padding: 7px 12px; }
  .card-delivery-block { display: none; }

  /* Keep inline panel fully inside card */
  .card-inline-panel-content { padding: 12px; }
  .inline-section-layout { gap: 10px; }

  /* Tighten card header on tiny screens */
  .card-top-row { gap: 6px; }
  .rating-num { font-size: 16px; }
  .rating-star { font-size: 14px; }
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.property-card-wrapper { animation: fadeInUp 0.4s ease both; }
.property-card-wrapper:nth-child(1) { animation-delay: 0.05s; }
.property-card-wrapper:nth-child(2) { animation-delay: 0.10s; }
.property-card-wrapper:nth-child(3) { animation-delay: 0.15s; }
.property-card-wrapper:nth-child(4) { animation-delay: 0.20s; }
.property-card-wrapper:nth-child(5) { animation-delay: 0.25s; }
.property-card-wrapper:nth-child(n+6) { animation-delay: 0.30s; }

@keyframes galleryFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.gallery-popup-overlay.open .gallery-popup {
  animation: galleryFadeIn 0.25s ease both;
}

/* ── Availability Modal ────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1100;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px 16px;
  overflow-y: auto;
  box-sizing: border-box;
}
@media (max-height: 600px), (max-width: 480px) {
  .modal-overlay {
    align-items: flex-start;
  }
}
.modal-overlay.open { display: flex; }
.modal-overlay.open .modal-card {
  animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-card {
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.06);
  width: 100%; max-width: 440px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
}

.modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

@media (max-width: 480px) {
  .modal-card {
    max-height: calc(100dvh - 40px);
    border-radius: 14px;
  }
}

.modal-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 0;
}
.modal-header-text { flex: 1; }
.modal-title {
  font-size: 18px; font-weight: 700;
  color: var(--color-text);
  line-height: 1.3; margin: 0;
}
.modal-subtitle {
  font-size: 12px; color: var(--color-muted);
  margin-top: 4px; line-height: 1.4;
}
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  color: var(--color-muted); font-size: 18px;
  cursor: pointer; transition: var(--transition);
  flex-shrink: 0; margin: -4px -6px 0 8px;
}
.modal-close:hover {
  background: var(--color-bg); color: var(--color-text);
}

.modal-body { padding: 18px 24px 24px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.modal-field {
  margin-bottom: 14px;
}
.modal-field:last-of-type { margin-bottom: 18px; }

.modal-label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 5px; letter-spacing: 0.02em;
  text-transform: uppercase;
}

.modal-input,
.modal-select {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  font-size: 13px; font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  box-sizing: border-box;
}
.modal-input::placeholder { color: var(--color-muted); }
.modal-input:focus,
.modal-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent);
}
.modal-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.modal-row {
  display: flex; gap: 10px;
}
.modal-row .modal-field { flex: 1; min-width: 0; }

.modal-submit {
  width: 100%; padding: 12px;
  background: var(--color-primary);
  color: #fff; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(27,60,110,0.25);
}
.modal-submit:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 4px 16px rgba(27,60,110,0.35);
}
.modal-submit:active { transform: scale(0.98); }

.modal-consent {
  font-size: 10px; color: var(--color-muted);
  text-align: center; margin-top: 12px;
  line-height: 1.5;
}
.modal-consent a {
  color: var(--color-primary); text-decoration: none;
}
.modal-consent a:hover { text-decoration: underline; }

/* ── Utility ───────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.text-accent { color: var(--color-accent); }
.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-muted); }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }

/* ── Inline Panel Banners ───────────────────────────────────── */
.inline-section-layout {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

.inline-main-content {
  flex: 1;
  min-width: 0;
}

.inline-side-banner {
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  justify-content: space-between;
}

.inline-side-banner:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-border);
}

.inline-side-banner .banner-info {
  display: flex;
  flex-direction: column;
}

.inline-side-banner .banner-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 6px;
  border-radius: 4px;
  width: fit-content;
  margin-bottom: 8px;
  background: var(--color-bg);
  color: var(--color-text-secondary);
}

.inline-side-banner .banner-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.inline-side-banner .banner-text {
  font-size: 10px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin: 0 0 14px 0;
  flex-grow: 1;
}

.inline-side-banner .banner-btn {
  width: 100%;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  font-family: inherit;
}

.inline-side-banner .banner-btn:hover {
  background: var(--color-border-light);
}

/* Mobile responsive styles for inline panel banners */
@media (max-width: 768px) {
  .inline-section-layout {
    flex-direction: column;
    gap: 14px;
  }
  
  .inline-side-banner {
    align-self: stretch;
    width: auto;
    min-width: unset;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid var(--color-border-light);
  }
  
  .inline-side-banner .banner-info {
    flex: 1;
    min-width: 0;
  }
  
  .inline-side-banner .banner-text {
    margin-bottom: 0;
    margin-top: 2px;
  }
  
  .inline-side-banner .banner-btn {
    width: auto;
    white-space: nowrap;
    padding: 8px 16px;
  }
}

@media (max-width: 480px) {
  .inline-side-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .inline-side-banner .banner-btn {
    width: 100%;
  }
}
