/* ==========================================================================
   carousel.css — CLS-optimized
   Uses aspect-ratio to reserve space before images load.
   ========================================================================== */

.carousel {
    position: relative;
    width: 100%;
    /* Override Materialize default height:400px — usar aspect-ratio 5/3 (=1.667)
       coincide con las imágenes PC 392x235 y mobile 500x300. */
    height: auto !important;
    aspect-ratio: 5 / 3;
    overflow: hidden;
    contain: layout style;
    perspective: none !important;
    transform-style: flat !important;
}

/* reference-height image: invisible, used only for sizing fallback */
.carousel .reference-height {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
    aspect-ratio: 5 / 3;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    object-fit: cover;
}

.carousel a {
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 1;
    opacity: 0;
    left: 0;
    top: 0;
    transition: opacity .4s linear;
}

.carousel a.active {
    opacity: 1;
    z-index: 5;
}

.carousel picture {
    display: block;
    width: 100%;
    height: 100%;
}

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

.carousel .arrow {
    position: absolute;
    z-index: 10;
    top: 0;
    width: 50px;
    height: 100%;
    background: transparent;
    border: 0;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.5;
    cursor: pointer;
    transition: background .2s linear;
}

.carousel .arrow:hover {
    background: rgba(0, 0, 0, 0.5);
}

.carousel .arrow.left {
    left: 0;
}

.carousel .arrow.right {
    right: 0;
}

.carousel .arrow .material-icons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    display: inline-block;
    text-align: center;
    /* fallback: ocultar texto hasta que cargue la fuente Material Icons */
    color: inherit;
    overflow: hidden;
}

.carousel .arrow:hover .material-icons {
    color: white;
}

.carousel .carousel-indicators {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.carousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    background: var(--text-muted);
    opacity: 0.3;
    margin: 0 10px;
    cursor: pointer;
}

.carousel .carousel-indicators button.active {
    opacity: 1;
}

@media screen and (min-width: 1200px) {
    .carousel .arrow {
        width: 80px;
    }

    .carousel .arrow .material-icons {
        font-size: 50px;
        width: 50px;
        height: 50px;
        line-height: 50px;
    }
}
