.geolocator-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.geolocator-modal {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.08);
    width: 90%;
    max-width: 900px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 9999;
}

.geolocator-modal-header {
    padding: 1rem;
    padding-right: 3.5rem;
    border-bottom: 1px solid #dee2e6;
    font-size: 1.25rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.geolocator-modal-body {
    flex-grow: 1;
    position: relative;
}

#geolocator-map {
    width: 100%;
    height: 100%;
}

.geolocator-zoom-level {
    width: 26px;
    height: 26px;
    border-bottom: 1px solid #ccc;
    background-color: #fff;
    color: #333;
    font-size: 12px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
    user-select: none;
}

.geolocator-poi-control {
    position: relative;
    min-width: 190px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}

.geolocator-poi-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.7rem;
    border: 0;
    background: transparent;
    color: #243447;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.geolocator-poi-toggle:focus-visible,
.geolocator-poi-retry:focus-visible {
    outline: 2px solid #0878e8;
    outline-offset: 2px;
}

.geolocator-poi-arrow {
    width: 0.5rem;
    height: 0.5rem;
    flex: 0 0 auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 180ms ease;
}

.geolocator-poi-control.is-open .geolocator-poi-arrow {
    transform: rotate(225deg) translate(-2px, -1px);
}

.geolocator-poi-panel {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0 0.7rem 0.7rem;
    color: #243447;
    font-size: 0.78rem;
}

.geolocator-poi-panel[hidden] {
    display: none;
}

.geolocator-poi-enabled,
.geolocator-poi-category {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
}

.geolocator-poi-enabled {
    font-weight: 600;
}

.geolocator-poi-categories {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0;
    padding: 0.45rem 0 0;
    border: 0;
    border-top: 1px solid #dce3e9;
}

.geolocator-poi-categories legend {
    padding: 0 0.25rem 0 0;
    font-size: 0.72rem;
    font-weight: 700;
}

.geolocator-poi-category input,
.geolocator-poi-enabled input {
    margin: 0;
}

.geolocator-poi-swatch {
    width: 0.65rem;
    height: 0.65rem;
    flex: 0 0 auto;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 50%;
}

.geolocator-poi-status {
    margin: 0;
    color: #536273;
    font-size: 0.72rem;
    line-height: 1.35;
}

.geolocator-poi-retry {
    align-self: flex-start;
    padding: 0.35rem 0.55rem;
    border: 1px solid #8ca4bb;
    border-radius: 4px;
    background: #fff;
    color: #174a78;
    font: inherit;
    cursor: pointer;
}

.geolocator-poi-source {
    color: #45647e;
    font-size: 0.68rem;
    text-decoration: underline;
}

.geolocator-modal-footer {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.geolocator-footer-address {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 1rem;
}

.geolocator-footer-address-label {
    display: block;
    margin-bottom: 0.2rem;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 600;
}

.geolocator-footer-address-text {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #212529;
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.geolocator-footer-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.5rem;
}

.geolocator-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    border: none;
    background: none;
}

