html {
  --noche: #0f2140;
  --noche-2: #1a3160;
  --sol: #f6b91b;
  --rojo: #d6303f;
  --verde: #1f8a5f;
  --azul: #1e6fb8;
  --morado: #7b3fa0;

  --fondo: #f3f6fb;
  --papel: #ffffff;
  --texto: #17233a;
  --texto-suave: #4a566c;
  --linea: #d9e0ec;

  --fuente-titulo: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --fuente-texto: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ancho: 1180px;
  --radio: 18px;
  --sombra: 0 10px 30px rgba(15, 33, 64, 0.14);
  scroll-behavior: smooth; -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--fuente-texto);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--texto);
  background: var(--fondo);
}

/* Colores de cada barrio */
.rebolo {
  --color: var(--verde);
}

.san-roque {
  --color: var(--azul);
}

.centro-historico {
  --color: var(--rojo);
}

.barrio-abajo {
  --color: var(--sol);
}

.el-prado {
  --color: var(--morado);
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--fuente-titulo);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  color: var(--noche);
}
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--azul); text-underline-offset: 3px; }

:focus-visible {
  outline: 3px solid var(--sol);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--noche);
  border-radius: 6px;
}
main:focus, h1:focus { outline: none; box-shadow: none; }

.visualmente-oculto {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.salto {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--sol); color: var(--noche); padding: 0.6rem 1rem;
  font-weight: 700; border-radius: 8px; text-decoration: none;
}
.salto:focus { top: 1rem; }

.contenedor { width: min(100% - 2.5rem, var(--ancho)); margin-inline: auto; }
.cargando, .aviso { padding: 4rem 1.25rem; text-align: center; color: var(--texto-suave); }

