/* ═══════════════════════════════════════════════════════════════
   UMBRAL — Sistema de diseño Lab 1
   Tono: editorial · arquitectura · datos
   Fuente: Space Grotesk — una sola familia, dos pesos
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --black:     #0a0a0a;
  --white:     #ffffff;
  --gray-100:  #f8f8f8;
  --gray-200:  #f0f0f0;
  --gray-300:  #e8e8e8;
  --gray-400:  #d0d0d0;
  --gray-500:  #aaaaaa;
  --gray-600:  #888888;
  --gray-700:  #555555;

  --border-strong: 1.5px solid #0a0a0a;
  --border-soft:   1px solid #e8e8e8;
  --border-muted:  1px solid #f0f0f0;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;

  --font: 'Space Grotesk', system-ui, sans-serif;
  --nav-h: 54px;
  --sidebar-w: 300px;
  --trans: all 0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ─────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--white);
  border-bottom: var(--border-strong);
  display: flex; align-items: center;
  z-index: 9000; padding: 0 20px; gap: 16px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--black);
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  white-space: nowrap; flex-shrink: 0;
  padding-right: 16px; border-right: var(--border-soft); height: 100%;
}
.nav-modules {
  display: flex; align-items: center; height: 100%;
  flex: 1; gap: 4px; overflow-x: auto;
  scrollbar-width: none; padding: 0 4px;
}
.nav-modules::-webkit-scrollbar { display: none; }
.nav-mod {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; text-decoration: none;
  color: var(--gray-600); font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: var(--trans); white-space: nowrap; height: 34px;
}
.nav-mod:hover { color: var(--black); background: var(--gray-200); }
.nav-mod.active { color: var(--black); background: var(--gray-200); }
.nav-mod.disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
.nav-back {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; background: var(--black); color: var(--white);
  font-family: var(--font); font-size: 12px; font-weight: 500;
  letter-spacing: 0.01em; border-radius: var(--radius-md);
  border: none; cursor: pointer; text-decoration: none;
  white-space: nowrap; flex-shrink: 0; margin-left: auto;
  transition: var(--trans);
}
.nav-back:hover { opacity: 0.85; }

/* ── Layout ──────────────────────────────────────────────────── */
.main { padding-top: var(--nav-h); }

/* ── Tipografía ──────────────────────────────────────────────── */
.t-eyebrow { font-size: 10px; font-weight: 600; color: var(--gray-500); letter-spacing: 0.08em; text-transform: uppercase; }
.t-hero    { font-size: clamp(36px,5vw,56px); font-weight: 700; line-height: 0.95; letter-spacing: -0.03em; }
.t-sub     { font-size: clamp(16px,2.5vw,22px); font-weight: 300; letter-spacing: -0.01em; line-height: 1.2; }
.t-body    { font-size: 13px; font-weight: 400; color: var(--gray-700); line-height: 1.7; }
.t-label   { font-size: 10px; font-weight: 600; color: var(--gray-500); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 5px; }

/* ── Datos ───────────────────────────────────────────────────── */
.data-num    { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; border-bottom: 1.5px solid var(--gray-300); display: inline-block; padding-bottom: 3px; }
.data-num-lg { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; border-bottom: 1.5px solid var(--gray-300); display: inline-block; padding-bottom: 3px; }
.data-row  { display: grid; border-top: var(--border-strong); }
.data-cell { padding: 18px 20px 18px 0; border-right: var(--border-muted); }
.data-cell:last-child { border-right: none; }
.data-cell:not(:first-child) { padding-left: 20px; }

/* ── Botones ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; font-family: var(--font); font-size: 11px;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  border-radius: var(--radius-md); cursor: pointer;
  border: var(--border-strong); background: var(--white); color: var(--black);
  text-decoration: none; white-space: nowrap; transition: var(--trans);
}
.btn:hover { background: var(--gray-100); }
.btn-fill {
  background: var(--black); color: var(--white); border: none;
  border-radius: var(--radius-md); padding: 8px 16px;
  font-family: var(--font); font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; transition: var(--trans);
}
.btn-fill:hover { opacity: 0.85; }
.btn-ghost {
  border: var(--border-soft); color: var(--gray-600); background: var(--white);
  border-radius: var(--radius-md); padding: 8px 14px;
  font-family: var(--font); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: var(--trans);
}
.btn-ghost:hover { border-color: var(--gray-500); color: var(--black); }
.btn-reset {
  width: 100%; justify-content: center;
  background: var(--gray-100); border: var(--border-soft); color: var(--gray-700);
  border-radius: var(--radius-md); padding: 8px 16px;
  font-family: var(--font); font-size: 11px; font-weight: 600;
  letter-spacing: 0.03em; cursor: pointer;
  display: flex; align-items: center; gap: 6px; transition: var(--trans);
}
.btn-reset:hover { background: var(--gray-200); color: var(--black); }

/* ── Tags ────────────────────────────────────────────────────── */
.tag { display: inline-block; padding: 4px 10px; font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; border-radius: var(--radius-sm); }
.tag-fill   { background: var(--black); color: var(--white); }
.tag-border { border: 1.5px solid var(--black); color: var(--black); }
.tag-soft   { background: var(--gray-200); color: var(--gray-700); }
.tag-muted  { background: var(--gray-100); color: var(--gray-500); border: var(--border-soft); }

