/* ========================================
   RESET
======================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;

    width: 100%;
    height: 100%;

    overflow-x: hidden;
}


/* ========================================
   SLIDER GALERÍA
======================================== */

.gallery-slider {
    --slider-gap: 12px;

    position: relative;

    width: 100%;
    height: 100vh;
    height: 100dvh;

    margin: 0;
    padding: 0;

    overflow: hidden;

    background: #000;
}


/* ========================================
   VIEWPORT
======================================== */

.gallery-slider__viewport {
    width: 100%;
    height: 100%;

    overflow: hidden;
}


/* ========================================
   TRACK
======================================== */

.gallery-slider__track {
    display: flex;

    width: 100%;
    height: 100%;

    gap: var(--slider-gap);

    transition:
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.35s ease;

    will-change: transform;
}


/* ========================================
   EFECTO DURANTE EL CAMBIO
======================================== */

.gallery-slider.is-changing .gallery-slider__track {
    opacity: 0.82;
}


/* ========================================
   CADA IMAGEN
   PC = 2 IMÁGENES
======================================== */

.gallery-slider__item {
    flex: 0 0 calc((100% - var(--slider-gap)) / 2);

    min-width: 0;
    height: 100%;

    overflow: hidden;

    border-radius: 0;

    background: #000;

    transform: scale(1);

    transition:
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.8s ease;
}


/* ========================================
   EFECTO VISUAL AL CAMBIAR
======================================== */

.gallery-slider.is-changing .gallery-slider__item {
    transform: scale(0.99);

    filter: brightness(1.08);
}


/* ========================================
   IMÁGENES
======================================== */

.gallery-slider__item img {
    display: block;

    width: 100%;
    height: 100%;

    /*
       COVER:
       llena completamente el espacio
       sin deformar la fotografía.
    */
    object-fit: cover;

    /*
       Mantiene el centro de la fotografía
       como punto principal.
    */
    object-position: center center;

    user-select: none;

    -webkit-user-drag: none;

    transition:
        transform 0.6s ease,
        filter 0.6s ease;
}


/* ========================================
   EFECTO HOVER EN PC
======================================== */

@media (hover: hover) {

    .gallery-slider__item:hover img {
        transform: scale(1.025);
    }

}


/* ========================================
   FLECHAS
======================================== */

.gallery-slider__arrow {
    position: absolute;

    top: 50%;

    z-index: 20;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.65);

    color: #ffffff;

    font-size: 25px;
    line-height: 1;

    cursor: pointer;

    transform: translateY(-50%);

    box-shadow:
        0 5px 18px rgba(0, 0, 0, 0.25);

    backdrop-filter: blur(5px);

    -webkit-backdrop-filter: blur(5px);

    transition:
        background 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}


/* ========================================
   HOVER FLECHAS
======================================== */

.gallery-slider__arrow:hover {
    background: rgba(0, 0, 0, 0.90);

    transform:
        translateY(-50%)
        scale(1.08);

    box-shadow:
        0 7px 22px rgba(0, 0, 0, 0.30);
}


/* ========================================
   POSICIÓN FLECHAS
======================================== */

.gallery-slider__arrow--prev {
    left: 20px;
}


.gallery-slider__arrow--next {
    right: 20px;
}


/* ========================================
   TABLETS
======================================== */

@media (max-width: 900px) {

    .gallery-slider {
        --slider-gap: 8px;
    }


    .gallery-slider__arrow {
        width: 42px;
        height: 42px;

        font-size: 22px;
    }


    .gallery-slider__arrow--prev {
        left: 12px;
    }


    .gallery-slider__arrow--next {
        right: 12px;
    }

}


/* ========================================
   CELULARES
   1 SOLA IMAGEN A PANTALLA COMPLETA
======================================== */

@media (max-width: 600px) {

    .gallery-slider {
        --slider-gap: 0px;

        width: 100%;

        height: 100vh;
        height: 100dvh;

        margin: 0;
        padding: 0;
    }


    .gallery-slider__viewport {
        width: 100%;
        height: 100%;
    }


    .gallery-slider__track {
        width: 100%;
        height: 100%;
    }


    /*
       Cada imagen ocupa exactamente
       todo el ancho disponible.
    */

    .gallery-slider__item {
        flex: 0 0 100%;

        width: 100%;
        height: 100%;

        min-width: 100%;

        border-radius: 0;
    }


    /*
       La fotografía llena toda
       la pantalla del celular.
    */

    .gallery-slider__item img {
        width: 100%;
        height: 100%;

        object-fit: cover;

        object-position: center center;
    }


    /* FLECHAS */

    .gallery-slider__arrow {
        width: 42px;
        height: 42px;

        font-size: 21px;

        background: rgba(0, 0, 0, 0.55);
    }


    .gallery-slider__arrow--prev {
        left: 12px;
    }


    .gallery-slider__arrow--next {
        right: 12px;
    }

}


/* ========================================
   CELULARES PEQUEÑOS
======================================== */

@media (max-width: 380px) {

    .gallery-slider__arrow {
        width: 38px;
        height: 38px;

        font-size: 19px;
    }


    .gallery-slider__arrow--prev {
        left: 8px;
    }


    .gallery-slider__arrow--next {
        right: 8px;
    }

}


/* ========================================
   ACCESIBILIDAD
   REDUCIR ANIMACIONES
======================================== */

@media (prefers-reduced-motion: reduce) {

    .gallery-slider__track,
    .gallery-slider__item,
    .gallery-slider__item img,
    .gallery-slider__arrow {
        transition-duration: 0.01ms;
    }

}