/*
 * Sección «Cobertura nacional» de la portada.
 *
 * La estructura viene del bosquejo aprobado; los colores NO. El bosquejo venía en
 * grafito + cobre con Fraunces e IBM Plex, y esta landing es azul sobre claro con
 * Hanken Grotesk: se remapearon los tokens --al-* a los de publico.css para que la
 * sección se lea como parte del sitio y siga el tema claro/oscuro. Se mantiene la capa
 * --al-* propia para no atar el bosquejo al resto del sistema visual.
 */

.al-cobertura {
    --al-surface:   var(--card-bg);
    --al-surface-2: var(--surface-2);
    --al-line:      var(--border);
    --al-brand:     var(--primary);
    --al-brand-2:   var(--accent);
    --al-cal:       var(--text);
    --al-muted:     var(--text-muted);
    --al-r-lg:      var(--radius-2xl);

    position: relative;
    overflow: hidden;
    padding: clamp(48px, 7vw, 96px) 20px;
    background:
        radial-gradient(900px 520px at 78% 12%, var(--primary-glow), transparent 62%),
        radial-gradient(700px 480px at 12% 88%, var(--accent-glow), transparent 60%),
        var(--bg);
}

/* Rejilla técnica de fondo, difuminada hacia los bordes. */
.al-cobertura::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image:
        linear-gradient(to right, var(--al-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--al-line) 1px, transparent 1px);
    background-size: 72px 72px;
    -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 15%, transparent 78%);
    mask-image: radial-gradient(circle at 50% 40%, #000 15%, transparent 78%);
}

.al-cob-wrap { position: relative; max-width: 1180px; margin: 0 auto; }

