/* ============================================================
   ECONATOURS TITANIUM UI v10.2.8 🚀
   FULL STACK STYLESHEET - 2026 LOGISTICS CORE
   Blindaje: UTF-8, Anti-Bounce, Safe-Areas, Glassmorphism & Switcher Fix
   ============================================================ */

:root {
    /* Paleta Titanium Pro */
    --eco-blue-dark: #1e3a8a;
    --eco-blue-light: #3b82f6;
    --eco-success: #10b981;
    --eco-danger: #ef4444;
    --eco-warning: #f59e0b;
    --eco-gray-soft: #64748b;
    --eco-bg: #f1f5f9; 
    --card-bg: #ffffff;
    --nav-height: 75px;
    
    /* Tipografía UTF-8 Safe */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Sombras y Efectos */
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 1. BLINDAJE DE ESTRUCTURA (Anti-Bounce)
   Evita que el scroll de WordPress rompa la experiencia de App */
body:has(#eco-app-shell) {
    background-color: var(--eco-bg) !important;
    margin: 0 !important;
    padding: 0 !important;
    position: fixed !important; 
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important; 
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

#eco-app-shell {
    position: fixed !important; 
    inset: 0;
    display: flex; 
    flex-direction: column;
    z-index: 999999;
    background: var(--eco-bg);
    font-family: var(--font-main);
}

/* 2. HEADER MASTER (Control de Marca y Búsqueda) */
.eco-admin-header {
    background: #ffffff;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    flex-shrink: 0; /* Evita que el header se aplaste */
}

.eco-branding h1 {
    font-size: 20px;
    color: var(--eco-blue-dark);
    margin: 0;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.v-tag {
    font-size: 9px;
    background: #eff6ff;
    color: var(--eco-blue-light);
    padding: 2px 6px;
    border-radius: 6px;
    vertical-align: middle;
}

.eco-search-bar {
    margin-top: 12px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.eco-search-bar:focus-within {
    background: #fff;
    border-color: var(--eco-blue-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.eco-search-bar input {
    border: none; background: none; width: 100%;
    font-size: 15px; font-weight: 600; outline: none;
}

/* 3. VIEWPORT DINÁMICO (Contenedor de Fichas) */
#eco-dynamic-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: 150px; /* Espacio para Nav y FAB */
    -webkit-overflow-scrolling: touch;
}

/* 4. FICHAS DE VIAJE (Titanium Cards) */
.eco-ficha-viaje {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 15px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(226, 232, 240, 0.5);
    animation: ecoFadeUp 0.4s ease-out forwards;
}

@keyframes ecoFadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 5. MODALES PREMIUM (Estilo iOS Premium) */
.eco-modal-overlay {
    position: fixed !important;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000000;
    display: flex;
    align-items: flex-end; 
    justify-content: center;
}

.eco-modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 550px;
    border-radius: 30px 30px 0 0;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -15px 50px rgba(0,0,0,0.2);
    animation: ecoSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: env(safe-area-inset-bottom); /* Soporte iOS */
}

@keyframes ecoSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* 6. COTIZADOR WIZARD (Pasos y Campos) */
.eco-progress-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
}

.eco-progress-bar .step {
    flex: 1; height: 6px; background: #e2e8f0; border-radius: 10px;
    transition: 0.4s;
}

.eco-progress-bar .step.active {
    background: var(--eco-blue-light);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.eco-form-group label {
    display: block; font-size: 11px; font-weight: 900;
    color: #475569; text-transform: uppercase; margin-bottom: 8px;
}

.eco-form-control {
    width: 100% !important;
    padding: 15px !important;
    background: #f8fafc !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 15px !important;
    font-size: 16px !important; /* Anti-zoom en iOS */
    font-weight: 600 !important;
}

.eco-form-control:focus {
    border-color: var(--eco-blue-light) !important;
    background: #fff !important;
    outline: none !important;
}

/* 7. NAVEGACIÓN INFERIOR (Safe-Area Ready) - CONECTADO A TU HTML */
.eco-manager-menu {
    flex-shrink: 0;
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 botones exactos */
    border-top: 1px solid #e2e8f0;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000000;
}

.eco-manager-menu .nav-item {
    border: none; background: none; display: flex;
    flex-direction: column; align-items: center; justify-content: center;
    color: #94a3b8; gap: 4px;
    font-size: 10px; font-weight: 800; text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
}

.eco-manager-menu .nav-item.active { 
    color: var(--eco-blue-dark); 
}

/* 8. BOTÓN ACCIÓN CENTRAL (FAB) - CONECTADO A TU HTML */
.eco-fab-add { 
    position: fixed;
    bottom: calc(var(--nav-height) + 20px + env(safe-area-inset-bottom));
    right: 20px;
    background: var(--eco-blue-dark);
    color: #fff;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 20px rgba(30, 58, 138, 0.3);
    border: none;
    font-size: 24px;
    z-index: 1000001;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.eco-fab-add:active { 
    transform: scale(0.9) rotate(5deg);
    background: var(--eco-blue-light);
}

/* 9. BOTONES DE ACCIÓN (Save/Next) */
.eco-btn-save {
    background: var(--eco-success) !important;
    color: white !important;
    padding: 18px !important;
    border-radius: 16px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    width: 100%; border: none; cursor: pointer;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

/* 10. SCROLLBAR PERSONALIZADA */
#eco-dynamic-content::-webkit-scrollbar { width: 5px; }
#eco-dynamic-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }


/* =====================================================
   11. FIX DEFINITIVO DEL SWITCHER (Z-INDEX BYPASS)
   ===================================================== */
.eco-workspace-switcher-container {
    position: fixed !important;
    top: 75px !important; /* Para que baje del header en desktop */
    left: 20px !important;
    background: #ffffff !important;
    width: 250px !important;
    border-radius: 16px !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2) !important;
    border: 1px solid #cbd5e1 !important;
    
    /* LA MAGIA QUE LO PONE POR ENCIMA DE TODO: */
    z-index: 9999999999 !important; 
    
    /* Aceleración por hardware para que no se atore debajo del fondo azul */
    transform: translateZ(9999px) !important; 
}

/* Opciones del Switcher para que se vean bonitas y clicleables */
.eco-workspace-switcher-container .ws-option {
    padding: 15px !important;
    cursor: pointer !important;
    border-bottom: 1px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    transition: background-color 0.2s ease !important;
}

.eco-workspace-switcher-container .ws-option:last-child {
    border-bottom: none !important;
}

.eco-workspace-switcher-container .ws-option:hover {
    background-color: #eff6ff !important;
    color: #1e3a8a !important;
}

/* Si estamos en Móvil, el switcher debe estar debajo del Header Blanco */
@media (max-width: 767px) {
    .eco-workspace-switcher-container {
        top: 65px !important; /* Altura del header móvil */
        left: 15px !important;
    }
}