/* Cabecera */
.cabecera {
  position: sticky; top: 0; z-index: 1000;
  background: var(--noche);
  color: #fff;
  padding-top: env(safe-area-inset-top, 0px);
}
/* Franja de los cuatro colores */
.cabecera::after {
  content: ""; display: block; height: 5px;
  background: linear-gradient(90deg,
    var(--sol) 0 20%, var(--rojo) 20% 40%, var(--verde) 40% 60%, var(--azul) 60% 80%, var(--morado) 80% 100%);
}
.cabecera_interior {
  width: min(100% - 2.5rem, var(--ancho)); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 68px;
}
.marca { display: flex; align-items: center; gap: 0.7rem; color: #fff; text-decoration: none; }
.marca img { border-radius: 10px; }
.marca_texto { display: flex; flex-direction: column; line-height: 1; }
.marca_nombre { font-family: var(--fuente-titulo); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.01em; }
.marca_lema { font-size: 0.82rem; color: var(--sol); margin-top: 3px; font-weight: 600; }

.nav ul { list-style: none; display: flex; gap: 0.3rem; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 0.55rem 0.95rem; border-radius: 999px;
  color: #e6ecf7; text-decoration: none; font-weight: 600; font-size: 0.98rem;
}
.nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav a[aria-current="page"] { color: var(--sol); box-shadow: inset 0 -3px 0 var(--sol); border-radius: 0; }

.menu-btn {
  display: none; width: 46px; height: 46px; border: 0; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.1); align-items: center; justify-content: center;
}
.menu-btn__barras, .menu-btn__barras::before, .menu-btn__barras::after {
  display: block; width: 22px; height: 3px; border-radius: 2px; background: #fff; content: "";
  transition: transform 0.2s, opacity 0.2s;
}
.menu-btn__barras { position: relative; }
.menu-btn__barras::before { position: absolute; top: -7px; }
.menu-btn__barras::after { position: absolute; top: 7px; }
.menu-btn[aria-expanded="true"] .menu-btn__barras { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-btn__barras::before { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__barras::after { transform: translateY(-7px) rotate(-45deg); }

.boton {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--sol); color: var(--noche); font-weight: 700; text-decoration: none;
  padding: 0.85rem 1.5rem; border-radius: 999px; border: 0; cursor: pointer;

}
.boton:hover { background: #ffc93c; transform: translateY(-2px); }
.boton--borde { background: transparent; border: 2px solid var(--noche); color: var(--noche); padding: 0.6rem 1.15rem; }
.boton--borde:hover { background: var(--noche); color: #fff; }
.boton svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ----------------------------------------------------------------- Inicio */
.hero { background: var(--noche); color: #fff; overflow: hidden; }
.hero_section {
  width: min(100% - 2.5rem, var(--ancho)); margin-inline: auto;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: center;
  padding: 3.5rem 0 4rem;
}

.hero-content {
  width: min(100% - 2.5rem, var(--ancho)); margin-inline: auto;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: center;
  padding: 3.5rem 0 4rem;
}

.hero span { color: #c9d5ea; font-size: 1.15rem; margin-bottom: 0.4rem;  }
.hero h1 { color: #fff; font-size: clamp(2.9rem, 7vw, 5.6rem); line-height: 0.95; letter-spacing: -0.03em; margin-bottom: 0.3em; }
.hero h1 span { display: block; color: var(--sol); font-size: 0.5em; font-weight: 600; letter-spacing: -0.01em; margin-top: 0.2em; }


.hero_imagen {
  border-radius: 28px; overflow: hidden; aspect-ratio: 4 / 3.2;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  animation: revelar 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero_imagen img { width: 100%; height: 100%; object-fit: cover; }
@keyframes revelar { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }



.map-section {
  padding: 2.5rem 0;
}

.map-section .section-heading {
  width: min(100% - 2.5rem, var(--ancho));
  margin-inline: auto;
  margin-bottom: 1rem;
}

.map-layout {
  width: min(100% - 2.5rem, var(--ancho));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
}

.neighborhood-list {
  position: static;
  width: 100%;
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  overflow: hidden;
  order: 2;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  background: var(--noche);
  color: #fff;
  font-weight: 700;
}

#neighborhoodCount {
  color: var(--sol);
}

#neighborhoodButtons {
  padding: 0.75rem;
}

.neighborhood-button::before {
  content: "";
  width: 12px;
  height: 12px;
  min-width: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 10px;
  background: var(--color-barrio);
}

.map-wrapper {
  position: relative;
  width: 100%;
  min-width: 0;
  background: var(--papel);
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra);
  order: 1;
}

#map {
  width: 100%;
  height: 600px;
  min-height: 0;
  max-height: none;
}

.map-note {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 0.75rem;
  color: var(--texto-suave);
}

.map-wrapper {
  position: relative;
  z-index: 1;
}

#map {
  position: relative;
  z-index: 1;
}

@media (max-width: 850px) {
  .map-layout {
    width: min(100% - 2rem, var(--ancho));
    grid-template-columns: 1fr;
  }

  .neighborhood-list {
    position: static;
    width: 100%;
    margin: 0;
    order: 1;
  }

  .map-wrapper {
    width: 100%;
    order: 2;
  }

  #map {
    height: 60vh;
    min-height: 400px;
  }
}


@media (max-width: 600px) {
  .map-section {
    padding: 3rem 0;
  }

  .map-layout {
    width: calc(100% - 1.5rem);
  }

  .neighborhood-list {
    width: 100%;
    margin: 0;
  }

  #map {
    height: 50vh;
    min-height: 350px;
  }

  .map-note {
    font-size: 0.65rem;
  }
}

.neighborhood-button {
  width: 100%;
  display: block;
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;

  border: 1px solid var(--linea);
  border-radius: 10px;

  background: #fff;
  color: var(--texto);

  font-family: var(--fuente-texto);
  font-size: 0.95rem;
  font-weight: 600;

  text-align: left;
  cursor: pointer;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.neighborhood-button:hover {
  background: var(--noche);
  color: #fff;
  border-color: var(--noche);
  transform: translateX(3px);
}

.neighborhood-button:focus-visible {
  outline: 3px solid var(--sol);
  outline-offset: 2px;
}

.barrio-tooltip {
    background: var(--noche);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    font-family: var(--fuente-texto);
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: var(--sombra);
}

.barrio-tooltip::before {
    border-top-color: var(--noche);
}

.leaflet-interactive {
  transition:
    fill-opacity 0.35s ease,
    stroke-width 0.35s ease,
    opacity 0.35s ease;
}

#mapa {
  scroll-margin-top: 50px;
}

