/* ============================================================
   Aliados con Propósito · Cajasan Santander
   Sistema de diseño del sitio público
   ------------------------------------------------------------
   1. Tokens
   2. Base y utilidades
   3. Botones y etiquetas
   4. Cabecera
   5. Hero + mapa
   6. Buscador y formularios
   7. Secciones y chips
   8. Tarjetas de aliado
   9. Directorio y paginación
   10. Pie de página
   11. Responsive
   12. Accesibilidad e impresión
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
    --ink-900: #07101f;
    --ink-800: #0b1729;
    --ink-700: #14233d;
    --navy-700: #1a2b4d;
    --navy-600: #243966;
    --brand-600: #2e427a;
    --brand-500: #3d5da3;
    --brand-400: #5b7cc4;
    --brand-200: #c3d3ee;
    --brand-100: #e6edfa;
    --brand-50: #f2f6fd;

    --gold-500: #f4c430;
    --gold-600: #e0ac0b;
    --gold-50: #fdf6dd;

    --paper: #ffffff;
    --bg: #f6f7f9;
    --bg-soft: #eef1f6;
    --line: #e3e8f0;
    --line-strong: #cfd8e6;

    /* Grises de texto con contraste AA (≥ 4.5:1 sobre blanco) */
    --muted: #56637a;
    --muted-soft: #6b7689;

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-sm: 0 1px 2px rgba(7, 16, 31, .05);
    --shadow-md: 0 10px 30px -22px rgba(7, 16, 31, .45);
    --shadow-lg: 0 30px 60px -40px rgba(7, 16, 31, .55);

    --font-body: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Manrope', ui-sans-serif, system-ui, sans-serif;
    --font-accent: 'Instrument Serif', ui-serif, Georgia, serif;

    --container: 1200px;
    --gutter: clamp(1rem, 4vw, 2rem);
    --header-h: 68px;
    --ease: cubic-bezier(.22, .61, .36, 1);

    /* Mapa: color y velocidad de la luz que recorre los bordes */
    --glow-color: #d4e4ff;
    --glow-halo: rgba(140, 185, 255, .95);
    --glow-speed: 7s;
}

/* ---------- 2. Base y utilidades ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1.5rem);
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink-700);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: 0;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    color: var(--navy-700);
    line-height: 1.15;
    letter-spacing: -.025em;
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

ul,
ol {
    list-style: none;
    padding: 0;
}

/* El atributo hidden siempre oculta, aunque otra regla ponga display */
[hidden] {
    display: none !important;
}

::selection {
    background: var(--brand-200);
    color: var(--ink-900);
}

:focus-visible {
    outline: 3px solid rgba(61, 93, 163, .5);
    outline-offset: 3px;
    border-radius: 4px;
}

.container {
    width: min(100% - (var(--gutter) * 2), var(--container));
    margin-inline: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none !important;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 100;
    padding: .7rem 1.1rem;
    border-radius: var(--radius-sm);
    background: var(--navy-700);
    color: #fff;
    font-weight: 700;
}

.skip-link:focus {
    top: 1rem;
}

.icon {
    width: 1.25rem;
    height: 1.25rem;
    flex: none;
}

.icon--xs { width: .9rem; height: .9rem; }
.icon--sm { width: 1rem; height: 1rem; }
.icon--lg { width: 1.5rem; height: 1.5rem; }

/* ---------- 3. Botones y etiquetas ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .78rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: -.005em;
    line-height: 1.2;
    text-align: center;
    transition: background-color .2s var(--ease), border-color .2s var(--ease),
                color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}

.btn--sm {
    padding: .56rem .95rem;
    font-size: .82rem;
}

.btn--primary {
    background: var(--brand-600);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
    background: var(--navy-700);
    box-shadow: 0 10px 24px -16px rgba(26, 43, 77, .9);
}

.btn--ghost {
    border-color: var(--line-strong);
    background: #fff;
    color: var(--navy-700);
}

.btn--ghost:hover {
    border-color: var(--brand-200);
    background: var(--brand-50);
}

.btn--gold {
    background: var(--gold-500);
    color: #3a2b00;
}

.btn--gold:hover {
    background: var(--gold-600);
}

.btn--wide {
    width: 100%;
}

.btn .icon {
    transition: transform .2s var(--ease);
}

.btn:hover .icon[data-dir="right"] {
    transform: translateX(2px);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .28rem .6rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1.4;
}

/* Etiqueta sobre imagen (solo si se pide explícitamente) */
.badge-star {
    position: absolute;
    top: .6rem;
    right: .6rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .22rem .5rem;
    border-radius: 999px;
    background: var(--gold-500);
    color: #3a2b00;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    box-shadow: 0 6px 14px -8px rgba(58, 43, 0, .8);
}

