/* NegocioGo — Mapa público premium (Mapbox) */

.map-page {
    --map-green: var(--brand-green-bright, #0E8F66);
    --map-green-dark: var(--brand-green, #068C61);
    --map-green-soft: var(--brand-green-muted, #F3FFFA);
    --map-navy: var(--brand-navy, #0f172a);
    --map-text: #334155;
    --map-muted: #64748b;
    --map-border: #e2e8f0;
    --map-surface: #ffffff;
    --map-bg: #f8fafc;
    --map-radius: 18px;
    --map-shadow: 0 4px 24px -8px rgba(15, 23, 42, 0.12);
    --map-nav-offset: 4rem;
    max-width: none;
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: calc(100vh - var(--map-nav-offset));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: var(--map-bg);
}

.map-page__toolbar {
    flex-shrink: 0;
    padding: 0.65rem 1rem 0;
    background: var(--map-surface);
    border-bottom: 1px solid var(--map-border);
    position: relative;
    top: auto;
    z-index: 30;
}

@media (min-width: 1024px) {
    .map-page-header--compact .map-lead {
        display: none;
    }

    .map-page-header--compact h1 {
        font-size: 1.15rem;
        margin: 0;
    }

    .map-page-header--compact {
        margin-bottom: 0;
        padding-bottom: 0.35rem;
    }
}

/* Header */
.map-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 0.85rem;
}

.map-kicker {
    margin: 0 0 0.3rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--map-green-dark);
}

.map-page-header h1 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--map-navy);
    line-height: 1.12;
}

.map-lead {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--map-muted);
    max-width: 36rem;
    line-height: 1.55;
}

.map-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.map-btn--filters-mobile {
    display: none;
}

/* Filters — card compacto en grid */
.map-filters.map-filter-card {
    margin-bottom: 0.75rem;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.map-filter-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr) minmax(0, 0.8fr);
    gap: 14px;
    align-items: end;
}

.map-filter-grid-secondary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr) auto auto;
    gap: 14px;
    align-items: end;
    margin-top: 14px;
}

.map-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    width: 100%;
    padding-top: 0;
}

.map-filter-chips .vendly-filter-chip input:checked + span {
    background: var(--map-green-soft);
    border-color: rgba(14, 143, 102, 0.45);
    color: var(--map-green-dark);
}

.map-field {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 0;
    width: 100%;
}

.map-field__label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.map-field input,
.map-field select,
.map-filter-input,
.map-filters .country-filter__input,
.map-filters input[type="search"],
.map-filters input[type="text"],
.map-filters select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.58rem 0.72rem;
    border: 1px solid var(--map-border);
    border-radius: 10px;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--map-bg);
    color: var(--map-navy);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.map-field--country .country-filter {
    width: 100%;
    flex: none;
}

.map-field--category .category-select {
    width: 100%;
    flex: none;
}

.map-field input:focus,
.map-field select:focus,
.map-filters .country-filter__input:focus,
.map-field--category .category-select__input:focus {
    outline: none;
    border-color: var(--map-green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(14, 143, 102, 0.14);
}

.map-btn--apply,
.map-btn--clear {
    white-space: nowrap;
}

/* Invitación de ubicación */
.map-location-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.85rem 1rem;
    margin: 0 0 0.85rem;
    padding: 0.95rem 1rem;
    border-radius: var(--map-radius);
    background: #fff;
    border: 1px solid var(--map-border);
    box-shadow: var(--map-shadow);
}

.map-location-banner[hidden],
.map-location-active[hidden],
.map-location-status[hidden] {
    display: none !important;
}

.map-location-banner__icon {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--map-green-soft);
    color: var(--map-green-dark);
}

.map-location-banner__copy {
    flex: 1 1 14rem;
    min-width: 0;
}

.map-location-banner__title {
    margin: 0 0 0.25rem;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--map-navy);
    letter-spacing: -0.02em;
}

.map-location-banner__text {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--map-muted);
    line-height: 1.5;
    max-width: 42rem;
}

.map-location-banner__note {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
}

.map-location-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    width: 100%;
}

@media (min-width: 720px) {
    .map-location-banner__actions {
        width: auto;
        margin-left: auto;
        flex: 0 0 auto;
    }
}

/* Ubicación activa */
.map-location-active {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 0 0 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.map-location-active__chip {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
}

.map-location-active__dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.map-location-active__label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1d4ed8;
    white-space: nowrap;
}

