/* ==========================================
   BANNER DEL CATÁLOGO
   ========================================== */
.banner-catalogo {
    background: linear-gradient(145deg, #003366 0%, #0072ce 50%);
    color: #ffffff;
    padding: 80px 20px;
    text-align: center;
}

.contenedor-banner h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.contenedor-banner p {
    font-size: 1.5rem;
    color: #e0f2fe;
}

/* ==========================================
   SECCIÓN DEL CATÁLOGO
   ========================================== */
.seccion-catalogo {
    padding: 60px 0 100px 0;
    background: linear-gradient(145deg, #ffffff 0%, #f4fafd 50%);
}
.contenedor-catalogo {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- FILTROS DE PRODUCTOS --- */
.filtros-productos {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 50px;
}

.btn-filtro {
    background-color: #ffffff;
    border: 2px solid #d0e1f7;
    color: #475569;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    
    /* Agregamos esto para que los enlaces se comporten como botones */
    text-decoration: none; 
    display: inline-block;
    text-align: center;
}

.btn-filtro:hover {
    border-color: #000911;
    color: #f8fafc;
    background: linear-gradient(145deg, #003366 0%, #0072ce 50%);
    transition: all 0.9s ease-in-out;
    border-radius: 25px 5px 25px 5px;
}


/* --- GRID DE PRODUCTOS --- */
.grid-productos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* --- TARJETA DE PRODUCTO INDIVIDUAL --- */
.tarjeta-producto {
    background: linear-gradient(180deg, #f5f8fa 97%, #003663 3%);
    border: 1px solid rgb(2, 116, 137);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
}

.tarjeta-producto:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 114, 206, 0.15);
}

.imagen-producto {
    width: 100%;
    height: 350px;
    background: linear-gradient(360deg, #f5f8fa 97%, #003663 3%);
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
}

.imagen-producto img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
    padding: 10px;
}

.tarjeta-producto:hover .imagen-producto img {
    transform: scale(1.05); /* Zoom sutil a la foto al pasar el mouse */
}

/* --- INFORMACIÓN DEL PRODUCTO --- */
.info-producto {
    padding: 25px;
}

.etiqueta-categoria {
    display: inline-block;
    background-color: #e0f2fe;
    color: #0072ce;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.info-producto h3 {
    font-size: 1.4rem;
    color: #1e293b;
    margin-bottom: 15px;
    font-weight: 800;
}

.info-producto p {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 8px;
}

/* --- BOTÓN COTIZAR WHATSAPP --- */
.btn-cotizar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: rgb(3, 37, 159);
    color: #ffffff;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.btn-cotizar i {
    font-size: 1.2rem;
}

.btn-cotizar:hover {
    background-color: #1da851;
}

/* ==========================================
   GALERÍA DESTACADA POR CATEGORÍA (TAMAÑO GIGANTE)
   ========================================== */
.galeria-destacada {
    background-color: #f0f7ff;
    border-radius: 12px;
    padding: 20px 20px;
    
    /* Centrado y ocupando el 80% del contenedor */
    width: 80%;
    margin: 0 auto 30px auto; 
    
    border-left: 5px solid #014378;
    border-bottom: 5px solid #014378;
    text-align: center;
    animation: aparecerSuave 0.5s ease;
}

.galeria-destacada h3 {
    color: #003366;
    font-size: 2.2rem; /* Letra más grande */
    margin-bottom: 10px;
    font-weight: 800;
}

.galeria-destacada p {
    color: #64748b;
    margin-bottom: 40px;
    font-size: 1.15rem;
}

/* --- CUADRÍCULA: 2 COLUMNAS EXACTAS --- */
.grid-galeria-grande {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Crea exactamente 2 columnas */
    gap: 30px; /* Espaciado entre las imágenes */
}

/* Estilo de cada imagen gigante */
.grid-galeria-grande img {
    width: 100%;
    height: 300px; /* Las hace altas y vistosas */
    object-fit: cover; /* Evita que las fotos se deformen o estiren mal */
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 85, 0.5);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
    border: 1px solid rgb(69, 148, 251);
}

.grid-galeria-grande img:hover {
    /* El zoom es más suave (1.03) porque las fotos ya son enormes */
    transform: scale(1.03); 
    box-shadow: 0 15px 35px rgba(0, 114, 206, 0.25);
}

@keyframes aparecerSuave {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVE: ADAPTACIÓN PARA TABLETS Y CELULARES --- */
@media (max-width: 992px) {
    .galeria-destacada {
        width: 95%; /* En tablets aprovecha casi toda la pantalla */
        padding: 40px 20px;
    }
    .grid-galeria-grande img {
        height: 280px; /* Reduce un poco la altura para que no sea excesiva */
    }
}

@media (max-width: 768px) {
    .grid-galeria-grande {
        grid-template-columns: 1fr; /* En celulares pasa a 1 sola columna hacia abajo */
        gap: 20px;
    }
    .galeria-destacada h3 {
        font-size: 1.6rem;
    }
    .grid-galeria-grande img {
        height: 250px;
    }
}
/* --- CUADRÍCULA: 1 SOLA IMAGEN (Para Línea Galénico) --- */
.grid-galeria-unica {
    display: flex;
    justify-content: center;
}

.grid-galeria-unica img {
    width: 100%;
    max-width: 600px; /* Evita que la foto se estire infinitamente */
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

.grid-galeria-unica img:hover {
    transform: scale(1.03); 
    box-shadow: 0 15px 35px rgba(0, 114, 206, 0.25);
}

@media (max-width: 768px) {
    .grid-galeria-unica img {
        height: 280px;
    }
}
/* ==========================================
   DISEÑO DE LA VENTANA FLOTANTE (MODAL)
   ========================================== */
.modal-oculto {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 9999; /* Por encima de todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 33, 71, 0.8); /* Fondo azul marino oscuro y transparente */
    backdrop-filter: blur(5px); /* Desenfoque elegante de lo que hay atrás */
    align-items: center;
    justify-content: center;
}

/* Clase que el JS usará para mostrarlo */
.mostrar-modal {
    display: flex !important;
    animation: aparecerModal 0.3s ease-out;
}

.contenido-modal {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 40px;
    width: 90%;
    max-width: 800px; /* Tamaño máximo de la ventana */
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    max-height: 90vh; /* Altura máxima: 90% de la pantalla */
    overflow-y: auto; /* Crea una barra de desplazamiento si el contenido es muy alto */
}

.cerrar-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #64748b;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}
/* 2. IMÁGENES DEL MODAL (Solución para que se adapten enteras) */
.modal-galeria img {
    width: 100%;
    height: 250px; 
    /* Cambiamos cover por contain para que no se corte nada */
    object-fit: contain; 
    background-color: #a6cff9; /* Fondo gris muy clarito para rellenar el espacio vacío */
    border-radius: 8px;
    border: 1px solid #036cf6;
    padding: 5px; /* Espacio interno para que la foto no pegue con los bordes */
}

.cerrar-modal:hover {
    color: #ef4444; /* Se pone rojo al pasar el mouse */
}

#modal-titulo {
    color: #003366;
    font-size: 2rem;
    margin-bottom: 15px;
    padding-right: 30px;
}

#modal-descripcion {
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Galería de 3 imágenes dentro del modal */
.modal-galeria {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.modal-galeria img {
    width: 100%;
    height: 290px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Botón Whatsapp del modal */
.btn-whatsapp-modal {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #25d366;
    color: #ffffff;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    transition: background-color 0.3s, transform 0.3s;
}

.btn-whatsapp-modal:hover {
    background-color: #1ebc5c;
    transform: scale(1.05);
}

/* Botón Ver Detalles (Para la tarjeta) */
.btn-ver-detalles {
    width: 100%;
    background-color: #f8fafc;
    color: #0072ce;
    border: 1px solid #0072ce;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.btn-ver-detalles:hover {
    background-color: #0072ce;
    color: #ffffff;
}

@keyframes aparecerModal {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .modal-galeria { grid-template-columns: 1fr; }
    .modal-galeria img { height: 290px; }
    .contenido-modal { padding: 30px 20px; }
}
/* 3. ADAPTACIÓN PARA CELULARES (Mantiene buen tamaño) */
@media (max-width: 768px) {
    .modal-galeria { 
        grid-template-columns: 1fr; /* Una foto debajo de otra */
    }
    .modal-galeria img { 
        height: 250px; /* Mantiene la foto grande y visible en celular */
        object-fit: contain;
        padding: 5px; /* Espacio interno para que la foto no pegue con los bordes */
    }
    .contenido-modal { 
        padding: 30px 20px;
        max-height: 85vh; /* Deja un poco más de margen arriba y abajo en celulares */
    }
}
/* FASE 1 - Corrección de filtros y modal */
.tarjeta-producto[hidden], .modal-galeria img[hidden] { display: none !important; }
.btn-filtro.activo { color: #fff; background: #0072ce; border-color: #0072ce; }
.cerrar-modal { border: 0; background: transparent; line-height: 1; }
.modal-galeria img { object-fit: contain; }