.badge-star .icon {
    width: .7rem;
    height: .7rem;
    fill: currentColor;
    stroke-width: 1;
}

/* ---------- 4. Cabecera ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    border-bottom: 1px solid rgba(227, 232, 240, .9);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--header-h);
}

.site-header.is-scrolled {
    box-shadow: 0 12px 30px -28px rgba(7, 16, 31, .55);
    background: rgba(255, 255, 255, .94);
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: none;
}

.brand img {
    width: auto;
    height: 34px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: clamp(.9rem, 2.5vw, 1.6rem);
}

.nav-link {
    position: relative;
    padding: .3rem 0;
    color: var(--ink-700);
    font-size: .86rem;
    font-weight: 600;
    transition: color .2s var(--ease);
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--brand-500);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s var(--ease);
}

.nav-link:hover {
    color: var(--brand-600);
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* ---------- 5. Hero + mapa ---------- */

/*
 * `isolation: isolate` crea un contexto de apilamiento propio.
 * Sin él, los pseudo-elementos con z-index negativo (retícula y
 * resplandor) quedaban DETRÁS del fondo del hero y no se veían.
 */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(2.5rem, 6vw, 4.75rem) 0 clamp(5.5rem, 9vw, 7rem);
    background:
        radial-gradient(120% 90% at 82% 18%, #3d5da3 0%, rgba(61, 93, 163, 0) 55%),
        radial-gradient(90% 80% at 8% 92%, #12305c 0%, rgba(18, 48, 92, 0) 60%),
        linear-gradient(150deg, #07101f 0%, #15294d 52%, #2b4a86 100%);
    color: #fff;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
    background-size: 64px 64px;
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    right: -12%;
    bottom: -35%;
    z-index: -1;
    width: 70vw;
    height: 70vw;
    max-width: 900px;
    max-height: 900px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(116, 160, 230, .28) 0%, rgba(116, 160, 230, 0) 62%);
    pointer-events: none;
}

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
}

.hero__copy {
    max-width: 34rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--brand-500);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 1.4rem;
    height: 1px;
    background: currentColor;
    opacity: .55;
}

.hero .eyebrow {
    color: rgba(226, 236, 255, .72);
    margin-bottom: 1.15rem;
}

.hero__title {
    margin-bottom: 1.4rem;
    color: #fff;
    font-size: clamp(2.6rem, 5.1vw, 4.15rem);
    font-weight: 800;
    line-height: .96;
    letter-spacing: -.045em;
}

.hero__title em {
    display: inline-block;
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 400;
    font-size: 1.06em;
    letter-spacing: -.02em;
    color: #d7e3fb;
}

.hero__lead {
    max-width: 32rem;
    color: rgba(233, 240, 255, .82);
    font-size: clamp(.98rem, 1.2vw, 1.08rem);
    line-height: 1.7;
}

.hero__lead strong {
    color: #fff;
    font-weight: 700;
}

.hero__stats {
    display: flex;
    align-items: stretch;
    gap: clamp(1rem, 2.6vw, 2rem);
    margin: 1.9rem 0;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .14);
    max-width: 30rem;
}

/* Columna flexible: los números quedan alineados abajo aunque
   una etiqueta ocupe dos líneas ("Municipios con aliados") */
