@layer page {
    .product.page {
        margin-top: 2rem;

        .fixed-cart {
            position: fixed;
            bottom: .5rem;
            left: .5rem;
            right: .5rem;
            height: 5rem;
            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;
                display: flex;
                flex-direction: row;
                flex-wrap: nowrap;
                align-items: center;
                justify-content: center;

                .added-to-cart {
                    display: flex;
                    flex-direction: column;
                    flex-wrap: nowrap;
                    align-items: center;
                    gap: 0.3rem;
                    justify-content: space-between;
                    width: 100%;

                    .text {
                        display: flex;
                        align-items: center;
                        gap: 0.6rem;
                        color: var(--primary-color);
                        font-size: 0.9rem;

                        .site-icon.cart {
                            background-color: var(--primary-color);
                        }
                    }

                    .action {
                        display: flex;
                        align-items: center;
                        border-radius: .5rem;
                        color: var(--primary-color);
                        border: 2px solid var(--cart-action-color);
                        padding: .5rem 1rem;
                        gap: .8rem;
                        text-decoration: none;
                        background-color: white;
                        font-size: 0.9rem;

                        .site-icon.arrow-right {
                            background-color: var(--primary-color);
                        }

                        &:hover {
                            background-color: var(--primary-border-color);
                        }
                    }
                }

                .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;
                    cursor: pointer;

                    &.out-of-stock {
                        background-color: var(--neutral-gray-color);
                        cursor: not-allowed;
                    }

                    &:hover:not(.out-of-stock) {
                        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-gap: 1rem;

                        @media screen and (min-width: 992px) {
                            display: grid;
                            grid-template-columns: 1fr 5fr;
                            grid-gap: 1rem;
                            align-items: start;
                        }

                        .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;
                                height: min(70vh, 34rem);
                                box-sizing: border-box;
                                display: flex;
                                flex-direction: column;
                            }

                            .slider-container {
                                overflow: hidden;
                                position: relative;
                                border-radius: .3rem;
                                height: 100%;
                            }

                            .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;
                                }
                            }
                        }

                        .features-row {

                            img.category {
                                width: 16rem;
                            }

                            ul.list {
                                padding-left: 2rem;

                                li.highlighted {
                                    font-weight: 600;
                                }
                            }
                        }

                        .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;
                            }
                        }

                        .feedback-row {
                            padding: 2rem 0;

                            @media screen and (min-width: 992px) {
                                display: none;
                            }
                        }
                    }
                }

                .area-card {
                    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;
                    }

                    .warnings {
                        & > .uppercase {
                            text-transform: uppercase;
                        }
                    }
                }

                .middle-area {
                }

                .importer-area {
                    & > .row {
                        gap: 2rem;
                    }

                    .sub-info {
                        font-style: italic;
                        color: var(--neutral-gray-color);
                    }

                    h3 {
                        margin-bottom: .5rem;
                        font-weight: normal;
                    }

                    img.label {
                        border: .3rem solid var(--neutral-border-color);
                        border-radius: .6rem;
                    }
                }
            }

            .sidebar-column {
                & > .sticky-wrapper {
                    display: none;

                    @media screen and (min-width: 992px) {
                        display: flex;
                        flex-direction: column;
                        position: sticky;
                        top: 2rem;
                        gap: 2rem;
                    }
                }

                .message-box {
                    @media screen and (min-width: 992px) {
                        grid-template-columns: max-content auto;
                    }
                }
            }
        }

        .similar-products {
            padding-top: 4rem;
            padding-bottom: 4rem;

            h2 {
                margin-bottom: 2rem;
            }

            .list {
                display: grid;
                grid-template-columns: repeat(2, 1fr);
                column-gap: 2rem;
                row-gap: 3rem;
                width: 100%;

                @media screen and (min-width: 768px) {
                    grid-template-columns: repeat(3, 1fr);
                }

                @media screen and (min-width: 992px) {
                    grid-template-columns: repeat(4, 1fr);
                }
            }

            a.catalog {
                display: flex;
                flex-direction: row;
                flex-wrap: nowrap;
                align-items: center;
                margin-top: 2rem;
                font-size: 1.3rem;
                color: var(--primary-color);
                text-decoration: none;
                padding: .5rem 1.6rem;
                border: 3px solid var(--primary-border-color);
                border-radius: .5rem;
                width: min-content;
                transition: background-color 0.1s ease;
                gap: .8rem;

                &:hover {
                    text-decoration: underline;
                    background-color: var(--primary-background-color);
                }

                .site-icon {
                    transform: translateY(0px);
                }
            }
        }
    }

    @keyframes swipe-pulse {
        0% {
            transform: translateY(-50%) scale(1);
        }

        50% {
            transform: translateY(-50%) scale(1.2);
        }

        100% {
            transform: translateY(-50%) scale(1);
        }
    }

    /* Zoom Overlay */
    .label-zoom-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: #e6e9ecbf;
        z-index: 10000;
        padding: 2rem;
        box-sizing: border-box;

        .close-zoom {
            position: absolute;
            top: 0;
            right: 1rem;
            color: var(--neutral-gray-color);
            font-size: 45px;
            cursor: pointer;
            z-index: 10001;
            line-height: 1;
            user-select: none;
        }

        .zoom-container {
            display: grid;
            grid-template-columns: fit-content(33.333%) 1fr;
            width: 100%;
            height: 100%;
            gap: 1rem;
            align-items: center;

            .zoom-left {
                max-width: 100%;
                max-height: 100%;
                display: flex;
                justify-content: center;
                align-items: center;
                position: relative;
                overflow: hidden;
                background: var(--neutral-background-color);
                border-radius: .6rem;
                border: 4px solid var(--primary-border-color);

                img {
                    max-width: 100%;
                    max-height: 90vh;
                    object-fit: contain;
                    cursor: crosshair;
                    /*border-radius: .6rem;*/
                }
            }

            .zoom-result {
                height: 90vh;
                background-repeat: no-repeat;
                background-color: var(--neutral-background-color);
                border: 4px solid var(--neutral-background-color);
                display: flex;
                align-items: center;
                justify-content: center;
                border-radius: .6rem;

                .zoom-hint {
                    color: var(--neutral-gray-color);
                    font-size: 1.2rem;
                    text-align: center;
                    padding: 2rem;
                    pointer-events: none;
                }
            }
        }
    }

    @media (max-width: 992px) {
        .label-zoom-overlay {
            padding: 10px;

            .close-zoom {
                top: 10px;
                right: 20px;
            }

            .zoom-container {
                grid-template-columns: 1fr;
                justify-content: center;
                position: relative;

                .zoom-left {
                    width: 100%;
                    height: auto;
                    max-height: 80vh;
                }

                .zoom-result {
                    display: none;
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                    z-index: 10;
                    border: none;
                    background-color: #000;

                    .zoom-hint {
                        display: none;
                    }
                }
            }
        }
    }
}
