@font-face {
    font-family: 'EncodeSans';
    src: url('/css/EncodeSans.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
/* Ajustar la página a la altura visible, incluidas las barras del navegador móvil. */
body.map-page { height: 100vh; height: 100dvh; overflow: hidden; }
.map-page > nav { flex-shrink: 0; }
.map-stage { min-height: 0; }
.map-stage > #map { flex: 1 1 0; min-height: 0; }
body.map-welcome-preview-page { margin: 0; background: #e9e9e9; }
.map-welcome-preview { max-width: 390px; margin: 24px auto; }
.map-welcome-preview-header {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 70px;
    padding: 0 18px;
    background: #f8f9fa;
    color: #262a2c;
    font: 16px 'EncodeSans', sans-serif;
}
.map-welcome-preview-logo { font: 800 22px Arial, sans-serif; letter-spacing: -1.5px; }
.map-welcome-preview-logo span { color: var(--theme-primary); }
.map-welcome-preview-header > .bi { font-size: 23px; }
.map-welcome-preview-language { margin-left: auto; font-size: 14px; }
.map-welcome-preview-menu { padding: 9px 12px; border: 1px solid #d2d2d2; }
.map-welcome-preview-stage { position: relative; min-height: 500px; background: #343733; }
@media (max-width: 390px) {
    .map-welcome-preview { margin: 0 auto; }
}

.map-welcome {
    display: none;
    flex-direction: column;
    position: absolute;
    inset: 0;
    z-index: 10;
    box-sizing: border-box;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.72);
    font-family: 'EncodeSans', sans-serif;
}
.map-welcome *, .map-welcome *::before, .map-welcome *::after {
    box-sizing: border-box;
}
.map-welcome-content {
    width: 100%;
    max-width: 390px;
    margin: auto;
    padding: 40px 22px;
}
.map-welcome .map-welcome-close {
    display: inline-flex;
    align-items: center;
    width: auto;
    font-family: inherit;
    text-align: left;
    padding: 6px 20px;
    border: 1px solid var(--theme-welcome-action);
    border-radius: 0;
    background: var(--theme-welcome-action);
    color: #fff !important;
    box-shadow: none;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.4;
    cursor: pointer;
}
.map-welcome .map-welcome-close:hover { background: var(--theme-welcome-action-hover); border-color: var(--theme-welcome-action-hover); }
.map-welcome .map-welcome-close:active { background: var(--theme-welcome-action-active); border-color: var(--theme-welcome-action-active); }
.map-welcome .map-welcome-close:focus-visible { outline: 2px solid var(--theme-primary-hover); outline-offset: 3px; }
.map-welcome-footer { flex: 0 0 auto; text-align: center; padding: 16px 16px calc(36px + env(safe-area-inset-bottom, 0px)); }
.map-welcome-footer-initial { width: 100%; max-width: 390px; margin: 0 auto; padding-left: 22px; padding-right: 22px; }
.map-essentials-footer { display: flex; align-items: center; justify-content: center; padding: 26px 16px calc(26px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--theme-welcome-border); background: var(--theme-welcome-background); }
.map-welcome-showing-essentials > .map-welcome-footer-initial { display: none; }
/* main.css impone colores globales con !important; estos se limitan a la bienvenida. */
.map-welcome-title {
    margin: 0 0 24px;
    color: #fff !important;
    font-size: 26px;
    font-weight: 400;
    line-height: 1.25;
    text-align: center;
}
.map-welcome-options { display: grid; gap: 18px; }
.map-welcome-choice {
    appearance: none;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 16px;
    column-gap: 12px;
    width: 100%;
    margin: 0;
    padding: 24px 20px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    color: var(--theme-text-brand);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.map-welcome-choice-icon {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    color: var(--theme-primary) !important;
    font-size: 27px;
    line-height: 1;
}
.map-welcome-choice-title {
    grid-column: 2;
    grid-row: 1;
    color: var(--theme-text-brand) !important;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.25;
}
.map-welcome-choice-description {
    grid-column: 2;
    grid-row: 2;
    margin-top: 6px;
    color: var(--theme-text) !important;
    font-size: 15px;
    line-height: 1.45;
}
.map-welcome-choice-arrow {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
    color: var(--theme-text-brand) !important;
    font-size: 16px;
    line-height: 1;
}
.map-welcome-choice:focus-visible {
    outline: 2px solid var(--theme-primary-hover);
    outline-offset: 4px;
}
@media (max-width: 599.98px) {
    .map-welcome { display: flex; }
}
@media (max-width: 350px) {
    .map-welcome-content { padding: 32px 16px; }
    .map-welcome-footer-initial { padding-left: 16px; padding-right: 16px; }
    .map-welcome-choice { padding: 22px 15px; column-gap: 9px; }
    .map-welcome-choice-title { font-size: 22px; }
    .map-welcome .map-welcome-close { font-size: 20px; }
}
/* La vista previa también permite revisar el diseño móvil desde escritorio. */
.map-welcome-preview .map-welcome { display: flex; background: transparent; }

.map-welcome[hidden], .map-welcome [hidden] { display: none !important; }
.map-welcome { transition: background-color 240ms ease; }
.map-welcome.map-welcome-transitioning { overflow: hidden; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
    .map-welcome { transition: none; }
}
.map-welcome.map-welcome-showing-essentials { overflow: hidden; background: var(--theme-welcome-background); }
.map-essentials {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
}
.map-essentials-header {
    flex: 0 0 auto;
    padding: 20px 16px 18px;
    border-bottom: 1px solid var(--theme-welcome-border);
    background: var(--theme-welcome-background);
}
.map-essentials-heading { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; }
.map-essentials-heading h2 {
    margin: 0;
    color: var(--theme-text-brand) !important;
    font-size: 27px;
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
}
.map-essentials-back {
    width: 40px;
    height: 40px;
    padding: 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
}
.map-essentials-back i { color: var(--theme-text-brand) !important; font-size: 22px; line-height: 1; }
.map-essentials-header p { margin: 9px 0 0; color: var(--theme-text) !important; font-size: 15px; line-height: 1.4; text-align: center; }
.map-nearby-retry { border: 1px solid var(--theme-action-border); border-radius: 0; padding: 8px 14px; background: var(--theme-surface-accent); color: var(--theme-text-brand) !important; font: inherit; cursor: pointer; }
.map-nearby-retry:focus-visible { outline: 2px solid var(--theme-icon-muted); outline-offset: 2px; }
.map-nearby-status { margin: 0; padding: 0; color: var(--theme-text) !important; font-size: 15px; }
.map-nearby-location-state:not([hidden]),
.map-nearby .map-essentials-empty:not([hidden]) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-height: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 24px 8px;
    text-align: center;
    font-size: 15px;
    line-height: 1.5;
}
.map-nearby-empty-icon {
    position: relative;
    display: block;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    color: var(--theme-welcome-action);
    font-size: 48px;
    line-height: 1;
}
.map-nearby-empty-icon .bi { color: var(--theme-welcome-action) !important; }
.map-nearby-empty-icon .bi-x-circle-fill {
    position: absolute;
    right: -4px;
    bottom: -2px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #fff;
    font-size: 20px;
}
.map-nearby.is-locating .map-nearby-location-state::before {
    content: "";
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    box-sizing: border-box;
    border: 4px solid var(--theme-surface-accent);
    border-top-color: var(--theme-welcome-action);
    border-radius: 50%;
    animation: map-nearby-locating 1s linear infinite;
}
@keyframes map-nearby-locating {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .map-nearby.is-locating .map-nearby-location-state::before { animation: none; }
}
.map-nearby-retry { margin: 0 8px 24px; }
.map-nearby-search-again { margin: 0; }
.map-nearby-location-state .map-nearby-retry { margin: 0; }
.map-nearby-location-icon { display: none; }
.map-nearby.has-location-error .map-nearby-location-icon {
    display: block;
    width: 48px;
    height: 48px;
    color: var(--theme-welcome-action) !important;
    font-size: 48px;
    line-height: 1;
    flex-shrink: 0;
}
.map-nearby-choices { padding: 8px 0; }
.map-nearby-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 20px 8px;
    border: 0;
    border-bottom: 1px solid var(--theme-list-border);
    background: #fff;
    color: var(--theme-text-brand);
    font: inherit;
    font-size: 18px;
    text-align: left;
    cursor: pointer;
}
.map-nearby-choice:hover { background: var(--theme-surface-hover); }
.map-nearby-choice:focus-visible { outline: 2px solid var(--theme-primary); outline-offset: -2px; }
.map-welcome-close:disabled { opacity: 0.45; cursor: not-allowed; }
.map-essentials-list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--theme-scrollbar) var(--theme-welcome-background);
    padding: 0 16px;
}
.map-essential-point {
    appearance: none;
    border: 0;
    border-radius: 0;
    font: inherit;
    cursor: pointer;
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr) 14px;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 0;
    border-bottom: 1px solid var(--theme-list-border);
    background: #fff;
    text-decoration: none;
    text-align: left;
}
.map-essential-point:hover { background: var(--theme-surface-hover); }
.map-nearby .map-essential-text { align-self: start; }
.map-essential-thumbnail { position: relative; display: grid; place-items: center; width: 108px; height: 112px; background: var(--theme-thumbnail-background); overflow: hidden; }
.map-essential-thumbnail > i { color: var(--theme-icon-muted) !important; font-size: 28px; }
.map-essential-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map-essential-name { display: block; color: var(--theme-text-brand) !important; font-size: 22px; font-weight: 400; line-height: 1.25; overflow-wrap: anywhere; }
.map-essential-type { display: block; margin-top: 9px; color: var(--theme-text) !important; font-size: 14px; line-height: 1.4; }
.map-essential-arrow { color: var(--theme-text-brand) !important; font-size: 14px; line-height: 1; }
.map-essentials-empty { padding: 24px 8px; color: var(--theme-text) !important; font-size: 16px; line-height: 1.5; }
.map-essential-point:focus-visible, .map-essentials-back:focus-visible { outline: 2px solid var(--theme-primary); outline-offset: -2px; }
@media (max-width: 350px) {
    .map-essentials-list { padding: 0 12px; }
    .map-essential-point { grid-template-columns: 90px minmax(0, 1fr) 12px; gap: 10px; }
    .map-essential-thumbnail { width: 90px; }
    .map-essential-name { font-size: 21px; }
}