.stat {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat + .stat {
    padding-left: clamp(1rem, 2.6vw, 2rem);
    border-left: 1px solid rgba(255, 255, 255, .14);
}

.stat dt {
    color: rgba(226, 236, 255, .7);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    line-height: 1.35;
}

.stat dd {
    margin-top: auto;
    padding-top: .2rem;
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 2.6vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* "12 de 87": el total va más pequeño y suave */
.stat dd small {
    margin-left: .2rem;
    color: rgba(226, 236, 255, .62);
    font-size: .42em;
    font-weight: 700;
    letter-spacing: 0;
}

/* Mapa */
.map-panel {
    position: relative;
}

.map-stage {
    position: relative;
    overflow: visible;
    border-radius: 0;
    background: none;
}

.map-svg {
    width: 100%;
    height: auto;
    overflow: visible;
    filter: drop-shadow(0 34px 48px rgba(3, 10, 22, .45));
    transform-origin: center 60%;
    transition: transform .45s var(--ease);
    will-change: transform;
}

/*
 * Luz que recorre el borde de los municipios.
 * Las líneas las crea js/mapa-glow.js (una copia de cada <path>
 * con pathLength="1").
 */
.map-glow {
    pointer-events: none;
    fill: none;
    stroke: var(--glow-color);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: .07 .93;
    stroke-dashoffset: 1;
    animation: map-glow-run var(--glow-speed) linear infinite;
    animation-delay: var(--glow-delay, 0s);
}

.map-svg:has(.map-glow) {
    filter:
        drop-shadow(0 0 4px var(--glow-halo))
        drop-shadow(0 34px 48px rgba(3, 10, 22, .45));
}

@keyframes map-glow-run {
    to { stroke-dashoffset: 0; }
}

.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 26rem;
    text-align: center;
}

.map-loading p {
    margin-top: .9rem;
    color: rgba(233, 240, 255, .72);
    font-size: .8rem;
    letter-spacing: .04em;
}

.spinner {
    width: 2.25rem;
    height: 2.25rem;
    margin-inline: auto;
    border: 2px solid rgba(255, 255, 255, .22);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.map-toolbar {
    position: absolute;
    right: .75rem;
    bottom: -.6rem;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(7, 16, 31, .55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.map-toolbar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: rgba(233, 240, 255, .9);
    transition: background-color .2s, color .2s;
}

.map-toolbar__btn:hover {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.map-legend {
    position: absolute;
    left: .9rem;
    bottom: -.4rem;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: .45rem;
    color: rgba(226, 236, 255, .75);
    font-size: .74rem;
    letter-spacing: .03em;
}

.map-legend__dot {
    width: .55rem;
    height: .55rem;
    border-radius: 2px;
    background: #6f9be0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .4) inset;
}

.map-tooltip {
    position: absolute;
    z-index: 30;
    pointer-events: none;
    padding: .5rem .7rem;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    background: rgba(7, 16, 31, .92);
    box-shadow: var(--shadow-md);
    color: #fff;
    font-size: .8rem;
    line-height: 1.35;
}

.map-tooltip strong {
    display: block;
    font-weight: 700;
}

.map-tooltip span {
    color: rgba(226, 236, 255, .75);
    font-size: .75rem;
}

.map-error {
    padding: 1.25rem;
    text-align: center;
    color: rgba(233, 240, 255, .85);
}

.map-error p:first-child {
    font-weight: 700;
}

/* ---------- 6. Buscador y formularios ---------- */
.search-dock {
    position: relative;
    z-index: 25;
    margin-top: clamp(-4.5rem, -6vw, -3rem);
}

.search-card {
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: 0 24px 48px -34px rgba(7, 16, 31, .55);
}

.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: .8rem;
}

/*
 * Etiquetas de campo en mayúsculas.
 * Se excluye .checkbox: antes heredaba este estilo y el texto
 * de aceptación del cupón salía en MAYÚSCULAS y negrita.
 */
.field > label:not(.checkbox) {
    display: block;
    margin-bottom: .35rem;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    cursor: pointer;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    line-height: 1.55;
}

.checkbox input {
    flex: none;
    width: 1.05rem;
    height: 1.05rem;
    margin-top: .15rem;
    accent-color: var(--brand-600);
}

.field__control {
    position: relative;
}

.field__control .icon {
    position: absolute;
    top: 50%;
    left: .85rem;
    width: 1rem;
    height: 1rem;
    color: var(--muted-soft);
    transform: translateY(-50%);
    pointer-events: none;
}

.input,
.select {
    width: 100%;
    height: 46px;
    padding: 0 .95rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink-700);
    font-size: .88rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.field__control .input {
    padding-left: 2.35rem;
}

.input::placeholder {
    color: #9aa5b6;
}

.input:hover,
.select:hover {
    border-color: #b7c3d6;
}

.input:focus,
.select:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(61, 93, 163, .16);
}

.select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235d6a7e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .85rem center;
}

.search-form .btn {
    height: 46px;
    padding-inline: 1.6rem;
}

.search-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: .85rem;
    color: var(--muted);
    font-size: .8rem;
}

.search-summary strong {
    color: var(--ink-700);
}

/* Migas de pan */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin-bottom: 1.1rem;
    color: var(--muted-soft);
    font-size: .8rem;
    font-weight: 600;
}

.breadcrumb a {
    color: var(--muted);
    transition: color .2s var(--ease);
}

.breadcrumb a:hover {
    color: var(--brand-600);
}

.breadcrumb .icon {
    opacity: .55;
}

