/* =========================================================
   HONDUCOR - Mapa interactivo de agencias (portada)
   Mapa propio en SVG (sin servicios externos): departamentos coloreados por cantidad de agencias y
   acercamiento animado. Solo el mapa: la guía va en la barra y, al elegir un departamento, sus agencias
   aparecen como botones en el pie. Cada agencia lleva a /pagina/puntos-de-servicio?agencia=... (Google Maps).
   Todas las clases empiezan con "am-" para no chocar con el resto del sitio.
   ========================================================= */

.am-section { position: relative; overflow: hidden; background: var(--hc-bg); }

.am-head { text-align: center; max-width: 680px; margin: 0 auto 2.4rem; }
.am-head .eyebrow { justify-content: center; }
.am-head p { color: var(--hc-muted); margin: .8rem 0 0; }

/* ---------- Mapa (sin recuadro) ---------- */
.am-wrap { position: relative; max-width: 1080px; margin: 0 auto; }

.am-bar { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .6rem; min-height: 48px; margin-bottom: .4rem; }
.am-dep-titulo { display: inline-flex; align-items: baseline; gap: .5rem; font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; color: var(--hc-navy);
                 animation: am-entrar .35s var(--hc-ease); }
.am-dep-titulo i { color: #CF1D1F; font-size: 1.1rem; }
.am-dep-titulo small { font-family: inherit; font-weight: 600; font-size: .82rem; color: var(--hc-muted); }

/* Guía corta que cambia según lo que haga el usuario */
.am-hint { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border-radius: 999px; color: var(--hc-navy); font-size: .82rem; font-weight: 600;
           background: rgba(255, 255, 255, .78); border: 1px solid rgba(31, 86, 156, .14); box-shadow: 0 10px 24px -16px rgba(11, 42, 82, .45);
           -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.am-hint > i { color: var(--hc-blue); flex: none; }
.am-hint.am-pulso > i { animation: am-toque .5s var(--hc-ease); }
@keyframes am-toque { 40% { transform: scale(1.3) rotate(-12deg); } }
#amAvisoText { white-space: nowrap; transition: opacity .2s, transform .25s var(--hc-ease); }
#amAvisoText.am-cambia { opacity: 0; transform: translateY(4px); }

.am-btn { display: inline-flex; align-items: center; gap: .4rem; height: 38px; padding: 0 1rem; border-radius: 999px; border: 0; background: var(--hc-blue);
          color: #fff; font: 700 .78rem var(--font-head); cursor: pointer; white-space: nowrap; box-shadow: 0 10px 20px -10px rgba(31, 86, 156, .8);
          transition: all .2s var(--hc-ease); animation: am-entrar .3s var(--hc-ease); }
.am-btn:hover, .am-btn:focus-visible { background: var(--hc-navy); transform: translateY(-2px); outline: none; }
@keyframes am-entrar { from { opacity: 0; transform: translateY(6px); } }

/* Al acercar, los bordes del mapa se desvanecen en vez de cortarse */
.am-mapa { position: relative; overflow: hidden; padding: .5rem 0; }
.am-zoom .am-mapa { -webkit-mask-image: radial-gradient(ellipse 54% 56% at 50% 50%, #000 58%, transparent 100%);
                    mask-image: radial-gradient(ellipse 54% 56% at 50% 50%, #000 58%, transparent 100%); }
.am-svg { display: block; width: 100%; height: auto; overflow: visible; }

.am-dep { fill: var(--c); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; cursor: pointer; vector-effect: non-scaling-stroke;
          transition: fill .25s, opacity .35s, filter .25s; outline: none; }
.am-anim .am-dep { animation: am-aparecer .6s var(--hc-ease) backwards; animation-delay: var(--d); }
@keyframes am-aparecer { from { opacity: 0; transform: translateY(8px); } }
.am-dep:hover, .am-dep:focus-visible { fill: #F5AE09; filter: drop-shadow(0 6px 10px rgba(11, 42, 82, .35)); }
.am-sel .am-dep { opacity: .28; }
.am-sel .am-dep.am-activo { opacity: 1; fill: var(--hc-blue); }
.am-sel .am-dep.am-activo:hover { fill: #2d68b2; }
.am-sombra { fill: rgba(11, 42, 82, .18); filter: blur(6px); transform: translate(0, 8px); }

.am-nombre { font: 700 11px var(--font-head); fill: var(--hc-navy); paint-order: stroke; stroke: rgba(255, 255, 255, .85); stroke-width: 3px;
             pointer-events: none; text-anchor: middle; opacity: 0; transition: opacity .3s; }
.am-nombres .am-nombre { opacity: .85; }
.am-sel .am-nombre { opacity: 0; }

.am-pin { cursor: pointer; outline: none; }
.am-anim .am-pin { animation: am-pin 1.1s cubic-bezier(.34, 1.3, .64, 1) backwards; animation-delay: var(--d); }
@keyframes am-pin { from { opacity: 0; transform: translateY(-26px); } }
.am-halo { fill: #F5AE09; opacity: .35; transform-box: fill-box; transform-origin: center; animation: am-latir 2.4s ease-out infinite; animation-delay: var(--h); }
@keyframes am-latir { 0% { transform: scale(.6); opacity: .55; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
.am-punto { fill: #fff; stroke: #CF1D1F; stroke-width: 2.4; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center;
            transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), fill .2s; }
.am-pin:hover .am-punto, .am-pin:focus-visible .am-punto, .am-pin.am-hot .am-punto { fill: #CF1D1F; transform: scale(1.5); }
.am-sel .am-pin.am-fuera { opacity: .15; pointer-events: none; }
.am-etiqueta { font: 700 11.5px var(--font-head); fill: var(--hc-navy); paint-order: stroke; stroke: #fff; stroke-width: 3px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.am-sel .am-pin:not(.am-fuera) .am-etiqueta { opacity: 1; }

.am-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--hc-navy); color: #fff; border-radius: 14px; padding: .6rem .85rem; font-size: .8rem; min-width: 150px;
          box-shadow: 0 16px 32px -14px rgba(0, 0, 0, .55); transform: translate(-50%, calc(-100% - 14px)); border-bottom: 3px solid #F5AE09; white-space: nowrap; }
.am-tip::after { content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #F5AE09; }
.am-tip b { display: block; font-size: .88rem; }
.am-tip small { opacity: .8; }
.am-tip .am-cta { display: block; margin-top: .3rem; color: #F5AE09; font-weight: 700; font-size: .74rem; }

/* ---------- Pie: leyenda, o las agencias del departamento elegido ---------- */
.am-pie { position: relative; z-index: 1; display: flex; justify-content: center; margin-top: .4rem; }
.am-leyenda { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .6rem 1rem; padding: .4rem 0; font-size: .74rem; color: var(--hc-muted); font-weight: 600; }
.am-leyenda > i { width: 120px; height: 8px; border-radius: 8px; background: linear-gradient(90deg, #dbe7f6, #8fb3e0, var(--hc-blue), var(--hc-navy)); }
.am-leyenda-pin { margin-left: 1rem; display: inline-flex; align-items: center; gap: .4rem; }
.am-leyenda-pin b { width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2.4px solid #CF1D1F; box-shadow: 0 0 0 4px rgba(245, 174, 9, .3); }

.am-agencias { max-width: 900px; padding: .2rem 0; animation: am-entrar .35s var(--hc-ease); }
.am-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; margin: 0; padding: .1rem; list-style: none; }
.am-pills a { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1rem; border-radius: 999px; background: #fff; border: 1px solid rgba(31, 86, 156, .16); box-shadow: 0 8px 18px -14px rgba(11, 42, 82, .5);
              color: var(--hc-navy); font-size: .82rem; font-weight: 600; text-decoration: none; white-space: nowrap;
              transition: all .2s var(--hc-ease); animation: am-entrar .35s var(--hc-ease) backwards; }
.am-pills a i { color: #CF1D1F; font-size: .8rem; transition: transform .2s var(--hc-ease); }
.am-pills a:hover, .am-pills a:focus-visible, .am-pills a.am-hot { background: var(--hc-blue); border-color: var(--hc-blue); color: #fff; transform: translateY(-2px);
              box-shadow: 0 10px 18px -10px rgba(31, 86, 156, .8); outline: none; }
.am-pills a:hover i, .am-pills a.am-hot i { color: #F5AE09; transform: translateX(2px); }

.am-cargando { display: grid; place-items: center; min-height: 380px; color: var(--hc-muted); font-weight: 600; font-size: .9rem; }

@media (max-width: 767.98px) {
    .am-dep-titulo { width: 100%; justify-content: center; font-size: 1.2rem; }
    .am-mapa { padding: .3rem 0; }
    .am-leyenda-pin { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .am-section *, .am-section *::before, .am-section *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* ---------- Puntos de servicio: agencia seleccionada (Google Maps) ---------- */
.am-agencia { scroll-margin-top: 120px; background: #fff; border: 1px solid var(--hc-line); border-radius: 24px; overflow: hidden; box-shadow: 0 30px 60px -32px rgba(11, 42, 82, .45); }
.am-agencia-grid { display: grid; grid-template-columns: 360px 1fr; }
.am-agencia-info { display: flex; flex-direction: column; border-right: 1px solid var(--hc-line); }
.am-agencia-head { position: relative; padding: 1.3rem 1.4rem; background: linear-gradient(120deg, var(--hc-blue), var(--hc-navy)); color: #fff; border-bottom: 4px solid #F5AE09; }
.am-agencia-head small { text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; font-weight: 700; color: #F5AE09; }
.am-agencia-head h2 { margin: .25rem 0 .15rem; font-size: 1.45rem; line-height: 1.15; color: #fff; }
.am-agencia-head span { opacity: .85; font-size: .88rem; }
.am-agencia-body { padding: 1.4rem; display: grid; gap: .9rem; flex: 1; }
.am-dato { display: flex; gap: .8rem; align-items: flex-start; }
.am-dato > i { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; background: #eaf1fb; color: var(--hc-blue); font-size: 1.05rem; }
.am-dato b { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--hc-muted); }
.am-dato span, .am-dato a { font-size: .93rem; color: var(--hc-ink); font-weight: 600; }
.am-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .3rem; }
.am-acciones .btn { border-radius: 999px; font-weight: 700; font-size: .86rem; }
.am-otra { padding: 1.1rem 1.4rem 1.4rem; border-top: 1px solid var(--hc-line); background: #fbfcfe; }
.am-otra label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--hc-muted); }
.am-otra select { margin-top: .45rem; border-radius: 14px; }
.am-gmap { position: relative; min-height: 460px; background: #e9eef5; }
.am-gmap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 991.98px) {
    .am-agencia-grid { grid-template-columns: 1fr; }
    .am-agencia-info { border-right: 0; border-bottom: 1px solid var(--hc-line); }
    .am-gmap { min-height: 360px; }
}
