@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@200;300;400;500;600;700&display=swap");

:root {
    --width: 220px;
    --gap: 1rem;
    /* anim speed */
    --speed: 500ms;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: 1px solid rgba(255, 255, 255, 0.25);
}

body {
    font-family: Outfit, Arial, Helvetica;
    height: 100vh;
}

main {
    height: auto;
    background: #202227;
    box-sizing: border-box;
    overflow: hidden;
}

.container-slider {
    height: 100dvh;
    min-height: 100vh;
    width: 100dvw;
    position: relative;

}


.slider {
    position: relative;
    width: 100dvw;
    height: 100dvh;

    /* makes items resize from center */
    display: flex;
    /* you can align item (flex-start, center, flex-end) */
    align-items: center;
    overflow: hidden;
    /* 
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
        url(https://images.pexels.com/photos/3769747/pexels-photo-3769747.jpeg); */
    background-size: cover;
    background-position: center;

}

.slider-price-footer {
    position: absolute;

    bottom: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    color: red;
    text-align: center;
    padding: 0.3rem;
    font-size: 1.70rem;
    font-weight: 800;
    z-index: 10;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3);
}

@media (max-width: 650px) {
    .slider-price-footer {
        font-size: 1rem;
        padding: 0.5rem;
    }
}


.item {
    display: flex;
    align-items: center;
    width: var(--width);
    /* item ratio */
    height: calc(var(--width) * 1.5);
    position: absolute;
    z-index: 1;
    border-radius: var(--border-radius--imgWrapper);
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 1);
    transition: left var(--speed), width var(--speed), height var(--speed),
        border-radius var(--speed), opacity var(--speed);
    /* cubic-bezier(0.25,0.46,0.45,0.94); */
    transition-timing-function: ease-out;
    transform-origin: center;
    overflow: hidden;
    will-change: transform, opacity;
}

.item::after {
    content: "";
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    box-shadow: 0px 0px 50px 25px rgba(0, 0, 0, 0.25) inset;
    transition: box-shadow var(--speed);
    will-change: transform, opacity;
}

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


.item:nth-child(1) {
    left: 50%;
}

.item:nth-child(2) {
    left: calc(50% + var(--width) + var(--gap));
    transition-delay: calc(var(--speed) * 0.2);
}

.item:nth-child(3) {
    left: calc(50% + calc(var(--width) * 2) + calc(var(--gap) * 2));
    transition-delay: calc(var(--speed) * 0.4);
}

.item:nth-child(4) {
    left: calc(50% + calc(var(--width) * 3) + calc(var(--gap) * 3));
    opacity: 0;
    transition-delay: calc(var(--speed) * 0.6);
}

/* Ocultamos los demás si hay más de 4 */
.item:nth-child(n+5) {
    display: none;
}


.content {
    width: min(30vw, 400px);
    position: absolute;
    left: 3rem;
    z-index: 1;
    transform: translateY(25%);
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.75);
    opacity: 0;
    display: none;
    flex-direction: column;
    gap: 1rem;
    outline: 0;
}

.content * {
    outline: 0;
}

.content .title {
    font-weight: 600;
    text-transform: uppercase;
}

.content .description {
    line-height: 1.7;
}

.content button {
    width: fit-content;
    background-color: rgba(255, 255, 255, 0.9);
    color: rgba(0, 0, 0, 0.9);
    border: 0;
    border-radius: 0.25rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: background var(--speed), color var(--speed);
}

.content button:hover {
    background-color: rgba(0, 0, 0, 0.9);
    color: rgba(255, 255, 255, 0.9);
}

/* .item:nth-of-type(3) .content {
    display: flex;
    animation: show var(--speed) ease-in-out calc(var(--speed) / 2) forwards;
} */

