/* =============================================================
   Rutas de taxi y camión sobre el Mapa Interactivo (MapLibre).
   Botón + lista + panel de ficha, en estilo «liquid glass» como las demás fichas.
   ============================================================= */
/* Botón de rutas: el dibujo de taxi + camioneta + camión sobre una franja que sale del mapa hasta el borde de la página,
   para que se distinga de los íconos de lugares y no tape el mapa. */
.map-stage { position: relative; scroll-margin-top: 84px; }
.route-toggle {
  --edge: clamp(1rem, 4vw, 3rem);               /* mismo margen lateral que el mapa: la franja arranca en el borde de la página */
  position: absolute; top: 20px; left: 0; z-index: 9;
  display: flex; align-items: center; gap: .7rem; height: 46px;
  padding: 0 1.3rem 0 calc(var(--edge) + 12px);
  background: #0B1B7A; color: #fff; cursor: pointer;
  border: 3px solid #D4FEAA; border-left: 0; border-radius: 0 999px 999px 0;
  font: 800 .8rem/1 var(--display); letter-spacing: .1em; text-transform: uppercase;
  box-shadow: 0 12px 26px rgba(10, 14, 40, .32);
  transition: background .25s var(--ease-out), transform .25s var(--ease-out);
}
.route-toggle img { width: 156px; height: auto; margin: -22px 0; flex: none; filter: drop-shadow(0 5px 6px rgba(0,0,0,.35)); transition: transform .25s var(--ease-out); }
.route-toggle[hidden] { display: none; }
.route-toggle:hover { transform: translateX(4px); }
.route-toggle:hover img { transform: scale(1.06); }
.route-toggle:focus-visible { outline: 3px solid #FFC533; outline-offset: 3px; }
.route-toggle[aria-pressed="true"] { background: var(--tjx-orange); }

/* con las rutas activas se apagan los pines y las zonas para que solo se vean las líneas */
.map-shell .real-pin, .map-shell .zone-chip { transition: opacity .45s ease; }
.map-shell.routes-on .real-pin, .map-shell.routes-on .zone-chip { opacity: 0 !important; pointer-events: none !important; }
.map-shell.routes-on .map-overview, .map-shell.routes-on .map-hint { display: none; }
.map-shell.routes-on .map-edit-toggle { display: none; }

/* paneles de vidrio */
.route-drawer, .route-panel {
  position: absolute; z-index: 7; cursor: auto; touch-action: pan-y; overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,.88), rgba(244,247,255,.78));
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255,255,255,.9); border-radius: 22px;
  box-shadow: 0 24px 56px rgba(10, 14, 40, .22), inset 0 1px 0 rgba(255,255,255,.9);
}
.route-drawer[hidden], .route-panel[hidden] { display: none; }
.route-drawer { top: 92px; left: 14px; bottom: 14px; width: min(300px, calc(100% - 28px)); display: flex; flex-direction: column; gap: .7rem; padding: .9rem; }
.route-q { width: 100%; padding: .7rem 1rem; border: 1.5px solid rgba(10,10,10,.12); border-radius: 999px; background: rgba(255,255,255,.8); font: 500 .9rem var(--sans); }
.route-q:focus { outline: none; border-color: var(--tjx-blue); }
.route-types { display: flex; gap: .4rem; }
.route-types button { flex: 1; padding: .45rem .5rem; border-radius: 999px; background: rgba(10,10,20,.06); font: 700 .74rem var(--sans); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); cursor: pointer; transition: background .2s, color .2s; }
.route-types button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.route-list { flex: 1; min-height: 0; overflow: auto; display: grid; gap: .3rem; align-content: start; padding-right: 2px; list-style: none; margin: 0; padding-left: 0; }
.route-list button { display: flex; align-items: center; gap: .65rem; width: 100%; text-align: left; padding: .6rem .65rem; border-radius: 14px; border: 1.5px solid transparent; cursor: pointer; transition: background .2s, border-color .2s; }
.route-list button:hover { background: rgba(255,255,255,.85); }
.route-list button[aria-pressed="true"] { border-color: var(--ink); background: #fff; }
.route-list i { width: 8px; align-self: stretch; border-radius: 4px; flex: none; }
.route-list span { display: grid; min-width: 0; }
.route-list b { font: 700 .86rem/1.2 var(--display); }
.route-list small { font-size: .74rem; color: var(--ink-mute); }
.route-empty { font-size: .86rem; color: var(--ink-mute); padding: .5rem; }
.route-credit { font-size: .7rem; line-height: 1.45; color: var(--ink-mute); }
.route-credit a { text-decoration: underline; text-underline-offset: 2px; }

.route-panel { top: 14px; right: 14px; bottom: 14px; width: min(350px, calc(100% - 28px)); overflow: auto; padding: 1.1rem 1.1rem 1.3rem; animation: rpIn .45s var(--ease-out); }
@keyframes rpIn { from { opacity: 0; transform: translateX(22px); } }
.rp-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; background: rgba(10,10,20,.07); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.rp-x:hover { background: rgba(10,10,20,.14); }
.rp-car { margin: 2px 0 8px; padding: .8rem .8rem .3rem; border-radius: 16px; background: color-mix(in srgb, var(--rc) 16%, #fff); }
.rp-car svg { width: 100%; max-width: 230px; height: auto; margin-inline: auto; }
.rp-type { display: flex; align-items: center; gap: .5rem; font: 700 .7rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); }
.rp-type i { width: 22px; height: 6px; border-radius: 3px; }
.rp-demo { display: inline-block; margin: .5rem 0 0; padding: .3rem .7rem; border-radius: 999px; background: var(--tjx-amber); color: #0a0a14; font: 700 .68rem var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.route-panel h3 { font-size: 1.3rem; font-weight: 700; margin: .45rem 0 .5rem; padding-right: 28px; text-transform: uppercase; }
.rp-rows { display: grid; gap: 2px; margin: .5rem 0 .8rem; font-size: .86rem; }
.rp-rows div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(10,10,20,.08); padding: .38rem 0; }
.rp-rows dt { color: var(--ink-mute); } .rp-rows dd { margin: 0; font-weight: 700; text-align: right; }
.route-panel h4 { font: 700 .74rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--tjx-orange); margin: .9rem 0 .4rem; }
.rp-stops { counter-reset: s; display: grid; font-size: .86rem; list-style: none; padding: 0; margin: 0; }
.rp-stops li { counter-increment: s; position: relative; padding: .28rem 0 .28rem 30px; }
.rp-stops li::before { content: counter(s); position: absolute; left: 0; top: .28rem; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .7rem; display: grid; place-items: center; }
.rp-places { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.rp-places li { padding: .3rem .75rem; border-radius: 999px; background: rgba(255,182,54,.28); font-size: .8rem; font-weight: 600; }
.rp-note { margin-top: .9rem; font-size: .72rem; line-height: 1.45; color: var(--ink-mute); }

/* pines de salida / llegada con el símbolo de TJXPERIENCE */
.rt-pin { display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.rt-pin-tag { margin-bottom: 6px; padding: .2rem .6rem; border-radius: 999px; background: #fff; font: 700 .66rem var(--display); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 6px 14px rgba(10,10,20,.22); }
.rt-pin-head { width: 36px; height: 36px; margin-bottom: 8px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c, var(--ink)); border: 3px solid #fff; box-shadow: 0 8px 16px rgba(10,10,20,.35); display: grid; place-items: center; }
.rt-pin-head img { width: 24px; height: 24px; transform: rotate(45deg); object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; }
.maplibregl-popup.rt-popup .maplibregl-popup-content { padding: .35rem .7rem; border-radius: 999px; font: 700 .76rem var(--sans); box-shadow: 0 8px 18px rgba(10,10,20,.22); }
.maplibregl-popup.rt-popup .maplibregl-popup-tip { display: none; }

@media (max-width: 1100px) { .map-shell.has-panel .route-drawer { display: none; } } /* en pantallas medianas el panel de la ficha reemplaza a la lista */
@media (max-width: 760px) {
  .route-toggle { top: 14px; height: 38px; padding-left: calc(var(--edge) + 6px); font-size: .72rem; }
  .route-toggle img { width: 104px; margin: -16px 0; }
  .route-drawer { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 40%; }
  .route-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 62%; }
  .map-shell.has-panel .route-drawer { display: none; }
}
@media (prefers-reduced-motion: reduce) { .route-panel { animation: none; } }

/* en modo rutas no se desenfoca el mapa al alejar (el modo «vista general» de las zonas queda en pausa) */
.map-shell.routes-on.is-overview #real-map { filter: none; }

/* Modo app (mapa-interactivo.html?app=1): el mapa va dentro de la app TJXPERIENCE, sin cabecera ni textos de la landing */
.in-app .map-page-header, .in-app .map-intro, .in-app .map-edit-toggle, .in-app .map-hint, .in-app footer { display: none !important; }
.in-app body { margin: 0; padding: 0; }
.in-app .map-search { margin: 10px auto !important; }
.in-app .map-shell { height: calc(100vh - 82px) !important; height: calc(100dvh - 82px) !important; border-radius: 0 !important; }
.in-app .maplibregl-ctrl-bottom-right, .in-app .maplibregl-ctrl-bottom-left { margin-bottom: 84px; }
/* las rutas quedan completas por encima del dock de la app (antes el dock tapaba la parte de abajo) y el mapa sigue a la vista arriba */
.in-app .route-drawer { bottom: 100px; height: min(56%, 470px); }
.in-app .route-panel { bottom: 100px; max-height: min(70%, 540px); }
.in-app .route-list { padding-bottom: 6px; }
.in-app .route-credit { display: none; }      /* el crédito de OpenStreetMap ya sale en el mapa; así caben más rutas en la lista */
