:root {
  --fondo: #f6f5f3;
  --papel: #ffffff;
  --tinta: #26282b;
  --tinta-suave: #5d6166;
  --gris: #8a8d91;
  --linea: #e1dfdb;
  --acento: #3f4a52;
  --disponible: #2f6b4f;
  --disponible-fondo: #e4f1ea;
  --arrendado: #6b6e72;
  --arrendado-fondo: #ebebe9;
  --radio: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--tinta);
  background: var(--fondo);
  line-height: 1.55;
}

a { color: inherit; }

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px;
  background: rgba(246, 245, 243, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--linea);
}
.marca { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; font-size: 1rem; font-family: "Courier New", Courier, monospace; }
.marca img { height: 34px; width: auto; display: block; }
.top nav { display: flex; gap: 20px; }
.top nav a { text-decoration: none; color: var(--tinta-suave); font-size: 0.95rem; }
.top nav a:hover { color: var(--tinta); }

.portada {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center;
  max-width: 1100px; margin: 0 auto; padding: 56px 24px;
}
.sobretitulo { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; color: var(--gris); margin: 0 0 12px; }
.portada h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.15; margin: 0 0 16px; font-weight: 600; }
.bajada { color: var(--tinta-suave); font-size: 1.05rem; margin: 0 0 24px; max-width: 46ch; }
.portada-foto {
  aspect-ratio: 4 / 3; border-radius: var(--radio);
  background: #d9d8d5 center / cover no-repeat;
}

