/* ═══════════════════════════════════════════════════
   URBANOWNER PORTAL — Estilos (tema oscuro)
═══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --p50:  #1a1030; --p100: #221540; --p200: #2e1d58;
  --p400: #7c3aed; --p500: #6d28d9; --p600: #5b21b6; --p700: #4c1d95;
  --teal: #0f766e; --teal-l: #0d3d39;
  --gray-50:  #0d1117;
  --gray-100: #131922;
  --gray-200: #1e2b3c;
  --gray-400: #4b6280;
  --gray-500: #7a92ad;
  --gray-600: #9fb3c8;
  --gray-700: #c8d6e3;
  --gray-800: #dde6ef;
  --gray-900: #f0f4f8;
  --white:    #161f2e;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,.5), 0 4px 20px rgba(0,0,0,.35);
  --shadow-md: 0 6px 32px rgba(0,0,0,.6);
}

body { font-family: 'Inter', sans-serif; background: var(--gray-50); color: var(--gray-700); min-height: 100vh; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; }
input, select { font-family: inherit; }

/* ── Navbar ─────────────────────────────────────── */
.navbar {
  background: var(--white); border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; height: 64px;
}
.nav-logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-logo .logo-u { color: #a78bfa; font-weight: 900; font-size: 1.25rem; }
.nav-logo .logo-o { color: #2dd4bf; font-weight: 900; font-size: 1.25rem; }
.nav-logo .logo-tag { font-size: .65rem; font-weight: 600; color: var(--gray-400); margin-left: 4px; letter-spacing: .04em; text-transform: uppercase; }
.nav-search {
  flex: 1; max-width: 480px;
  display: flex; align-items: center;
  background: var(--gray-100); border: 1.5px solid var(--gray-200);
  border-radius: 30px; padding: 0 16px; gap: 8px; transition: border-color .2s;
}
.nav-search:focus-within { border-color: var(--p400); background: #1a2540; }
.nav-search input { flex: 1; border: none; background: transparent; outline: none; font-size: .88rem; padding: 10px 0; color: var(--gray-800); }
.nav-search input::placeholder { color: var(--gray-400); }
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn-ghost { background: transparent; color: var(--gray-600); font-size: .85rem; font-weight: 500; padding: 8px 14px; border-radius: 8px; transition: background .15s; display: inline-block; }
.btn-ghost:hover { background: var(--gray-200); color: var(--gray-900); }
.btn-publish { background: var(--teal); color: #fff; font-size: .85rem; font-weight: 600; padding: 9px 18px; border-radius: 30px; transition: background .15s; display: inline-block; }
.btn-publish:hover { background: #0d5f58; }

/* ── Account dropdown ───────────────────────────── */
.account-wrap { position: relative; }
.account-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: 14px; box-shadow: var(--shadow-md);
  min-width: 260px; z-index: 300; overflow: hidden;
  animation: dropIn .15s ease;
}
.account-dropdown.open { display: block; }
@keyframes dropIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.acct-header {
  padding: 16px 18px; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 12px;
}
.acct-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800; color: #fff;
}
.acct-avatar.portal-type { background: linear-gradient(135deg, #0f766e, #0d5f58); }
.acct-avatar.dash-type   { background: linear-gradient(135deg, #5b21b6, #4c1d95); }
.acct-name  { font-size: .88rem; font-weight: 700; color: var(--gray-900); }
.acct-email { font-size: .72rem; color: var(--gray-500); margin-top: 1px; }
.acct-badge {
  display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 20px;
  font-size: .65rem; font-weight: 700; letter-spacing: .03em;
}
.acct-badge.portal { background: rgba(15,118,110,.2); color: #2dd4bf; border: 1px solid rgba(15,118,110,.3); }
.acct-badge.dash   { background: rgba(109,40,217,.2); color: #c4b5fd; border: 1px solid rgba(109,40,217,.3); }
.acct-actions { padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.acct-action {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 9px; font-size: .83rem; font-weight: 600;
  color: var(--gray-700); background: transparent; border: none; cursor: pointer;
  text-align: left; transition: background .15s; text-decoration: none;
}
.acct-action:hover { background: var(--gray-100); color: var(--gray-900); }
.acct-action.primary { background: var(--p600); color: #fff; }
.acct-action.primary:hover { background: var(--p700); }
.acct-action.danger { color: #f87171; }
.acct-action.danger:hover { background: rgba(239,68,68,.1); }
.acct-divider { height: 1px; background: var(--gray-200); margin: 2px 10px; }
/* no-auth state */
.acct-noauth { padding: 18px; text-align: center; }
.acct-noauth p { font-size: .78rem; color: var(--gray-500); margin-bottom: 14px; }
.acct-noauth .btn-login {
  display: block; width: 100%; padding: 10px; border-radius: 9px;
  background: var(--p600); color: #fff; font-weight: 700; font-size: .85rem;
  border: none; cursor: pointer; margin-bottom: 8px; transition: background .15s;
}
.acct-noauth .btn-login:hover { background: var(--p700); }
.acct-noauth .btn-register {
  display: block; width: 100%; padding: 10px; border-radius: 9px;
  background: transparent; color: var(--gray-600); font-weight: 600; font-size: .85rem;
  border: 1.5px solid var(--gray-200); cursor: pointer; transition: all .15s;
}
.acct-noauth .btn-register:hover { border-color: var(--p400); color: #c4b5fd; }

/* ── Hero ────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0a0618 0%, #1a0a3a 35%, #0f2a4a 70%, #0a1f2e 100%);
  border-bottom: 1px solid var(--gray-200);
  color: #fff; padding: 56px 24px 72px;
  text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(109,40,217,.35) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 900; margin-bottom: 10px; position: relative; }
.hero p { font-size: .95rem; opacity: .75; margin-bottom: 32px; position: relative; }

.search-box {
  max-width: 780px; margin: 0 auto;
  background: #0f1825; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 6px 6px 6px 16px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  box-shadow: 0 8px 40px rgba(0,0,0,.5); position: relative;
}
.search-box select, .search-box input[type=text] {
  border: none; outline: none; background: transparent;
  font-size: .88rem; color: var(--gray-800); padding: 10px 8px;
  flex: 1; min-width: 120px;
}
.search-box select option { background: #0f1825; color: var(--gray-800); }
.search-divider { width: 1px; height: 28px; background: var(--gray-200); flex-shrink: 0; }
.btn-search {
  background: linear-gradient(135deg, var(--p500), var(--p700)); color: #fff; font-weight: 700;
  padding: 12px 28px; border-radius: 9px; font-size: .88rem;
  white-space: nowrap; transition: opacity .15s;
}
.btn-search:hover { opacity: .88; }

.hero-stats { display: flex; justify-content: center; gap: 32px; margin-top: 28px; flex-wrap: wrap; position: relative; }
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 1.4rem; font-weight: 900; color: #c4b5fd; }
.hero-stat span { font-size: .78rem; opacity: .6; }

/* ── Tabs de operación ──────────────────────────── */
.op-tabs {
  display: flex; gap: 4px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 30px; padding: 4px;
  width: fit-content; margin: 0 auto 20px; position: relative;
}
.op-tab {
  padding: 8px 22px; border-radius: 30px; font-size: .85rem; font-weight: 600;
  color: rgba(255,255,255,.55); background: transparent; transition: all .15s;
}
.op-tab.active { background: rgba(109,40,217,.7); color: #fff; }

/* ── Layout principal ───────────────────────────── */
.main-layout {
  max-width: 1280px; margin: 0 auto; padding: 28px 24px;
  display: grid; grid-template-columns: 260px 1fr; gap: 24px;
}
@media (max-width: 900px) { .main-layout { grid-template-columns: 1fr; } }

/* ── Sidebar filtros ────────────────────────────── */
.filters-panel {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--gray-200); padding: 20px;
  height: fit-content; position: sticky; top: 80px;
}
.filters-panel h3 { font-size: .75rem; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 16px; }
.filter-group { margin-bottom: 20px; }
.filter-label { font-size: .78rem; font-weight: 600; color: var(--gray-600); margin-bottom: 8px; display: block; }
.filter-select, .filter-input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--gray-200);
  border-radius: 9px; font-size: .84rem; color: var(--gray-800);
  outline: none; background: var(--gray-100); transition: border-color .2s;
}
.filter-select option { background: var(--gray-100); }
.filter-select:focus, .filter-input:focus { border-color: var(--p400); }
.price-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 12px; border-radius: 20px; font-size: .76rem; font-weight: 600;
  border: 1.5px solid var(--gray-200); color: var(--gray-500);
  cursor: pointer; transition: all .15s; background: var(--gray-100);
}
.chip.active { border-color: var(--p400); background: rgba(109,40,217,.2); color: #c4b5fd; }
.chip:hover:not(.active) { border-color: var(--gray-400); color: var(--gray-700); }
.btn-apply {
  width: 100%; padding: 10px; background: linear-gradient(135deg, var(--p500), var(--p700)); color: #fff;
  font-weight: 700; font-size: .85rem; border-radius: 9px; margin-top: 4px; transition: opacity .15s;
}
.btn-apply:hover { opacity: .88; }
.btn-clear { width: 100%; padding: 8px; background: transparent; color: var(--gray-400); font-size: .8rem; margin-top: 6px; }
.btn-clear:hover { color: var(--gray-600); }

/* ── Panel de resultados ────────────────────────── */
.results-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.results-count { font-size: .9rem; color: var(--gray-500); }
.results-count strong { color: var(--gray-900); }
.sort-select {
  padding: 7px 12px; border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-size: .82rem; color: var(--gray-700); outline: none; background: var(--white);
}
.sort-select option { background: var(--white); }
.view-toggle { display: flex; gap: 4px; }
.view-btn {
  width: 34px; height: 34px; border-radius: 8px; background: var(--gray-100);
  color: var(--gray-500); font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: all .15s; border: 1px solid var(--gray-200);
}
.view-btn.active { background: var(--p500); color: #fff; border-color: var(--p500); }

/* ── Grid de propiedades ────────────────────────── */
.listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.listings-list { display: flex; flex-direction: column; gap: 14px; }

/* ── Tarjeta de propiedad ───────────────────────── */
.prop-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--gray-200); overflow: hidden;
  transition: box-shadow .2s, transform .15s, border-color .2s; cursor: pointer;
}
.prop-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: rgba(109,40,217,.4); }
.prop-img {
  position: relative; height: 190px; overflow: hidden;
  background: linear-gradient(135deg, #1a1035, #0d2a3a);
  display: flex; align-items: center; justify-content: center;
}
.prop-img img { width: 100%; height: 100%; object-fit: cover; }
.prop-img .prop-img-placeholder { font-size: 3.5rem; opacity: .5; }
.prop-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 10px; border-radius: 20px; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge-renta { background: #0f766e; color: #fff; }
.badge-venta { background: #5b21b6; color: #fff; }
.prop-fav {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%; background: rgba(15,25,40,.75);
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
  transition: background .15s; border: 1px solid rgba(255,255,255,.1);
}
.prop-fav:hover { background: rgba(15,25,40,.95); }
.prop-body { padding: 14px 16px; }
.prop-price { font-size: 1.2rem; font-weight: 900; color: #c4b5fd; margin-bottom: 4px; }
.prop-price span { font-size: .72rem; font-weight: 500; color: var(--gray-400); }
.prop-title { font-size: .88rem; font-weight: 600; color: var(--gray-900); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-location { font-size: .76rem; color: var(--gray-500); display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.prop-specs {
  display: flex; gap: 14px; font-size: .76rem; color: var(--gray-600);
  border-top: 1px solid var(--gray-200); padding-top: 10px;
}
.prop-spec { display: flex; align-items: center; gap: 4px; }

/* Tarjeta en modo lista */
.prop-card-list {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--gray-200); display: flex; gap: 0;
  transition: box-shadow .2s, border-color .2s; cursor: pointer; overflow: hidden;
}
.prop-card-list:hover { box-shadow: var(--shadow-md); border-color: rgba(109,40,217,.4); }
.prop-card-list .prop-img { width: 220px; height: 160px; flex-shrink: 0; border-radius: 0; }
.prop-card-list .prop-body { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.prop-card-list .prop-title { white-space: normal; }
.prop-card-list .prop-desc { font-size: .78rem; color: var(--gray-500); line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Paginación ─────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.page-btn {
  width: 38px; height: 38px; border-radius: 8px; border: 1.5px solid var(--gray-200);
  background: var(--white); color: var(--gray-600); font-size: .85rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.page-btn:hover:not(.active) { border-color: var(--p400); color: #c4b5fd; }
.page-btn.active { background: var(--p500); color: #fff; border-color: var(--p500); }
.page-btn.dots { border: none; background: transparent; cursor: default; }

/* ══ MAPA ════════════════════════════════════════ */
.map-layout {
  display: grid; grid-template-columns: 380px 1fr;
  height: calc(100vh - 64px); /* debajo del navbar */
  max-height: calc(100vh - 64px);
}
.map-list {
  overflow-y: auto; background: var(--gray-50);
  border-right: 1px solid var(--gray-200);
  display: flex; flex-direction: column; gap: 0;
}
.map-list-header {
  padding: 14px 16px; border-bottom: 1px solid var(--gray-200);
  background: var(--white); position: sticky; top: 0; z-index: 10;
  font-size: .82rem; color: var(--gray-500);
}
.map-list-header strong { color: var(--gray-900); }
.map-card {
  display: flex; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200); cursor: pointer;
  background: var(--white); transition: background .15s;
}
.map-card:hover, .map-card.active { background: var(--gray-100); }
.map-card.active { border-left: 3px solid var(--p500); }
.map-card-img {
  width: 88px; height: 72px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #1a1035, #0d2a3a);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; overflow: hidden;
}
.map-card-img img { width: 100%; height: 100%; object-fit: cover; }
.map-card-info { flex: 1; min-width: 0; }
.map-card-price { font-size: .95rem; font-weight: 800; color: #c4b5fd; }
.map-card-title { font-size: .8rem; font-weight: 600; color: var(--gray-900); margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-card-loc { font-size: .72rem; color: var(--gray-500); }
.map-card-specs { font-size: .7rem; color: var(--gray-600); margin-top: 4px; }

.map-container { position: relative; z-index: 1; }
#leafletMap { width: 100%; height: 100%; }

/* Marcadores de precio en el mapa */
.price-marker {
  background: #5b21b6; color: #fff;
  padding: 5px 10px; border-radius: 20px;
  font-size: .75rem; font-weight: 800;
  white-space: nowrap; border: 2px solid rgba(255,255,255,.25);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  cursor: pointer; transition: transform .1s, background .1s;
}
.price-marker:hover, .price-marker.active {
  background: #4c1d95; transform: scale(1.1);
  border-color: rgba(255,255,255,.6);
  z-index: 500 !important;
}
.price-marker.renta { background: #0f766e; }
.price-marker.renta:hover, .price-marker.renta.active { background: #0d5f58; }

/* Popup del mapa */
.leaflet-popup-content-wrapper {
  background: #161f2e !important; border: 1px solid #1e2b3c !important;
  border-radius: 12px !important; box-shadow: 0 8px 32px rgba(0,0,0,.5) !important;
  padding: 0 !important;
}
.leaflet-popup-content { margin: 0 !important; width: 220px !important; }
.leaflet-popup-tip { background: #161f2e !important; }
.leaflet-popup-close-button { color: #7a92ad !important; top: 8px !important; right: 10px !important; }
.map-popup { padding: 14px; }
.map-popup-img {
  width: 100%; height: 110px; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, #1a1035, #0d2a3a);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; margin-bottom: 10px;
}
.map-popup-img img { width: 100%; height: 100%; object-fit: cover; }
.map-popup-price { font-size: 1rem; font-weight: 900; color: #c4b5fd; margin-bottom: 3px; }
.map-popup-title { font-size: .8rem; font-weight: 600; color: #f0f4f8; margin-bottom: 3px; }
.map-popup-loc { font-size: .72rem; color: #7a92ad; margin-bottom: 10px; }
.map-popup-btn {
  display: block; width: 100%; padding: 8px; text-align: center;
  background: #5b21b6; color: #fff; font-size: .78rem; font-weight: 700;
  border-radius: 8px; border: none; cursor: pointer; transition: background .15s;
}
.map-popup-btn:hover { background: #4c1d95; }

/* ── Estado vacío ────────────────────────────────── */
.empty-state {
  grid-column: 1/-1; text-align: center; padding: 80px 24px;
}
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); margin-bottom: 8px; }
.empty-state p { font-size: .88rem; color: var(--gray-500); margin-bottom: 20px; line-height: 1.6; }
.empty-state a {
  display: inline-block; padding: 11px 24px;
  background: var(--p500); color: #fff; border-radius: 10px;
  font-size: .88rem; font-weight: 700;
}

/* ── Modal de detalle ───────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  display: none; align-items: center; justify-content: center;
  z-index: 500; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: 16px; border: 1px solid var(--gray-200);
  width: 100%; max-width: 820px; max-height: 90vh;
  overflow-y: auto; position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 16px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: var(--gray-600); border: 1px solid var(--gray-200);
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  z-index: 10; transition: background .15s;
}
.modal-close:hover { background: rgba(255,255,255,.15); color: var(--gray-900); }
.detail-gallery {
  height: 280px; background: linear-gradient(135deg, #1a1035, #0d2a3a);
  display: flex; align-items: center; justify-content: center; font-size: 5rem;
  border-radius: 16px 16px 0 0; overflow: hidden;
}
.detail-gallery img { width: 100%; height: 100%; object-fit: cover; }
.detail-body { padding: 24px; }
.detail-price { font-size: 1.6rem; font-weight: 900; color: #c4b5fd; margin-bottom: 4px; }
.detail-title { font-size: 1.1rem; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.detail-location { font-size: .85rem; color: var(--gray-500); margin-bottom: 20px; }
.detail-specs {
  display: flex; gap: 24px; flex-wrap: wrap;
  background: var(--gray-100); border-radius: 10px; border: 1px solid var(--gray-200);
  padding: 16px 20px; margin-bottom: 20px;
}
.detail-spec strong { display: block; font-size: 1.1rem; font-weight: 800; color: var(--gray-900); }
.detail-spec span { font-size: .72rem; color: var(--gray-500); }
.detail-desc { font-size: .88rem; color: var(--gray-600); line-height: 1.7; margin-bottom: 20px; }
.detail-features { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.feature-tag {
  padding: 5px 12px; background: rgba(109,40,217,.2); color: #c4b5fd;
  border: 1px solid rgba(109,40,217,.35); border-radius: 20px; font-size: .76rem; font-weight: 600;
}
.contact-card {
  background: var(--gray-100); border-radius: 12px; border: 1px solid var(--gray-200);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
}
.contact-card h4 { font-size: .9rem; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.btn-contact {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 10px; font-weight: 700; font-size: .88rem; transition: opacity .15s;
}
.btn-contact:hover { opacity: .85; }
.btn-wa { background: #1a9e52; color: #fff; }
.btn-email { background: var(--p500); color: #fff; }
.btn-tel { background: #1e3a5f; color: #94c7f7; border: 1px solid #2a5080; }

/* Galería slider */
.detail-gallery-slider { position: relative; height: 300px; overflow: hidden; border-radius: 16px 16px 0 0; background: #0d1a2a; }
.detail-gallery-slider img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; transition: background .15s;
}
.gallery-nav:hover { background: rgba(0,0,0,.8); }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.gallery-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; transition: background .15s; }
.gallery-dot.active { background: #fff; }
.gallery-count { position: absolute; top: 10px; right: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }

/* ── Toast ──────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: #0f1825; color: var(--gray-800); padding: 12px 20px;
  border-radius: 10px; font-size: .85rem; font-weight: 500;
  border: 1px solid var(--gray-200); box-shadow: var(--shadow-md);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Footer ─────────────────────────────────────── */
footer {
  background: #080c14; color: var(--gray-400);
  text-align: center; padding: 28px 24px; font-size: .8rem; margin-top: 48px;
  border-top: 1px solid var(--gray-200);
}
footer a { color: #a78bfa; }
footer a:hover { color: #c4b5fd; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; grid-template-rows: 300px 1fr; }
  .map-list { border-right: none; border-bottom: 1px solid var(--gray-200); max-height: 300px; }
}
@media (max-width: 640px) {
  .nav-search { display: none; }
  .hero { padding: 36px 16px 52px; }
  .search-box { flex-direction: column; padding: 12px; gap: 6px; }
  .search-divider { display: none; }
  .btn-search { width: 100%; }
  .main-layout { padding: 16px; }
  .filters-panel { position: static; }
  .listings-grid { grid-template-columns: 1fr; }
  .prop-card-list { flex-direction: column; }
  .prop-card-list .prop-img { width: 100%; height: 180px; }
}

/* ── Light mode (override del tema oscuro base) ─────── */
:root[data-theme="light"] {
  --p50:  #faf5ff; --p100: #ede9fe; --p200: #ddd6fe;
  --p400: #7c3aed; --p500: #6d28d9; --p600: #5b21b6; --p700: #4c1d95;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white:    #ffffff;
  --shadow: 0 2px 8px rgba(0,0,0,.08), 0 4px 20px rgba(0,0,0,.06);
  --shadow-md: 0 6px 32px rgba(0,0,0,.12);
}
[data-theme="light"] body { color: var(--gray-700); }
[data-theme="light"] .navbar { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
[data-theme="light"] .hero { background: linear-gradient(160deg,#4c1d95 0%,#7c3aed 50%,#0f766e 100%); }
[data-theme="light"] .search-box { background: #fff; border-color: #e2e8f0; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
[data-theme="light"] input, [data-theme="light"] select { color: #0f172a; }
[data-theme="light"] .prop-card { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
[data-theme="light"] .prop-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.12); }
[data-theme="light"] .prop-tag { background: rgba(124,58,237,.12); color: #6d28d9; }
[data-theme="light"] .prop-price { color: #0f172a; }
[data-theme="light"] .prop-title { color: #1e293b; }
[data-theme="light"] .prop-loc { color: #64748b; }
[data-theme="light"] .prop-feat span { color: #64748b; }
[data-theme="light"] .filter-select, [data-theme="light"] .filter-input { background: #fff; border-color: #e2e8f0; color: #1e293b; }
[data-theme="light"] .chip { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
[data-theme="light"] .chip.active { background: #7c3aed; color: #fff; border-color: #7c3aed; }
[data-theme="light"] .sort-select { background: #fff; border-color: #e2e8f0; color: #1e293b; }
[data-theme="light"] .view-btn { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
[data-theme="light"] .view-btn.active { background: #7c3aed; color: #fff; }
[data-theme="light"] footer { background: #1e293b; }
[data-theme="light"] .modal-box { background: #fff; }
[data-theme="light"] .detail-modal-box { color: #1e293b; }

/* ── Theme toggle button ─────────────────────────────── */
.btn-portal-theme {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--gray-100); border: 1.5px solid var(--gray-200);
  color: var(--gray-600); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all .2s;
}
.btn-portal-theme:hover { border-color: var(--p400); color: var(--p400); }

/* ── Lightbox ─────────────────────────────────────── */
.lb-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.95);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.lb-overlay.open { display: flex; }

.lb-img-wrap {
  max-width: calc(100vw - 120px);
  max-height: calc(100vh - 80px);
  display: flex; align-items: center; justify-content: center;
}
.lb-img-wrap img {
  max-width: 100%; max-height: calc(100vh - 80px);
  object-fit: contain; border-radius: 8px;
  user-select: none; -webkit-user-drag: none;
}

.lb-close {
  position: fixed; top: 16px; right: 20px;
  background: rgba(255,255,255,.12); border: none; color: #fff;
  font-size: 1.4rem; width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s; z-index: 10;
}
.lb-close:hover { background: rgba(255,255,255,.25); }

.lb-nav {
  flex-shrink: 0; background: rgba(255,255,255,.1); border: none; color: #fff;
  font-size: 2.5rem; width: 52px; height: 52px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s; margin: 0 8px;
}
.lb-nav:hover { background: rgba(255,255,255,.25); }

.lb-counter {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,.12); color: #fff;
  font-size: .8rem; font-weight: 600; padding: 5px 14px;
  border-radius: 20px; pointer-events: none;
}
