/* ==========================================================================
   OmniEstate AI Aggregator - World-Class PropTech Design System
   Inspired by Zillow, Airbnb, Zonaprop, and Idealista
   ========================================================================== */

:root {
  --bg-dark: #090e1a;
  --bg-card: #111a2e;
  --bg-card-hover: #192642;
  --bg-input: #15223c;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #233354;
  --border-light: rgba(255, 255, 255, 0.08);
  
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --primary-hover: #0284c7;
  
  --accent-green: #10b981;
  --accent-green-bg: rgba(16, 185, 129, 0.15);
  --accent-gold: #f59e0b;
  --accent-gold-bg: rgba(245, 158, 11, 0.15);
  --accent-red: #ef4444;
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-main);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.3);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Header Section
   ========================================================================== */
.app-header {
  height: 64px;
  background: #0d1527;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 0 16px var(--primary-glow);
}

.logo-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.logo-title span {
  color: var(--primary);
}

.logo-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Operation Segmented Controls (Zillow / Idealista Style) */
.operation-segmented-control {
  display: flex;
  background: #080d19;
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

.op-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.op-btn.active {
  background: #1e2d4a;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.op-btn:hover:not(.active) {
  color: var(--text-main);
}

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

.live-pulse-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 0.4; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.live-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-green);
}