/* ── Inputs ──────────────────────────────────────────────────── */
input[type="text"], input[type="number"], select {
  background: var(--white); border: var(--border-soft); color: var(--black);
  font-family: var(--font); font-size: 12px; font-weight: 500;
  border-radius: var(--radius-sm); padding: 7px 10px;
  outline: none; transition: var(--trans); width: 100%;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus { border-color: var(--black); }

/* ── Chips de filtro ─────────────────────────────────────────── */
.chip {
  display: inline-block; padding: 5px 10px;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm);
  font-size: 10px; font-weight: 600; letter-spacing: 0.03em;
  color: var(--gray-600); cursor: pointer; transition: var(--trans); user-select: none;
}
.chip:hover { border-color: var(--gray-500); color: var(--black); }
.chip.active { border-color: var(--black); color: var(--black); background: var(--gray-100); }

/* ── Botones de capa ─────────────────────────────────────────── */
.layer-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  font-family: var(--font); font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius-md);
  background: var(--white); color: var(--gray-500); cursor: pointer; transition: var(--trans);
}
.layer-btn:hover { border-color: var(--gray-500); color: var(--black); }
.layer-btn.active { border-color: var(--black); color: var(--black); background: var(--gray-100); }
.layer-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── Panel ───────────────────────────────────────────────────── */
.panel { background: var(--white); border-right: var(--border-soft); display: flex; flex-direction: column; overflow: hidden; }
.panel-header { padding: 18px 16px 14px; border-bottom: var(--border-soft); flex-shrink: 0; }
.panel-section { padding: 14px 16px; border-bottom: var(--border-soft); flex-shrink: 0; }
.panel-section-title { font-size: 10px; font-weight: 600; color: var(--gray-500); letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 10px; }
.panel-body { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--gray-300) transparent; }
.panel-body::-webkit-scrollbar { width: 3px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }

/* ── Lista proyectos ─────────────────────────────────────────── */
.proyecto-item { padding: 12px 16px; border-bottom: var(--border-muted); cursor: pointer; transition: background 0.12s; }
.proyecto-item:hover { background: var(--gray-100); }
.proyecto-item.selected { background: var(--gray-100); border-left: 2px solid var(--black); }
.proyecto-nombre { font-size: 12px; font-weight: 600; color: var(--black); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; }
.proyecto-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proyecto-precio { font-size: 12px; font-weight: 700; color: var(--black); letter-spacing: -0.01em; }
.proyecto-zona { font-size: 10px; font-weight: 600; color: var(--gray-500); letter-spacing: 0.04em; text-transform: uppercase; }

/* ── Popup mapa ──────────────────────────────────────────────── */
.maplibregl-popup-content { background: var(--white) !important; border: var(--border-strong) !important; border-radius: var(--radius-lg) !important; padding: 0 !important; box-shadow: 0 8px 32px rgba(0,0,0,0.1) !important; min-width: 240px; max-width: 300px; }
.maplibregl-popup-tip { display: none !important; }
.maplibregl-popup-close-button { color: var(--gray-500) !important; font-size: 18px !important; right: 12px !important; top: 10px !important; background: none !important; border: none !important; }
.maplibregl-popup-close-button:hover { color: var(--black) !important; }
.popup-inner { padding: 16px 18px; }
.popup-eyebrow { font-size: 10px; font-weight: 600; color: var(--gray-500); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.popup-title { font-size: 15px; font-weight: 700; color: var(--black); margin-bottom: 12px; line-height: 1.25; padding-right: 20px; }
.popup-price { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 2px; }
.popup-price-sub { font-size: 11px; font-weight: 500; color: var(--gray-500); margin-bottom: 12px; }
.popup-divider { border: none; border-top: var(--border-soft); margin: 12px 0; }
.popup-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 11px; }
.popup-row-lbl { color: var(--gray-500); font-weight: 500; }
.popup-row-val { color: var(--black); font-weight: 600; }
.popup-modelos { margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.popup-modelo { background: var(--gray-100); border: var(--border-soft); border-radius: var(--radius-sm); padding: 5px 10px; display: flex; justify-content: space-between; font-size: 11px; }
.popup-modelo-lbl { color: var(--gray-600); font-weight: 500; }
.popup-modelo-val { color: var(--black); font-weight: 700; }
.popup-link { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; background: var(--gray-100); border-top: var(--border-soft); color: var(--black); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); transition: var(--trans); }
.popup-link:hover { background: var(--black); color: var(--white); }