.map-location-active__hint {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
}

.map-location-active__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
    flex-shrink: 0;
}

/* Mensajes de estado */
.map-location-status {
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.map-location-status.is-info {
    background: var(--map-green-soft);
    border: 1px solid rgba(14, 143, 102, 0.2);
    color: var(--map-green-dark);
}

.map-location-status.is-error {
    background: #fef2f2;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.map-adult-filter {
    margin: -0.25rem 0 0.65rem;
}

/* Layout — panel + mapa integrados */
.map-layout.map-results-layout {
    display: grid;
    grid-template-columns: minmax(280px, 38%) minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    border: none;
    border-top: 1px solid var(--map-border);
    border-radius: 0;
    overflow: hidden;
    background: var(--map-surface);
    box-shadow: none;
}

.map-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--map-border);
    background: var(--map-surface);
    overflow: hidden;
}

.map-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--map-border);
    background: linear-gradient(180deg, #fff 0%, var(--map-bg) 100%);
}

.map-sidebar__count {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--map-text);
}

.map-view-toggle {
    display: none;
    border: 1px solid var(--map-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.map-view-toggle button {
    padding: 0.38rem 0.7rem;
    border: none;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--map-muted);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.map-view-toggle button.is-active {
    background: var(--map-navy);
    color: #fff;
}

.map-list-scroll {
    flex: 1;
    overflow-y: auto;
    max-height: none;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.map-list-items {
    display: flex;
    flex-direction: column;
}

/* Store cards */
.map-store-card {
    display: flex;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    cursor: pointer;
    transition: background 0.14s, box-shadow 0.14s;
    outline: none;
}

.map-store-card:hover,
.map-store-card:focus-visible {
    background: #fff;
}

.map-store-card.is-active {
    background: #fff;
    border-left: 3px solid var(--map-green-dark);
    padding-left: calc(1rem - 3px);
    box-shadow: inset 3px 0 0 var(--map-green);
}

.map-store-card__avatar {
    position: relative;
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--map-border);
    display: grid;
    place-items: center;
    color: var(--map-navy);
    font-weight: 700;
    font-size: 1.05rem;
    box-shadow: 0 2px 8px -4px rgba(15, 23, 42, 0.12);
}

.map-store-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-store-card__status {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    border: 2px solid #fff;
    font-style: normal;
}

.map-store-card__status--open {
    background: var(--map-green);
}

.map-store-card__status--closed {
    background: #cbd5e1;
}

.map-store-card__body {
    min-width: 0;
    flex: 1;
}

.map-store-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.map-store-card__name {
    font-size: 0.925rem;
    font-weight: 700;
    color: var(--map-navy);
    line-height: 1.3;
}

.map-store-card__badge,
.map-chip {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.14rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}

.map-store-card__badge--featured,
.map-chip--featured {
    background: #fef3c7;
    color: #92400e;
}

.map-store-card--featured .map-store-card__avatar {
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e4b44c, 0 2px 8px -4px rgba(15, 23, 42, 0.12);
}

.map-chip--open {
    background: var(--map-green-soft);
    color: var(--map-green-dark);
}

.map-chip--closed {
    background: #f1f5f9;
    color: #64748b;
}

.map-chip--wa {
    background: #ecfdf5;
    color: #047857;
}

.map-chip--delivery,
.map-chip--pickup {
    background: #f1f5f9;
    color: var(--map-text);
}

.map-store-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}

.map-store-card__meta,
.map-store-card__foot {
    margin: 0.18rem 0 0;
    font-size: 0.75rem;
    color: var(--map-muted);
    line-height: 1.45;
}

.map-store-card__dot {
    margin: 0 0.2rem;
    opacity: 0.45;
}

.map-store-card__open {
    color: var(--map-green-dark);
    font-weight: 600;
}

.map-store-card__closed {
    color: #94a3b8;
    font-weight: 600;
}

.map-store-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

/* Result-card actions are compact controls, not primary page CTAs. */
.map-store-card__actions .map-btn.map-btn--sm {
    min-height: 2.25rem;
    height: 2.25rem;
    padding: 0 .65rem;
    border-radius: 9px;
    line-height: 1;
}

.map-zone-panel {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    max-width: calc(100% - 2rem);
    pointer-events: none;
}

.map-zone-panel > * {
    pointer-events: auto;
}

.map-zone-hint,
.map-zoom-hint {
    margin: 0;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--map-muted);
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.map-zone-search-btn {
    box-shadow: 0 8px 22px rgba(14, 143, 102, 0.28);
}

.map-zone-empty {
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    text-align: center;
    max-width: 280px;
}

.map-zone-empty p {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    color: var(--map-text);
}

/* Canvas */
.map-canvas-wrap {
    position: relative;
    top: auto;
    height: 100%;
    min-height: calc(100vh - var(--map-nav-offset) - 12rem);
    background: #e8edf3;
    isolation: isolate;
}

.map-canvas {
    width: 100%;
    height: 100%;
    min-height: inherit;
}

.map-canvas .mapboxgl-canvas {
    border-radius: 0;
}

.map-sidebar__status {
    margin: 0;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid var(--map-border);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--map-muted);
    background: var(--map-bg);
}