.breadcrumb span[aria-current] {
    color: var(--ink-700);
}

/* Ayudas y errores de formulario */
.field__help {
    margin-top: .3rem;
    color: var(--muted-soft);
    font-size: .75rem;
}

.field__error {
    margin-top: .3rem;
    color: #b42318;
    font-size: .76rem;
    font-weight: 600;
}

.input[aria-invalid="true"],
.select[aria-invalid="true"] {
    border-color: #d92d20;
    box-shadow: 0 0 0 3px rgba(217, 45, 32, .12);
}

/* Alertas */
.alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin-bottom: 1.25rem;
    padding: .85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    line-height: 1.5;
}

.alert--error {
    border: 1px solid #f3c7c3;
    background: #fdf3f2;
    color: #8f1d14;
}

.alert--error .icon {
    flex: none;
    margin-top: .1rem;
    color: #c4321b;
}

.alert strong {
    display: block;
    font-weight: 800;
}

.alert p {
    margin-top: .1rem;
}

.chip-clear {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    padding: .22rem .55rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 600;
    transition: background-color .15s, border-color .15s;
}

.chip-clear:hover {
    background: var(--brand-50);
    border-color: var(--brand-200);
}

/* ---------- 7. Secciones y chips ---------- */
.section {
    padding: clamp(2.75rem, 5.5vw, 4.5rem) 0;
}

.section--band {
    background: var(--bg);
}

.section--tight {
    padding-top: clamp(1.75rem, 3.5vw, 2.5rem);
}

/* Destacados → directorio: sin el gran hueco entre ambos */
.section--featured {
    padding-bottom: clamp(.5rem, 1.5vw, 1rem);
}

.section--featured + .section {
    padding-top: clamp(1.75rem, 3.5vw, 2.75rem);
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: clamp(1.4rem, 3vw, 2.1rem);
}

.section-head__text {
    max-width: 42rem;
}

.section-title {
    margin-top: .45rem;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -.035em;
}

.section-sub {
    margin-top: .45rem;
    color: var(--muted);
    font-size: .92rem;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: #fff;
    color: var(--navy-700);
    transition: border-color .2s, background-color .2s, color .2s, transform .2s;
}

.icon-btn:hover {
    border-color: var(--brand-200);
    background: var(--brand-50);
    color: var(--brand-600);
}

.icon-btn:active {
    transform: scale(.96);
}

.icon-btn:disabled {
    opacity: .38;
    cursor: default;
}

/*
 * Chips de categorías con desplazamiento horizontal.
 * site.js añade .is-scrollable / .at-start / .at-end para mostrar
 * los degradados y las flechas solo cuando hay más chips ocultos.
 */
.chip-scroller {
    position: relative;
    margin: 0 0 1.5rem;
}

.chip-row {
    display: flex;
    gap: .5rem;
    margin: 0 0 1.5rem;
    padding-bottom: .35rem;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-padding-inline: 2.75rem;
}

.chip-scroller .chip-row {
    margin: 0;
    padding: .15rem 0 .35rem;
}

.chip-row::-webkit-scrollbar {
    display: none;
}

.chip-scroller::before,
.chip-scroller::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: .35rem;
    z-index: 1;
    width: 4rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s var(--ease);
}

.chip-scroller::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg) 30%, rgba(246, 247, 249, 0));
}

.chip-scroller::after {
    right: 0;
    background: linear-gradient(270deg, var(--bg) 30%, rgba(246, 247, 249, 0));
}

.chip-scroller.is-scrollable:not(.at-start)::before,
.chip-scroller.is-scrollable:not(.at-end)::after {
    opacity: 1;
}

.chip-scroller__btn {
    position: absolute;
    top: calc(50% - .175rem);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: #fff;
    color: var(--navy-700);
    box-shadow: var(--shadow-md);
    transform: translateY(-50%);
    transition: background-color .2s, border-color .2s, color .2s;
}

.chip-scroller__btn:hover {
    border-color: var(--brand-200);
    background: var(--brand-50);
    color: var(--brand-600);
}

.chip-scroller__btn--prev { left: 0; }
.chip-scroller__btn--next { right: 0; }

/* En pantallas táctiles basta con deslizar */
@media (hover: none) {
    .chip-scroller__btn {
        display: none !important;
    }
}

.chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 600;
    transition: border-color .2s, background-color .2s, color .2s;
}

.chip:hover {
    border-color: var(--brand-200);
    color: var(--brand-600);
}