/* --- Estilos de Botones (Reemplazo de Bootstrap) --- */
.geolocator-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-weight: 500;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.geolocator-btn-icon {
    flex: 0 0 1.1rem;
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.geolocator-btn-download {
    color: #fff;
    background-color: #6741a5;
    border-color: #6741a5;
}
.geolocator-btn-download:hover {
    background-color: #543487;
    border-color: #4e307e;
    box-shadow: 0 4px 12px rgba(103, 65, 165, 0.2);
    transform: translateY(-1px);
}
.geolocator-btn-cancel {
    color: #fff;
    background-color: #c64545;
    border-color: #c64545;
}
.geolocator-btn-cancel:hover {
    background-color: #aa3535;
    border-color: #9f3030;
    box-shadow: 0 4px 12px rgba(198, 69, 69, 0.18);
    transform: translateY(-1px);
}
.geolocator-btn-confirm {
    color: #fff;
    background-color: #198754;
    border-color: #198754;
}
.geolocator-btn-confirm:hover {
    background-color: #146c43;
    border-color: #125f3b;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.18);
    transform: translateY(-1px);
}
.geolocator-btn:disabled {
    cursor: wait;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

/* Asegura que SweetAlert2 se muestre por encima del modal del geolocalizador (z-index 9999) */
.geolocator-swal-zindex {
    z-index: 11000 !important;
}

.geolocator-header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-left: auto;
}

.geolocator-provider-label {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.geolocator-provider-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

/* Selector de proveedor en el header */
.geolocator-provider-select {
    min-width: 0;
    font-size: 0.9rem;
    padding: 0.375rem 0.625rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background-color: #fff;
    color: #212529;
}

/* --- Estilos para el Switch Satelital --- */
.geolocator-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    user-select: none;
}

.geolocator-switch input {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.geolocator-slider {
    position: relative;
    display: inline-block;
    flex: 0 0 42px;
    width: 42px;
    height: 24px;
    background-color: #aab3c0;
    border: 1px solid #929eae;
    border-radius: 999px;
    box-shadow: inset 0 1px 2px rgba(18, 35, 56, 0.18);
    transition: background-color 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
                border-color 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.geolocator-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    top: 2px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(18, 35, 56, 0.3);
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.geolocator-switch input:checked + .geolocator-slider {
    background-color: #0878e8;
    border-color: #0666c7;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18),
                0 0 0 3px rgba(8, 120, 232, 0.14);
}

.geolocator-switch input:checked + .geolocator-slider:before {
    transform: translateX(18px);
}

.geolocator-switch:hover .geolocator-slider {
    box-shadow: 0 0 0 3px rgba(18, 35, 56, 0.08);
}

.geolocator-switch:hover input:checked + .geolocator-slider {
    box-shadow: 0 0 0 3px rgba(8, 120, 232, 0.16);
}

.geolocator-switch:hover .geolocator-slider:before {
    box-shadow: 0 2px 5px rgba(18, 35, 56, 0.28);
}

.geolocator-switch input:focus-visible + .geolocator-slider {
    outline: 3px solid rgba(8, 120, 232, 0.35);
    outline-offset: 3px;
}

.geolocator-attribution {
    max-width: 190px;
    overflow: hidden;
    color: transparent;
    white-space: nowrap;
    cursor: pointer;
    border-radius: 3px 0 0 0;
    transition: max-width 0.2s ease, color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.geolocator-attribution::before {
    content: "\00a9 Esri \00b7 colaboradores";
    display: block;
    color: #333;
    font-size: 11px;
    line-height: 1.4;
}

.geolocator-attribution.is-expanded,
.geolocator-attribution:hover,
.geolocator-attribution:focus-visible {
    max-width: min(560px, calc(100vw - 32px));
    overflow-x: auto;
    color: #333;
    white-space: normal;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.geolocator-attribution.is-expanded::before,
.geolocator-attribution:hover::before,
.geolocator-attribution:focus-visible::before {
    display: none;
}

.geolocator-attribution:focus-visible {
    outline: 2px solid #0878e8;
    outline-offset: 2px;
}

.geolocator-modal .leaflet-marker-icon {
    transition: filter 0.2s ease;
}

.geolocator-modal .leaflet-marker-icon:hover {
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.22));
}

@media (max-width: 600px) {
    .geolocator-modal-header {
        align-items: flex-start;
        gap: 0.75rem;
        padding-right: 3.25rem;
    }

    .geolocator-header-controls {
        width: 100%;
        gap: 0.5rem;
    }

    .geolocator-provider-select {
        max-width: 100%;
    }

    .geolocator-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .geolocator-footer-address {
        margin-right: 0;
    }

    .geolocator-footer-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .geolocator-poi-control {
        min-width: 170px;
    }
}