/* ─── Gallery & Comparison Sections ─── */

.section-gallery {
    background-color: transparent;
    padding: 40px 0;
}

.section-ics {
    background-color: transparent;
    padding: 40px 0;
}

/* Gallery Section */
.gallery-section {
    padding: 20px 0;
}

.gallery-title {
    text-align: center;
    /* Fallback para clamp() */
    font-family: 'minecraft_seven_v2', cursive;
    font-size: 1.5rem;
    margin-bottom: 40px;
    color: #ffffff;
    text-shadow: none;
}

@supports (font-size: clamp(1rem, 2vw, 3rem)) {
    .gallery-title {
        font-size: clamp(1.2rem, 3vw, 2rem);
    }
}

.gallery-container {
    position: relative;
    margin-bottom: 30px;
}

.gallery-wrapper {
    width: 100%;
    overflow: hidden;
    border: 4px solid #3a3a3a;
    background-color: #2a2a2a;
}

.gallery-track {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

.gallery-item {
    min-width: 100%;
    position: relative;
}

/* Fallback aspect-ratio para galería */
.gallery-item::before {
    content: "";
    display: block;
    padding-bottom: 56.25%; /* 16/9 = 56.25% */
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

@supports (aspect-ratio: 1) {
    .gallery-item::before {
        display: none;
        padding-bottom: 0;
    }
    
    .gallery-item img {
        position: static;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
    }
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    /* Fallback para gradientes sin prefijo */
    background: -webkit-linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 40px 20px 20px;
    /* Fallback para clamp() */
    font-size: 0.75rem;
    text-align: center;
    color: #ffffff;
}

@supports (font-size: clamp(1rem, 2vw, 3rem)) {
    .gallery-caption {
        font-size: clamp(0.6rem, 1.5vw, 0.9rem);
    }
}

/* Gallery Buttons — superpuestos dentro de la imagen */
.gallery-btn {
    position: absolute;
    top: 50%;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    z-index: 2;
    width: 50px;
    height: 50px;
    background-color: rgba(58, 58, 58, 0.85);
    border: 3px solid #4a4a4a;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    -webkit-transition: background-color 0.2s ease, opacity 0.2s ease;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    opacity: 0.85;
}

.gallery-btn-prev {
    left: 12px;
}

.gallery-btn-next {
    right: 12px;
}

.gallery-btn:hover {
    background-color: rgba(74, 74, 74, 0.95);
    opacity: 1;
}

.gallery-btn:active {
    opacity: 0.7;
}

.gallery-btn span {
    line-height: 1;
    font-family: 'minecraft_seven_v2', cursive;
}

/* Los spacers del ICS ya no necesitan ocupar espacio */
.ics-spacer {
    display: none;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .section-gallery {
        padding: 30px 0;
    }

    .section-ics {
        padding: 30px 0;
    }

    .gallery-section {
        padding: 15px 0;
    }

    .gallery-wrapper {
        border-width: 3px;
    }

    @supports (aspect-ratio: 1) {
        .gallery-item img {
            aspect-ratio: 16 / 9;
        }
    }

    .gallery-btn {
        width: 40px;
        height: 40px;
        font-size: 1.6rem;
        border-width: 2px;
        left: 8px;
    }

    .gallery-btn-next {
        left: auto;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .section-gallery {
        padding: 15px 0;
    }

    .section-ics {
        padding: 15px 0;
    }

    .gallery-btn {
        width: 32px;
        height: 32px;
        font-size: 1.3rem;
        border-width: 2px;
        left: 4px;
    }

    .gallery-btn-next {
        left: auto;
        right: 4px;
    }

    .gallery-wrapper {
        border-width: 2px;
    }
}
