/* --- 1. ESTILOS PARA LA PÁGINA DE GALERÍA (CERÁMICAS) --- */

.gallery-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem auto;
    font-size: 1.1rem;
    color: #555;
}

.gallery-grid {
    display: grid;
    /* 4 columnas en pantallas grandes */
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.gallery-text {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gallery-text h3 {
    font-family: var(--font-title);
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.gallery-text p {
    font-size: 0.9rem;
    color: #666;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.details-link {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--color-secondary-text);
    text-decoration: none;
    padding: 0.3rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}

.gallery-item:hover .details-link {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}


/* --- Estilos para el Mini-Carrusel dentro de cada item --- */
.mini-carousel {
    position: relative;
    width: 100%;
    /* Proporción de imagen 4:3 */
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.mini-carousel-slides {
    display: flex;
    height: 100%;
    transition: transform 0.4s ease-in-out;
}

.mini-carousel-slide {
    min-width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    font-size: 1.5rem;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .mini-carousel-control,
.modal-content-gallery:hover .mini-carousel-control {
    opacity: 1;
}

.mini-carousel-control.prev { left: 10px; }
.mini-carousel-control.next { right: 10px; }


/* --- Estilos para el Modal (Pop-up) de la Galería --- */
.modal-content-gallery {
    position: relative;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    /* Animación de entrada */
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* El overlay ya está definido, pero le añadimos esto para la animación del contenido */
.modal-overlay:not(.hidden) .modal-content-gallery {
    transform: scale(1);
    opacity: 1;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 2.5rem;
    line-height: 1;
    color: #888;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #333;
}

#modal-carousel-container .mini-carousel {
    margin-bottom: 1.5rem;
    aspect-ratio: 16 / 9; /* El carrusel del modal puede ser más panorámico */
}

#modal-text-container h3 {
    font-family: var(--font-title);
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

#modal-text-container p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--color-text);
}


/* --- Media Queries para la Galería (Responsividad) --- */

/* Para tablets (2 columnas) */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Para móviles (1 columna) */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    #modal-text-container h3 {
        font-size: 1.5rem;
    }
    #modal-text-container p {
        font-size: 1rem;
    }
    .modal-content-gallery {
        padding: 1.5rem;
        padding-top: 3rem; /* Más espacio para el botón de cerrar */
    }
}