/* ── Controles del mapa ──────────────────────────────────────── */
.maplibregl-ctrl-group { background: var(--white) !important; border: var(--border-strong) !important; border-radius: var(--radius-md) !important; box-shadow: none !important; }
.maplibregl-ctrl-group button { background: var(--white) !important; color: var(--black) !important; }
.maplibregl-ctrl-group button:hover { background: var(--gray-100) !important; }
.maplibregl-ctrl-attrib { display: none !important; }

/* ── Loading ─────────────────────────────────────────────────── */
.loading-overlay { position: absolute; inset: 0; background: var(--white); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; z-index: 100; }
.loading-text { font-size: 11px; font-weight: 600; color: var(--gray-500); letter-spacing: 0.06em; text-transform: uppercase; }
.loading-bar { width: 120px; height: 2px; background: var(--gray-200); border-radius: 1px; overflow: hidden; }
.loading-bar-fill { height: 100%; background: var(--black); border-radius: 1px; animation: loading 1.2s ease-in-out infinite; }
@keyframes loading { 0% { width:0; margin-left:0; } 50% { width:60%; margin-left:20%; } 100% { width:0; margin-left:100%; } }

/* ── Legend ──────────────────────────────────────────────────── */
.map-legend { position: absolute; bottom: 24px; left: 16px; background: var(--white); border: var(--border-strong); border-radius: var(--radius-lg); padding: 12px 14px; z-index: 10; }
.legend-title { font-size: 10px; font-weight: 700; color: var(--gray-500); letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 8px; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-size: 11px; font-weight: 600; color: var(--gray-700); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ── Footer ──────────────────────────────────────────────────── */
.footer { background: var(--black); padding: 36px 32px 28px; }
.footer-headline { font-size: clamp(22px,3vw,32px); font-weight: 700; color: var(--white); letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 6px; }
.footer-sub { font-size: 13px; color: #555; font-style: italic; margin-bottom: 28px; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; border-top: 1px solid #1e1e1e; flex-wrap: wrap; gap: 12px; }
.footer-meta { font-size: 11px; color: #555; font-weight: 500; }
.footer-link { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--white); color: var(--black); font-size: 12px; font-weight: 500; border-radius: var(--radius-md); text-decoration: none; transition: var(--trans); }
.footer-link:hover { opacity: 0.85; }

/* ── Home grid ───────────────────────────────────────────────── */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mod-card { border: 1.5px solid var(--gray-300); border-radius: var(--radius-lg); padding: 22px; text-decoration: none; display: flex; flex-direction: column; transition: border-color 0.15s; cursor: pointer; }
.mod-card:hover { border-color: var(--black); }
.mod-card.live  { border-color: var(--black); }
.mod-card.disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.mod-icon-wrap { width: 36px; height: 36px; border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 15px; margin-bottom: 14px; }
.mod-card.live .mod-icon-wrap { border-color: var(--black); }
.mod-name { font-size: 14px; font-weight: 700; color: var(--black); margin-bottom: 6px; }
.mod-desc { font-size: 12px; color: var(--gray-600); line-height: 1.6; flex: 1; margin-bottom: 14px; }
.mod-status { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gray-400); display: flex; align-items: center; gap: 6px; }
.mod-status.live { color: var(--black); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--black); flex-shrink: 0; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 680px) {
  :root { --sidebar-w: 100%; }
  .nav-modules { display: none; }
  .home-grid { grid-template-columns: 1fr; }
}

/* ── Utils ───────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }
.fade-in { animation: fadeIn 0.2s ease; }