.btn-simulate {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.btn-simulate:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   Top Sticky Quick Filter Bar
   ========================================================================== */
.quick-filter-bar {
  background: #0f172a;
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 900;
}

.primary-quick-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

/* Map Toggle Button (Airbnb / Zillow Style) */
.btn-toggle-map, .btn-toggle-map-feed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.28), rgba(14, 165, 233, 0.16));
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-toggle-map:hover, .btn-toggle-map-feed:hover {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.btn-toggle-map.active, .btn-toggle-map-feed.active {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
  color: #e2e8f0;
}

/* Secondary filters toggle button */
.btn-toggle-more-filters {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-toggle-more-filters:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.btn-toggle-more-filters.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.secondary-filters-tray {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
  margin-top: 2px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  animation: trayFadeIn 0.2s ease-out;
}

@keyframes trayFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.custom-select {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-select:focus, .custom-select:hover {
  border-color: var(--primary);
}

.custom-select.highlight {
  border-color: rgba(56, 189, 248, 0.4);
  background: #192742;
}

.custom-select optgroup {
  background: #080e1b;
  color: var(--primary);
  font-weight: 700;
}

.custom-select option {
  background: #141e33;
  color: #fff;
}

/* Modern Multi-Select Dropdown */
.multiselect-wrapper {
  position: relative;
}

.multiselect-trigger {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 170px;
  justify-content: space-between;
  transition: all 0.2s ease;
  user-select: none;
}

.multiselect-trigger:hover, .multiselect-trigger:focus, .multiselect-wrapper.open .multiselect-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.multiselect-trigger .ms-arrow {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.multiselect-wrapper.open .ms-arrow {
  transform: rotate(180deg);
}

.multiselect-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 280px;
  background: #0f192d;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  padding: 12px;
  z-index: 1200;
  display: none;
  flex-direction: column;
  gap: 8px;
  animation: fadeInDown 0.15s ease-out;
}

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

.multiselect-wrapper.open .multiselect-menu {
  display: flex;
}

.ms-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.ms-btn {
  flex: 1;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--primary);
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ms-btn:hover {
  background: rgba(56, 189, 248, 0.25);
}

.ms-btn.ms-reset {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.ms-btn.ms-reset:hover {
  background: rgba(239, 68, 68, 0.25);
}

.ms-search {
  background: #16243f;
  border: 1px solid var(--border);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}

.ms-search:focus {
  border-color: var(--primary);
}

.ms-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

.ms-list::-webkit-scrollbar {
  width: 5px;
}

.ms-list::-webkit-scrollbar-thumb {
  background: #233354;
  border-radius: 4px;
}

.ms-group-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  padding: 6px 4px 2px 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ms-group-title:first-child {
  border-top: none;
  padding-top: 0;
}

.ms-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s ease;
}

.ms-item:hover {
  background: rgba(56, 189, 248, 0.1);
}

.ms-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.ms-item .ms-cnt-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 1px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

.price-secondary-approx {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.price-inputs-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  transition: border-color var(--transition-fast);
}

.price-inputs-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.price-input {
  width: 95px;
  min-width: 90px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  font-family: inherit;
  -moz-appearance: textfield;
}

.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.price-sep {
  color: var(--text-muted);
  font-size: 12px;
}

/* Rooms Pill Group */
.pill-options {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.pill-btn.active {
  background: var(--primary);
  color: #0b1120;
}

.pill-btn:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* Quick Furnished Expat Chips */
.furnished-pill-options {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.btn-furnished-chip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-furnished-chip.active {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #0b1120;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.btn-furnished-chip:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Quick Checkbox Chips */
.quick-chips-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-chip-toggle {
  display: inline-flex;
  cursor: pointer;
  user-select: none;
}

.quick-chip-toggle input {
  display: none;
}

.chip-label {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.quick-chip-toggle:hover .chip-label {
  border-color: rgba(56, 189, 248, 0.4);
  color: #fff;
}

.quick-chip-toggle input:checked + .chip-label {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* Mega-Filters Trigger Button */
.btn-mega-filter {
  background: linear-gradient(135deg, #1e293b, #334155);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #fff;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-mega-filter:hover {
  background: linear-gradient(135deg, #283952, #475569);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.filter-count-badge {
  background: var(--primary);
  color: #090e1a;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}

.quick-results-count {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.btn-quick-reset {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-quick-reset:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
  color: #fff;
  transform: translateY(-1px);
}

.btn-clear-price {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  display: none;
  border-radius: 4px;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-clear-price:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

.price-inputs-wrap.has-val .btn-clear-price {
  display: inline-flex;
}

.active-filters-notice {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  padding: 8px 14px;
  margin: 0 16px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #e2e8f0;
  animation: fadeInDown 0.2s ease-out;
}

.active-filters-notice .af-text {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.active-filters-notice .af-tag {
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
}

.active-filters-notice .af-reset-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.active-filters-notice .af-reset-btn:hover {
  background: #ef4444;
  color: #fff;
}



/* ==========================================================================
   Quick Source Pills Bar (1-Click Source Filtering)
   ========================================================================== */
.source-pills-bar {
  background: #090f1f;
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 850;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.source-pills-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
  flex-shrink: 0;
}

.source-pills-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.source-pills-scroll::-webkit-scrollbar {
  display: none;
}

.btn-source-pill {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.btn-source-pill .pill-cnt {
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 6px;
  border-radius: 10px;
  color: #94a3b8;
}

.btn-source-pill:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #fff;
  border-color: rgba(148, 163, 184, 0.45);
  transform: translateY(-1px);
}

.btn-source-pill.active {
  background: #38bdf8;
  color: #0b1120;
  font-weight: 700;
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
}

.btn-source-pill.active .pill-cnt {
  background: rgba(0, 0, 0, 0.25);
  color: #0b1120;
}

.btn-source-pill.soloduenos.active {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  border-color: #fbbf24;
  color: #0b1120;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.5);
}

.btn-source-pill.zonaprop.active {
  background: linear-gradient(135deg, #ea580c, #f97316);
  border-color: #fb923c;
  color: #fff;
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.5);
}

.btn-source-pill.argenprop.active {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  border-color: #f87171;
  color: #fff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
}

.btn-source-pill.properati.active {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  border-color: #a78bfa;
  color: #fff;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.5);
}

.btn-source-pill.mercadolibre.active {
  background: #ffe600;
  border-color: #facc15;
  color: #111;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.5);
}

.btn-source-pill.facebook.active {
  background: linear-gradient(135deg, #1877f2, #2563eb);
  border-color: #60a5fa;
  color: #fff;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.5);
}

.btn-source-pill.telegram.active {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.5);
}

/* Telegram Dropdown Pill & Caret */
.tg-pill-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-source-pill.telegram {
  padding-right: 6px;
}

.tg-caret-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease, background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.tg-caret-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.tg-caret-btn.open {
  transform: rotate(180deg);
  color: #fff;
}

.tg-pill-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  margin-left: 5px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tg-pill-reset-btn:hover {
  background: #ef4444;
}

/* Telegram Dropdown Menu (Fixed, Zero-clipping) */
.tg-channels-dropdown-menu {
  position: fixed;
  display: none;
  flex-direction: column;
  width: 420px;
  max-width: calc(100vw - 20px);
  max-height: 520px;
  background: #0b1329;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 14px;
  box-shadow: 0 20px 50px -4px rgba(0, 0, 0, 0.85), 0 0 24px rgba(56, 189, 248, 0.2);
  z-index: 999999;
  font-family: inherit;
  overflow: hidden;
  backdrop-filter: blur(14px);
  animation: tgDdFade 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tgDdFade {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tg-channels-dropdown-menu.open {
  display: flex !important;
}

.tg-dd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3), rgba(15, 23, 42, 0.95));
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.tg-dd-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.tg-dd-title i {
  color: #38bdf8;
  font-size: 16px;
}

.tg-dd-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 6px;
  line-height: 1;
}

.tg-dd-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.tg-dd-search-wrap {
  position: relative;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.85);
}

.tg-dd-search-icon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 12px;
  pointer-events: none;
}

.tg-dd-search-input {
  width: 100%;
  padding: 7px 28px 7px 30px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.tg-dd-search-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.tg-dd-search-clear {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
}

.tg-dd-all-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin: 6px 10px 4px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tg-dd-all-option:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
}

.tg-dd-all-option.active {
  background: rgba(2, 132, 199, 0.25);
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.tg-dd-scroll-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 8px;
  scrollbar-width: thin;
  max-height: 330px;
}

.tg-dd-scroll-list::-webkit-scrollbar {
  width: 5px;
}

.tg-dd-scroll-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 4px;
}

.tg-dd-section-title {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 8px 6px 4px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tg-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.tg-dd-item:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(56, 189, 248, 0.25);
}

.tg-dd-item.active {
  background: rgba(2, 132, 199, 0.22);
  border-color: #38bdf8;
}

.tg-dd-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.tg-dd-radio {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.15s;
}

.tg-dd-item.active .tg-dd-radio,
.tg-dd-all-option.active .tg-dd-radio {
  border-color: #38bdf8;
  background: #0284c7;
  color: #fff;
}

.tg-dd-item-info {
  min-width: 0;
  flex: 1;
}

.tg-dd-item-name {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-dd-item.active .tg-dd-item-name {
  color: #38bdf8;
  font-weight: 700;
}

.tg-dd-item-sub {
  font-size: 10.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.tg-dd-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 8px;
}

.tg-dd-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  white-space: nowrap;
}

.tg-dd-badge.all {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3), rgba(56, 189, 248, 0.2));
  color: #38bdf8;
  border-color: #38bdf8;
}

.tg-dd-badge.empty {
  background: rgba(148, 163, 184, 0.08);
  color: #64748b;
  border-color: rgba(148, 163, 184, 0.15);
}

.tg-dd-badge.info {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.3);
}

.tg-dd-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  text-decoration: none;
  font-size: 10px;
  transition: all 0.15s;
}

.tg-dd-open-link:hover {
  background: #0284c7;
  color: #fff;
  transform: translateY(-1px);
}

.tg-dd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: rgba(15, 23, 42, 0.96);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.tg-dd-footer-text {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tg-dd-item .tg-dd-radio {
  border-radius: 4px;
}

.tg-dd-footer-btn {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.tg-dd-footer-btn:hover {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

.tg-dd-footer-apply-btn {
  background: linear-gradient(135deg, #0284c7, #0077b6);
  border: 1px solid #38bdf8;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.tg-dd-footer-apply-btn:hover {
  background: #0369a1;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* ==========================================================================
   Top Barrios Quick Filter Scroll Bar
   ========================================================================== */
.top-barrios-scroll-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 10px;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.top-barrios-scroll-wrap::-webkit-scrollbar {
  display: none;
}

.top-barrios-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.top-barrios-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.btn-barrio-pill {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.btn-barrio-pill .barrio-cnt {
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 5px;
  border-radius: 8px;
  color: #94a3b8;
}

.btn-barrio-pill:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #fff;
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}

.btn-barrio-pill.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #0b1120;
  font-weight: 700;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.btn-barrio-pill.active .barrio-cnt {
  background: rgba(0, 0, 0, 0.25);
  color: #0b1120;
}

.card-location {
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-location:hover {
  color: #38bdf8 !important;
  text-decoration: underline;
}

/* ==========================================================================
   Main Content Layout (Split Screen)
   ========================================================================== */
.main-container {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Collapsed Map Layout (Full-Width Airbnb Grid Mode) */
.main-container.map-collapsed .sidebar {
  width: 100% !important;
  flex: 1 1 100% !important;
  max-width: 100% !important;
  border-right: none !important;
  padding: 22px 36px;
}

.main-container.map-collapsed .map-container {
  display: none !important;
}

.main-container.map-collapsed .property-feed {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)) !important;
  gap: 20px !important;
}

/* Left Section: Sidebar Feed (58% Width) */
.sidebar {
  width: 58%;
  flex: 0 0 58%;
  max-width: 58%;
  height: 100%;
  overflow-y: auto;
  padding: 18px 24px;
  background-color: var(--bg-dark);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feed-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.feed-heading {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.feed-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.feed-sort-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-label {
  color: var(--text-muted);
  font-size: 13px;
}

.sort-select {
  font-size: 12px;
  padding: 5px 10px;
}

/* Property Feed Grid */
.property-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   Property Card Design (Zillow + Zonaprop Pro Cards)
   ========================================================================== */
.property-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.property-card:hover, .property-card.active {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(56, 189, 248, 0.2);
}

.card-image-wrap {
  height: 220px;
  position: relative;
  overflow: hidden;
  background: #020617;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.property-card:hover .card-image {
  transform: scale(1.04);
}

.card-badge-eval {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  z-index: 5;
}

.card-badge-eval.agency {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.btn-favorite {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: transform 0.2s;
}

.btn-favorite:hover {
  transform: scale(1.15);
}

.card-sources-preview {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 5;
}

.source-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  color: #fff;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 4px;
}

.source-badge.telegram { background: rgba(34, 158, 217, 0.95); border: 1px solid rgba(56, 189, 248, 0.4); }
.source-badge.argenprop { background: rgba(235, 87, 87, 0.95); border: 1px solid rgba(255, 107, 107, 0.4); }
.source-badge.zonaprop { background: rgba(249, 115, 22, 0.95); border: 1px solid rgba(251, 146, 60, 0.4); }
.source-badge.mercadolibre { background: #ffe600; color: #111; font-weight: 800; border: 1px solid rgba(250, 204, 21, 0.6); }
.source-badge.facebook { background: rgba(24, 119, 242, 0.95); border: 1px solid rgba(96, 165, 250, 0.4); }
.source-badge.instagram { background: linear-gradient(135deg, rgba(225, 48, 108, 0.95), rgba(131, 58, 180, 0.95)); }
.source-badge.infocasas { background: rgba(16, 185, 129, 0.95); border: 1px solid rgba(52, 211, 153, 0.4); }
.source-badge.properati { background: rgba(139, 92, 246, 0.95); border: 1px solid rgba(167, 139, 250, 0.4); }
.source-badge.soloduenos { background: rgba(217, 119, 6, 0.95); border: 1px solid rgba(245, 158, 11, 0.4); }
.source-badge.airbnb { background: rgba(255, 56, 92, 0.95); }

.dev-info-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dev-info-box strong { color: var(--primary); }
.dev-info-box a { color: var(--primary); text-decoration: underline; word-break: break-all; }

/* Card Content */
.card-content {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.card-price-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.card-price {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.card-price span.price-period {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.u-listing-price {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

/* Если оригинал в USD: */
.card-price.orig-usd .price-usd-main,
.card-price.orig-usd .u-listing-price,
.modal-price-wrap.orig-usd .price-usd-main,
.modal-price-wrap.orig-usd .u-listing-price,
.modal-main-price.orig-usd {
  color: #ffffff;
  text-decoration: underline #10b981 3px;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

/* Если оригинал в ARS: */
.card-price.orig-ars .price-ars-main,
.card-price.orig-ars .u-listing-price,
.modal-price-wrap.orig-ars .price-ars-main,
.modal-price-wrap.orig-ars .u-listing-price,
.modal-main-price.orig-ars {
  color: #38bdf8;
  text-decoration: underline #38bdf8 3px;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.orig-currency-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  vertical-align: middle;
  line-height: 1.2;
}

.orig-currency-badge.ars {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.orig-currency-badge.usd {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.card-date-badge {
  position: absolute;
  top: 12px;
  right: 52px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  white-space: nowrap;
}
.card-date-badge i {
  color: var(--primary);
  font-size: 11px;
}

.price-secondary-approx {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 2px;
  margin-bottom: 4px;
  text-decoration: none !important;
}

.modal-price-wrap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-main-price {
  font-size: 26px;
  font-weight: 800;
}

.modal-secondary-approx {
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
  text-decoration: none !important;
}

.card-expensas-tag {
  font-size: 12px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.card-expensas-tag.zero {
  color: var(--accent-green);
  background: var(--accent-green-bg);
  border-color: rgba(16, 185, 129, 0.3);
}

.card-location-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zone-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background: #1e293b;
  color: var(--primary);
  padding: 2px 7px;
  border-radius: 4px;
}

.card-location {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
}

.card-specs-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  align-items: center;
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.prop-type-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  background: #334155;
  color: #e2e8f0;
}

/* Card Amenities Tags */
.card-amenities-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.amenity-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: #172238;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.amenity-tag.highlight {
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  border-color: rgba(56, 189, 248, 0.3);
}

.card-footer-actions {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-source-direct {
  background: var(--bg-card-hover);
  color: var(--text-main);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
}

.btn-source-direct:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-source-direct.argenprop {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.45);
}
.btn-source-direct.argenprop:hover {
  background: #ea580c;
  color: #fff;
  border-color: #ea580c;
}

.btn-source-direct.zonaprop {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.45);
}
.btn-source-direct.zonaprop:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.btn-source-direct.telegram {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.45);
}
.btn-source-direct.telegram:hover {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

.btn-source-direct.mercadolibre {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.45);
}
.btn-source-direct.mercadolibre:hover {
  background: #eab308;
  color: #000;
  border-color: #eab308;
}

.btn-source-direct.facebook {
  background: rgba(24, 119, 242, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(24, 119, 242, 0.45);
}
.btn-source-direct.facebook:hover {
  background: #1877f2;
  color: #fff;
  border-color: #1877f2;
}

.btn-source-direct.whatsapp {
  background: rgba(37, 211, 102, 0.15);
  color: #25d366;
  border: 1px solid rgba(37, 211, 102, 0.45);
}
.btn-source-direct.whatsapp:hover {
  background: #25d366;
  color: #000;
  border-color: #25d366;
}

.custom-select.highlight-source {
  border-color: rgba(56, 189, 248, 0.4);
  background: #17243c;
}

/* ==========================================================================
   Right Section: Leaflet Map (42% Width)
   ========================================================================== */
.map-container {
  flex: 1;
  min-width: 0;
  position: relative;
  height: 100%;
}

#map {
  width: 100%;
  height: 100%;
  background: #0f172a;
}

.map-overlay-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-control-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.map-control-btn:hover {
  background: var(--primary);
  color: #0b1120;
}

/* Leaflet Custom Price Map Markers */
.custom-map-marker {
  background: #111a2e;
  color: #fff;
  border: 2px solid var(--primary);
  border-radius: 20px;
  padding: 4px 10px;
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  white-space: nowrap;
  transition: transform 0.2s, background-color 0.2s;
}

.custom-map-marker.active-marker {
  background: var(--primary);
  color: #0b1120;
  transform: scale(1.2);
  z-index: 1000 !important;
  box-shadow: 0 0 16px var(--primary);
}

/* ==========================================================================
   MEGA-FILTERS MODAL (Zillow + Zonaprop + Idealista + Циан)
   ========================================================================== */
.mega-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 18, 0.85);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.mega-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.mega-modal-card {
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  background: #0f172a;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.mega-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #141e33;
}

.mega-modal-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mega-active-pill {
  font-size: 12px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.2);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.mega-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}

.mega-close-btn:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

.mega-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.filter-section {
  background: #131c31;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.section-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.form-select, .form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-select:focus, .form-input:focus {
  border-color: var(--primary);
}

/* Tiles Grid for Property Types */
.tiles-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.tile-checkbox {
  cursor: pointer;
}

.tile-checkbox input {
  display: none;
}

.tile-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: all 0.2s ease;
}

.tile-checkbox:hover .tile-card {
  border-color: rgba(56, 189, 248, 0.4);
  color: #fff;
}

.tile-checkbox input:checked + .tile-card {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* Custom Checkbox Grid */
.checkbox-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.custom-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.custom-checkbox-item:hover {
  background: #1c2b4a;
  border-color: rgba(56, 189, 248, 0.4);
}

.custom-checkbox-item input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.custom-checkbox-item input:checked ~ .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.custom-checkbox-item input:checked ~ .checkmark::after {
  content: "✔";
  color: #0b1120;
  font-size: 11px;
  font-weight: 900;
}

.item-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Sticky Modal Footer */
.mega-modal-footer {
  padding: 16px 24px;
  background: #141e33;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.btn-modal-reset {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-modal-reset:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: #ef4444;
}

.btn-modal-apply {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #090e1a;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
  transition: all 0.2s ease;
}

.btn-modal-apply:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
}

/* ==========================================================================
   Property Detail Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 18, 0.85);
  backdrop-filter: blur(10px);
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}

.modal-close:hover {
  background: var(--accent-red);
}

.card-photos-count {
  display: none !important;
}

.modal-gallery-wrap {
  position: relative;
  width: 100%;
  height: 340px;
  background: #020617;
  overflow: hidden;
}

.modal-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s ease;
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 8;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-nav-btn:hover {
  background: var(--primary);
  color: #090e1a;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
  transform: translateY(-50%) scale(1.08);
}

.gallery-nav-btn.prev {
  left: 14px;
}

.gallery-nav-btn.next {
  right: 14px;
}

.gallery-counter-badge {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.modal-gallery-thumbnails {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.95);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
  border-bottom: 1px solid var(--border);
}

.modal-gallery-thumb {
  width: 64px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.65;
  transition: all 0.2s ease;
}

.modal-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-gallery-thumb:hover {
  opacity: 0.95;
  transform: scale(1.04);
}

.modal-gallery-thumb.active {
  opacity: 1;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-header-info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-zone-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-top: 4px;
}

.modal-price {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.modal-price span {
  font-size: 14px;
  color: var(--text-muted);
}

.modal-specs-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-desc-box {
  background: #0d1527;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.box-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.desc-text {
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-sources-section {
  background: #0d1527;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.sources-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sources-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sources-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.source-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  gap: 12px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .sidebar {
    width: 52%;
    flex: 0 0 52%;
    max-width: 52%;
  }
}

@media (max-width: 768px) {
  body {
    height: auto;
    overflow-y: auto;
  }

  .app-header {
    height: auto;
    min-height: 56px;
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .operation-segmented-control {
    display: none;
  }

  .quick-filter-bar {
    padding: 10px 14px;
    gap: 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  .source-pills-bar {
    padding: 8px 14px;
    gap: 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .source-pills-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-item, .quick-chips-group {
    flex-shrink: 0;
  }

  .main-container {
    flex-direction: column-reverse;
    height: auto;
  }

  .sidebar {
    width: 100%;
    flex: 1 1 auto;
    max-width: 100%;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 14px;
  }

  .map-container {
    width: 100%;
    height: 38vh;
    min-height: 220px;
  }

  .section-grid-2 {
    grid-template-columns: 1fr;
  }
}
