/* ==========================================================================
   Valorador Vendrell — landing.css
   Solo la home (index.html y es/index.html). El valorador (valorar.html) sigue
   con main.css + valorar.css, sin tocar.

   Idea visual: noche azul marino arriba (la misma oscuridad que la página del
   valorador, para que el salto de una a otra no se note) y papel cálido para
   los datos. Nada de fotos de banco: lo que se ve son precios reales, en
   mapa, barras y curvas.

   Orden: fuentes > tokens > base > componentes > secciones > movimiento.
   ========================================================================== */

/* ------------------------------------------------------------- 1. FUENTES
   La de Apple: San Francisco (SF Pro), la del propio sistema. No se descarga
   nada: en iPhone/Mac sale SF Pro; en Android, Roboto; en Windows, Segoe UI.
   ------------------------------------------------------------------------ */

/* -------------------------------------------------------------- 2. TOKENS */
:root {
  /* Noche (hero, banda final, pie) */
  --noche:      #07101E;
  --noche-2:    #0D1A2E;
  --noche-3:    #142640;
  --noche-linea:#213656;
  --sobre-noche:   #EEF4FF;
  --sobre-noche-2: #B3C3DA;   /* 9.6:1 sobre --noche */
  --sobre-noche-3: #8296B3;   /* 5.6:1 */

  /* Papel (secciones de datos) */
  --papel:      #F7F4EF;
  --papel-2:    #EFEAE2;
  --tarjeta:    #FFFFFF;
  --linea:      #E4DED4;
  --tinta:      #0F1A2A;
  --tinta-2:    #435066;      /* 8.6:1 sobre papel */
  --tinta-3:    #5F6B80;      /* 5.2:1 */

  /* Marca: azul Valorador + verde de revalorización */
  --azul:      #2B5FA9;    /* 5.9:1 sobre papel */
  --azul-700:  #18325E;
  --azul-050:  #EAF1FA;
  --azul-100:  #D3E2F5;
  --azul-luz:  #8FB8F0;    /* el violeta sobre la noche */
  --verde:        #187A45;    /* subidas, sobre papel 5.4:1 */
  --verde-luz:    #4FD68F;    /* subidas, sobre la noche */
  --verde-050:    #E5F5EC;
  --rojo:         #B3361F;    /* bajadas, sobre papel 5.6:1 */
  --rojo-luz:     #FF8D7A;
  --rojo-050:     #FBEAE6;

  /* CTA: el MISMO naranja que el botón del valorador, para que el clic de
     la home y el "Continuar" de la página siguiente se lean como uno. */
  --cta:        #FF7A33;
  --cta-hover:  #FF9560;
  --sobre-cta:  #200A00;      /* 8.2:1 */

  /* Municipios: un color por pueblo en mapa, barras y curvas */
  --m-vendrell:   #3D6DB4;
  --m-torre:      #3FA7D6;
  --m-roda:       #F29A2E;
  --m-creixell:   #22A6A0;
  --m-calafell:   #4F86E8;
  --m-interior:   #8C8798;

  --f-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-text:    -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --t-xs:   .75rem;
  --t-s:    .875rem;
  --t-m:    clamp(1rem, .97rem + .15vw, 1.0625rem);
  --t-lead: clamp(1.0625rem, 1rem + .45vw, 1.3125rem);
  --t-h3:   clamp(1.125rem, 1.04rem + .5vw, 1.375rem);
  --t-h2:   clamp(1.875rem, 1.35rem + 2.3vw, 3.25rem);
  --t-h1:   clamp(2.375rem, 1.5rem + 4.2vw, 5rem);

  --ancho: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --sec: clamp(4rem, 9vw, 7.5rem);
  --r-xl: 28px; --r-l: 20px; --r-m: 14px; --r-s: 10px;

  --sombra-1: 0 1px 2px rgba(15,26,42,.05), 0 2px 8px rgba(15,26,42,.05);
  --sombra-2: 0 6px 16px rgba(15,26,42,.07), 0 18px 40px rgba(15,26,42,.08);
  --sombra-noche: 0 20px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06) inset;

  --e-out: cubic-bezier(.16, 1, .3, 1);
  --e-io:  cubic-bezier(.65, 0, .35, 1);

  --cta-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------------------------------------------------------------- 3. BASE */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: var(--f-text); font-size: var(--t-m); line-height: 1.6;
  color: var(--tinta); background: var(--papel);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