.chip.is-active {
    border-color: var(--brand-600);
    background: var(--brand-600);
    color: #fff;
}

.chip small {
    min-width: 1.25rem;
    padding: .05rem .35rem;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.chip.is-active small {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

/* ---------- 8. Tarjetas de aliado ---------- */
.ally-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}

.ally-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand-200);
    box-shadow: 0 22px 40px -30px rgba(7, 16, 31, .5);
}

.ally-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: radial-gradient(120% 120% at 50% 0%, #f9fbff 0%, #eef2f8 100%);
}

.ally-media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    box-shadow: inset 0 0 0 1px rgba(7, 16, 31, .05);
    pointer-events: none;
}

.ally-media__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(28px) saturate(1.15);
    opacity: .32;
    transform: scale(1.3);
}

.ally-media__img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ally-media--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ally-media--empty span {
    color: rgba(46, 66, 122, .28);
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -.04em;
}

.ally-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .25rem;
    padding: 1rem 1rem 1.05rem;
}

/* Categoría + etiqueta "Destacado" (ya no tapa el afiche) */
.ally-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem .5rem;
    line-height: 1.4;
}

.ally-card__cat {
    color: var(--brand-500);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.ally-card__star {
    display: inline-flex;
    align-items: center;
    gap: .22rem;
    padding: .08rem .45rem;
    border: 1px solid #f3dc8c;
    border-radius: 999px;
    background: var(--gold-50);
    color: #6b4f00;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.ally-card__star .icon {
    width: .7rem;
    height: .7rem;
    fill: var(--gold-500);
    stroke: var(--gold-600);
    stroke-width: 1;
}

.ally-card__name {
    color: var(--navy-700);
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.02em;
}

.ally-card__place {
    display: flex;
    align-items: flex-start;
    gap: .3rem;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.4;
}

.ally-card__place .icon {
    margin-top: .12rem;
    opacity: .75;
}

.ally-card__place span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

/* Beneficio: recuadro compacto, sin línea lateral, con el % al frente */
.ally-card__benefit {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin-top: .6rem;
    padding: .55rem .65rem;
    border: 1px solid var(--brand-100);
    border-radius: var(--radius-sm);
    background: var(--brand-50);
}

.ally-card__pct {
    flex: none;
    min-width: 2.9rem;
    padding: .18rem .4rem;
    border-radius: 6px;
    background: var(--brand-600);
    color: #fff;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.3;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/*
 * El recorte va en el texto (no en el recuadro con relleno):
 * así nunca asoma la parte de arriba de una cuarta línea.
 */
.ally-card__benefit-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    max-height: 4.5em; /* 3 líneas × 1.5 */
    color: var(--navy-600);
    font-size: .8rem;
    font-weight: 500;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* El botón siempre queda al pie: alineado en todas las tarjetas */
.ally-card__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin-top: auto;
    padding: .62rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--brand-600);
    color: #fff;
    font-size: .84rem;
    font-weight: 700;
    transition: background-color .2s var(--ease);
}

/* Separación entre el último contenido y el botón */
.ally-card__body > :nth-last-child(2) {
    margin-bottom: 1rem;
}

.ally-card__cta .icon {
    transition: transform .25s var(--ease);
}

.ally-card:hover .ally-card__cta {
    background: var(--navy-700);
}

.ally-card:hover .ally-card__cta .icon {
    transform: translateX(3px);
}

/* Variante horizontal (destacados) */
.ally-card--wide .ally-media {
    aspect-ratio: 16 / 11;
}

@media (min-width: 620px) {
    .ally-card--wide {
        flex-direction: row;
        min-height: 16.5rem;
    }

    .ally-card--wide .ally-media {
        flex: 0 0 42%;
        aspect-ratio: auto;
        min-height: 100%;
    }

    .ally-card--wide .ally-card__body {
        padding: 1.15rem 1.25rem 1.25rem;
    }

    .ally-card--wide .ally-card__name {
        font-size: 1.15rem;
    }

    .ally-card--wide .ally-card__benefit-text {
        -webkit-line-clamp: 4;
        line-clamp: 4;
        max-height: 6em;
    }
}

/* Carrusel */
.carousel {
    position: relative;
}

.carousel__track {
    display: flex;
    gap: 1.1rem;
    overflow-x: auto;
    padding: .25rem .15rem 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.carousel__track::-webkit-scrollbar {
    display: none;
}

.carousel__track > * {
    flex: 0 0 86%;
    scroll-snap-align: start;
}

@media (min-width: 760px) {
    .carousel__track > * {
        flex-basis: calc(50% - .55rem);
    }
}

.carousel__track.is-paused {
    scroll-behavior: auto;
}

/* ---------- 9. Directorio y paginación ---------- */
.ally-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.15rem;
}

