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

html, body {
  width: 100%; height: 100%;
  font-family: 'DM Sans', Arial, sans-serif;
  background: #050505;
  overflow: hidden;
}

/* ─────────────────────────────
   INTRO OVERLAY
───────────────────────────── */
.intro-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(0,200,150,0.08), transparent 40%),
    rgba(0,0,0,0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: opacity 1s ease, visibility 1s ease;
}
.intro-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.intro-box {
  position: relative; width: 100%; max-width: 900px;
  padding: 70px;
  border-radius: 38px; overflow: hidden;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(30px);
  box-shadow: 0 20px 70px rgba(0,0,0,0.45);
  animation: glassReveal 1.2s cubic-bezier(.19,1,.22,1) forwards;
}
.intro-box::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent 40%);
  pointer-events: none;
}
.intro-box::after {
  content: ''; position: absolute;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,150,0.12), transparent 70%);
  top: -250px; right: -180px; pointer-events: none;
}
.intro-box > * { position: relative; z-index: 2; }

.intro-tag {
  font-size: 0.72rem; letter-spacing: 5px; text-transform: uppercase;
  color: #00c896; margin-bottom: 26px;
  opacity: 0; transform: translateY(20px);
  animation: fadeUp 1s ease forwards; animation-delay: .2s;
}
.intro-box h1 {
  font-size: clamp(3rem, 6vw, 5.5rem); font-weight: 300;
  line-height: 1.05; color: white; margin-bottom: 28px;
  opacity: 0; transform: translateY(30px);
  animation: fadeUp 1s ease forwards; animation-delay: .35s;
}
.intro-box p {
  color: rgba(255,255,255,0.72); line-height: 1.9;
  font-size: 1rem; max-width: 720px; margin-bottom: 52px;
  opacity: 0; transform: translateY(30px);
  animation: fadeUp 1s ease forwards; animation-delay: .5s;
}
.intro-benefits { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 52px; }
.intro-benefit {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px; border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  opacity: 0; transform: translateY(25px);
  animation: fadeUp 1s ease forwards;
}
.intro-benefit:nth-child(1) { animation-delay: .65s; }
.intro-benefit:nth-child(2) { animation-delay: .80s; }
.intro-benefit:nth-child(3) { animation-delay: .95s; }
.intro-benefit span { color: #00c896; font-size: 1.15rem; }
.intro-benefit strong { color: white; font-weight: 400; }

.intro-btn {
  padding: 18px 36px; border: none; border-radius: 18px;
  background: #00c896; color: white;
  font-size: 0.78rem; letter-spacing: 2px; text-transform: uppercase;
  cursor: pointer;
  transition: transform .35s ease, filter .35s ease, box-shadow .35s ease;
  opacity: 0; transform: translateY(30px);
  animation: fadeUp 1s ease forwards; animation-delay: 1.1s;
}
.intro-btn:hover { transform: translateY(-4px); filter: brightness(1.08); box-shadow: 0 10px 30px rgba(0,200,150,0.35); }

/* ─────────────────────────────
   LAYOUT VISOR
───────────────────────────── */
.visor-layout {
  display: flex;
  width: 100vw; height: 100vh;
  position: relative;
}

/* ─────────────────────────────
   SIDEBAR
───────────────────────────── */
.sidebar {
  width: 320px;
  min-width: 320px;
  height: 100vh;
  overflow-y: auto;
  background: rgba(10,10,10,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255,255,255,0.07);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: transform 0.4s cubic-bezier(.19,1,.22,1), width 0.4s;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,200,150,0.3) transparent;
}
.sidebar.closed {
  transform: translateX(-100%);
  min-width: 0; width: 0;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0,200,150,0.3); border-radius: 4px; }