@keyframes show {
    0% {
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

.navSlider {
    display: flex;
    gap: 0.5rem;
    position: absolute;
    bottom: 3.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    user-select: none;
    border-radius: 100vw;
    padding: 0.25rem;
}

.navSlider .btn {
    background-color: rgba(255, 255, 255, 0.9);
    color: rgba(0, 0, 0, 0.9);
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--speed), color var(--speed);
}

.navSlider .btn:hover {
    background-color: rgba(0, 0, 0, 0.9);
    color: rgba(255, 255, 255, 0.9);
}

/* did not mess with responsiveness */
@media (max-width: 900px) and (min-width: 651px) {
    /* .content .title {
        font-size: 1rem;
    }

    .content .description {
        font-size: 0.8rem;
    }

    .content button {
        font-size: 0.8rem;
    } */

    :root {
        --width: 190px;
        --gap: 0.75rem;
    }

    .item:nth-child(1) {
        left: 50%;
    }

    .item:nth-child(2) {
        left: calc(50% + var(--width) + var(--gap));
    }

    .item:nth-child(3) {
        left: calc(50% + calc(var(--width) * 2) + calc(var(--gap) * 2));
    }

    .item:nth-child(4) {
        left: calc(50% + calc(var(--width) * 3) + calc(var(--gap) * 3));
        opacity: 0;
    }
}

@media (max-width: 650px) {
    /* .content .title {
        font-size: 0.9rem;
    }

    .content .description {
        font-size: 0.7rem;
    }

    .content button {
        font-size: 0.7rem;
    } */

    :root {
        --width: 140px;
        --gap: 0.5rem;
    }

    .item:nth-child(1) {
        left: 50%;
    }

    .item:nth-child(2) {
        left: calc(50% + var(--width) + var(--gap));
    }

    .item:nth-child(3) {
        left: calc(50% + calc(var(--width) * 2) + calc(var(--gap) * 2));
    }

    .item:nth-child(4) {
        left: calc(50% + calc(var(--width) * 3) + calc(var(--gap) * 3));
        opacity: 0;
    }
}


/* 
    Floating content for the slider
    This is a separate section that can be used to display additional information
    or actions related to the current slide.
*/


.floating-content {
    width: clamp(30vw, 30vw, 400px);
    position: absolute;
    left: clamp(1rem, 5vw, 3rem);
    top: 55%;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.75);
    opacity: 1;
}


/* 
.floating-content {
    width: clamp(30vw, 30vw, 400px);
    position: absolute;
    left: clamp(1rem, 5vw, 3rem);
    transform: translateY(0%);
    top: unset;
    bottom: 5rem;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.75);
    opacity: 1;
} */

.floating-content .title {
    font-weight: 600;
    text-transform: uppercase;
}

.floating-content .description {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.5;
}

/* .floating-content button {
    width: fit-content;
    background-color: rgba(255, 255, 255, 0.9);
    color: rgba(0, 0, 0, 0.9);
    border: 0;
    border-radius: 0.25rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: background var(--speed), color var(--speed);
} */

/* .floating-content button:hover {
    background-color: rgba(0, 0, 0, 0.9);
    color: rgba(255, 255, 255, 0.9);
} */

/* Badge de precio en la esquina superior derecha */
.price-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: #ffc107;
    color: #000;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    text-align: center;
    max-width: 80%;
    word-break: break-word;
}

.item .price-badge {
    opacity: 1;
}

/* Responsive: Tablets */
@media (max-width: 900px) {
    .price-badge {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Responsive: Teléfonos */
@media (max-width: 650px) {
    .price-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        top: 0.4rem;
        right: 0.4rem;
    }
}

@media (max-width: 1100px) {
    .floating-content {
        width: 47vw;
        left: 1rem;
        /* bottom: 10rem; */
    }


    .floating-content .title {
        font-size: 1.5rem;
    }

    .floating-content .description {
        font-size: 1rem;
    }
}

@media (max-width: 650px) {

    .floating-content {
        width: 45vw;
        left: 10px;
    }

    .floating-content .title {
        font-size: 0.9rem;
    }

    .floating-content .description {
        font-size: 0.7rem;
    }
}