.map-sidebar__status[hidden] {
    display: none !important;
}

.map-sidebar__error {
    margin: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    background: #fef2f2;
}

.map-sidebar__error[hidden] {
    display: none !important;
}

.map-sidebar__error p {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    color: #b91c1c;
}

/* Error real del mapa (solo si Google Maps falla) */
.map-canvas__error {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(248, 250, 252, 0.94);
    font-size: 0.875rem;
    color: var(--map-text);
    text-align: center;
    padding: 1.5rem;
}

.map-canvas__error[hidden] {
    display: none !important;
}

.map-canvas__error strong {
    font-size: 1rem;
    color: var(--map-navy);
}

.map-canvas__error p {
    margin: 0;
    max-width: 20rem;
    color: var(--map-muted);
}

/* Map controls */
.map-controls {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.map-control-btn {
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid var(--map-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    color: var(--map-navy);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 20px -10px rgba(15, 23, 42, 0.4);
    transition: border-color 0.12s, background 0.12s, transform 0.1s;
}

.map-control-btn:hover {
    border-color: var(--map-green);
    background: var(--map-green-soft);
}

.map-control-btn:active {
    transform: scale(0.96);
}

.map-control-btn--locate.is-active,
.map-btn.location-action-btn--standard.is-active {
    background: var(--map-green);
    border-color: var(--map-green-dark);
    color: #fff;
}

/* User location marker */
.map-user-marker {
    position: relative;
    width: 22px;
    height: 22px;
    cursor: default;
}

.map-user-marker__dot {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.45);
    position: relative;
    z-index: 2;
}

/* Sin pulso / animación en el marcador de usuario */
.map-user-marker__pulse {
    display: none !important;
}

.map-load-error {
    display: none !important;
}

/* Popup */
.map-popup-card {
    position: absolute;
    z-index: 15;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1rem;
    width: min(320px, calc(100% - 2rem));
    max-width: 320px;
    padding: 0;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 18px 44px -14px rgba(15, 23, 42, 0.38);
    overflow: hidden;
    animation: map-popup-in 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.map-popup-card--anchored {
    left: auto;
    bottom: auto;
    right: auto;
    top: auto;
    transform: none;
    width: min(320px, calc(100vw - 2rem));
    max-width: 320px;
    animation: map-popup-anchored-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes map-popup-anchored-in {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.map-popup__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem 0.65rem;
    padding-right: 2rem;
}

.map-popup__thumb {
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--map-border);
    color: var(--map-navy);
    display: grid;
    place-items: center;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px -4px rgba(15, 23, 42, 0.1);
}

.map-popup__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.map-popup__content {
    min-width: 0;
    flex: 1;
}

.map-popup__meta,
.map-popup__sub {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--map-muted);
}

.map-popup__sub {
    margin-top: 0.2rem;
    color: var(--map-text);
    font-weight: 600;
}

.map-popup__sep {
    margin: 0 0.3rem;
    opacity: 0.55;
}

@keyframes map-popup-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.map-popup-card[hidden] {
    display: none !important;
}

.map-popup__close {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    width: 1.65rem;
    height: 1.65rem;
    border: none;
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.95);
    color: var(--map-muted);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.map-popup__name {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--map-navy);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.map-popup__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 0.9rem 0.75rem;
}

/* Buttons */
.map-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.9rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s, border-color 0.12s, transform 0.1s;
    white-space: nowrap;
}