@media (max-width: 760px) {

  /* ---------- NAVBAR ---------- */

  .cabecera_interior {min-height: 62px; width: min(100% - 1.5rem, var(--ancho));}

  .marca_nombre {font-size: 1.1rem;}
  .marca_lema {font-size: 0.7rem;}
  .marca img {width: 42px; height: 42px;}


  .menu-btn {display: inline-flex;flex-shrink: 0;}

  /* Ocultar menú inicialmente */
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    background: var(--noche);
    padding: 0.5rem 1rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  }

  /* Mostrar menú cuando se presiona el botón */
  .cabecera.abierto .nav {display: block;}

  .nav ul {flex-direction: column; gap: 0; width: 100%;}
  .nav li {width: 100%;}
  .nav a {width: 100%;padding: 0.9rem 0.75rem;border-radius: 8px;font-size: 1rem;}
  .nav a:hover {background: rgba(255,255,255,0.1);}
  .nav a[aria-current="page"] {box-shadow: none;background: rgba(255,255,255,0.08);}


  /* ---------- HERO ---------- */

  .hero_section,
  .hero-content {
    width: min(100% - 1.5rem, var(--ancho));
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2.5rem 0 3rem;
    align-items: stretch;
  }

  .hero-content > div:first-child,
  .hero_section > div:first-child {order: 1;}

  .hero_imagen {
    order: 2;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 20px;
  }

  .hero h1 {font-size: clamp(2.5rem, 13vw, 4rem);line-height: 0.95;}
  .hero span {font-size: 1rem;}
  .hero p {font-size: 1rem;}
  .hero .boton {width: 100%;justify-content: center;}

}

/* seccion de barrios */
#barrios {
  scroll-margin-top: 100px;
}

.seccion .seccion_cabecera h2 {margin-bottom: 0.25rem;}
eccion .seccion_cabecera p {margin: 0 0 1rem;}
.seccion {margin-bottom: 3rem;}

/* Paneles de barrios: se expande el que recibe el cursor o el foco */
.paneles { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.75rem; height: 440px; }
.paneles li { flex: 1; min-width: 0; transition: flex 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.paneles li:hover, .paneles li:focus-within { flex: 2.6; }
.panel {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%;
  border-radius: var(--radio); overflow: hidden; text-decoration: none; color: #fff;
  background: var(--noche);
}
.panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.panel::before {content: ""; position: absolute; inset: 0; background: var(--color); opacity: 0; z-index: 1; transition: opacity 0.4s ease;}
.paneles li:hover .panel::before,
.paneles li:focus-within .panel::before {opacity: 0.35;}
.panel::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--color); }
.panel_texto { position: relative;z-index: 2; padding: 1.2rem 1.2rem 1.6rem; }
.panel h3 {color: #fff; margin-bottom: 0.3rem; font-size: 1.35rem; transition: font-size 0.3s ease;}
.paneles li:hover .panel h3,
.paneles li:focus-within .panel h3 {font-size: 2.5rem;}
.panel p { font-size: 0.95rem; margin: 0; color: #e6ecf7; max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.4s, opacity 0.4s; }
.paneles li:hover .panel p, .paneles li:focus-within .panel p { max-height: 8rem; opacity: 1; }

/* Responsive para paneles de barrios */

@media (max-width: 900px) {
  .paneles {
    height: 380px;
    gap: 0.5rem;
  }

  .paneles li:hover,
  .paneles li:focus-within {
    flex: 2;
  }

  .panel_texto {
    padding: 1rem;
  }

  .panel h3 {
    font-size: 1.2rem;
  }

  .panel p {
    font-size: 0.9rem;
  }
}

@media (max-width: 600px) {
  .paneles {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    gap: 1rem;
  }

  .paneles li {
    min-height: 260px;
  }

  .paneles li:hover,
  .paneles li:focus-within {
    flex: none;
  }

  .panel {
    height: 260px;
  }

  .panel p {
    max-height: none;
    opacity: 1;
  }
}

[hidden] { display: none !important; }

.volver {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--texto-suave); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  width: min(100% - 2.5rem, var(--ancho)); margin: 1.5rem auto 0;
}
.volver:hover { color: var(--texto); }
.volver svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; }