/* ── Encabezado ─────────────────────────────────────────────────────────── */
.al-cob-eyebrow {
    display: inline-flex; align-items: center; gap: 9px;
    font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700;
    color: var(--al-brand);
    border: 1px solid color-mix(in srgb, var(--al-brand) 32%, transparent);
    padding: 6px 13px; border-radius: 999px;
    background: color-mix(in srgb, var(--al-brand) 7%, transparent);
}
.al-cob-eyebrow i {
    width: 6px; height: 6px; border-radius: 50%; background: var(--al-brand);
    animation: al-cob-ping 2.4s infinite;
}
@keyframes al-cob-ping {
    0%   { box-shadow: 0 0 0 0 var(--primary-glow); }
    70%  { box-shadow: 0 0 0 9px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.al-cob-title {
    font-weight: 800; font-size: clamp(28px, 4vw, 46px); line-height: 1.08;
    letter-spacing: -.02em; margin: 20px 0 12px; max-width: 18ch; color: var(--text);
}
.al-cob-title em { font-style: normal; color: var(--al-brand-2); }
.al-cob-lede { color: var(--al-muted); max-width: 52ch; font-size: 16px; line-height: 1.65; margin: 0; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.al-cob-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 620px);
    gap: clamp(24px, 4vw, 56px); align-items: start; margin-top: clamp(32px, 4vw, 56px);
}
@media (max-width: 960px) { .al-cob-grid { grid-template-columns: 1fr; } }

/* ── Contador ───────────────────────────────────────────────────────────── */
.al-cob-counter { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 6px; }
.al-cob-num {
    font-weight: 900; font-size: clamp(64px, 10vw, 112px); line-height: .82; letter-spacing: -.045em;
    background: linear-gradient(175deg, var(--al-brand) 25%, var(--al-brand-2) 105%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.al-cob-plus { font-weight: 800; font-size: clamp(30px, 5vw, 48px); color: var(--al-brand-2); line-height: 1; padding-bottom: 6px; }
.al-cob-clabel {
    font-size: 12px; letter-spacing: .13em; text-transform: uppercase; font-weight: 600;
    color: var(--al-muted); padding-bottom: 12px; max-width: 14ch; line-height: 1.5;
}

/* ── Métricas ───────────────────────────────────────────────────────────── */
.al-cob-metrics {
    display: grid; grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--al-line); border-bottom: 1px solid var(--al-line); margin: 26px 0;
}
.al-cob-metric { padding: 18px 0; }
.al-cob-metric + .al-cob-metric { border-left: 1px solid var(--al-line); padding-left: 18px; }
.al-cob-metric-v { font-size: 26px; font-weight: 800; color: var(--text); }
.al-cob-metric-k { font-size: 12px; color: var(--al-muted); margin-top: 4px; }

/* ── Chips de zona ──────────────────────────────────────────────────────── */
.al-cob-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.al-cob-chip {
    font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600;
    padding: 8px 14px; border-radius: 999px; cursor: pointer; font-family: inherit;
    background: transparent; color: var(--al-muted); border: 1px solid var(--al-line);
    transition: all .18s ease;
}
.al-cob-chip:hover { color: var(--text); border-color: var(--al-brand); }
.al-cob-chip[aria-pressed="true"] { background: var(--al-brand); border-color: var(--al-brand); color: #fff; }
.al-cob-chip:focus-visible { outline: 2px solid var(--al-brand-2); outline-offset: 2px; }

/* ── Ficha del cliente ──────────────────────────────────────────────────── */
.al-cob-ficha {
    background: var(--al-surface); border: 1px solid var(--al-line); border-radius: var(--al-r-lg);
    padding: 20px; display: flex; gap: 16px; align-items: flex-start;
    min-height: 150px; position: relative; overflow: hidden; box-shadow: var(--card-shadow);
}
.al-cob-ficha::after {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(var(--al-brand), transparent);
}
.al-cob-win {
    width: 60px; height: 60px; border-radius: 14px; flex: none; display: grid; place-items: center;
    border: 1px solid color-mix(in srgb, var(--al-brand) 32%, transparent); color: var(--al-brand);
    background: color-mix(in srgb, var(--al-brand) 9%, transparent);
}
.al-cob-win svg { width: 30px; height: 30px; }
.al-cob-nom { font-size: 19px; font-weight: 800; margin: 0 0 2px; line-height: 1.2; color: var(--text); }
.al-cob-meta { font-size: 11px; color: var(--al-brand); letter-spacing: .07em; text-transform: uppercase; font-weight: 700; }
.al-cob-quote { margin: 10px 0 0; font-size: 14px; line-height: 1.6; color: var(--al-muted); font-style: italic; }
.al-cob-tags { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.al-cob-tag {
    font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
    padding: 4px 9px; border-radius: 6px;
    background: color-mix(in srgb, var(--al-brand-2) 12%, transparent);
    color: var(--al-brand-2); border: 1px solid color-mix(in srgb, var(--al-brand-2) 24%, transparent);
}
.al-cob-hint { color: var(--al-muted); font-size: 13.5px; line-height: 1.6; align-self: center; }

/* ── Mapa en 3 tiras ────────────────────────────────────────────────────── */
.al-cob-mapa {
    background: var(--al-surface); border: 1px solid var(--al-line); border-radius: var(--al-r-lg);
    padding: 22px 18px 16px; position: relative; box-shadow: var(--card-shadow);
}
.al-cob-tiras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.al-cob-tira { position: relative; }
.al-cob-tira-head {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
    color: var(--al-muted); padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--al-line);
}
.al-cob-tira-n { color: var(--al-brand); font-weight: 800; }
.al-cob-canvas { position: relative; width: 100%; aspect-ratio: 300/568.2; }
/* overflow hidden y no visible: cada tira recorta al tercio de Chile que le toca por
   viewBox. Con overflow visible el path entero se salía de la tarjeta y se veían tres
   siluetas completas superpuestas. Los pines no se recortan porque son HTML absoluto
   dentro de .al-cob-canvas, fuera del SVG. */
.al-cob-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; }
.al-cob-land { fill: url(#alLandGrad); stroke: var(--al-brand); stroke-width: 1.1; vector-effect: non-scaling-stroke; opacity: .9; }

/* ── Pines ──────────────────────────────────────────────────────────────── */
.al-cob-pin {
    position: absolute; transform: translate(-50%, -50%); border: 0; padding: 0; background: none;
    cursor: pointer; z-index: 2; opacity: 0; animation: al-cob-pop .5s cubic-bezier(.2, 1.4, .4, 1) forwards;
}
@keyframes al-cob-pop {
    from { opacity: 0; transform: translate(-50%, -30%) scale(.4); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .al-cob-pin { animation: none; opacity: 1; }
}

.al-cob-pin--win { width: 34px; height: 34px; }
.al-cob-pin--win .al-cob-chipwin {
    width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
    background: var(--al-surface); border: 1.6px solid var(--al-brand); color: var(--al-brand);
    box-shadow: 0 3px 12px rgba(0, 0, 0, .18);
    transition: transform .2s ease, border-color .2s ease, color .2s ease, background .2s ease;
}
.al-cob-pin--win svg { width: 17px; height: 17px; display: block; }
.al-cob-pin--win::after {
    content: ""; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%) rotate(45deg);
    width: 9px; height: 9px; background: var(--al-brand); border-radius: 2px; z-index: -1;
}
.al-cob-pin--win:hover .al-cob-chipwin,
.al-cob-pin--win.is-active .al-cob-chipwin {
    transform: scale(1.16); background: var(--al-brand); border-color: var(--al-brand); color: #fff;
}
.al-cob-pin--win:hover, .al-cob-pin--win.is-active { z-index: 6; }

.al-cob-pin--dot { width: 11px; height: 11px; z-index: 1; }
.al-cob-pin--dot span {
    display: block; width: 100%; height: 100%; border-radius: 50%;
    background: var(--al-brand-2); border: 1.5px solid var(--al-surface);
    box-shadow: 0 0 10px var(--accent-glow); transition: transform .18s ease;
}
.al-cob-pin--dot:hover span, .al-cob-pin--dot.is-active span { transform: scale(1.9); background: var(--al-brand); }

/* Agrupados por comuna cuando el mapa se llena: el número va dentro del punto. */
.al-cob-pin--grupo { width: 24px; height: 24px; z-index: 1; }
.al-cob-pin--grupo span {
    display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
    background: var(--al-brand-2); color: #fff; font-size: 10px; font-weight: 800;
    border: 1.5px solid var(--al-surface); box-shadow: 0 0 10px var(--accent-glow);
}

.al-cob-pin.is-dimmed { opacity: .16; filter: saturate(.2); pointer-events: none; }
.al-cob-pin:focus-visible { outline: 2px solid var(--al-brand-2); outline-offset: 3px; border-radius: 50%; }

/* ── Tooltip ────────────────────────────────────────────────────────────── */
.al-cob-tip {
    position: absolute; z-index: 20; pointer-events: none; opacity: 0;
    transform: translate(-50%, -120%) scale(.96); transition: opacity .14s ease, transform .14s ease;
    white-space: nowrap; background: var(--text); color: var(--card-bg);
    padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
}
.al-cob-tip small { display: block; font-weight: 400; font-size: 10px; opacity: .7; letter-spacing: .04em; }
.al-cob-tip.is-on { opacity: 1; transform: translate(-50%, -135%) scale(1); }

.al-cob-pie {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--al-line);
    font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--al-muted);
}
.al-cob-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.al-cob-legend span { display: inline-flex; align-items: center; gap: 6px; }
.al-cob-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--al-brand-2); display: inline-block; }
.al-cob-legend i.win { background: transparent; border: 1.5px solid var(--al-brand); border-radius: 3px; }

/* ── CTA ────────────────────────────────────────────────────────────────── */
.al-cob-cta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.al-cob-cta-note { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--al-muted); max-width: 20ch; line-height: 1.6; }

@media (max-width: 600px) {
    .al-cob-mapa { padding: 16px 12px 12px; }
    .al-cob-tiras { gap: 6px; }
    .al-cob-pin--win { width: 28px; height: 28px; }
    .al-cob-pin--win svg { width: 14px; height: 14px; }
    .al-cob-metric + .al-cob-metric { padding-left: 12px; }
}