.map-btn:active {
    transform: scale(0.98);
}

.map-btn--primary {
    background: var(--map-green);
    color: #fff;
    box-shadow: 0 8px 24px -12px rgba(14, 143, 102, 0.7);
}

.map-btn--primary:hover {
    background: var(--map-green-dark);
}

.map-btn--secondary {
    background: #fff;
    border-color: var(--map-border);
    color: var(--map-text);
}

.map-btn--secondary:hover {
    border-color: var(--map-green);
    color: var(--map-green-dark);
}

.map-btn--soft {
    background: var(--map-bg);
    color: var(--map-text);
}

.map-btn--soft:hover {
    background: #f1f5f9;
}

.map-btn--ghost {
    background: transparent;
    border-color: var(--map-border);
    color: var(--map-muted);
}

.map-btn--ghost:hover {
    background: var(--map-bg);
    color: var(--map-navy);
}

.map-btn--whatsapp {
    background: var(--map-green-dark);
    color: #fff;
}

.map-btn--whatsapp:hover {
    background: #056947;
}

.map-btn--wa-disabled {
    background: var(--map-bg);
    color: #94a3b8;
    cursor: not-allowed;
    border: 1px solid var(--map-border);
    font-size: 0.6875rem;
}

.map-btn--sm {
    padding: 0.38rem 0.62rem;
    font-size: 0.75rem;
}

/* Empty state */
.map-empty {
    padding: 2rem 1.25rem 2.25rem;
    text-align: center;
}

.map-empty__icon {
    color: var(--map-green);
    margin-bottom: 0.85rem;
    opacity: 0.85;
}

.map-empty__title {
    margin: 0 0 0.45rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--map-navy);
}

.map-empty__desc {
    margin: 0 auto;
    max-width: 20rem;
    font-size: 0.8125rem;
    color: var(--map-muted);
    line-height: 1.55;
}

.map-empty__actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 1.1rem;
    align-items: stretch;
    max-width: 15rem;
    margin-left: auto;
    margin-right: auto;
}

/* Skeleton del listado: ver static/css/skeleton.css */

/* Adult dialog */
.map-adult-toggle {
    font-size: 0.8125rem;
    opacity: 0.9;
}

.map-adult-dialog {
    max-width: 22rem;
    border: none;
    border-radius: 16px;
    padding: 1.35rem;
    box-shadow: 0 20px 50px -16px rgba(15, 23, 42, 0.35);
}

.map-adult-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.map-adult-dialog-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Mapbox attribution */
.map-canvas-wrap .mapboxgl-ctrl-bottom-right {
    bottom: 0.5rem;
    right: 0.5rem;
}

.map-canvas-wrap .mapboxgl-ctrl-attrib {
    font-size: 0.625rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
}

.map-canvas-wrap:fullscreen {
    border-radius: 0;
    min-height: 100vh;
}

.map-canvas-wrap:fullscreen .map-canvas {
    min-height: 100vh;
}

