/* ========================================
   CARRUSEL DE IMÁGENES
   ======================================== */

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto var(--spacing-2xl);
    background-color: var(--color-white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Ratio 1:1 */
    background-color: #000;
}

.carousel-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-item.active {
    opacity: 1;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-item a {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.carousel-item a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Botones del carrusel */
.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(196, 30, 58, 0.8);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-button:hover {
    background-color: rgba(196, 30, 58, 1);
    transform: translateY(-50%) scale(1.1);
}

.carousel-button.prev {
    left: 10px;
}

.carousel-button.next {
    right: 10px;
}

/* Indicadores (puntos) */
.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background-color: var(--color-primary);
    width: 30px;
    border-radius: 6px;
}

.carousel-indicator:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   GRID DE 3 COLUMNAS
   ======================================== */

.gallery-grid {
    display: grid;
    /* grid-template-columns: repeat(3, 1fr); */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    justify-content: center;   /* centra cuando hay menos columnas */
    justify-items: center;     /* centra el contenido dentro de cada celda */
    margin-bottom: var(--spacing-2xl);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Overlay en hover */
.gallery-item::after {
   content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(196, 30, 58, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* Modal para ampliar imagen */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.image-modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: all 0.3s ease;
}

.modal-close:hover {
    transform: scale(1.2);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    .carousel-button {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .carousel-button.prev {
        left: 5px;
    }

    .carousel-button.next {
        right: 5px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .carousel-button {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .carousel-indicators {
        bottom: 10px;
    }

    .carousel-indicator {
        width: 10px;
        height: 10px;
    }

    .carousel-indicator.active {
        width: 25px;
    }
}