.empty-state {
    padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    background: #fff;
    text-align: center;
}

.empty-state h3 {
    margin-bottom: .35rem;
    font-size: 1.35rem;
    font-weight: 800;
}

.empty-state p {
    margin-bottom: 1.4rem;
    color: var(--muted);
}

.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: clamp(2rem, 4vw, 3rem);
}

.pagination__info {
    color: var(--muted);
    font-size: .82rem;
}

.pagination__pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 .75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink-700);
    font-size: .82rem;
    font-weight: 600;
    transition: border-color .2s, background-color .2s, color .2s;
}

a.page-link:hover {
    border-color: var(--brand-200);
    background: var(--brand-50);
    color: var(--brand-600);
}

.page-link.is-current {
    border-color: var(--brand-600);
    background: var(--brand-600);
    color: #fff;
    font-weight: 800;
}

.page-link.is-disabled {
    border-color: transparent;
    background: transparent;
    color: var(--muted-soft);
    cursor: default;
}

.page-ellipsis {
    padding: 0 .25rem;
    color: var(--muted-soft);
}

/* ---------- 10. Pie de página ---------- */
.site-footer {
    padding: clamp(2.75rem, 5vw, 4rem) 0 1.5rem;
    background: var(--ink-900);
    color: rgba(233, 240, 255, .78);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr .9fr;
    gap: clamp(1.75rem, 4vw, 3.5rem);
    padding-bottom: 2.5rem;
}

.site-footer__brand img {
    width: auto;
    height: 44px;
    margin-bottom: 1rem;
}

.site-footer__brand p {
    max-width: 18rem;
    color: rgba(233, 240, 255, .66);
    font-size: .85rem;
    line-height: 1.65;
}

.site-footer__title {
    margin-bottom: .7rem;
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.site-footer__text {
    max-width: 22rem;
    font-size: .85rem;
    line-height: 1.7;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.1rem;
    margin-top: 1rem;
    font-size: .82rem;
    font-weight: 600;
}

.site-footer__links a {
    color: rgba(233, 240, 255, .75);
    transition: color .2s;
}

.site-footer__links a:hover {
    color: #fff;
}

.site-footer__contact {
    display: grid;
    gap: .55rem;
    font-size: .84rem;
}

.site-footer__contact li {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.site-footer__contact .icon {
    color: var(--brand-400);
}

.site-footer__contact a {
    transition: color .2s;
}

.site-footer__contact a:hover {
    color: #fff;
}

.site-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
    color: rgba(233, 240, 255, .55);
    font-size: .78rem;
}

.site-footer__signature {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.site-footer__signature .icon {
    color: var(--gold-500);
}

/* ---------- 11. Responsive ---------- */
@media (max-width: 1080px) {
    .ally-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .hero__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero__copy {
        max-width: 38rem;
    }

    .map-stage {
        max-width: 34rem;
        margin-inline: auto;
    }

    .map-loading {
        min-height: 21rem;
    }

    .search-form {
        grid-template-columns: 1fr 1fr;
    }

    .search-form .field--search,
    .search-form .btn {
        grid-column: 1 / -1;
    }

    .search-form .btn {
        width: 100%;
    }

    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .site-footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .ally-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    :root {
        --header-h: 62px;
    }

    .brand img {
        height: 28px;
    }

    .nav-link {
        display: none;
    }

    .hero {
        padding-top: 2rem;
        padding-bottom: 5rem;
    }

    .hero__stats {
        gap: .9rem;
    }

    .stat + .stat {
        padding-left: .9rem;
    }

    .stat dt {
        font-size: .66rem;
    }

    .map-legend {
        display: none;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .search-form .btn {
        grid-column: auto;
    }

    .ally-grid {
        grid-template-columns: 1fr;
    }

    .ally-card__name {
        font-size: 1.06rem;
    }

    .site-footer__grid {
        grid-template-columns: 1fr;
    }

    .site-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---------- 12. Accesibilidad e impresión ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

    .carousel__track {
        scroll-behavior: auto;
    }

    .map-glow {
        animation: none;
        stroke-dasharray: none;
        stroke-dashoffset: 0;
        opacity: .35;
    }
}

@media print {
    .site-header,
    .site-footer,
    .skip-link {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .map-glow {
        display: none;
    }
}