.church-map-page {
    background: var(--bg-light);
    min-height: 100vh;
}

.map-hero {
    background: var(--primary);
    color: var(--white);
    padding: 70px 0 45px;
    text-align: center;
}

.map-hero h1 {
    font-family: var(--serif);
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: var(--accent);
    margin-bottom: 12px;
}

.map-hero p {
    max-width: 680px;
    margin: 0 auto 26px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
    line-height: 1.6;
}

.map-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.map-location-status {
    margin-top: 18px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.78);
}

.map-content {
    padding: 45px 0 70px;
}

.map-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.church-list-panel {
    background: var(--white);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
    max-height: 680px;
    display: flex;
    flex-direction: column;
}

.church-list-header {
    padding: 20px;
    border-bottom: 1px solid rgba(12, 32, 54, 0.08);
}

.church-list-header h2 {
    font-family: var(--serif);
    color: var(--primary);
    font-size: 1.35rem;
    margin-bottom: 4px;
}

.church-list-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.church-list {
    overflow-y: auto;
    padding: 10px;
}

.church-map-card {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid rgba(12, 32, 54, 0.06);
}

.church-map-card:hover,
.church-map-card.active {
    background: rgba(212, 167, 44, 0.12);
}

.church-map-card strong {
    display: block;
    color: var(--primary);
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 4px;
}

.church-map-card small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.4;
}

.church-distance {
    display: inline-flex;
    margin-top: 8px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
}

.map-wrapper {
    background: var(--white);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 12px;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

#mapa-igrejas {
    width: 100%;
    height: 680px;
    min-height: 430px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.popup-title {
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1.25;
}

.popup-text {
    color: #4b5563;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

.popup-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.popup-actions a {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.popup-details {
    background: var(--primary);
    color: var(--white);
}

.popup-route {
    background: var(--accent);
    color: var(--primary);
}

.map-empty {
    background: var(--white);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-secondary);
}

.map-empty h2 {
    font-family: var(--serif);
    color: var(--primary);
    margin-bottom: 8px;
}

@media (max-width: 992px) {
    .map-layout {
        grid-template-columns: 1fr;
    }

    .church-list-panel {
        max-height: 420px;
        order: 2;
    }

    .map-wrapper {
        order: 1;
    }

    #mapa-igrejas {
        height: 520px;
    }
}

@media (max-width: 600px) {
    .map-hero {
        padding: 55px 0 35px;
    }

    .map-hero p {
        font-size: 0.95rem;
    }

    .map-content {
        padding: 28px 0 50px;
    }

    .map-wrapper {
        padding: 8px;
        border-radius: 14px;
    }

    #mapa-igrejas {
        height: 430px;
        border-radius: 12px;
    }

    .church-list-panel {
        border-radius: 14px;
    }

    .map-actions .btn {
        width: 100%;
        max-width: 320px;
    }
}

/* CORREÇÃO: manter controles do Leaflet presos dentro do mapa */
.map-wrapper {
    position: relative;
    overflow: hidden;
}

#mapa-igrejas {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Garante que o container dos controles fique preso ao mapa */
#mapa-igrejas .leaflet-control-container {
    position: absolute;
    inset: 0;
    z-index: 500;
    pointer-events: none;
}

#mapa-igrejas .leaflet-container,
.leaflet-container {
    width: 100%;
    height: 100%;
}

/* Reforça o posicionamento interno dos controles */
#mapa-igrejas .leaflet-top,
#mapa-igrejas .leaflet-bottom {
    position: absolute;
    z-index: 500;
    pointer-events: none;
}

#mapa-igrejas .leaflet-left {
    left: 12px;
}

#mapa-igrejas .leaflet-top {
    top: 12px;
}

#mapa-igrejas .leaflet-control {
    margin: 0;
    pointer-events: auto;
}

/* Reset específico dos botões de zoom para não herdarem o CSS global de links */
#mapa-igrejas .leaflet-control-zoom a {
    display: block;
    width: 34px;
    height: 34px;
    line-height: 34px;
    padding: 0;
    margin: 0;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
    color: #0C2036;
    background: #FFFFFF;
    border: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    transform: none !important;
}

#mapa-igrejas .leaflet-control-zoom a:hover {
    background: #D4A72C;
    color: #0C2036;
    transform: none !important;
}

#mapa-igrejas .leaflet-control-zoom {
    border: 1px solid rgba(12, 32, 54, 0.12);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(12, 32, 54, 0.18);
}