.boton {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  background: var(--acento); color: #fff; text-decoration: none; font-size: 0.95rem;
}
.boton:hover { background: #2d363c; }
.boton.claro { background: var(--papel); color: var(--tinta); border: 1px solid var(--linea); }
.boton.claro:hover { background: #efeeec; }

.seccion { max-width: 1100px; margin: 0 auto; padding: 48px 24px; }
.seccion-suave { max-width: none; background: #ecebe8; padding-left: max(24px, calc((100% - 1052px) / 2)); padding-right: max(24px, calc((100% - 1052px) / 2)); }
.seccion h2 { font-size: 1.6rem; margin: 0 0 8px; font-weight: 600; }

.seccion-cabecera { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.filtros { display: flex; gap: 8px; }
.filtro {
  font: inherit; font-size: 0.88rem; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--linea); background: var(--papel); color: var(--tinta-suave);
}
.filtro.activo { background: var(--acento); border-color: var(--acento); color: #fff; }

.resumen { color: var(--tinta-suave); margin: 0 0 24px; }

.grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.tarjeta { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; display: flex; flex-direction: column; }
.foto {
  position: relative; aspect-ratio: 4 / 3; background: #dcdad6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #a5a3a0;
}
.sinfoto-num { font-size: 2.4rem; font-weight: 600; line-height: 1; }
.sinfoto { font-size: 0.82rem; letter-spacing: 0.04em; }
.foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.etiqueta {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.etiqueta.disponible { background: var(--disponible-fondo); color: var(--disponible); }
.etiqueta.arrendado { background: var(--arrendado-fondo); color: var(--arrendado); }
.cuerpo { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cuerpo h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.metros { color: var(--gris); font-size: 0.9rem; }
.cuerpo p { margin: 0; color: var(--tinta-suave); font-size: 0.93rem; }
.precio { margin-top: auto !important; padding-top: 8px; color: var(--tinta) !important; font-weight: 600; }
.tarjeta.arrendado .foto img { filter: grayscale(0.6); }
.tarjeta.arrendado .precio { color: var(--gris) !important; }
.consultar { display: inline-block; margin-top: 8px; font-size: 0.9rem; color: var(--acento); }

.nota, .cargando { color: var(--gris); font-size: 0.88rem; }
.nota { margin-top: 20px; }

.actividades-caja { background: var(--papel); border: 1px dashed #c9c7c3; border-radius: var(--radio); padding: 24px; }
.actividades-caja iframe { width: 100%; height: 600px; border: 0; }

.contacto-botones { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.direccion { color: var(--tinta-suave); }

footer { text-align: center; padding: 32px 24px; color: var(--gris); font-size: 0.88rem; border-top: 1px solid var(--linea); }

@media (max-width: 720px) {
  .portada { grid-template-columns: 1fr; padding-top: 32px; }
  .top { padding: 12px 16px; }
  .top nav { gap: 14px; }
}

/* ---------- Página Archivo ---------- */
.top nav a[aria-current="page"] { color: var(--tinta); font-weight: 600; }
.titulo-pagina { font-size: clamp(1.7rem, 3.5vw, 2.4rem); line-height: 1.15; margin: 0 0 12px; font-weight: 600; }
#archivo { margin-top: 32px; }
.anio { margin-bottom: 48px; }
.anio-titulo { font-size: 1.5rem; font-weight: 600; margin: 0 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--linea); }
.eventos-grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.evento { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; display: flex; flex-direction: column; }
.evento.con-fotos { cursor: pointer; }
.evento.con-fotos:hover, .evento.con-fotos:focus-visible { border-color: var(--gris); outline: none; }
.evento-foto { position: relative; aspect-ratio: 4 / 3; background: #dcdad6; overflow: hidden; }
.evento-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.evento-cuenta { position: absolute; right: 10px; bottom: 10px; font-size: 0.78rem; padding: 4px 10px; border-radius: 999px; background: rgba(38, 40, 43, 0.78); color: #fff; }
.evento-cuerpo { padding: 14px 16px 16px; }
.evento-cuerpo h3 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 600; }
.evento-cuerpo p { margin: 0; color: var(--tinta-suave); font-size: 0.93rem; }

#visor { border: 0; padding: 0; background: rgba(20, 21, 23, 0.94); color: #fff; width: 100vw; height: 100vh; max-width: none; max-height: none; }
#visor[open] { display: flex; align-items: center; justify-content: center; }
#visor::backdrop { background: rgba(20, 21, 23, 0.94); }
#visor figure { margin: 0; max-width: min(92vw, 1200px); text-align: center; }
#visor img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 6px; }
#visor figcaption { margin-top: 12px; font-size: 0.92rem; color: #d4d4d1; }
.visor-cerrar, .visor-flecha { position: absolute; background: none; border: 0; color: #fff; cursor: pointer; font-family: inherit; line-height: 1; }
.visor-cerrar { top: 14px; right: 20px; font-size: 2.4rem; }
.visor-flecha { top: 50%; transform: translateY(-50%); font-size: 3.2rem; padding: 12px 16px; }
.visor-flecha.ant { left: 8px; }
.visor-flecha.sig { right: 8px; }
.visor-flecha[hidden] { display: none; }

/* ---------- Plano interactivo ---------- */
.plano-leyenda { display: flex; gap: 18px; font-size: 0.88rem; color: var(--tinta-suave); margin: 0 0 14px; }
.plano-leyenda .punto { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.punto.disp { background: rgba(47, 107, 79, 0.55); border: 1px solid var(--disponible); }
.punto.arr { background: rgba(107, 110, 114, 0.25); border: 1px solid var(--arrendado); }
.plano-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.plano-caja { min-width: 720px; max-width: 900px; margin: 0 auto; background: #f1ece9; border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; }
.plano-caja svg { display: block; width: 100%; height: auto; }
.zona { cursor: pointer; transition: fill-opacity 0.15s; stroke-width: 3; outline: none; }
.zona.disponible { fill: #2f6b4f; fill-opacity: 0.32; stroke: #2f6b4f; }
.zona.arrendado { fill: #6b6e72; fill-opacity: 0.14; stroke: #6b6e72; stroke-opacity: 0.55; }
.zona:hover, .zona:focus-visible { fill-opacity: 0.5; }
.zona.arrendado:hover, .zona.arrendado:focus-visible { fill-opacity: 0.34; }

#ficha { border: 0; padding: 0; border-radius: var(--radio); width: min(92vw, 380px); background: transparent; overflow: visible; }
#ficha::backdrop { background: rgba(20, 21, 23, 0.6); }
#ficha .tarjeta { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); }
.ficha-cerrar { position: absolute; top: 8px; right: 8px; z-index: 2; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: var(--tinta); font-size: 1.5rem; line-height: 1; cursor: pointer; }
