/* Posadas Viva — estilo compartido
   Identidad de la campaña: degradé turquesa #06ABB1 → #038291 → #016C7E.
   Tipografía: Source Sans 3 (textos y títulos) y Barlow Condensed solo en el logotipo (alojadas, licencia OFL).
   Tono: moderno y tecnológico; fondo claro, datos en primer plano. */

@font-face { font-family: "Barlow Condensed"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/barlow-condensed-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-style: normal; font-display: swap; src: url("/assets/fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); }


@font-face { font-family: "Source Sans 3"; font-weight: 300; font-style: normal; font-display: swap; src: url("/assets/fonts/source-sans-3-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/source-sans-3-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

/* ===== Variables de diseño (fuente única de verdad) ===== */
:root {
  /* color */
  --tinta: #0E2A33;          /* azul petróleo oscuro: textos */
  --suave: #51656C;          /* texto secundario */
  --tenue: #7C8D93;          /* texto terciario, deshabilitado */
  --papel: #FFFFFF;
  --superficie: #F5F8F9;     /* gris frío muy claro */
  --niebla: var(--superficie);
  --linea: #E2E9EB;          /* divisores y bordes */
  --linea-fuerte: #CBD6D9;
  --turquesa: #06ABB1;       /* marca */
  --medio: #038291;
  --petroleo: #016C7E;
  --rio: var(--petroleo);
  --turquesa-suave: #E6F6F6;
  --rio-claro: var(--turquesa-suave);
  --degrade: linear-gradient(120deg, #06ABB1 0%, #038291 55%, #016C7E 100%); /* solo logotipo */
  --verde: #2B8A3E;  --verde-suave: #E7F4EA;
  --amarillo: #D99A00; --amarillo-suave: #FDF4DD;
  --rojo: #D23B3B;   --rojo-suave: #FBEAEA;
  /* tipografía */
  --f-titulo: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --f-ui: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --f-num: "Source Sans 3", system-ui, Arial, sans-serif;
  --f-marca: "Barlow Condensed", "Arial Narrow", sans-serif;
  --fuente: var(--f-ui); --texto: var(--f-ui); --cond: var(--f-titulo);
  --t-xs: 12px; --t-sm: 14px; --t-md: 17px; --t-lg: 18px; --t-xl: 22px; --t-2xl: 28px; --t-3xl: 40px; --t-4xl: 56px;
  /* espaciado (múltiplos de 8) */
  --e-1: 8px; --e-2: 16px; --e-3: 24px; --e-4: 32px; --e-5: 40px; --e-6: 48px; --e-8: 64px; --e-10: 80px; --e-12: 96px;
  /* radios y sombras */
  --radio-sm: 6px; --radio: 8px; --radio-md: 12px; --radio-lg: 16px;
  --sombra: 0 1px 2px rgba(14,42,51,.04), 0 2px 8px rgba(14,42,51,.04);
  --sombra-hover: 0 2px 4px rgba(14,42,51,.05), 0 8px 24px rgba(14,42,51,.07);
  --ancho: 1160px;
  --transicion: 160ms cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--f-ui); color: var(--tinta); background: var(--papel); font-size: var(--t-md); line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { font-family: var(--f-titulo); color: var(--tinta); }
a { color: var(--petroleo); }
:focus-visible { outline: 2px solid var(--turquesa); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.num { font-family: var(--f-num); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.degrade-texto { background: var(--degrade); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ===== Encabezado ===== */
.top { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; justify-content: space-between; gap: var(--e-2); padding: 0 var(--e-3); height: 64px; background: var(--papel); border-bottom: 1px solid var(--linea); }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-marca); font-weight: 800; font-size: 25px; letter-spacing: .01em; text-transform: uppercase; white-space: nowrap; line-height: 1; }
.marca .palabra { background: var(--degrade); -webkit-background-clip: text; background-clip: text; color: transparent; }
.marca svg { flex: none; }
.nav { display: flex; gap: 4px; }
.nav a { font-family: var(--f-ui); color: var(--suave); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: var(--radio); transition: background var(--transicion), color var(--transicion); }
.nav a:hover { color: var(--tinta); background: var(--superficie); }
.nav a[aria-current="page"] { color: var(--petroleo); background: var(--turquesa-suave); }
@media (max-width: 640px) {
  .top { padding: 0 var(--e-1) 0 var(--e-2); height: 56px; gap: var(--e-1); }
  .marca { font-size: 21px; gap: 8px; }
  .nav { gap: 0; }
  .nav a { padding: 6px 8px; font-size: 14px; }
  .nav .solo-escritorio { display: none; }
}

/* estados de los proyectos: texto con un círculo que se va llenando, sin fondos de color */
.estado { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-ui); font-size: 13px; font-weight: 500; color: var(--suave); white-space: nowrap; }
.estado::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; }
.estado.disponible { color: var(--tinta); font-weight: 600; }
.estado.disponible::before { background: var(--petroleo); border-color: var(--petroleo); }
.estado.preparacion::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.estado.proximo { color: var(--tenue); }

/* pie */
.pie { border-top: 1px solid var(--linea); padding: var(--e-4) var(--e-3) var(--e-5); color: var(--suave); font-size: var(--t-sm); }
.pie .ancho { max-width: var(--ancho); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; }

/* ===== Pantallas de mapa como app: barra lateral + barra superior + panel + mapa ===== */
.app-shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; background: var(--papel); }
.riel { flex: none; width: 84px; display: flex; flex-direction: column; align-items: stretch; background: #0B3640; color: #fff; padding: 10px 0 12px; z-index: 1001; }
.riel a, .riel .off { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 4px; color: rgba(255,255,255,.72); text-decoration: none; font-family: var(--f-ui); font-size: 12px; font-weight: 500; line-height: 1.15; text-align: center; position: relative; transition: background var(--transicion), color var(--transicion); }
.riel a:hover { color: #fff; background: rgba(255,255,255,.07); }
.riel a[aria-current="page"] { color: #fff; background: #016C7E; }
.riel a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #5FC7CB; }
.riel .off { color: rgba(255,255,255,.38); cursor: default; }
.riel .off small { font-size: 10px; color: rgba(255,255,255,.45); margin-top: -2px; }
.riel .riel-logo { padding: 6px 0 16px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.12); }
.riel .riel-logo:hover { background: none; }
.riel .riel-inicio { margin-top: auto; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.barra { flex: none; height: 64px; display: flex; align-items: center; gap: var(--e-2); padding: 0 var(--e-3); background: var(--papel); border-bottom: 1px solid var(--linea); position: relative; z-index: 1000; }
.dir { flex: 1; max-width: 640px; display: flex; align-items: center; gap: 8px; }
.dir .campo-calle { position: relative; flex: 1; min-width: 0; }
.dir .campo-calle svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--suave); pointer-events: none; }
.dir input { width: 100%; height: 42px; border: 1px solid var(--linea-fuerte); border-radius: var(--radio); font: inherit; font-size: 15px; padding: 0 12px; background: var(--papel); color: var(--tinta); }
.dir #calle { padding-left: 38px; padding-right: 34px; }
.dir #altura { width: 96px; flex: none; }
.dir input:focus { border-color: var(--turquesa); outline: none; box-shadow: 0 0 0 3px rgba(6,171,177,.18); }
.dir #limpiar { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: none; border-radius: var(--radio-sm); font-size: 20px; line-height: 1; color: var(--suave); cursor: pointer; display: none; }
.dir.con-texto #limpiar { display: block; }
.dir #limpiar:hover { background: var(--superficie); color: var(--tinta); }
.dir .boton { height: 42px; padding: 0 18px; flex: none; }
.dir .boton:disabled { opacity: .7; cursor: wait; }
.barra-marca { margin-left: auto; display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--f-marca); font-weight: 800; font-size: 20px; text-transform: uppercase; letter-spacing: .01em; line-height: 1; white-space: nowrap; }
.barra-marca .palabra { background: var(--degrade); -webkit-background-clip: text; background-clip: text; color: transparent; }
.app { flex: 1; min-height: 0; display: flex; position: relative; }
.panel { width: 380px; flex: none; overflow-y: auto; border-right: 1px solid var(--linea); padding: 22px 22px 32px; background: var(--papel); }
.mapa { flex: 1; min-height: 300px; }
.asa { display: none; }
.panel h1 { font-family: var(--f-titulo); font-weight: 300; font-size: 32px; line-height: 1.12; margin: 0 0 8px; letter-spacing: -.005em; }
.panel h1 span { color: inherit; }
.panel .bajada { color: var(--suave); margin: 0 0 var(--e-2); font-size: 15px; }
.panel h2 { font-family: var(--f-titulo); font-size: 15px; font-weight: 600; color: var(--tinta); margin: var(--e-3) 0 var(--e-1); }
.aviso-dir { font-size: 14px; line-height: 1.45; color: var(--tinta); background: var(--turquesa-suave); border-radius: var(--radio); padding: 10px 12px; margin: 0 0 var(--e-2); }
.aviso-dir:empty { display: none; }
.aviso-dir.error { background: #FBEAEA; color: #8E2620; }
.boton-mapa { width: 40px; height: 40px; display: grid; place-items: center; background: var(--papel); color: var(--tinta); border: 1px solid var(--linea-fuerte); border-radius: var(--radio); cursor: pointer; box-shadow: 0 1px 3px rgba(14,42,51,.12); }
.boton-mapa:hover { color: var(--petroleo); border-color: var(--petroleo); }
.boton-mapa.buscando { color: var(--turquesa); }
.marca-dir { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; background: var(--tinta); border: 3px solid #fff; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.35); }

@media (max-width: 820px) {
  .app-shell { flex-direction: column-reverse; }
  .riel { width: auto; height: 62px; flex-direction: row; padding: 0; border-top: 1px solid rgba(255,255,255,.12); padding-bottom: env(safe-area-inset-bottom); height: calc(62px + env(safe-area-inset-bottom)); }
  .riel a, .riel .off { flex: 1; padding: 9px 2px 7px; font-size: 11px; gap: 3px; }
  .riel .riel-logo { display: none; }
  .riel .riel-inicio { order: -1; margin-top: 0; }
  .riel a[aria-current="page"]::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 3px; }
  .riel .off small { display: none; }
  .barra { height: 58px; padding: 0 10px; gap: 8px; }
  .barra-marca { display: none; }
  .dir { max-width: none; gap: 6px; }
  .dir input { height: 40px; font-size: 16px; }
  .dir #altura { width: 72px; }
  .dir .boton { height: 40px; padding: 0 12px; }
  .app { display: block; }
  .mapa { position: absolute; inset: 0; }
  .panel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 900; width: auto; max-height: 40%; border-right: 0; border-radius: 14px 14px 0 0; padding: 0 16px 20px; box-shadow: 0 -6px 20px rgba(14,42,51,.16); transition: max-height 240ms ease; }
  .panel.abierto { max-height: 86%; }
  .asa { display: flex; flex-direction: column; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 2; width: calc(100% + 32px); margin: 0 -16px 6px; padding: 8px 0 6px; border: 0; background: var(--papel); font: inherit; font-size: 12px; font-weight: 600; color: var(--suave); cursor: pointer; }
  .asa::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: var(--linea-fuerte); }
  .panel h1 { font-size: 24px; }
  .panel .bajada { display: none; }
}

/* controles */
.seg { display: flex; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 4px; border-radius: var(--radio-sm); font: inherit; font-size: 14px; font-weight: 500; color: var(--suave); cursor: pointer; transition: background var(--transicion), color var(--transicion); }
.seg button[aria-pressed="true"] { background: var(--papel); color: var(--petroleo); font-weight: 600; box-shadow: var(--sombra); }
select, input[type=search] { width: 100%; padding: 9px 12px; border: 1px solid var(--linea-fuerte); border-radius: var(--radio); font: inherit; font-size: 15px; background: var(--papel); color: var(--tinta); }
select:focus, input[type=search]:focus { border-color: var(--turquesa); outline: none; box-shadow: 0 0 0 3px rgba(6,171,177,.18); }
select + select { margin-top: 8px; }
.boton-sec { border: 1px solid var(--linea-fuerte); color: var(--petroleo); background: var(--papel); border-radius: var(--radio); padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background var(--transicion), border-color var(--transicion); }
.boton-sec:hover { background: var(--turquesa-suave); border-color: var(--turquesa); }
.boton { display: inline-flex; align-items: center; gap: var(--e-1); background: var(--petroleo); color: #fff; border: 0; border-radius: var(--radio); padding: 11px 18px; font-family: var(--f-ui); font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background var(--transicion); }
.boton:hover { background: #015A69; }
input[type=range] { accent-color: var(--medio); }
input[type=checkbox] { accent-color: var(--medio); width: 16px; height: 16px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 15px; margin: 6px 0; cursor: pointer; }
.nota { font-size: 13px; color: var(--suave); line-height: 1.5; }
details.metodo { margin-top: var(--e-3); border-top: 1px solid var(--linea); padding-top: var(--e-2); font-size: 14px; color: var(--suave); }
details.metodo summary { cursor: pointer; color: var(--tinta); font-weight: 600; }

/* popups de Leaflet */
.leaflet-container { font-family: var(--fuente); }
.leaflet-popup-content { font-family: var(--fuente); font-size: 14px; margin: 12px 14px; }
.leaflet-popup-content-wrapper { border-radius: var(--radio-md); box-shadow: var(--sombra-hover); }
.pop h3 { margin: 0 0 2px; font-size: 17px; font-weight: 600; }
.pop .meta { color: var(--suave); font-size: 13px; }
.pop a { color: var(--petroleo); font-weight: 600; }
.p-icon { background: var(--petroleo); color: #fff; font-weight: 800; font-size: 13px; border-radius: 6px; width: 22px; height: 22px; line-height: 22px; text-align: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); font-family: var(--fuente); }

/* sin la cruz nativa del buscador: usamos la propia */
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }

/* aviso propio antes de pedir la ubicación */
.pedir-ubic { position: absolute; z-index: 950; left: 16px; top: 16px; width: min(360px, calc(100% - 32px)); background: var(--papel); border: 1px solid var(--linea-fuerte); border-radius: var(--radio-md); padding: 14px 16px; box-shadow: 0 6px 20px rgba(14,42,51,.16); font-size: 15px; }
.pedir-ubic b { display: block; font-family: var(--f-titulo); font-size: 17px; margin-bottom: 4px; }
.pedir-ubic p { margin: 0 0 8px; color: var(--suave); }
.pedir-ubic .check { align-items: flex-start; font-size: 13px; color: var(--suave); line-height: 1.4; }
.pedir-ubic .check input { margin-top: 2px; flex: none; }
.pedir-ubic .acciones { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pedir-ubic .boton { padding: 9px 14px; font-size: 14px; }
@media (max-width: 820px) { .pedir-ubic { left: 10px; right: 10px; top: 10px; width: auto; } }
.riel a small { font-size: 10px; color: rgba(255,255,255,.45); margin-top: -2px; }
@media (max-width: 820px) { .riel a small { display: none; } }
