
/* ============================================================
   FLOR DE UTRERA - CSS COMPLETO V13.3 (VISUAL FIX)
   ============================================================ */

/* 1. CONTENEDOR PRINCIPAL: Z-INDEX BAJO PARA NO TAPAR HEADER */
.fdu-scope-v13 {
    --brand: #A60039;
    --text: #374151;
    --bg: #F9F7F2;
    font-family: 'Poppins', sans-serif !important;
    background: var(--bg);
    padding: 30px 10px;
    box-sizing: border-box;
    position: relative;
    z-index: 0 !important; /* Mantiene el plugin debajo del header flotante del tema */
    isolation: isolate;
}

.fdu-scope-v13 * { box-sizing: border-box; }

/* FIX LEAFLET Z-INDEX: Forzar que el mapa no se coma el menú */
.leaflet-top, .leaflet-bottom { z-index: 400 !important; }

/* 2. FILTROS */
.fdu-filter-bar { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.fdu-pill {
    background: white; border: 1px solid #e5e7eb; color: #64748b;
    padding: 8px 16px; border-radius: 20px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; cursor: pointer; transition: 0.2s; white-space: nowrap;
}
.fdu-pill.active { background: var(--brand); color: white; border-color: var(--brand); }

/* 3. LAYOUT */
.fdu-main-card {
    display: flex; flex-direction: column; background: white; border-radius: 24px;
    overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    max-width: 1200px; margin: 0 auto; border: 1px solid #f1f5f9;
    position: relative; /* Necesario para el posicionamiento absoluto del CTA en desktop */
}

/* 4. MOBILE LAYOUT (< 1024px) */
@media (max-width: 1023px) {
    .fdu-main-card { flex-direction: column; height: auto !important; }
    .fdu-map-wrap { height: 45vh !important; min-height: 350px; width: 100%; }
    
    .fdu-sidebar {
        width: 100% !important;
        height: 50vh !important;
        border-right: none !important; border-top: 1px solid #f1f5f9;
        display: flex; flex-direction: column;
        position: relative;
        /* PADDING CLAVE: Espacio extra al final para que el último item no quede bajo el botón "Alta" */
        padding-bottom: 100px !important; 
    }
    
    /* En móvil, el CTA se posiciona fijo abajo del sidebar */
    .fdu-cta-float {
        position: absolute; bottom: 20px; left: 20px; right: 20px;
        background: rgba(255,255,255,0.95); padding: 15px; border-radius: 16px;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.1); z-index: 500;
        display: flex; justify-content: space-between; align-items: center;
        border: 1px solid #f1f5f9;
    }

    .fdu-filter-bar { justify-content: flex-start !important; overflow-x: auto; flex-wrap: nowrap !important; -webkit-overflow-scrolling: touch; padding-bottom: 10px; }
    .fdu-filter-bar::-webkit-scrollbar { display: none; }
}

/* 5. DESKTOP LAYOUT (>= 1024px) */
@media (min-width: 1024px) {
    .fdu-main-card { flex-direction: row-reverse; height: 700px; }
    .fdu-sidebar { width: 400px; height: 100%; border-right: 1px solid #f1f5f9; display: flex; flex-direction: column; }
    .fdu-map-wrap { flex: 1; height: 100%; position: relative; }

    /* En escritorio, el CTA flota sobre el mapa */
    .fdu-cta-float {
        position: absolute; bottom: 30px; right: 30px; width: 300px;
        background: rgba(255,255,255,0.95); padding: 20px; border-radius: 20px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.15); z-index: 500;
        display: block; border: 1px solid white;
    }
}

