/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #e6ded6;
    color: #333;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

/* Filtros */
.filter-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    background-color: #fff;
    color: #2c3e50;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.filter-btn.active, .filter-btn:hover {
    background-color: #e46008;
    color: #fff;
}

/* Galería Adaptable (Mobile First) */
.gallery {
    display: grid;
    grid-template-columns: 1fr; /* 1 columna en celular */
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Tablets */
@media (min-width: 600px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Monitores/Computadoras */
@media (min-width: 1000px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tarjetas de diseño */
.gallery-item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover; /* Evita que la imagen se deforme */
    display: block;
}

.item-info {
    padding: 20px;
}

.item-info h3 {
    margin-bottom: 5px;
    color: #2c3e50;
}

/* ==========================================================================
   NUEVO ESTILO PARA EL MODAL (Imagen gigante y botón cerrar visible)
   ========================================================================== */

/* Fondo del modal: cubre toda la pantalla */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95); /* Fondo casi negro para resaltar el diseño */
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 10px;
}

/* Caja de contenido: ocupa el 95% de la pantalla */
.modal-content {
    background-color: transparent; /* Sacamos el fondo blanco para que luzca la imagen */
    width: 95%;
    max-width: 1400px; /* Tamaño máximo en monitores gigantes */
    height: 90vh; /* Ocupa el 90% del alto de la pantalla */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    animation: fadeIn 0.3s ease;
}

/* La imagen: se adapta al máximo ancho y alto disponible sin deformarse */
.modal-content img {
    width: 100%;
    height: 100%;
    max-height: 80vh; /* Deja espacio abajo para los textos */
    object-fit: contain; /* Muestra la imagen completa sin recortarla */
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Textos informativos debajo de la imagen */
#modalTitle {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

#modalDesc {
    color: #ccc;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Botón de cerrar: Grande, fijo arriba a la derecha y flotante */
.close-modal {
    position: fixed;
    top: 20px;
    right: 25px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.close-modal:hover {
    background-color: #e74c3c; /* Cambia a rojo al pasar el mouse */
    border-color: #e74c3c;
    transform: scale(1.05);
}

/* Ajustes especiales para pantallas de celulares */
@media (max-width: 600px) {
    .modal-content {
        height: 85vh;
    }
    
    .modal-content img {
        max-height: 70vh;
    }

    .close-modal {
        top: auto;
        bottom: 30px; /* En celulares lo ponemos abajo al medio para que se toque fácil con el pulgar */
        right: 50%;
        transform: translateX(50%);
    }

    .close-modal:hover {
        transform: translateX(50%) scale(1.05);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