/* Tablet */
@media (max-width: 1100px) {
    .map-filter-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .map-field--search {
        grid-column: 1 / -1;
    }

    .map-filter-grid-secondary {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .map-field--category {
        grid-column: 1 / -1;
    }
}

/* Mobile */
@media (max-width: 960px) {
    .map-page:not(.map-app-page) {
        padding: 1rem 0.85rem 2rem;
    }

    .map-app-page {
        padding: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .map-layout,
    .map-layout.map-results-layout,
    .map-app-page .map-shell,
    .map-app-page .map-layout.map-results-layout {
        display: flex;
        flex-direction: column;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .map-filter-grid,
    .map-filter-grid-secondary {
        grid-template-columns: 1fr;
    }

    .map-field--search {
        grid-column: auto;
    }

    .map-filter-grid-secondary .map-btn--apply,
    .map-filter-grid-secondary .map-btn--clear {
        grid-column: auto;
        width: 100%;
    }

    .map-layout {
        grid-template-columns: minmax(0, 1fr);
        min-height: auto;
        border-radius: var(--map-radius);
    }

    .map-app-page .map-layout,
    .map-app-page .map-layout.map-results-layout {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    /* Mobile split: mapa primero, resultados debajo (mapa siempre accesible) */
    .map-layout.is-split-view .map-canvas-wrap {
        order: 1;
        display: flex;
        min-height: 56vh;
    }

    .map-layout.is-split-view .map-sidebar {
        order: 2;
        display: flex;
        border-right: none;
        border-bottom: none;
        border-top: 1px solid var(--map-border);
    }

    .map-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--map-border);
    }

    .map-view-toggle {
        display: flex;
    }

    .map-btn--filters-mobile {
        display: inline-flex;
    }

    .map-filters {
        display: none;
        margin-bottom: 0;
        border-radius: var(--map-radius);
    }

    .map-filters.is-open {
        display: flex;
        margin-bottom: 0.75rem;
    }

    .map-layout.is-map-view .map-sidebar {
        display: none;
    }

    .map-layout.is-list-view .map-canvas-wrap {
        display: none;
    }

    .map-list-scroll {
        max-height: none;
        min-height: 22rem;
    }

    .map-canvas-wrap {
        min-height: 56vh;
    }

    .map-canvas {
        min-height: 56vh;
    }

    .map-popup-card {
        width: min(300px, calc(100% - 1.25rem));
        max-width: 300px;
    }

    .map-popup-card--anchored {
        width: min(300px, calc(100vw - 1.25rem));
    }

    .map-popup__row {
        padding: 0.75rem 0.8rem 0.6rem;
        padding-right: 1.85rem;
    }

    .map-popup__actions {
        padding: 0 0.8rem 0.7rem;
    }
}

@media (max-width: 520px) {
    .map-page-header__actions {
        width: 100%;
    }

    .map-page-header__actions .map-btn {
        flex: 1;
    }

    .map-filter-grid,
    .map-filter-grid-secondary {
        grid-template-columns: 1fr;
    }

    .map-filter-grid-secondary .map-btn--apply,
    .map-filter-grid-secondary .map-btn--clear {
        width: 100%;
        justify-content: center;
    }

    .map-field {
        width: 100%;
        min-width: 0;
    }

    .map-location-banner__actions {
        width: 100%;
        flex-direction: column;
    }

    .map-location-banner__actions .map-btn {
        width: 100%;
        justify-content: center;
    }

    .map-location-active {
        flex-direction: column;
        align-items: stretch;
    }

    .map-location-active__actions {
        margin-left: 0;
        width: 100%;
    }

    .map-location-active__actions .map-btn {
        flex: 1;
    }
}

/* —— Vista mapa tipo app (Zillow / Airbnb) —— */
:root {
    --navbar-height: 72px;
    --map-toolbar-height: 56px;
}

.is-map-app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.is-map-app-shell .site-nav-shell {
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

/* iOS: en mapa el body no aporta safe-area (PWA); el navbar público debe reservarlo */
body.is-map-app-shell .site-nav-shell .public-nav {
    padding-top: env(safe-area-inset-top, 0px);
    box-sizing: border-box;
}

html.ng-pwa-standalone body.is-map-app-shell .site-nav-shell .public-nav {
    padding-top: env(safe-area-inset-top, 0px);
}

.is-map-page .site-footer {
    display: none !important;
}

.map-immersive-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    overflow: hidden;
}

.map-app-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.map-immersive-page > main,
.map-immersive-page .map-app-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.is-map-app-shell .site-footer,
.map-immersive-page .site-footer {
    display: none !important;
}

.is-map-app-shell > .ng-bottom-nav {
    flex-shrink: 0;
}

.map-page.map-app-page {
    min-height: 0;
}

.map-app-page {
    --map-navbar-height: var(--navbar-height, 72px);
    --map-toolbar-height: 56px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
    background: var(--map-bg);
    overflow: hidden;
}

/* Toolbar compacta — pegada al navbar, sin offset sticky duplicado */
.is-map-app-shell .map-toolbar {
    position: relative;
    top: auto;
    z-index: 40;
    flex-shrink: 0;
    padding: 8px 14px;
    margin: 0 !important;
    background: rgba(248, 250, 252, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e5e7eb;
    overflow: visible;
}

.map-toolbar {
    flex-shrink: 0;
}

/* —— Toolbar compacta: buscador + filtros + ubicación —— */
.map-filters-form {
    margin: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.map-toolbar-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-search-bar {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--map-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.map-search-bar__icon {
    flex-shrink: 0;
    color: var(--map-muted);
}

.map-search-bar input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font-size: 0.875rem;
    color: var(--map-navy);
    outline: none;
}

.map-search-bar input::placeholder {
    color: #94a3b8;
}

.map-btn--filters-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    white-space: nowrap;
}

.map-filters-badge {
    display: inline-grid;
    place-items: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--map-green-dark);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 800;
    line-height: 1;
}

.map-filters-badge[hidden] {
    display: none !important;
}

.map-toolbar-compact .map-btn--icon {
    flex-shrink: 0;
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
}

/* Chips de filtros activos */
.map-active-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    min-height: 0;
}

.map-active-filters[hidden] {
    display: none !important;
}

.map-active-filters__chips {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 1px;
}

.map-active-filters__chips::-webkit-scrollbar {
    display: none;
}

.map-active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    height: 28px;
    padding: 0 8px 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(14, 143, 102, 0.22);
    background: #F3FFFA;
    color: #166534;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.map-active-filter-chip__remove {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(14, 143, 102, 0.12);
    color: #056947;
    font-size: 0.875rem;
    line-height: 1;
    cursor: pointer;
}

