/**
 * Estilos base del mapa - FP Geo Content
 * 
 * Estilos mínimos para layout y funcionalidad.
 * Los estilos visuales se pueden personalizar desde:
 * - Ajustes > FP Geo Content > CSS Personalizado
 * - O desde el tema activo
 */

/* === LAYOUT BASE === */
.fp-geo-wrapper {
    position: relative;
    width: 100%;
    font-family: inherit;
}

.fp-geo-map-container {
    position: relative;
    display: flex;
    width: 100%;
}

.fp-geo-map {
    flex: 1;
    min-height: 400px;
    z-index: 1;
}

/* === FILTROS - LAYOUT === */
.fp-geo-filters {
    padding: 1rem;
}

.fp-geo-filters-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.fp-geo-filter-group {
    flex: 1;
    min-width: 200px;
}

.fp-geo-filter-label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.fp-geo-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fp-geo-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.fp-geo-filter-icon {
    width: 18px;
    height: 18px;
}

.fp-geo-clear-filters {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    background: transparent;
    font-weight: bold;
}

/* Footer de filtros con contador */
.fp-geo-filters-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.fp-geo-results-count {
    font-size: 0.875rem;
}

.fp-geo-results-number {
    font-weight: 600;
}

/* === LEYENDA - LAYOUT === */
.fp-geo-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    padding: 14px 18px;
    z-index: 800;
    min-width: 180px;
}

.fp-geo-sidebar-left .fp-geo-legend {
    right: auto;
    left: 20px;
}

.fp-geo-legend-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}

/* Secciones */
.fp-geo-legend-section {
    margin-bottom: 4px;
}

.fp-geo-legend-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 6px;
}

.fp-geo-legend-items {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.fp-geo-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    line-height: 1.3;
}

/* Marcador circular (iniciativas) */
.fp-geo-legend-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

/* Sección Bloque Piloto — separada visualmente */
.fp-geo-legend-pilot-section {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.fp-geo-legend-marker-pilot {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 28px;
}

.fp-geo-legend-marker-pilot svg {
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.fp-geo-legend-pilot-desc {
    font-size: 0.7rem;
    color: #9ca3af;
    margin: 2px 0 0 0;
    line-height: 1.35;
}

/* === AVISO DE SCROLL === */
.fp-geo-scroll-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.fp-geo-scroll-hint.visible {
    opacity: 1;
}

/* === PANEL DE DETALLE - LAYOUT === */
.fp-geo-detail {
    position: absolute;
    background: #fff;
    z-index: 1000;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Sidebar derecha (por defecto) */
.fp-geo-sidebar {
    top: 0;
    right: 0;
    width: 350px;
    max-width: 40%;
    height: 100%;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.fp-geo-sidebar.visible {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar izquierda */
.fp-geo-sidebar-left .fp-geo-sidebar {
    right: auto;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

.fp-geo-sidebar-left .fp-geo-sidebar.visible {
    transform: translateX(0);
}

/* Modal */
.fp-geo-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    z-index: 10001;
}

.fp-geo-modal.visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.fp-geo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fp-geo-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* === CONTENIDO DEL DETALLE === */
.fp-geo-detail-content {
    height: 100%;
    overflow-y: auto;
}

.fp-geo-detail-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-geo-detail-header {
    padding: 1.5rem;
}

.fp-geo-detail-taxonomies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fp-geo-detail-tax-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.fp-geo-detail-tax-icon {
    width: 14px;
    height: 14px;
}

.fp-geo-detail-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    display: none;
}

.fp-geo-detail-thumbnail.has-image {
    display: block;
}

.fp-geo-detail-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fp-geo-detail-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    padding: 1.25rem 1.25rem 0.5rem;
    line-height: 1.3;
}

.fp-geo-detail-excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 0 1.25rem;
    margin-bottom: 1rem;
}

.fp-geo-detail-meta {
    padding: 0 1.25rem;
    margin-bottom: 1rem;
}

.fp-geo-detail-location,
.fp-geo-detail-contact {
    font-size: 0.85rem;
}

.fp-geo-detail-location {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.fp-geo-detail-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.fp-geo-detail-contact-item a {
    text-decoration: none;
}

.fp-geo-detail-footer {
    padding: 1.25rem;
    border-top: 1px solid #eee;
}

.fp-geo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

/* === MARCADORES === */
.fp-geo-circle-marker {
    background: transparent !important;
    border: none !important;
}

.fp-geo-circle-marker svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* === CLUSTERS === */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
}

.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 15px;
    font: 12px sans-serif;
    font-weight: bold;
    line-height: 30px;
}

/* === ERROR === */
.fp-geo-error {
    background: #fee;
    color: #c00;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #c00;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .fp-geo-filters-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .fp-geo-filter-group {
        min-width: 100%;
    }

    .fp-geo-sidebar {
        width: 100%;
        max-width: 100%;
        height: 60%;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        transform: translateY(100%);
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    }

    .fp-geo-sidebar.visible {
        transform: translateY(0);
    }

    .fp-geo-sidebar-left .fp-geo-sidebar {
        right: 0;
        left: 0;
        transform: translateY(100%);
    }

    .fp-geo-sidebar-left .fp-geo-sidebar.visible {
        transform: translateY(0);
    }

    .fp-geo-modal {
        width: 95%;
        max-height: 90vh;
    }

    .fp-geo-legend {
        bottom: 10px;
        right: 10px;
        left: auto;
        padding: 10px 12px;
    }

    .fp-geo-sidebar-left .fp-geo-legend {
        right: 10px;
        left: auto;
    }
}
