@layer page {
    .product.page {
        margin-top: 2rem;

        .fixed-cart {
            position: fixed;
            bottom: .5rem;
            left: .5rem;
            right: .5rem;
            height: 5rem;
            background: red;
            border: .3rem solid var(--primary-border-color);
            background-color: var(--primary-background-color);
            border-radius: .6rem;
            padding: 0.2rem .5rem;
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            align-items: center;
            justify-content: flex-start;
            gap: 1rem;
            z-index: 100;
            opacity: 0;
            visibility: hidden;
            transform: translateY(100%);
            transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;

            img.product {
                max-width: 100%;
                max-height: 100%;
            }

            .info {
                .quantity {
                    font-size: .8rem;
                    font-weight: 800;
                    text-align: center;
                    color: var(--primary-color);
                }

                .price {
                    font-size: 1rem;
                    font-weight: 400;
                    text-align: center;
                    color: var(--primary-color);
                }
            }

            .action-wrapper {
                flex: 1;
                flex: 1;
                display: flex;
                flex-direction: row;
                flex-wrap: nowrap;
                align-items: center;
                justify-content: center;

                .action {
                    color: var(--cart-action-text-color);
                    font-weight: 600;
                    border-radius: .6rem;
                    background-color: var(--cart-action-color);
                    max-width: 100%;
                    padding: .7rem;
                    text-align: center;
                    text-decoration: none;

                    &:hover {
                        background-color: color-mix(in srgb, var(--cart-action-color), black 10%);
                    }
                }
            }

            &.visible {
                opacity: 1;
                visibility: visible;
                transform: translateY(0);
            }
        }

        h1.header {
            margin: 0;
            font-weight: 400;
            color: var(--primary-color);
            font-size: 2rem;
            text-align: center;

            @media screen and (min-width: 992px) {
                text-align: initial;
            }
        }

        .main.container {
            margin-top: 2rem;
            margin-bottom: 2rem;

            @media screen and (min-width: 992px) {
                display: grid;
                grid-template-columns: 3fr 1fr;
                grid-gap: 2rem;
            }

            .product-column {
                display: flex;
                flex-direction: column;
                flex-wrap: nowrap;
                gap: 4rem;

                @media screen and (min-width: 992px) {
                    gap: 6rem;
                }

                .top-area {
                    display: flex;
                    flex-direction: column;
                    flex-wrap: nowrap;
                    gap: 4rem;

                    @media screen and (min-width: 992px) {
                        display: grid;
                        grid-template-columns: 1fr 1fr;
                        grid-gap: 2rem;
                    }

                    .img-column {
                        display: grid;
                        grid-template-rows: fit-content 10rem;
                        grid-gap: 1rem;


                        @media screen and (min-width: 992px) {
                            display: grid;
                            grid-template-columns: 1fr 5fr;
                            grid-gap: 1rem;
                        }

                        .selection-column {
                            grid-row: 2 / 3;

                            @media screen and (min-width: 992px) {
                                grid-row: initial;
                            }

                            .list {
                                display: grid;
                                grid-template-columns: repeat(4, 1fr);
                                grid-gap: 1rem;

                                @media screen and (min-width: 992px) {
                                    display: grid;
                                    grid-template-columns: initial;
                                    grid-template-rows: repeat(4, 1fr);
                                    grid-gap: 1rem;
                                }

                                .item {
                                    display: flex;
                                    flex-direction: column;
                                    flex-wrap: nowrap;
                                    justify-content: center;
                                    padding: .1rem;
                                    border: .2rem solid var(--neutral-border-color);
                                    border-radius: .5rem;
                                    cursor: pointer;
                                    transition: transform 150ms ease-out;

                                    &:hover {
                                        border: .2rem solid var(--primary-border-color);
                                    }

                                    &.active {
                                        border: .2rem solid var(--primary-border-color);
                                        background-color: var(--primary-background-color);
                                    }
                                }
                            }
                        }

                        .main-image-column {
                            grid-row: 1 / 2;

                            @media screen and (min-width: 992px) {
                                grid-row: initial;
                            }

                            display: flex;
                            flex-direction: column;
                            flex-wrap: nowrap;
                            justify-content: center;
                            position: relative;

                            .image-wrapper {
                                padding: .5rem;
                                border: .3rem solid var(--primary-border-color);
                                border-radius: .6rem;
                                max-height: 34rem;
                                display: flex;
                                flex-direction: column;
                            }

                            .slider-container {
                                overflow: hidden;
                                position: relative;
                                border-radius: .3rem;
                                flex: 1;
                                min-height: 0;
                            }

                            .slider-track {
                                display: flex;
                                flex-direction: row;
                                width: 302%;
                                height: 100%;
                                transform: translateX(-33.4%);
                                will-change: transform;
                            }

                                .slider-track.animating {
                                    transition: transform 250ms ease-out;
                                }

                            .slide {
                                flex: 0 0 33.4%;
                                width: 33.4%;
                                height: 100%;
                                display: flex;
                                flex-direction: column;
                                flex-wrap: nowrap;
                                justify-content: center;
                                align-items: center;
                            }

                                .slide img {
                                    max-width: 100%;
                                    max-height: 100%;
                                    width: auto;
                                    height: auto;
                                    display: block;
                                    object-fit: contain;
                                }

                            .gallery-nav-btn {
                                position: absolute;
                                top: 50%;
                                transform: translateY(-50%);
                                width: 3rem;
                                height: 3rem;
                                border: none;
                                border-radius: 50%;
                                background-color: rgba(255, 255, 255, 0.7);
                                color: #333;
                                cursor: pointer;
                                display: flex;
                                align-items: center;
                                justify-content: center;
                                transition: all 0.3s ease;
                                opacity: 0.6;
                                z-index: 10;
                                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

                                svg {
                                    width: 1.5rem;
                                    height: 1.5rem;
                                }

                                &:hover {
                                    opacity: 1;
                                    background-color: rgba(255, 255, 255, 0.95);
                                    transform: translateY(-50%) scale(1.1);
                                }

                                &:active {
                                    transform: translateY(-50%) scale(0.95);
                                }
                                /* Swipe animation */
                                &.swipe-active {
                                    opacity: 1;
                                    background-color: var(--primary-color);
                                    color: white;
                                    animation: swipe-pulse 0.4s ease-out;
                                }
                            }

                            .gallery-nav-btn-prev {
                                left: 1rem;

                                @media screen and (min-width: 992px) {
                                    left: -.5rem;
                                }
                            }

                            .gallery-nav-btn-next {
                                right: 1rem;

                                @media screen and (min-width: 992px) {
                                    right: -.5rem;
                                }
                            }
                        }
                    }

                    .description-column {
                        color: var(--text-color);
                        display: flex;
                        flex-direction: column;
                        flex-wrap: nowrap;
                        gap: 2rem;

                        @media screen and (min-width: 992px) {
                            gap: 1rem;
                        }

                        .manufacturer-row {
                            display: flex;
                            justify-content: space-between;

                            img.logo {
                                height: 2.2rem;
                            }

                            .main-column {
                                display: flex;
                                flex-direction: column;
                                flex-wrap: nowrap;
                                gap: .3rem;

                                .header {
                                    font-size: .8rem;
                                    font-weight: 700;
                                }

                                .name {
                                    font-size: 1.1rem;
                                    font-weight: 500;
                                }
                            }
                        }

                        .variants-row {
                            align-self: start;

                            .list {
                                display: flex;
                                flex-direction: row;
                                justify-content: flex-start;
                                gap: 1rem;

                                .item {
                                    display: flex;
                                    flex-direction: column;
                                    flex-wrap: nowrap;
                                    justify-content: center;
                                    gap: 0.1rem;
                                    align-items: center;
                                    border: .3rem solid var(--neutral-border-color);
                                    border-radius: .6rem;
                                    padding: 1rem 1rem;

                                    &.active {
                                        border-color: var(--active-border-color);
                                        background-color: var(--primary-background-color);
                                    }

                                    .quantity {
                                        font-weight: 600;
                                    }

                                    .price {
                                    }
                                }
                            }
                        }

                        .cart-panel-content-wrapper-row {
                            display: flex;

                            @media screen and (min-width: 992px) {
                                display: none;
                            }

                            & > .cart-panel {
                                width: 100%;
                            }
                        }

                        .description-row {
                            h4 {
                                margin-bottom: .5rem;
                            }

                            p {
                                margin-top: .5rem;
                                margin-bottom: .5rem;
                            }
                        }
                    }
                }

                .middle-area {
                    border: .3rem solid var(--primary-border-color);
                    background-color: var(--neutral-background-color);
                    border-radius: .6rem;
                    color: var(--text-color);
                    padding: 1rem 1rem;

                    @media screen and (min-width: 992px) {
                        padding: 1rem 2rem;
                    }

                    h2, h3 {
                        font-weight: 500;
                    }

                        h2:not(:first-child) {
                            margin-top: 2rem;
                        }
                }
            }

            .sidebar-column {
                & > .sticky-wrapper {
                    display: none;

                    @media screen and (min-width: 992px) {
                        display: flex;
                        flex-direction: column;
                        position: sticky;
                        top: 2rem;
                    }
                }
            }
        }
    }

    @keyframes swipe-pulse {
        0% {
            transform: translateY(-50%) scale(1);
        }

        50% {
            transform: translateY(-50%) scale(1.2);
        }

        100% {
            transform: translateY(-50%) scale(1);
        }
    }
}
