/* ============================================================
   Mapa de sucursal + navegación (branch-navigator.js).
   Extraído de profile.css para poder usar el navegador fuera del
   perfil (p.ej. el modal de ruta de la lista de resultados) sin
   cargar los 160KB del perfil. Se empareja SIEMPRE con el JS:
   donde se encola branch-navigator.js, se encola esta hoja.
   ============================================================ */

/* ══════════════════════════════════════════════════════════
   MAPA — Pin personalizado
   ══════════════════════════════════════════════════════════ */
.bnav-pin {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: absolute;
    filter: drop-shadow(0 2px 6px rgba(60,64,67,.34));
    cursor: default;
}

/* Imagen circular */
.bnav-pin__img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--c-blue-g);
    padding: 3px;
    background: var(--c-white);
    box-sizing: border-box;
    display: block;
}

/* Fallback: círculo con inicial */
.bnav-pin--letter .bnav-pin__letter-char {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--c-blue-g);
    color: var(--c-on-brand);
    font-size: var(--fs-h2);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--c-blue-g);
    box-shadow: inset 0 0 0 3px var(--c-white);
}

/* Etiqueta con el nombre del negocio */
.bnav-pin__label {
    background: var(--c-white);
    color: var(--c-ink-800);
    font-size: var(--fs-caption);
    font-weight: 600;
    line-height: 1.2;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(60,64,67,.3);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Triángulo apuntando hacia el punto del mapa */
.bnav-pin::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--c-blue-g);
    margin-top: -2px;
}

/* ── Controles del tipo de mapa ──────────────────────────── */
.bnav-maptype {
    display: flex;
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(60,64,67,.28);
    overflow: hidden;
    margin-bottom: var(--space-3);
}

.bnav-maptype__btn {
    padding: 6px 14px;
    font-size: var(--fs-small);
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--c-gray-700);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.bnav-maptype__btn:hover { background: color-mix(in srgb, var(--c-accent) 12%, transparent); color: var(--c-ink-800); }
.bnav-maptype__btn--active { background: var(--c-accent); color: var(--c-on-brand); }

/* ── Panel de pasos de ruta ──────────────────────────────── */
.bnav-steps-panel {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-top: var(--space-2);
    font-size: var(--fs-body);
    line-height: 1.4;
}

.bnav-summary {
    font-weight: 600;
    margin: 0 0 var(--space-2);
    color: var(--c-text);
}

.bnav-summary__sep { color: var(--c-text-muted); margin: 0 4px; }

.bnav-steps {
    margin: 0;
    padding-left: var(--space-5);
    color: var(--c-text-muted);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.bnav-step { line-height: 1.5; }
/* ── Navegación activa dentro del mapa ───────────────────── */
.bnav-nav-btn--active {
    background: var(--c-red-700);
    border-color: var(--c-red-700);
    color: var(--c-on-brand);
}

.bnav-nav-btn--active:hover,
.bnav-nav-btn--active:focus-visible {
    background: var(--c-red-800);
    border-color: var(--c-red-800);
    color: var(--c-on-brand);
}

.bnav-btn__label {
    min-width: 0;
}

.bnav-user-marker {
    position: absolute;
    width: 44px;
    height: 44px;
    border: 3px solid var(--c-dark-surface);
    border-radius: 50%;
    box-sizing: border-box;
    background: var(--c-dark-surface);
    box-shadow: 0 3px 12px rgba(8, 28, 60, 0.32);
    overflow: hidden;
    pointer-events: none;
}

.bnav-user-marker__img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.bnav-user-marker--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-on-brand);
    font-size: var(--fs-small);
    font-weight: 700;
    line-height: 1;
}

.bnav-user-marker--empty::before {
    content: '';
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: var(--c-blue-g);
    box-shadow: inset 0 0 0 3px var(--c-white);
    z-index: 0;
}

.bnav-user-marker__initials {
    position: relative;
    z-index: 1;
}

.bnav-route-chip {
    display: grid;
    gap: 2px;
    margin: 10px 0 0 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--c-blue-700);
    color: var(--c-on-brand);
    box-shadow: 0 2px 8px rgba(8, 28, 60, 0.28);
    font-size: 0.78rem;
    line-height: 1.2;
}