.barrio-hero { background: var(--noche); color: #fff; overflow: hidden; }
.barrio-hero-inner {
  width: min(100% - 2.5rem, var(--ancho)); margin-inline: auto;
  padding: 2rem 0 3.5rem;
}
.barrio-hero__franja { width: 64px; height: 6px; border-radius: 999px; margin-bottom: 1.2rem; }
.barrio-hero h1 { color: #fff; margin-bottom: 0.3rem; }
.barrio-hero .eyebrow { color: #c9d5ea; }
.barrio-hero__imagen {
  margin-top: 2rem; border-radius: 24px; overflow: hidden;
  aspect-ratio: 21 / 9; box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.barrio-hero__imagen img { width: 100%; height: 100%; object-fit: cover; }

.datos-rapidos {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; width: min(100% - 2.5rem, var(--ancho)); margin: -2.5rem auto 0; position: relative; z-index: 2;
}
.dato-card {
  background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 1.1rem 1.3rem; box-shadow: var(--sombra);
}
.dato-card span { display: block; font-size: 0.8rem; color: var(--texto-suave); font-weight: 600; margin-bottom: 0.25rem; }
.dato-card strong { font-family: var(--fuente-titulo); font-size: 1.05rem; color: var(--noche); }

.barrio-section { padding: 3.5rem 0; }
.section-texto {
  width: min(100% - 2.5rem, var(--ancho)); margin-inline: auto;
  display: grid; grid-template-columns: 1fr; gap: 1rem; max-width: 780px;
}
.section-texto h2 { margin-bottom: 0.8rem; }

.lista-destacados {
  width: min(100% - 2.5rem, var(--ancho)); margin: 1.5rem auto 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem;
}
.destacado-card {
  background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 1.3rem; box-shadow: 0 6px 18px rgba(15,33,64,0.06);
}
.destacado-card h3 { margin-bottom: 0.4rem; }
.destacado-card p { margin: 0; color: var(--texto-suave); font-size: 0.96rem; }

.galeria {
  width: min(100% - 2.5rem, var(--ancho)); margin: 1.5rem auto 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem;
}
.galeria-item {
  aspect-ratio: 4 / 3; border-radius: var(--radio); overflow: hidden;
  background: var(--noche-2); display: flex; align-items: center; justify-content: center;
}
.galeria-item img { width: 100%; height: 100%; object-fit: cover; }
.galeria-item span { color: #c9d5ea; font-size: 0.85rem; font-weight: 600; text-align: center; padding: 1rem; }

.cta-mapa {
  width: min(100% - 2.5rem, var(--ancho)); margin: 0 auto;
  background: var(--noche); color: #fff; border-radius: var(--radio);
  padding: 2.5rem 2rem; text-align: center;
}
.cta-mapa p { color: #c9d5ea; }

/* ---------------------------------------------------------------------- Pie */
.pie { background: var(--noche); color: #c9d5ea; padding: 2rem 0 calc(2rem + env(safe-area-inset-bottom, 0px)); font-size: 0.95rem; }
.pie_interior { width: min(100% - 2.5rem, var(--ancho)); margin-inline: auto; }
.pie p { margin: 0 0 0.4rem; }
.pie strong { color: #fff; }
.pie a { color: var(--sol); }