/* 6. COMPONENTES COMUNES */
.fdu-search-box { padding: 20px; border-bottom: 1px solid #f1f5f9; position: relative; background: white; }
.fdu-search-icon { position: absolute !important; top: 50% !important; left: 35px !important; transform: translateY(-50%) !important; color: #94a3b8 !important; pointer-events: none; }
.fdu-input { width: 100% !important; padding: 14px 14px 14px 50px !important; border-radius: 12px !important; border: 1.5px solid #e2e8f0 !important; background: #f8fafc !important; font-size: 14px !important; outline: none !important; }
.fdu-input:focus { border-color: var(--brand) !important; background: white !important; }

.fdu-list-wrap { flex: 1; overflow-y: auto; padding: 15px; }
.fdu-item { padding: 20px; border: 1px solid #f1f5f9; border-radius: 16px; margin-bottom: 10px; cursor: pointer; transition: 0.2s; background: white; }
.fdu-item:hover { border-color: var(--brand); background: #FFF5F7; transform: translateY(-2px); }
.fdu-tag { font-size: 10px; font-weight: 800; color: white; background: #2563EB; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; display: inline-block; margin-bottom: 5px; }
.fdu-item h4 { margin: 0 0 5px 0 !important; font-family: 'Quattrocento', serif !important; font-size: 16px !important; color: #1e293b; }
.fdu-item p { margin: 0 !important; font-size: 12px; color: #64748b; }

.fdu-cta-text { font-size: 13px; margin-bottom: 10px; display: block; }
.fdu-cta-text strong { display: block; color: #1e293b; font-size: 15px; }
.fdu-btn-add { background: var(--brand) !important; color: white !important; border: none !important; padding: 12px 20px !important; border-radius: 10px !important; font-weight: 800 !important; cursor: pointer !important; width: 100%; }

/* 7. MODAL */
.fdu-modal-overlay { display: none; position: fixed; inset: 0; z-index: 9999999; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); align-items: center; justify-content: center; padding: 20px; }
.fdu-modal-overlay.open { display: flex; }
.fdu-modal-box { background: white; width: 100%; max-width: 450px; border-radius: 24px; overflow: hidden; box-shadow: 0 25px 50px rgba(0,0,0,0.3); display: flex; flex-direction: column; max-height: 90vh; }
.fdu-modal-header { background-color: #A60039 !important; padding: 20px 25px !important; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.fdu-modal-header h3 { color: white !important; margin: 0 !important; font-family: 'Quattrocento', serif !important; font-size: 20px !important; font-weight: 600 !important; }
.fdu-close { color: white !important; font-size: 24px; cursor: pointer; font-weight: bold; }
.fdu-modal-body { padding: 30px; overflow-y: auto; flex: 1; }
.fdu-modal-body label { font-size: 11px; font-weight: 800; color: #94a3b8; text-transform: uppercase; display: block; margin-bottom: 5px; }
.fdu-modal-body input, .fdu-modal-body textarea { width: 100%; padding: 12px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 15px; background: #f8fafc; font-family: 'Poppins', sans-serif !important; }
.fdu-captcha-box { background: #fff7ed; border: 1px solid #ffedd5; padding: 10px; border-radius: 8px; margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; }
.fdu-captcha-box label { margin: 0; color: #c2410c; }
.fdu-captcha-box input { margin: 0 !important; border-color: #fdba74; background: white; text-align: center; }
.fdu-btn-submit { width: 100%; background: #2D2424 !important; color: white !important; padding: 15px; border-radius: 10px; font-weight: 800; border: none; cursor: pointer; }

/* 8. POPUPS */
.leaflet-popup-content-wrapper { border-radius: 12px !important; padding: 0 !important; overflow: hidden; }
.leaflet-popup-content { margin: 0 !important; width: 260px !important; }
.fdu-popup { padding: 20px; font-family: 'Poppins', sans-serif; }
.fdu-popup h5 { margin: 0 0 5px 0; font-size: 16px; font-weight: 700; color: #1e293b; font-family: 'Quattrocento', serif; }
.fdu-popup p { margin: 0 0 15px 0; font-size: 12px; color: #64748b; }
.fdu-pop-btn { display: block; text-align: center; padding: 10px; border-radius: 8px; font-size: 12px; font-weight: 700; text-decoration: none !important; margin-bottom: 5px; cursor: pointer; }
.fdu-pop-btn.web { background: #FFF1F2; color: #A60039 !important; }
.fdu-pop-btn.go { background: #1f2937; color: white !important; }
