﻿.product-carousel {
    --product-height: 600px;
    overflow: hidden;
}

    .product-carousel .carousel-inner {
        width: calc(100% - 4.5rem);
        margin-inline: auto;
        overflow: visible;
    }

    .product-carousel .carousel-item {
        position: relative;
    }

.product-panel {
    position: relative;
    z-index: 1;
    height: var(--product-height);
    overflow: hidden;
    color: #fff;
    background: #18202b;
    border-radius: .75rem;
    outline: none;
    user-select: none;
}

    .product-panel img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        pointer-events: none;
        transition: transform .85s cubic-bezier(.22, .61, .36, 1), filter .65s ease;
    }

    .product-panel::after {
        position: absolute;
        inset: 0;
        z-index: 1;
        content: "";
        background: linear-gradient( 180deg, rgba(4, 15, 33, .12) 20%, rgba(4, 15, 33, .25) 50%, rgba(4, 15, 33, .9) 100% );
        transition: opacity .65s ease;
    }

    .product-panel:focus-visible {
        outline: 3px solid rgba(255, 255, 255, .9);
        outline-offset: -5px;
    }

.product-title {
    position: absolute;
    top: 1.5rem;
    right: 1.25rem;
    left: 1.25rem;
    z-index: 2;
    margin: 0;
    font-size: 1.4rem;
    font-size: 30px;
    font-weight: 700;
    color: #fff;
}

.product-details {
    width: 60%;
    position: absolute;
    right: 1.25rem;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 2;
    transition: opacity .35s ease, transform .35s ease;
}

.product-number,
.product-subtitle {
    display: block;
}

.product-number {
    font-size: 26px;
    /* font-size: clamp(1.15rem, 3vw, 2.3rem); */
    line-height: 1.1;
    font-weight: 400;
}

.product-subtitle {
    margin-top: .2rem;
    font-size: 0.9rem;
    font-size: 18px;
}

.product-link {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    margin-top: 1rem;
    padding-top: .85rem;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-top: 1px solid rgba(255, 255, 255, .45);
}

    .product-link:hover,
    .product-link:focus {
        color: #fff;
    }

.product-carousel .carousel-item.active::before,
.product-carousel .carousel-item.active::after {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2.75rem;
    content: "";
    background-position: center;
    background-size: cover;
    border-radius: .75rem;
    opacity: .72;
    pointer-events: none;
}

.product-carousel .carousel-item.active::before {
    left: -3.4rem;
    background-image: var(--peek-prev);
}

.product-carousel .carousel-item.active::after {
    right: -3.4rem;
    background-image: var(--peek-next);
}

.product-carousel .product-dots {
    gap: .45rem;
}

    .product-carousel .product-dots button {
        width: .5rem;
        height: .5rem;
        margin: 0;
        padding: 0;
        background-color: #aeb3ba;
        border: 0;
        border-radius: 50%;
        opacity: .65;
    }

        .product-carousel .product-dots button.active {
            width: .6rem;
            height: .6rem;
            background-color: var(--bs-primary);
            opacity: 1;
        }

@media (min-width: 992px) {
    .product-carousel {
        overflow: visible;
    }

        .product-carousel .carousel-inner {
            display: flex;
            gap: .15rem;
            width: 100%;
            overflow: hidden;
            border-radius: .75rem;
        }

        .product-carousel .carousel-item {
            display: block !important;
            flex: 0 0 clamp(74px, 7vw, 100px);
            width: auto;
            margin: 0;
            transform: none !important;
            transition: flex-grow .8s cubic-bezier(.22, .61, .36, 1), flex-basis .8s cubic-bezier(.22, .61, .36, 1) !important;
        }

            .product-carousel .carousel-item.active {
                flex-grow: 1;
            }

            .product-carousel .carousel-item::before,
            .product-carousel .carousel-item::after {
                display: none;
            }

            .product-carousel .carousel-item:not(.active) .product-panel img {
                filter: brightness(.62) saturate(.85);
            }

            .product-carousel .carousel-item:not(.active) .product-panel::after {
                opacity: .7;
            }

        .product-carousel .product-title {
            right: auto;
            white-space: nowrap;
            transition: top .75s cubic-bezier(.22, .61, .36, 1), left .75s cubic-bezier(.22, .61, .36, 1), transform .75s cubic-bezier(.22, .61, .36, 1), font-size .45s ease;
        }

        .product-carousel .carousel-item:not(.active) .product-title {
            top: 50%;
            left: 50%;
            font-size: 1.2rem;
            font-size: 26px;
            transform: translate(-50%, -50%) rotate(-90deg);
        }

        .product-carousel .carousel-item.active .product-title {
            top: 1.5rem;
            left: 1.25rem;
            transform: translate(0, 0) rotate(0);
        }

        .product-carousel .carousel-item:not(.active) .product-details {
            opacity: 0;
            pointer-events: none;
            transform: translateY(1rem);
        }

        .product-carousel .carousel-item.active .product-panel:hover img {
            transform: scale(1.035);
        }

        .product-carousel .product-dots {
            display: none;
        }
}

@media (max-width: 991.98px) {
    .product-carousel.slide .carousel-item {
        transition: transform .8s cubic-bezier(.22, .61, .36, 1);
    }
    .product-details {
        width: 95%;
    }
    .product-subtitle {
        font-size: 0.9rem;
        line-height: 1.6rem;
    }
}

@media (max-width: 575.98px) {
    .product-carousel {
        --product-height: 450px;
    }

        .product-carousel .carousel-inner {
            width: calc(100% - 4rem);
        }

    .product-title {
        top: 1.25rem;
        font-size: 1.35rem;
    }

    .product-number {
        font-size: 1.65rem;
    }

    .product-subtitle {
        font-size: 0.9rem;
        line-height: 1.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-carousel .carousel-item,
    .product-panel img,
    .product-panel::after,
    .product-title,
    .product-details {
        transition: none !important;
    }
}