@media (max-width: 900px) { body.js { padding-bottom: calc(var(--cta-h) + var(--safe-b)); } }
img, svg { display: block; max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--azul); text-underline-offset: 3px; }
a:hover { color: var(--azul-700); }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.05; letter-spacing: -.02em; font-weight: 750; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); letter-spacing: -.01em; line-height: 1.2; }
:focus-visible { outline: 3px solid var(--cta); outline-offset: 3px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 200;
  background: var(--azul); color: #fff; padding: .75rem 1rem; border-radius: var(--r-s);
}
.skip-link:focus { top: 1rem; color: #fff; }

.contenedor { width: 100%; max-width: var(--ancho); margin-inline: auto; padding-inline: var(--gutter); }
.sec { padding-block: var(--sec); }
.sec--blanca { background: var(--tarjeta); }
.sec--crema { background: var(--papel-2); }

.etiqueta {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--azul);
}
.etiqueta::before { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.cap { max-width: 44rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.cap h2 { margin-top: .75rem; }
.cap p { margin-top: 1rem; font-size: var(--t-lead); color: var(--tinta-2); }
.cap--centro { margin-inline: auto; text-align: center; }
.cap--centro .etiqueta::after { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }

.sube { color: var(--verde); }
.baja { color: var(--rojo); }

/* Cosas pendientes de rellenar: se ven en amarillo, como en el resto del proyecto */
.pendiente { background: #FFF3CD; color: #6B4E00; padding: 0 .25em; border-radius: 3px; }

/* ------------------------------------------------------------- 4. BOTONES */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 0 1.5rem; border-radius: 999px;
  font-weight: 700; font-size: 1rem; text-decoration: none; white-space: nowrap;
  border: 2px solid transparent;
  transition: transform 160ms var(--e-io), background-color 160ms var(--e-io), box-shadow 160ms var(--e-io);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--cta { background: var(--cta); color: var(--sobre-cta); box-shadow: 0 8px 24px rgba(255,122,51,.28); }
.btn--cta:hover { background: var(--cta-hover); color: var(--sobre-cta); box-shadow: 0 10px 30px rgba(255,122,51,.38); }
.btn--cta svg { transition: transform 200ms var(--e-out); }
.btn--cta:hover svg { transform: translateX(3px); }
.btn--gran { min-height: 60px; font-size: 1.0625rem; width: 100%; }
.btn--linea { border-color: var(--linea); color: var(--tinta); background: var(--tarjeta); }
.btn--linea:hover { border-color: var(--azul); color: var(--azul); }
.btn--noche { border-color: var(--noche-linea); color: var(--sobre-noche); background: transparent; }
.btn--noche:hover { border-color: var(--azul-luz); color: #fff; }
.btn.btn--wa { background: #0E6F64; color: #fff; }
.btn.btn--wa:hover { background: #0A5850; color: #fff; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ------------------------------------------------------------ 5. CABECERA */
.capcalera {
  position: sticky; top: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 68px; padding: .5rem var(--gutter);
  background: rgba(7,16,30,.78);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: var(--sobre-noche);
}
.marca { display: inline-flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; }
.marca img { width: 36px; height: 36px; }
.marca__nom { font-family: var(--f-display); font-weight: 750; font-size: 1.1875rem; letter-spacing: -.02em; }
.marca__nom b { color: var(--azul-luz); font-weight: 750; }
.capcalera__dreta { display: flex; align-items: center; gap: .75rem; }
.tel-capcalera {
  display: inline-flex; align-items: center; gap: .45em; color: var(--sobre-noche-2);
  text-decoration: none; font-weight: 600; font-size: var(--t-s);
}
.tel-capcalera:hover { color: #fff; }
.capcalera .btn { min-height: 42px; padding: 0 1.1rem; font-size: .9375rem; }
@media (max-width: 900px) { .capcalera__cta { display: none; } }
@media (max-width: 520px) { .tel-capcalera span { display: none; } .marca__nom { font-size: 1.0625rem; } }
.idiomes { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.06); }
.idiomes a {
  min-width: 34px; min-height: 30px; display: grid; place-items: center; border-radius: 999px;
  font-size: var(--t-xs); font-weight: 700; color: var(--sobre-noche-3); text-decoration: none;
}
.idiomes a[aria-current="true"] { background: var(--azul-luz); color: var(--noche); }
.idiomes a:hover { color: #fff; }
.idiomes a[aria-current="true"]:hover { color: var(--noche); }

/* ----------------------------------------------------------------- 6. HERO */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--noche); color: var(--sobre-noche);
  padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(3.5rem, 8vw, 6rem);
}
/* Halo violeta + rejilla de puntos: textura sin peso */
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 120%; z-index: -2;
  background:
    radial-gradient(50% 45% at 18% 20%, rgba(61,109,180,.45), transparent 70%),
    radial-gradient(40% 40% at 85% 30%, rgba(63,167,214,.22), transparent 70%),
    radial-gradient(45% 50% at 70% 95%, rgba(34,166,160,.18), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
          mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
}
.hero__onades {
  position: absolute; left: 0; right: 0; bottom: -2px; z-index: -1; width: 100%; height: auto;
  color: var(--papel); pointer-events: none;
}
.hero__graella { display: grid; gap: clamp(2.5rem, 5vw, 4rem); align-items: center; }
@media (min-width: 980px) { .hero__graella { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); } }

.hero__pill {
  display: inline-flex; align-items: center; gap: .6em; flex-wrap: wrap;
  padding: .45rem .9rem .45rem .55rem; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  font-size: var(--t-s); color: var(--sobre-noche-2);
}
.hero__pill b { color: var(--sobre-noche); }
.punt-viu {
  width: 10px; height: 10px; border-radius: 50%; background: var(--verde-luz);
  box-shadow: 0 0 0 0 rgba(79,214,143,.6); animation: batec 2.2s infinite;
}
@keyframes batec { 0% { box-shadow: 0 0 0 0 rgba(79,214,143,.55); } 70% { box-shadow: 0 0 0 10px rgba(79,214,143,0); } 100% { box-shadow: 0 0 0 0 rgba(79,214,143,0); } }

.hero__titol { font-size: var(--t-h1); line-height: .98; margin: 1.25rem 0 1.25rem; letter-spacing: -.035em; }
.hero__titol .accent {
  font-style: normal;
  background: linear-gradient(92deg, #A9CCFF 0%, #7FD3F5 55%, #FFB27A 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { font-size: var(--t-lead); color: var(--sobre-noche-2); max-width: 34rem; }
.hero__sub b { color: var(--sobre-noche); font-weight: 650; }

.rotador { white-space: nowrap; color: var(--sobre-noche); }
.rotador__cursor { display: none; }
.rotador--viu .rotador__cursor {
  display: inline-block; width: .07em; height: .82em; margin-left: .06em; vertical-align: -.06em;
  background: var(--cta); animation: parpelleig 1s steps(1) infinite;
}
@keyframes parpelleig { 50% { opacity: 0; } }

/* Split del titular (lo anima motion.js) */
.linia { display: block; overflow: hidden; padding-bottom: .06em; }
.linia > span { display: block; }
.js .linia > span { transform: translateY(110%); }
.js .linia--vista > span { transform: none; transition: transform 900ms var(--e-out); }
.js .linia:nth-child(2) > span { transition-delay: 90ms; }

/* Buscador: tarjeta clara sobre la noche */
.cercador {
  position: relative; margin-top: 2rem; max-width: 36rem;
  background: var(--tarjeta); color: var(--tinta);
  border-radius: var(--r-l); padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08);
}
.cercador__titol { font-family: var(--f-display); font-size: 1.1875rem; font-weight: 750; letter-spacing: -.01em; }
.cercador__ajuda { font-size: var(--t-s); color: var(--tinta-3); margin: .25rem 0 1rem; }
.camp { margin-bottom: .85rem; }
.camp > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.camp--adreca { position: relative; }
.camp--adreca .camp__icona {
  position: absolute; left: 16px; top: 18px; color: var(--azul); pointer-events: none;
}
.camp__control {
  width: 100%; min-height: 60px; padding: .75rem 1rem .75rem 46px;
  border: 2px solid var(--linea); border-radius: var(--r-m); background: var(--papel);
  font-size: 16px; color: var(--tinta);
  transition: border-color 160ms var(--e-io), box-shadow 160ms var(--e-io), background-color 160ms;
}
.camp__control::placeholder { color: var(--tinta-3); }
.camp__control:focus { outline: none; border-color: var(--azul); background: #fff; box-shadow: 0 0 0 5px var(--azul-100); }
.camp__control[aria-invalid="true"] { border-color: var(--rojo); }
.camp__error { display: block; font-size: var(--t-s); color: var(--rojo); margin-top: .5rem; font-weight: 600; }
.camp__error:empty { display: none; }

.suggeriments {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--r-m);
  box-shadow: var(--sombra-2); max-height: 280px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.suggeriments li { border-bottom: 1px solid var(--papel-2); }
.suggeriments li:last-child { border-bottom: 0; }
.suggeriments button {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  min-height: 54px; padding: .75rem 1rem; font-size: .9375rem; line-height: 1.3;
}
.suggeriments button:hover, .suggeriments li[aria-selected="true"] > button {
  background: var(--azul-050); box-shadow: inset 3px 0 0 var(--azul);
}
.sug__icona { flex: 0 0 auto; margin-top: 2px; color: var(--tinta-3); }
.sug__text { display: block; min-width: 0; }
.sug__zona { display: block; font-size: var(--t-s); color: var(--tinta-3); }

.cercador__garanties {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1rem; margin-top: .9rem;
  font-size: var(--t-xs); color: var(--tinta-3); font-weight: 600;
}
.cercador__garanties span { display: inline-flex; align-items: center; gap: .35em; }
.cercador__garanties svg { color: var(--verde); }

/* Visual del hero: resultado de ejemplo + chips de zona */
.hero__visual { position: relative; max-width: 520px; width: 100%; margin-inline: auto; }
.resultat {
  position: relative; z-index: 2;
  background: linear-gradient(180deg, rgba(20,38,64,.92), rgba(13,26,46,.96));
  border-radius: var(--r-xl); padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--sombra-noche);
}
.resultat__cap { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.resultat__etq {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sobre-noche-3);
}
.resultat__exemple {
  font-size: var(--t-xs); font-weight: 700; padding: .25rem .6rem; border-radius: 999px;
  background: rgba(143,184,240,.14); color: var(--azul-luz);
}
.resultat__adreca { margin-top: .85rem; font-weight: 650; color: var(--sobre-noche); }
.resultat__fitxa { font-size: var(--t-s); color: var(--sobre-noche-3); }
.resultat__xifra {
  margin-top: 1.25rem; font-family: var(--f-display); font-weight: 800; letter-spacing: -.03em;
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem); line-height: 1; color: #fff;
}
.resultat__rang { margin-top: .4rem; font-size: var(--t-s); color: var(--sobre-noche-2); }
.forquilla { position: relative; margin: 1.1rem 0 .4rem; height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); }
.forquilla__fill {
  position: absolute; left: 18%; right: 18%; top: 0; bottom: 0; border-radius: inherit;
  background: linear-gradient(90deg, #3D6DB4, #3FA7D6, #FF9560);
}
.forquilla__punt {
  position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(255,255,255,.18);
}
.forquilla__eix { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--sobre-noche-3); }
.resultat__factors { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.1rem; }
.factor {
  display: inline-flex; gap: .35em; align-items: center;
  font-size: var(--t-xs); font-weight: 650; padding: .35rem .6rem; border-radius: 999px;
  background: rgba(255,255,255,.06); color: var(--sobre-noche-2);
}
.factor b { color: var(--verde-luz); font-weight: 700; }
.factor b.baja { color: var(--rojo-luz); }
.resultat__evol {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1rem;
  margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid rgba(255,255,255,.08);
}
.resultat__evol p { font-size: var(--t-xs); color: var(--sobre-noche-3); }
.resultat__evol strong { display: block; font-size: 1.125rem; color: var(--sobre-noche); font-family: var(--f-display); }
.resultat__evol svg { width: 132px; height: 44px; }

.xip-zona {
  position: absolute; z-index: 3;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem .8rem; border-radius: 14px;
  background: rgba(255,255,255,.96); color: var(--tinta);
  box-shadow: 0 14px 30px rgba(0,0,0,.35);
  font-size: var(--t-s); line-height: 1.15; white-space: nowrap;
}
.xip-zona i { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.xip-zona small { display: block; font-size: .6875rem; color: var(--tinta-3); }
.xip-zona b { font-family: var(--f-display); font-size: 1rem; }
.xip-zona em { font-style: normal; font-weight: 700; font-size: var(--t-xs); }
.hero__visual { padding-bottom: 34px; }
.xip-zona--1 { top: -22px; right: -8px; }
.xip-zona--2 { bottom: 0; left: -14px; }
.xip-zona--3 { bottom: 58px; right: -8px; }
@media (min-width: 980px) and (max-width: 1240px) { .xip-zona--3 { display: none; } }
@media (max-width: 600px) {
  .xip-zona--1 { right: 6px; } .xip-zona--2 { left: 6px; } .xip-zona--3 { display: none; }
}
.anim-ok .xip-zona { animation: flota 6s var(--e-io) infinite alternate; }
.anim-ok .xip-zona--2 { animation-delay: -2s; }
.anim-ok .xip-zona--3 { animation-delay: -4s; }
@keyframes flota { from { transform: translateY(0); } to { transform: translateY(-8px); } }

/* ------------------------------------------------- 7. TICKER DE ZONAS */
.ticker {
  background: var(--papel); border-bottom: 1px solid var(--linea);
  overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker__pista { display: flex; width: max-content; animation: ticker 60s linear infinite; }
.ticker:hover .ticker__pista { animation-play-state: paused; }
.ticker__llista { display: flex; gap: 0; padding: 1rem 0; }
.ticker__item {
  display: inline-flex; align-items: baseline; gap: .5rem; padding: 0 1.4rem;
  border-right: 1px solid var(--linea); white-space: nowrap; font-size: var(--t-s);
}
.ticker__item span { color: var(--tinta-2); }
.ticker__item b { font-family: var(--f-display); font-size: 1rem; }
.ticker__item em { font-style: normal; font-weight: 700; font-size: var(--t-xs); }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker { overflow-x: auto; } .ticker__pista { animation: none; }
}

/* --------------------------------------------- 8. XIFRES (datos clave) */
.xifres { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--linea); border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--linea); }
@media (min-width: 820px) { .xifres { grid-template-columns: repeat(4, 1fr); } }
.xifra { background: var(--tarjeta); padding: clamp(1.1rem, 3vw, 1.75rem); }
.xifra strong {
  display: block; font-family: var(--f-display); font-weight: 800; letter-spacing: -.03em;
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem); line-height: 1; color: var(--azul);
}
.xifra span { display: block; margin-top: .5rem; font-size: var(--t-s); color: var(--tinta-2); }

/* -------------------------------------------------- 9. COM FUNCIONA */
.passos { display: grid; gap: 1rem; counter-reset: pas; }
@media (min-width: 860px) { .passos { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }
.pas {
  position: relative; background: var(--tarjeta); border: 1px solid var(--linea);
  border-radius: var(--r-l); padding: 1.5rem; overflow: hidden;
}
.pas__num {
  font-family: var(--f-display); font-weight: 800; font-size: 4.5rem; line-height: .8;
  color: var(--azul-050); position: absolute; right: 1rem; top: 1rem; letter-spacing: -.05em;
}
.pas__ic {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: var(--azul); color: #fff; margin-bottom: 1.25rem; box-shadow: 0 10px 24px rgba(43,95,169,.28);
}
.pas:nth-child(2) .pas__ic { background: #3FA7D6; box-shadow: 0 10px 24px rgba(63,167,214,.28); }
.pas:nth-child(3) .pas__ic { background: var(--verde); box-shadow: 0 10px 24px rgba(24,122,69,.28); }
.pas h3 { margin-bottom: .5rem; position: relative; }
.pas p { color: var(--tinta-2); font-size: var(--t-s); position: relative; }
.pas__temps {
  display: inline-block; margin-top: 1rem; font-size: var(--t-xs); font-weight: 700;
  padding: .3rem .65rem; border-radius: 999px; background: var(--papel); color: var(--tinta-2);
}

/* Banda de llamada intermedia */
.crida {
  display: flex; flex-direction: column; gap: 1rem; align-items: flex-start;
  margin-top: clamp(2rem, 4vw, 3rem); padding: clamp(1.25rem, 3vw, 1.75rem);
  border-radius: var(--r-l); background: var(--noche); color: var(--sobre-noche);
  background-image: radial-gradient(60% 120% at 100% 0%, rgba(61,109,180,.45), transparent 60%);
}
@media (min-width: 720px) { .crida { flex-direction: row; align-items: center; justify-content: space-between; } }
.crida__titol { font-family: var(--f-display); font-size: 1.375rem; font-weight: 750; letter-spacing: -.02em; }
.crida__sub { font-size: var(--t-s); color: var(--sobre-noche-2); }

/* ------------------------------------------------------ 10. MAPA DE PREUS */
.mapa { display: grid; gap: 1.25rem; }
@media (min-width: 980px) { .mapa { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: stretch; } }
.mapa__lienzo {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  background: #FBF8F3; border: 1px solid var(--linea);
  aspect-ratio: 800 / 430; align-self: start;
}
@media (min-width: 980px) { .mapa__lienzo { position: sticky; top: 92px; } }
.mapa__svg { width: 100%; height: 100%; display: block; }
.mapa__terra { fill: #FBF8F3; }
.mapa__mar { fill: #D4E6F1; }
.mapa__costa { fill: none; stroke: #9CC4DC; stroke-width: 2.5; }
.mapa__onada { fill: none; stroke: #B9D6E8; stroke-width: 1.4; stroke-dasharray: 2 7; stroke-linecap: round; }
.mapa__via { fill: none; stroke: #E0D8CB; stroke-width: 3; stroke-linecap: round; }
.mapa__mar-nom { font: 600 15px var(--f-display); fill: #8DB5CE; letter-spacing: .4em; }

.mpunt { cursor: pointer; }
.mpunt__halo { fill: currentColor; opacity: .14; transition: r 300ms var(--e-out), opacity 200ms; }
.mpunt__cor { fill: currentColor; stroke: #fff; stroke-width: 3; transition: r 300ms var(--e-out); }
.mpunt__nom { font: 700 21px var(--f-display); fill: var(--tinta); paint-order: stroke; stroke: #FBF8F3; stroke-width: 6px; stroke-linejoin: round; }
.mpunt__preu { font: 650 16px var(--f-text); fill: var(--tinta-2); paint-order: stroke; stroke: #FBF8F3; stroke-width: 6px; stroke-linejoin: round; }
.mpunt--petit .mpunt__nom { font-size: 15px; font-weight: 650; fill: var(--tinta-2); }
.mpunt:hover .mpunt__halo, .mpunt:focus-visible .mpunt__halo, .mpunt[aria-pressed="true"] .mpunt__halo { opacity: .28; }
.mpunt[aria-pressed="true"] .mpunt__cor { stroke: var(--tinta); }
.mpunt:focus-visible { outline: none; }
.mpunt:focus-visible .mpunt__cor { stroke: var(--cta); stroke-width: 4; }

.mapa__llegenda {
  position: absolute; right: 1rem; bottom: 1rem; max-width: 46%; display: flex; flex-wrap: wrap; gap: .3rem .8rem;
  font-size: var(--t-xs); color: var(--tinta-2); background: rgba(255,255,255,.85);
  padding: .5rem .75rem; border-radius: 10px; backdrop-filter: blur(6px);
}
.mapa__llegenda span { display: inline-flex; align-items: center; gap: .35rem; }
.mapa__llegenda i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* Panel de detalle del municipio */
.fitxa-m {
  background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--r-xl);
  padding: clamp(1.25rem, 3vw, 1.75rem); display: flex; flex-direction: column; gap: 1rem;
}
.fitxa-m[hidden] { display: none; }
.fitxa-m__cap { display: flex; align-items: center; gap: .75rem; }
.fitxa-m__color { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; }
.fitxa-m__nom { font-size: 1.5rem; }
.fitxa-m__comarca { font-size: var(--t-xs); color: var(--tinta-3); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.fitxa-m__xifres { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.fitxa-m__xifra { background: var(--papel); border-radius: var(--r-m); padding: .85rem 1rem; }
.fitxa-m__xifra small { display: block; font-size: var(--t-xs); color: var(--tinta-3); font-weight: 600; }
.fitxa-m__xifra b { font-family: var(--f-display); font-size: 1.5rem; letter-spacing: -.02em; }
.fitxa-m__spark { width: 100%; height: 64px; }
.fitxa-m__spark-peu { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--tinta-3); margin-top: -.5rem; }
.fitxa-m__barris { display: grid; gap: .45rem; }
.fitxa-m__barris li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; font-size: var(--t-s); }
.fitxa-m__barris .barra { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--papel-2); overflow: hidden; }
.fitxa-m__barris .barra i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--azul)); width: calc(var(--w) * 100%); transition: width 700ms var(--e-out); }
.fitxa-m__barris b { font-variant-numeric: tabular-nums; }
.fitxa-m__nota { font-size: var(--t-s); color: var(--tinta-2); }
.fitxa-m .btn { align-self: stretch; }
.fitxa-m__selector { display: none; }
/* Sin JS no hay mapa clicable: se listan todas las fichas, en rejilla */
.mapa__fitxes { display: grid; gap: 1rem; }
@media (min-width: 720px) { .mapa__fitxes { grid-template-columns: repeat(2, 1fr); } }
.js .mapa__fitxes { display: block; }

/* Pestañas de municipio para móvil (encima del mapa) */
.pestanyes-m {
  display: flex; gap: .5rem; overflow-x: auto; padding: .25rem .1rem .75rem; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pestanyes-m::-webkit-scrollbar { display: none; }
.pestanyes-m button {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: .45rem;
  min-height: 42px; padding: 0 .95rem; border-radius: 999px;
  border: 1.5px solid var(--linea); background: var(--tarjeta); font-weight: 650; font-size: var(--t-s);
}
.pestanyes-m button i { width: 9px; height: 9px; border-radius: 50%; }
.pestanyes-m button[aria-pressed="true"] { border-color: var(--tinta); background: var(--tinta); color: #fff; }
.no-js .pestanyes-m { display: none; }

/* ------------------------------------------------ 11. RÀNQUING DE BARRIS */
.ranking { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--r-xl); padding: clamp(1rem, 3vw, 1.75rem); }
.ranking__filtres { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.ranking__filtres button {
  min-height: 38px; padding: 0 .85rem; border-radius: 999px; font-size: var(--t-s); font-weight: 650;
  border: 1.5px solid var(--linea); color: var(--tinta-2); display: inline-flex; align-items: center; gap: .4rem;
}
.ranking__filtres button i { width: 8px; height: 8px; border-radius: 50%; }
.ranking__filtres button[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.ranking__taula { width: 100%; border-collapse: collapse; }
.ranking__taula caption { text-align: left; font-size: var(--t-xs); color: var(--tinta-3); caption-side: bottom; padding-top: 1rem; }
.ranking__taula thead th {
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--tinta-3);
  font-weight: 700; text-align: left; padding: 0 0 .6rem;
}
.ranking__taula thead th:nth-child(n+3) { text-align: right; }
.ranking__taula tbody tr { border-top: 1px solid var(--papel-2); }
.ranking__taula tbody tr[hidden] { display: none; }
.ranking__taula td, .ranking__taula tbody th { padding: .7rem 0; vertical-align: middle; }
.ranking__pos { width: 2.2rem; font-size: var(--t-xs); color: var(--tinta-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.ranking__zona { text-align: left; font-weight: 650; font-size: var(--t-s); }
.ranking__zona small { display: block; font-weight: 500; color: var(--tinta-3); font-size: var(--t-xs); }
.ranking__barra { width: 38%; padding-inline: 1rem !important; }
.ranking__barra span { display: block; height: 10px; border-radius: 999px; background: var(--papel-2); overflow: hidden; }
.ranking__barra i { display: block; height: 100%; width: calc(var(--w) * 100%); background: var(--c); border-radius: inherit; }
.js .ranking .ranking__barra i { width: 0; transition: width 900ms var(--e-out); }
.js .ranking.es-visible .ranking__barra i { width: calc(var(--w) * 100%); }
.ranking__preu { text-align: right; font-family: var(--f-display); font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ranking__var { text-align: right; width: 5.5rem; }
.pill-var {
  display: inline-block; font-size: var(--t-xs); font-weight: 700; padding: .2rem .5rem; border-radius: 999px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pill-var.sube { background: var(--verde-050); }
.pill-var.baja { background: var(--rojo-050); }
@media (max-width: 640px) {
  .ranking__barra { display: none; }
  .ranking__taula thead th:nth-child(3) { display: none; }
}
.ranking__peu { margin-top: 1rem; font-size: var(--t-s); color: var(--tinta-2); }

/* ------------------------------------------------- 12. EVOLUCIÓ (curvas) */
.evolucio { display: grid; gap: 1.25rem; }
@media (min-width: 980px) { .evolucio { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.grafic {
  background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--r-xl);
  padding: clamp(1rem, 3vw, 1.5rem);
}
.grafic svg { width: 100%; height: auto; overflow: visible; }
.grafic__eix { stroke: var(--papel-2); stroke-width: 1; }
.grafic__eix-txt { font: 500 11px var(--f-text); fill: var(--tinta-3); }
.grafic__linia { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.js .grafic .grafic__linia { stroke-dasharray: 1600; stroke-dashoffset: 1600; transition: stroke-dashoffset 1800ms var(--e-out); }
.js .grafic.es-visible .grafic__linia { stroke-dashoffset: 0; }
.grafic__final { font: 700 12px var(--f-display); }
.grafic__llegenda { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; margin-top: .75rem; font-size: var(--t-s); color: var(--tinta-2); }
.grafic__llegenda span { display: inline-flex; align-items: center; gap: .4rem; }
.grafic__llegenda i { width: 16px; height: 4px; border-radius: 4px; display: inline-block; }
.lectures { display: grid; gap: .75rem; }
.lectura { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--r-l); padding: 1.1rem 1.25rem; }
.lectura b { display: block; font-family: var(--f-display); font-size: 1.75rem; letter-spacing: -.02em; line-height: 1.1; }
.lectura p { font-size: var(--t-s); color: var(--tinta-2); margin-top: .25rem; }

/* --------------------------------------------- 13. COM CALCULEM (fórmula) */
.formula {
  display: grid; gap: .75rem; align-items: stretch;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) { .formula { grid-template-columns: 1fr auto 1fr auto 1.3fr auto 1fr; } }
.formula__terme {
  background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--r-l);
  padding: 1.1rem 1.2rem; display: flex; flex-direction: column; justify-content: center;
}
.formula__terme small { font-size: var(--t-xs); color: var(--tinta-3); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.formula__terme b { font-family: var(--f-display); font-size: 1.375rem; letter-spacing: -.02em; margin-top: .25rem; }
.formula__terme p { font-size: var(--t-s); color: var(--tinta-2); margin-top: .35rem; }
.formula__terme--resultat { background: var(--azul); border-color: var(--azul); color: #fff; }
.formula__terme--resultat small { color: var(--azul-100); }
.formula__terme--resultat p { color: #DCE8F7; }
.formula__op {
  display: grid; place-items: center; font-family: var(--f-display); font-size: 1.75rem; font-weight: 800; color: var(--azul);
}
.factors { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); margin-top: 1.5rem; }
.factors li {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--r-m);
  padding: .7rem .9rem; font-size: var(--t-s);
}
.factors li b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --------------------------------------------------------- 14. SITUACIONS */
.casos { display: grid; gap: 1rem; }
@media (min-width: 860px) { .casos { grid-template-columns: repeat(3, 1fr); } }
.cas {
  display: flex; flex-direction: column; gap: .75rem;
  background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--r-l); padding: 1.5rem;
  text-decoration: none; color: inherit;
  transition: transform 220ms var(--e-out), box-shadow 220ms var(--e-out), border-color 220ms;
}
.cas:hover { transform: translateY(-4px); box-shadow: var(--sombra-2); border-color: var(--azul-100); color: inherit; }
.cas__emoji { font-size: 1.75rem; line-height: 1; }
.cas p { color: var(--tinta-2); font-size: var(--t-s); flex: 1; }
.cas__accio { font-weight: 700; color: var(--azul); font-size: var(--t-s); }

/* --------------------------------------------------------------- 15. FAQ */
.faq-graella { display: grid; gap: 2rem; }
@media (min-width: 980px) { .faq-graella { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); } .faq-graella .cap { position: sticky; top: 100px; align-self: start; } }
.faq details { border-bottom: 1px solid var(--linea); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.15rem 0; font-weight: 650; font-size: 1.0625rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: 0 0 28px; height: 28px; border-radius: 50%;
  background: var(--papel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232B5FA9' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center no-repeat;
  transition: transform 260ms var(--e-out), background-color 200ms;
}
.faq details[open] summary::after { transform: rotate(45deg); background-color: var(--azul-100); }
.faq details > div { padding: 0 0 1.25rem; color: var(--tinta-2); max-width: 62ch; }

/* ------------------------------------------------------ 16. BANDA FINAL */
.final {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--noche); color: var(--sobre-noche); text-align: center;
  padding: clamp(4rem, 10vw, 7rem) 0;
}
.final::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(50% 70% at 50% 110%, rgba(61,109,180,.6), transparent 70%),
    radial-gradient(30% 50% at 10% 0%, rgba(63,167,214,.25), transparent 70%),
    radial-gradient(30% 50% at 90% 0%, rgba(255,122,51,.18), transparent 70%);
}
.final h2 { font-size: clamp(2.25rem, 1.5rem + 3.6vw, 4.25rem); letter-spacing: -.035em; max-width: 16ch; margin: .75rem auto 1.25rem; }
.final h2 em { font-style: normal; color: var(--azul-luz); }
.final p { color: var(--sobre-noche-2); max-width: 38rem; margin: 0 auto 2rem; font-size: var(--t-lead); }
.final .etiqueta { color: var(--azul-luz); }
.final__botons { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.final__micro { margin-top: 1.25rem !important; font-size: var(--t-s) !important; color: var(--sobre-noche-3) !important; }

/* --------------------------------------------------------------- 17. PIE */
.peu { background: #050B16; color: var(--sobre-noche-2); padding: 3.5rem 0 calc(2rem + var(--safe-b)); font-size: var(--t-s); }
.peu a { color: var(--sobre-noche); }
.peu a:hover { color: #fff; }
.peu__graella { display: grid; gap: 2rem; }
@media (min-width: 820px) { .peu__graella { grid-template-columns: 1.4fr 1fr 1fr; } }
.peu h2, .peu h3 { font-size: 1rem; color: var(--sobre-noche); margin-bottom: .75rem; font-family: var(--f-display); }
.peu address { font-style: normal; line-height: 1.8; }
.peu ul { display: grid; gap: .3rem; }
.peu__legal {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08); color: var(--sobre-noche-3);
}
.peu__legal a { color: var(--sobre-noche-3); }
.peu__acces { margin-left: auto; }

/* --------------------------------------------- 18. BARRA FIJA DEL MÓVIL */
.cta-fixa {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: flex; gap: .5rem; align-items: center;
  padding: .75rem var(--gutter) calc(.75rem + var(--safe-b));
  background: rgba(7,16,30,.92);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid rgba(255,255,255,.08);
  transform: translateY(110%); transition: transform 380ms var(--e-out);
}
.cta-fixa[data-visible] { transform: none; }
.cta-fixa .btn { flex: 1; min-height: 52px; }
.cta-fixa .btn--wa { flex: 0 0 52px; padding: 0; }
@media (min-width: 901px) { .cta-fixa { display: none; } }

/* ----------------------------------------------------------- 19. COOKIES */
.cookies {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--tarjeta); border-top: 3px solid var(--azul);
  box-shadow: 0 -10px 40px rgba(15,26,42,.18);
  padding: 1rem var(--gutter) calc(.75rem + var(--safe-b));
  max-height: 62vh; overflow-y: auto;
}
.cookies__cos { max-width: var(--ancho); margin-inline: auto; }
.cookies__titol { font-size: 1rem; margin-bottom: .25rem; }
.cookies .small { font-size: .8125rem; line-height: 1.45; color: var(--tinta-2); }
.cookies__botons { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .75rem; }
.cookies__botons .btn { width: 100%; min-height: 46px; padding: 0 .5rem; font-size: .875rem; border-radius: 12px; }
.cookies .btn--contorn { border-color: var(--linea); background: var(--tarjeta); color: var(--tinta); }
.cookies .btn--principal { background: var(--cta); color: var(--sobre-cta); }
.cookies__panell { margin-top: 1rem; border-top: 1px solid var(--linea); padding-top: 1rem; }
.cookies__opcio { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem 0; border-bottom: 1px solid var(--papel-2); font-size: var(--t-s); }
.cookies__opcio input { flex: 0 0 22px; width: 22px; height: 22px; accent-color: var(--azul); margin-top: 2px; }
.cookies .btn--gran { width: 100%; }

/* ------------------------------------------------------- 20. MOVIMIENTO */
.js [data-reveal] {
  opacity: 0; transform: translate3d(0, 24px, 0);
  transition: opacity 900ms var(--e-out), transform 900ms var(--e-out);
  transition-delay: var(--retard, 0ms);
}
.js [data-reveal].es-visible { opacity: 1; transform: none; }
.barra-scroll { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120; pointer-events: none; }
.barra-scroll__fill { height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--azul-luz), var(--cta)); }
.cursor { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .linia > span { transform: none !important; transition: none !important; }
  .js [data-reveal] { transition-duration: 240ms; transform: none; }
  .punt-viu, .anim-ok .xip-zona { animation: none; }
  .js .grafic .grafic__linia { stroke-dasharray: none; stroke-dashoffset: 0; }
}

/* Táctil: sin retardo de doble toque */
.btn, button, a[href], summary, .mpunt { touch-action: manipulation; }
@media not all and (hover: hover) and (pointer: fine) {
  .btn--cta:hover { background: var(--cta); }
  .cas:hover { transform: none; box-shadow: none; }
}

/* Antes de que landing.js arranque, solo se ve la ficha de El Vendrell:
   así no hay salto de 15 fichas a 1. Sin JS se ven todas. */
.js .fitxa-m[data-amagable] { display: none; }

/* ------------------------------------------- 21. MUNICIPIOS (SEO local) */
.fitxa-m__mes { text-align: center; font-weight: 700; font-size: var(--t-s); text-decoration: none; }
.munis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.muni-card {
  position: relative; display: grid; gap: .2rem; padding: 1.1rem 1.2rem 1.1rem 1.35rem;
  background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--r-l);
  text-decoration: none; color: var(--tinta); overflow: hidden;
  transition: transform 220ms var(--e-out), box-shadow 220ms var(--e-out), border-color 220ms;
}
.muni-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.muni-card:hover { transform: translateY(-3px); box-shadow: var(--sombra-2); border-color: var(--c); color: var(--tinta); }
.muni-card__nom { font-family: var(--f-display); font-weight: 750; font-size: 1.125rem; letter-spacing: -.01em; }
.muni-card__preu { font-family: var(--f-display); font-weight: 750; font-size: 1.5rem; letter-spacing: -.02em; color: var(--c); }
.muni-card__var { font-size: var(--t-xs); font-weight: 700; }
.muni-card__peu { font-size: var(--t-xs); color: var(--tinta-3); font-weight: 600; margin-top: .25rem; }

.hero--muni { padding-top: clamp(1.25rem, 4vw, 2rem); }
.molles { font-size: var(--t-s); color: var(--sobre-noche-3); margin-bottom: 1.25rem; }
.molles a { color: var(--sobre-noche-2); }
.hero__titol--muni { font-size: clamp(2.25rem, 1.5rem + 3.4vw, 4.25rem); margin-top: 1rem; }
.hero--muni .cercador { margin-top: 1.5rem; }
.kpis-m { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.kpi-m {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: var(--r-l);
  padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: .35rem;
}
.kpi-m small { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--sobre-noche-3); }
.kpi-m b { font-family: var(--f-display); font-size: clamp(1.375rem, 1.1rem + 1vw, 2rem); letter-spacing: -.02em; color: #fff; }
.kpi-m--ample { grid-column: 1 / -1; }
.kpi-m svg { width: 100%; height: 64px; }
.sube-luz { color: var(--verde-luz) !important; }
.baja-luz { color: var(--rojo-luz) !important; }
.ctx { display: grid; gap: 1rem; }
@media (min-width: 860px) { .ctx { grid-template-columns: repeat(3, 1fr); } }
.ctx .lectura p:last-child { font-size: var(--t-m); color: var(--tinta-2); }

/* Titular del hero SIEMPRE en dos líneas: «Quant val la teva casa» /
   «a Torredembarra?». El tamaño sale del ancho de la columna (cqi), no de la
   pantalla, así la línea más larga cabe entera en móvil y en escritorio. */
.hero__text { container-type: inline-size; }
.hero__titol { font-size: clamp(1.75rem, 10cqi, 4.75rem); }
.hero__titol .linia > span { white-space: nowrap; }
.hero__titol--muni { font-size: clamp(1.75rem, 8.4cqi, 4.25rem); }

/* ==========================================================================
   Tot el Tarragonès — los 22 municipios, en dos columnas en escritorio
   ========================================================================== */
.tgn { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--r-xl); padding: clamp(1rem, 3vw, 1.75rem); }
.tgn__cap {
  display: none; grid-template-columns: 1fr auto 4.5rem; gap: 1rem; padding: 0 .75rem .5rem;
  font-size: var(--t-xs, .75rem); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-3);
}
.tgn__llista { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.tgn__fila {
  display: grid; grid-template-columns: 1fr auto 4.5rem; align-items: center; gap: 1rem;
  min-height: 48px; padding: .5rem .75rem; border-radius: var(--r-s); text-decoration: none; color: var(--tinta);
  border-left: 3px solid var(--c, var(--azul));
}
.tgn__fila:hover, .tgn__fila:focus-visible { background: var(--azul-050); color: var(--tinta); }
.tgn__nom { font-weight: 650; min-width: 0; }
.tgn__preu { font-weight: 700; white-space: nowrap; text-align: right; }
.tgn__preu small { display: block; font-size: .7rem; font-weight: 600; color: var(--tinta-3); text-transform: uppercase; letter-spacing: .04em; }
.tgn__var { text-align: right; font-size: var(--t-s, .875rem); font-weight: 650; white-space: nowrap; }
.tgn .ranking__peu { margin-top: 1rem; }
@media (min-width: 760px) {
  /* Se lee columna abajo: la izquierda, los 11 más caros; la derecha, el resto. */
  .tgn__llista { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(11, auto); grid-auto-flow: column; column-gap: 2rem; }
}