/* HEADER */
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky; top: 0; z-index: 10;
  background: rgba(10,10,10,0.98);
}
.sidebar-logo {
  font-size: 1rem; font-weight: 600; letter-spacing: 5px;
  color: white;
}
.sidebar-logo span { color: #00c896; }

.sidebar-toggle {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; color: rgba(255,255,255,0.6);
  font-size: 1.4rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}
.sidebar-toggle:hover { background: rgba(0,200,150,0.15); color: #00c896; }

/* BOTÓN ABRIR SIDEBAR */
.sidebar-open-btn {
  position: absolute; top: 50%; left: 0;
  transform: translateY(-50%);
  z-index: 501;
  width: 28px; height: 56px;
  background: rgba(10,10,10,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: none;
  border-radius: 0 10px 10px 0;
  color: rgba(255,255,255,0.6);
  font-size: 1.2rem; cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.sidebar-open-btn:hover { background: rgba(0,200,150,0.2); color: #00c896; }
.sidebar-open-btn.visible { display: flex; }

/* SECCIONES */
.sidebar-section {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-label {
  font-size: 0.62rem; letter-spacing: 4px;
  text-transform: uppercase; color: rgba(255,255,255,0.35);
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.contador {
  background: rgba(0,200,150,0.15);
  color: #00c896; border-radius: 20px;
  padding: 2px 10px; font-size: 0.7rem; letter-spacing: 1px;
}

/* ─── FILTROS ─── */
.filter-group { margin-bottom: 20px; }
.filter-group:last-of-type { margin-bottom: 0; }

.filter-title {
  font-size: 0.75rem; color: rgba(255,255,255,0.55);
  margin-bottom: 10px; letter-spacing: 1px;
}

/* CHIPS TIPO */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.55);
  font-size: 0.72rem; letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover { border-color: rgba(0,200,150,0.4); color: #00c896; }
.chip--active {
  background: rgba(0,200,150,0.15);
  border-color: #00c896; color: #00c896;
}

/* TOGGLE DESTACADOS */
.filter-toggle {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.filter-toggle input { display: none; }
.toggle-track {
  width: 40px; height: 22px;
  background: rgba(255,255,255,0.1);
  border-radius: 11px; position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}
.filter-toggle input:checked + .toggle-track { background: #00c896; }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: white; border-radius: 50%;
  transition: transform 0.3s;
}
.filter-toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }
.toggle-label { font-size: 0.78rem; color: rgba(255,255,255,0.65); }

/* RANGE SLIDER */
.range-slider {
  width: 100%; margin: 8px 0 6px;
  -webkit-appearance: none; appearance: none;
  height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.1);
  outline: none; cursor: pointer;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #00c896;
  box-shadow: 0 0 8px rgba(0,200,150,0.5);
  cursor: pointer;
}
.range-value {
  font-size: 0.72rem; color: rgba(255,255,255,0.45);
}
.range-value span { color: #00c896; font-weight: 500; }

/* BOTÓN LIMPIAR */
.btn-limpiar {
  width: 100%; margin-top: 20px;
  padding: 10px; border-radius: 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-limpiar:hover { border-color: rgba(255,80,80,0.4); color: rgba(255,100,100,0.8); }

/* ─── LISTA PROPIEDADES ─── */
.props-list { display: flex; flex-direction: column; gap: 10px; }

.prop-card {
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  overflow: hidden; cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.prop-card:hover {
  border-color: rgba(0,200,150,0.35);
  background: rgba(0,200,150,0.05);
  transform: translateY(-2px);
}
.prop-card.destacado { border-color: rgba(0,200,150,0.25); }

.prop-card-img {
  width: 100%; height: 110px;
  object-fit: cover; display: block;
  background: rgba(255,255,255,0.05);
}
.prop-card-body { padding: 12px 14px; }
.prop-card-tipo {
  font-size: 0.6rem; letter-spacing: 3px; text-transform: uppercase;
  color: #00c896; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: space-between;
}
.badge-dest {
  background: rgba(0,200,150,0.15);
  padding: 2px 8px; border-radius: 10px;
  font-size: 0.58rem; letter-spacing: 2px;
}
.prop-card-titulo {
  font-size: 0.83rem; color: white; line-height: 1.3;
  margin-bottom: 8px; font-weight: 400;
}
.prop-card-precio {
  font-size: 0.9rem; font-weight: 600; color: white;
  margin-bottom: 6px;
}
.prop-card-meta {
  display: flex; gap: 10px;
  font-size: 0.7rem; color: rgba(255,255,255,0.45);
}

/* ─── MAPA ─── */
#map {
  flex: 1;
  height: 100vh;
}

/* ─── POPUP ─── */
.leaflet-popup-content-wrapper {
  background: rgba(15,15,15,0.96);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px; overflow: hidden; padding: 0;
  box-shadow: 0 10px 40px rgba(0,0,0,0.45);
}
.leaflet-popup-content { margin: 0; width: 320px !important; }
.leaflet-popup-tip { background: rgba(15,15,15,0.96); }

.popup-card { color: white; overflow: hidden; }
.popup-img { width: 100%; height: 180px; object-fit: cover; display: block; }
.popup-content { padding: 18px; }
.popup-type { font-size: 0.68rem; letter-spacing: 2px; text-transform: uppercase; color: #00c896; margin-bottom: 10px; }
.popup-content h3 { font-size: 1.1rem; line-height: 1.3; margin-bottom: 12px; }
.popup-price { font-size: 1.2rem; font-weight: 600; color: white; margin-bottom: 14px; }
.popup-desc { font-size: 0.82rem; line-height: 1.6; color: rgba(255,255,255,0.72); margin-bottom: 16px; }
.popup-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.popup-meta span { font-size: 0.74rem; color: rgba(255,255,255,0.82); }
.popup-btn {
  width: 100%; height: 44px; border: none; border-radius: 12px;
  background: #00c896; color: white;
  font-size: 0.72rem; letter-spacing: 2px; text-transform: uppercase;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: transform 0.3s ease, background 0.3s ease;
}
.popup-btn:hover { background: #00ddb0; transform: translateY(-2px); }

/* ─── PRICE MARKERS ─── */
.price-marker {
  position: relative;
  background: rgba(15,15,15,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  color: white; padding: 10px 14px; border-radius: 14px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 1px;
  backdrop-filter: blur(14px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.35), 0 0 18px rgba(0,200,150,0.22);
  white-space: nowrap;
  animation: markerFloat 3s ease-in-out infinite;
}
.price-marker::after {
  content: ''; position: absolute;
  left: 50%; bottom: -10px;
  width: 10px; height: 10px; border-radius: 50%;
  transform: translateX(-50%);
  background: #00ffbb;
  box-shadow: 0 0 12px rgba(0,255,187,0.85), 0 0 24px rgba(0,255,187,0.45);
}

/* ─── ANIMATIONS ─── */
@keyframes glassReveal {
  from { opacity: 0; transform: translateY(50px) scale(.96); filter: blur(14px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes markerFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .intro-box { padding: 42px 26px; }
  .intro-benefits { flex-direction: column; }
  .sidebar { position: absolute; left: 0; top: 0; z-index: 600; }
}

/* ─────────────────────────────
   MOBILE FIX
───────────────────────────── */

@media (max-width: 768px) {

  .intro-overlay {

    align-items: flex-start;

    overflow-y: auto;

    padding: 24px 18px;

  }

  .intro-box {

    margin-top: 40px;

    padding: 34px 24px;

    border-radius: 28px;

  }

  .intro-box h1 {

    font-size: 2.2rem;

    line-height: 1.1;

    margin-bottom: 20px;

  }

  .intro-box p {

    font-size: 0.92rem;

    line-height: 1.7;

    margin-bottom: 30px;

  }

  .intro-benefits {

    flex-direction: column;

    gap: 12px;

    margin-bottom: 28px;

  }

  .intro-benefit {

    width: 100%;

    padding: 14px 16px;

  }

  .intro-btn {

    width: 100%;

    padding: 18px 20px;

    font-size: 0.72rem;

  }

}