.map-active-filter-chip__remove:hover {
    background: rgba(14, 143, 102, 0.22);
}

.map-active-filters__clear {
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: var(--map-muted);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
    white-space: nowrap;
}

.map-active-filters__clear:hover {
    color: var(--map-navy);
}

/* Overlay + drawer de filtros */
.map-filters-overlay {
    position: fixed;
    inset: 0;
    z-index: 110;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.38);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.map-filters-overlay:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

.map-filters-drawer {
    position: fixed;
    z-index: 120;
    top: var(--map-navbar-height, 72px);
    right: 0;
    bottom: 0;
    width: min(400px, 94vw);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid var(--map-border);
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.12);
    transform: translateX(100%);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.map-filters-drawer.is-open {
    transform: translateX(0);
    pointer-events: auto;
}

.map-filters-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--map-border);
    flex-shrink: 0;
}

.map-filters-drawer__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--map-navy);
    letter-spacing: -0.02em;
}

.map-filters-drawer__close {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #f8fafc;
    color: var(--map-muted);
    cursor: pointer;
}

.map-filters-drawer__close:hover {
    background: #f1f5f9;
    color: var(--map-navy);
}

.map-filters-drawer__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
}

.map-filters-drawer__section {
    display: grid;
    gap: 12px;
}

.map-filters-drawer__section + .map-filters-drawer__section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}

.map-filters-drawer__section-label {
    margin: 0 0 4px;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--map-muted);
}

.map-filters-drawer .map-field__label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--map-muted);
}

.map-filters-drawer .map-field input,
.map-filters-drawer .map-field select,
.map-filters-drawer .country-filter__input,
.map-filters-drawer .category-select__input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--map-border);
    border-radius: 10px;
    background: #fff;
    font-size: 0.875rem;
    color: var(--map-navy);
    box-sizing: border-box;
}

.map-filter-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.map-filters-drawer__foot {
    display: flex;
    gap: 8px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--map-border);
    background: #fff;
    flex-shrink: 0;
}

.map-filters-drawer__foot .map-btn {
    flex: 1;
    min-height: 44px;
    justify-content: center;
}

.map-btn--icon {
    min-width: 2.5rem;
    padding: 0.55rem;
}

body.map-filters-panel-open {
    overflow: hidden;
}

.map-filters-advanced {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--map-border);
}

.map-filters-advanced[hidden] {
    display: none !important;
}

.map-adult-filter--inline {
    margin: 0;
}