.bnav-route-chip[hidden] {
    display: none;
}

.bnav-route-chip strong {
    font-size: var(--fs-lead);
    line-height: 1.1;
}

.bnav-route-chip span {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 600;
}

/* Chip de distancia del visitante al negocio (píldora azul arriba-izquierda). */
.bnav-distance-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 10px 0 0 10px;
    padding: 6px 11px;
    border-radius: 999px;
    background: var(--c-blue-700);
    color: var(--c-on-brand);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(8, 28, 60, 0.28);
}
.bnav-distance-chip svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.bnav-distance-chip[hidden] {
    display: none;
}
/* -- Navegacion en modal casi fullscreen ---------------------- */
body.bnav-modal-open {
    overflow: hidden;
}

.bnav-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    background: rgba(15, 23, 42, 0.72);
}

.bnav-modal[hidden] {
    display: none;
}

.bnav-modal__dialog {
    width: min(1120px, 100%);
    height: min(860px, calc(100dvh - 24px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: var(--c-white);
    box-shadow: 0 24px 70px rgba(8, 28, 60, 0.35);
}

.bnav-modal__bar {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 16px;
    border-bottom: 1px solid var(--c-slate-200);
    background: var(--c-white);
}

.bnav-modal__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--c-slate-900);
    font-size: var(--fs-lead);
    font-weight: 700;
}

.bnav-modal__close {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--c-powder);
    border-radius: 50%;
    background: var(--c-white);
    color: var(--c-slate-900);
    cursor: pointer;
}

.bnav-modal__close:hover,
.bnav-modal__close:focus-visible {
    background: var(--c-slate-100);
    border-color: var(--c-slate-400);
    outline: none;
}

.bnav-modal__close svg {
    width: 32px;
    height: 32px;
}

.bnav-modal__stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: var(--c-slate-100);
}

.bnav-modal .profile-map__div,
.bnav-map-modal__map {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
}

.bnav-modal .bnav-maptype {
    margin-bottom: 18px;
}

.bnav-modal .bnav-route-chip {
    margin: 14px 0 0 14px;
}

@media (max-width: 640px) {
    .bnav-modal {
        padding: 0;
    }

    .bnav-modal__dialog {
        width: 100%;
        height: 100dvh;
        border-radius: 0;
    }

    .bnav-modal__bar {
        min-height: 52px;
        padding-left: 14px;
    }
}

/* ── Menú digital: CTA en #catalogos + modal fullscreen (patrón bnav) ── */
.profile-cat-menu-cta {
    display: flex;
    justify-content: flex-start;
    margin-bottom: var(--space-3);
}

body.mnu-modal-open {
    overflow: hidden;
}

.mnu-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    background: rgba(15, 23, 42, 0.72);
}

.mnu-modal[hidden] {
    display: none;
}

.mnu-modal__dialog {
    width: min(1120px, 100%);
    height: min(860px, calc(100dvh - 24px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: var(--c-white);
    box-shadow: 0 24px 70px rgba(8, 28, 60, 0.35);
}

.mnu-modal__bar {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 16px;
    border-bottom: 1px solid var(--c-slate-200);
    background: var(--c-white);
}

.mnu-modal__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--c-slate-900);
    font-size: var(--fs-lead);
    font-weight: 700;
}

.mnu-modal__close {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--c-powder);
    border-radius: 50%;
    background: var(--c-white);
    color: var(--c-slate-900);
    cursor: pointer;
}

.mnu-modal__close:hover,
.mnu-modal__close:focus-visible {
    background: var(--c-slate-100);
    border-color: var(--c-slate-400);
    outline: none;
}

.mnu-modal__close svg {
    width: 32px;
    height: 32px;
}

.mnu-modal__stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: var(--c-slate-100);
}

.mnu-modal__frame {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    display: block;
}

@media (max-width: 640px) {
    .mnu-modal {
        padding: 0;
    }

    .mnu-modal__dialog {
        width: 100%;
        height: 100dvh;
        border-radius: 0;
    }

    .mnu-modal__bar {
        min-height: 52px;
        padding-left: 14px;
    }
}

