/* =========================================
       1. ANIMACIONES Y UI GENERAL
       ========================================= */
    @keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
    @keyframes overlay-fade { from { opacity: 0; } to { opacity: 1; } }
    @keyframes modal-emerge { from { transform: scale(0.9) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

    .animate-slideUp { animation: slideUp 0.8s ease-out forwards; }
    .animate-fade-in { animation: overlay-fade 0.4s ease-out forwards; }
    .animate-modal { animation: modal-emerge 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

    html { scroll-behavior: smooth; }
    body { background-color: #0f0f0f; color: #fff; }

    /* Scrollbars Profesionales */
    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: #0f0f0f; }
    ::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 10px; border: 2px solid #0f0f0f; }
    ::-webkit-scrollbar-thumb:hover { background: #f97316; }

    /* =========================================
       2. EDITOR QUILL Y RENDERIZADO (ADMIN)
       ========================================= */
    .ql-container.ql-snow {
        border: 1px solid rgba(255,255,255,0.1) !important;
        background: #151515 !important;
        border-radius: 0 0 15px 15px !important;
        color: white !important;
    }
    .ql-toolbar.ql-snow {
        background: #222 !important;
        border: 1px solid rgba(255,255,255,0.1) !important;
        border-radius: 15px 15px 0 0 !important;
    }

    /* =========================================
       3. MAPA (VISTA NORMAL SIN FILTROS)
       ========================================= */
    /* Forzamos que el mapa no tenga efectos extraños */
    iframe {
        filter: none !important;
        -webkit-filter: none !important;
    }

    /* Ocultar cualquier capa oscura que se haya quedado encima del mapa */
    .pointer-events-none.border-\[12px\] {
        display: none !important;
    }


    /* =========================================
       5. COMPONENTES ADICIONALES
       ========================================= */
    .glass-card {
        background: rgba(255, 255, 255, 0.03);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    #modal-description::-webkit-scrollbar { width: 4px; }
    #modal-description::-webkit-scrollbar-thumb { background: #f97316; border-radius: 10px; }

    .card-description {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        height: 3em; 
        color: #9ca3af;
        font-size: 0.85rem;
    }

    /* Estados del Horario */
    .status-open { background: rgba(34, 197, 94, 0.1); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.2); }
    .status-closed { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }

/* =========================================
   6. FILTRO DE CATEGORÍAS (ESTILO DARK)
   ========================================= */
.filter-container {
    margin: 40px auto;
    max-width: 320px;
    padding: 0 20px;
    text-align: center;
}

#category-filter {
    width: 100%;
    padding: 12px 20px;
    border-radius: 15px;
    /* Usamos el mismo estilo glass-card de tus otros componentes */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    outline: none;
    transition: all 0.4s ease;
    
    /* Flecha personalizada en color naranja */
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23f97316' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

#category-filter:focus {
    border-color: #f97316;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.2);
}

/* Para que las opciones se vean oscuras en PC */
#category-filter option {
    background-color: #1a1a1a;
    color: #fff;
}

/* Esto obliga a que la lista desplegable respete el color oscuro en PC */
#cot-material option {
    background-color: #161616 !important;
    color: white !important;
    padding: 10px;
}

/* Elimina el borde azul feo que ponen algunos navegadores al hacer click */
#cot-material:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

select option {
    background-color: #1c1c1c !important;
    color: white !important;
}

@media (max-width: 768px) {
            .main-content { 
                margin-left: 0 !important; 
                width: 100% !important; 
                padding-top: 80px !important;
            }
            .sidebar {
                transform: translateX(-100%);
                transition: transform 0.3s ease;
            }
            .sidebar.active {
                transform: translateX(0);
            }
        }
    
@media (max-width: 768px) {
    #lightbox-img {
        width: 100%;
        height: auto;
        max-height: 70vh; /* Deja espacio para el texto abajo */
    }
    #lightbox-desc {
        font-size: 14px;
        padding: 0 10px;
    }
}

#g-preview, #drop-area {
    transition: all 0.3s ease-in-out;
}

@keyframes fadeInCustom {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeInCustom 0.8s ease-out;
}

/* Elimina el espacio arriba en móvil y ajusta el modal */
@media (max-width: 640px) {
    .modal-bottom .modal-box {
        max-height: 100vh;
        border-radius: 0; /* Ocupa toda la pantalla */
    }
}

/* Scrollbar industrial para la info del proyecto */
.custom-scroll::-webkit-scrollbar {
    width: 4px;
}
.custom-scroll::-webkit-scrollbar-track {
    background: #1a1a1a;
}
.custom-scroll::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #f97316;
}

#portfolio-grid {
    display: grid;
    /* 2 columnas fijas en móvil (mínimo 150px cada una) */
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; /* Espacio entre tarjetas en móvil */
    padding: 12px;
}

@media (min-width: 768px) {
    #portfolio-grid {
        /* 3 columnas en tablets y desktops pequeños */
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
        padding: 0;
    }
}

@media (min-width: 1280px) {
    #portfolio-grid {
        /* 4 columnas en pantallas grandes */
        grid-template-columns: repeat(4, 1fr);
    }
}

.btn-white-industrial {
    background-color: white !important;
    color: black !important;
    border: none !important;
}
.btn-white-industrial:hover {
    background-color: #f97316 !important; /* Naranja */
    color: white !important;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-badge {
    animation: slideUpFade 0.4s ease-out forwards;
}