/* Ubicación activa: barra compacta en toolbar */
.location-status-bar,
.map-location-active--toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 8px;
    padding: 6px 10px;
    min-height: 36px;
    max-height: 40px;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.map-location-active--toolbar .map-location-active__chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.map-location-active--toolbar .map-location-active__hint {
    display: inline;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-location-active--toolbar .map-location-active__actions {
    margin-left: auto;
}

.map-location-active--toolbar .map-btn--sm {
    padding: 0.2rem 0.45rem;
    font-size: 0.6875rem;
}

.map-location-status {
    margin: 0 0 0.35rem;
}

/* Shell: lista + mapa full height */
.map-shell {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(280px, 38%) minmax(0, 1fr);
    min-height: 0;
    margin: 0;
    overflow: hidden;
    border-top: 1px solid var(--map-border);
}

.map-app-page .map-shell,
.map-app-page .map-layout.map-results-layout {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}

.map-app-page .map-sidebar {
    min-height: 0;
    height: 100%;
}

.map-app-page .map-list-scroll {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

.map-app-page .map-canvas-wrap {
    position: relative;
    top: auto;
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.map-app-page .map-layout.is-split-view .map-canvas-wrap {
    position: relative;
    top: auto;
    min-height: 0;
}

.map-app-page .map-canvas,
.map-app-page .map-canvas.mapboxgl-map,
.map-app-page .map-canvas.ng-google-map,
.map-app-page .map-canvas .mapboxgl-canvas,
.map-app-page .map-canvas .gm-style,
.map-app-page .map-canvas.ng-google-map > div {
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    max-width: 100%;
    flex: 1;
}

@media (min-width: 1100px) {
    .map-app-page .map-shell,
    .map-app-page .map-layout.map-results-layout {
        grid-template-columns: minmax(300px, 38%) minmax(0, 1fr);
    }
}

/* Mobile: bottom sheet de filtros */
@media (max-width: 768px) {
    .map-app-page {
        --map-toolbar-height: 52px;
        padding: 0;
    }

    .is-map-app-shell .map-toolbar {
        padding: 8px max(14px, env(safe-area-inset-right, 0px)) 8px max(14px, env(safe-area-inset-left, 0px));
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .map-toolbar-compact {
        width: 100%;
        min-width: 0;
        gap: 6px;
    }

    .map-toolbar-compact .map-btn--filters-toggle {
        padding: 0 10px;
    }

    .map-toolbar-compact .map-btn--icon {
        width: 40px;
        min-width: 40px;
        flex: 0 0 40px;
    }

    .map-active-filters {
        min-width: 0;
        max-width: 100%;
    }

    .map-active-filters__clear {
        padding-right: 2px;
    }

    .map-controls {
        right: max(0.7rem, env(safe-area-inset-right, 0px));
        top: 0.7rem;
    }

    .map-app-page .map-canvas-wrap,
    .map-app-page .map-layout.is-map-view .map-canvas-wrap,
    .map-app-page .map-layout.is-split-view .map-canvas-wrap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        align-self: stretch;
    }

    .map-filters-drawer {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 88dvh;
        border-left: 0;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.16);
        transform: translateY(100%);
    }

    .map-filters-drawer.is-open {
        transform: translateY(0);
    }

    .map-active-filters {
        margin-top: 6px;
    }

    .map-shell {
        display: block;
        flex: 1;
        min-height: 0;
    }

    .map-app-page .map-layout.is-map-view .map-sidebar {
        display: none;
    }

    .map-app-page .map-layout.is-list-view .map-canvas-wrap {
        display: none;
    }

    .map-app-page .map-canvas-wrap {
        min-height: calc(100dvh - var(--map-nav-offset) - var(--map-toolbar-height) - var(--ng-bottom-nav-clearance, 0px));
    }

    .map-app-page .map-canvas {
        min-height: calc(100dvh - var(--map-nav-offset) - var(--map-toolbar-height) - var(--ng-bottom-nav-clearance, 0px));
    }

    .map-view-toggle {
        display: flex;
    }
}

/* Split view desktop */
@media (min-width: 769px) {
    .map-layout.is-split-view .map-sidebar,
    .map-layout.is-split-view .map-canvas-wrap {
        display: flex;
    }

    .map-view-toggle {
        display: none;
    }
}

/* Google Maps: el canvas necesita altura real (no solo height:100% sobre min-height:0) */
.map-app-page .map-canvas-wrap {
    align-self: stretch;
}

.map-app-page .map-canvas.ng-google-map {
    position: relative;
    flex: 1 1 auto;
    align-self: stretch;
    width: 100% !important;
    height: 100% !important;
    min-height: 320px !important;
}

.map-canvas.ng-google-map,
.map-canvas.ng-google-map .gm-style,
.map-canvas.ng-google-map > div {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
}

/* El overlay de error no debe tapar un mapa ya creado */
.map-canvas-wrap.is-map-ready .map-canvas__error {
    display: none !important;
}

.ng-google-geolocate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 10px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    color: #18181b;
    cursor: pointer;
}

.ng-google-geolocate:hover {
    background: #f8fafc;
}
