/* css/estilos.css */
body { margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; overflow: hidden; }
#mapa { width: 100%; height: 100vh; z-index: 1; }

/* PANEL FLOTANTE - Glassmorphism Morado Claro */
#panel-flotante {
    position: absolute; top: 20px; left: 20px; width: 340px; z-index: 1000;
    background-color: rgba(155, 89, 182, 0.25); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(12px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    color: #2c3e50;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.3);
}

.logo-area { text-align: center; padding: 20px; border-bottom: 1px solid rgba(155, 89, 182, 0.2); }
.logo-area img { max-height: 90px; filter: drop-shadow(0px 2px 2px rgba(0,0,0,0.1)); }

#vista-contraida {
    background-color: rgba(155, 89, 182, 0.8);
    color: white; padding: 12px; text-align: center;
    border-radius: 0 0 15px 15px; cursor: pointer;
    font-weight: bold; text-transform: uppercase; font-size: 12px;
}

#vista-expandida { display: none; padding: 20px; position: relative; }

.btn-cerrar-lateral {
    position: absolute; right: -25px; top: 20px; width: 25px; height: 45px;
    background-color: rgba(155, 89, 182, 0.9); color: white;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border-radius: 0 5px 5px 0;
}

h3 { font-size: 13px; margin: 15px 0 8px 0; color: #5b2c6f; font-weight: 700; text-transform: uppercase; }

/* INPUTS Y SELECTS */
.input-custom, .select-custom {
    width: 100%; padding: 10px; border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 8px; background: rgba(255, 255, 255, 0.7);
    color: #2c3e50; box-sizing: border-box; outline: none; font-size: 14px;
}

.input-custom:focus, .select-custom:focus { border-color: #9b59b6; background: white; }

/* CHECKBOX AREA */
.checkbox-container {
    display: flex; align-items: center; gap: 10px;
    margin-top: 15px; font-size: 14px; color: #5b2c6f; font-weight: 600;
    cursor: pointer; background: rgba(255,255,255,0.4); padding: 8px; border-radius: 8px;
}

/* BOTONES */
.btn-accion {
    width: 100%; padding: 12px; margin-top: 15px;
    border: none; border-radius: 8px; font-weight: bold; cursor: pointer;
    transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background-color: #9b59b6; color: white; }
.btn-primary:hover { background-color: #8e44ad; }

/* Barra de opciones superior - FIJADA A LA DERECHA */
.menu-superior {
    position: absolute;
    top: 15px;
    right: 300px; 
    left: auto;
    z-index: 1000;
    display: flex;
    gap: 2px;
    background-color: #1a202c;
    padding: 2px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.btn-menu-sup {
    background-color: #1a202c; color: white; border: none;
    padding: 10px 15px; font-size: 13px; cursor: pointer;
    display: flex; align-items: center; gap: 8px; transition: background 0.2s;
}

.btn-menu-sup:hover { background-color: #2d3748; }
.btn-menu-sup:not(:last-child) { border-right: 1px solid #4a5568; }
.btn-menu-sup i { font-size: 14px; color: #cbd5e0; }

/* Mover controles de Leaflet abajo a la derecha */
.leaflet-bottom.leaflet-right { margin-bottom: 20px; margin-right: 10px; }

/* Estilo para la lista de cuadrantes */
.cuadrantes-list {
    display: flex; flex-direction: column; gap: 5px; margin-top: 10px;
    padding: 10px; background: rgba(255, 255, 255, 0.4); border-radius: 8px;
}

.cuadrante-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #5b2c6f; cursor: pointer; }


/* =========================================
   MODAL PARA AGREGAR NEGOCIO (Z-INDEX MEDIO)
   ========================================= */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6); z-index: 2000 !important; 
    justify-content: center; align-items: center; backdrop-filter: blur(5px);
}

.modal-contenido {
    background: white; border-radius: 15px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px; width: 90%; max-height: 90vh; overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%); color: white;
    padding: 25px; border-radius: 15px 15px 0 0; display: flex; justify-content: space-between; align-items: center;
}

.modal-header h2 { margin: 0; font-size: 24px; }

.btn-cerrar-modal {
    background: rgba(255, 255, 255, 0.2); border: none; color: white;
    font-size: 24px; cursor: pointer; width: 40px; height: 40px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: 0.3s;
}

.btn-cerrar-modal:hover { background: rgba(255, 255, 255, 0.3); }

.modal-body { padding: 30px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: #5b2c6f; font-weight: 600; font-size: 14px; }

.input-form, .input-form select {
    width: 100%; padding: 12px; border: 2px solid #e0e0e0; border-radius: 8px;
    font-size: 14px; box-sizing: border-box; transition: 0.3s;
}

.input-form:focus, .input-form select:focus {
    border-color: #9b59b6; outline: none; box-shadow: 0 0 8px rgba(155, 89, 182, 0.2);
}

.info-ubicacion {
    color: #7f8c8d; font-size: 13px; margin: 10px 0; padding: 10px;
    background: rgba(155, 89, 182, 0.1); border-radius: 8px; border-left: 4px solid #9b59b6;
}

.btn-ubicacion {
    width: 100%; padding: 12px; background: #c25fe98e; color: white; border: none;
    border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.3s;
    display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px;
}

.btn-ubicacion:hover { background: #8e44ad; }

.coords-display { margin-top: 10px; }
.coords-info { background: #d4edda; color: #155724; padding: 12px; border-radius: 8px; border: 1px solid #c3e6cb; font-size: 13px; line-height: 1.5; }

.form-buttons { display: flex; gap: 10px; margin-top: 30px; }
.btn-cancelar, .btn-guardar {
    flex: 1; padding: 12px; border: none; border-radius: 8px; font-weight: bold;
    cursor: pointer; transition: 0.3s; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-cancelar { background: #ecf0f1; color: #2c3e50; }
.btn-cancelar:hover { background: #bdc3c7; }
.btn-guardar { background: #27ae60; color: white; }
.btn-guardar:hover { background: #229954; }


/* ========================================================
   MODAL PARA SELECCIONAR UBICACIÓN (Z-INDEX MÁXIMO)
   ======================================================== */
.modal-overlay-mapa {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7); 
    z-index: 9999 !important; /* MÁXIMA PRIORIDAD PARA QUE SIEMPRE ESTÉ ARRIBA */
    justify-content: center; align-items: center;
}

.modal-mapa-contenido {
    background: white; border-radius: 15px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%; height: 90vh; max-width: 900px;
    display: flex; flex-direction: column; animation: slideUp 0.3s ease;
}

.modal-mapa-header {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%); color: white;
    padding: 20px 25px; border-radius: 15px 15px 0 0;
    display: flex; justify-content: space-between; align-items: center;
}

.modal-mapa-header h2 { margin: 0; font-size: 22px; }

.mapa-seleccion { flex: 1; width: 100%; border-radius: 0; background: #f0f0f0; z-index: 1; margin: 0;}

.modal-mapa-footer {
    padding: 15px 25px; border-top: 1px solid #e0e0e0; border-radius: 0 0 15px 15px;
    text-align: center; background: #f8f9fa;
}

#instruccion-mapa { margin: 0 0 10px 0; color: #7f8c8d; font-size: 14px; font-weight: 500; }
.coords-footer { margin-top: 10px; }

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
/* =========================================
   CONFIGURACIÓN PARA IMPRESIÓN DEL MAPA
   ========================================= */
@media print {
    /* Ocultar todos los menús y paneles de la interfaz */
    .menu-superior, 
    #panel-flotante, 
    .leaflet-control-zoom,
    .leaflet-control-layers {
        display: none !important;
    }

    /* Forzar al mapa a ocupar toda la hoja de papel */
    #mapa {
        width: 100vw !important;
        height: 100vh !important;
        position: absolute;
        top: 0;
        left: 0;
    }
}