@import url('../general-and-utility-classes.css');

.post-type-archive-product.woocommerce-shop {

    /* --- Hero --- */
    .shop-hero-container {
        display: flex;
        justify-content: center;
        width: 100%;
        max-height: 460px;
        background-color: #323031;
        overflow: hidden;

        .shop-hero {
            width: 100%;
            max-width: 1920px;
            height: 100%;
            object-fit: cover;
        }
    }

    /* --- Body --- */
    .shop-body {
        display: flex;
        gap: 24px;
        padding-top: 80px;
        padding-bottom: 80px;   
    
        /* - Mobile - */
        @media only screen and (max-width: 767px) {
            flex-wrap: wrap;
            padding-top: 40px;
        }

        .woocommerce-notices-wrapper {
            position: absolute;
        }
    }

    /* - Sidebar - */
    .shop-sidebar {
        position: sticky;
        top: 20px;
        width: 100%;
        max-width: 280px;
        height: 100%;
        max-height: max-content;

        /* - Mobile - */
        @media only screen and (max-width: 767px) {
            position: relative;
            top: initial;
            max-width: 100%;
        }
    }

    .filter-container {
        margin-top: 32px;
    }

    .filter-title {
        font-size: 16px;
        font-weight: 700;
        background-color: var(--color-light-gray-background);
        padding: 16px 12px;
    }

    .filter-form {
        margin-top: 10px;

        label  {
            display: block;
            position: relative;
            font-size: 16px;
            padding-left: 30px;
            margin-bottom: 12px;
            user-select: none;
            cursor: pointer;

            &:hover input ~ .checkmark {
                background-color: var(--color-light-gray-background);
            }
        }

        input[type='checkbox'] {
            position: absolute;
            opacity: 0;
            cursor: pointer;
            height: 0;
            width: 0;

            &:checked ~ .checkmark {
                background-color: var(--color-light-gray-background);
                
                &::after {
                    display: block;
                }
            }
        }

        .checkmark {
            position: absolute;
            top: 0;
            left: 0;
            height: 22px;
            width: 22px;
            border: 1px solid #A9A9A9;
            border-radius: 4px;

            &::after {
                content: "";
                position: absolute;
                display: none;
                left: 6px;
                top: 2px;
                width: 5px;
                height: 10px;
                border: solid var(--color-slick-blue);
                border-width: 0 3px 3px 0;
                transform: rotate(45deg);
            }
        }       

    }

    .can-we-help-you-container {
        background-image: url('../../images/woo/shop-can-we-help-you-bg.svg');
        background-size: cover;
        padding: 34px 16px 20px;
        margin-top: 42px;

        .can-we-help-you-title {
            font-size: 12px;
            font-weight: 700;
            color: var(--color-slick-blue);
            text-transform: uppercase;
            text-align: center;
        }

        .can-we-help-you-text {
            font-size: 20px;
            font-weight: 500;
            color: #232E39;
            text-align: center;
            max-width: 220px;
            margin: 12px auto 0;
        }

        a {
            display: block;
            text-align: center;
            text-transform: uppercase;
            margin-top: 62px;
        }
    }

    /* - Product Loop - */
    .shop-loop {

        &.searching {

            .products-count,
            .shop-loop-title,
            shop-products-container {
                filter: blur(4px);
            }

            .shop-products-container::before,
            .shop-products-container::after {
                display: block;
            }
        }
    }

    .shop-loop-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 24px;
    }

    .shop-products-container {
        position: relative;

        &::before {
            content: '';
            display: none;
            position: absolute;
            inset: 0;
            z-index: 10;
            background-color: rgba(0, 0, 0, .3);
        }

        &::after {
            content: '';
            position: absolute;
            top: calc(50% - 31px);
            left: calc(50% - 31px);
            display: none;
            width: 62px;
            height: 62px;
            border: 8px solid var(--color-gray);
            border-radius: 50%;
            border-top-color: var(--color-slick-yellow);
            animation: spin 1s ease-in-out infinite;
        }
    }

    .products {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 42px 26px;

        /* - Tablet - */
        @media only screen and (max-width: 992px) {
            grid-template-columns: repeat(2, 1fr);
        }
        /* - Mobile - */
        @media only screen and (max-width: 767px) {
            grid-template-columns: 1fr;
        }
    }

    .products::before,
    .products::after {
        display: none;
    }

    /* - Product Card - */
    .product  {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .woocommerce-loop-product__link {
        position: absolute;
        inset: 0;

        &:hover,
        &:focus,
        &:active {  

            & ~ .product-body {
                
                .add_to_cart_button {
                    color: var(--color-white);
                    background-color: var(--color-dark);
                    border: 1px solid var(--color-dark);
                }
            }
        }
    }

    .product-image {
        width: 100%;
        height: 280px;

        img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    }
    
    .product-body {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100%;
    }

    .woocommerce-loop-product__title {
        font-size: 18px;
        color: var(--color-text-black);
    }

    .product-footer {
        display: flex;
        justify-content: space-between;
        margin-top: 18px;

        .price {
            display: flex;
            flex-wrap: wrap;
            align-items: flex-end;
            font-weight: 700;
            color: var(--color-text-black);

            .woocommerce-Price-amount {
                width: 100%;
            }
        }

        .add_to_cart_button {
            appearance: none;
            font-size: 16px;
            line-height: 20px;
            font-weight: 700;
            font-family: var(--font-montserrat);
            color: var(--color-black);
            background-color: transparent;
            border: 1px solid var(--color-black);
            cursor: pointer;
            padding: 20px 18px;
            transition: .2s linear;
        }
    }

    /* - Pagination - */
    .woocommerce-pagination {
        display: flex;
        justify-content: center;
        margin-top: 52px;

        ul.page-numbers {
            display: flex;
            gap: 10px;
            list-style-type: none;

            li {
                position: relative;
                width: 42px;
                height: 42px;
                border: 1px solid var(--color-light-gray-background);
                border-radius: 50%;
                transition: .2s linear;

                &:hover {
                    background-color: var(--color-slick-blue);
                    border: 1px solid var(--color-slick-blue);

                    a {
                        color: var(--color-white);
                    }
                }

                &:has(.current) {
                    background-color: var(--color-slick-blue);
                    border: 1px solid var(--color-slick-blue);
                }

                a,
                span {
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    position: absolute;
                    inset: 0;
                    font-size: 16px;
                    font-weight: 700;
                }

                a {
                    color: var(--color-slick-blue);
                }

                span {
                    color: var(--color-white);

                    &.dots {
                        color: var(--color-slick-blue);
                    }
                }
            }
        }
    }
}