/* продукты */
.products {
    display: flex;
    gap: 40px 20px;
    flex-wrap: wrap;
}

.products-product-cont {
    position: relative;
    max-width: 615px;
    flex: 0 1 calc((100% - 20px * 3) / 4);
    min-width: 450px;
}

.products-product {
    width: 100%;
    height: fit-content;
    gap: 20px;


    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.products-product-img {
    width: 100%;
    height: 360px;
}

.products-product-img img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.products-product-img.scheme img {
    object-fit: contain;
}

.products-product-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.price {
    font-size: 24px;
    line-height: 110%;
    font-weight: 500;
    letter-spacing: -0.3px;
    color: var(--color-foreground-primary);

    text-transform: lowercase; 
}

.name {
    font-size: 16px;
    line-height: 110%;
    font-weight: 500;
    letter-spacing: -0.2px;
    color: var(--color-foreground-primary);

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 36px;

    text-transform: lowercase; 
}

.dop {
    display: flex;
    justify-content: space-between;
    height: fit-content;
}

.dop-des {
    display: flex;
    gap: 8px;
}

.dop-des-ch {
    display: flex;
    align-items: center;
    justify-content: center;
    
    height: 38px;
    padding: 0 16px;

    border: .8px solid var(--color-foreground-primary);
    border-radius: 24px;

    font-size: 16px;
    line-height: 110%;
    font-weight: 500;
    letter-spacing: -0.2px;
    color: var(--color-foreground-primary);

    text-transform: lowercase; 
}

.dop-to-cart,
.dop-to-favourites {
    cursor: pointer;
}

.dop-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;

    position: absolute;
    top: calc(360px + 114px);
    right: 0;
    
    height: 38px;
    width: 56px;

    background-color: var(--color-foreground-primary);
    border-radius: 24px;

    transition: all 0.3s ease;
}

.dop-to-cart.added {
    border: .8px solid var(--color-foreground-primary);
    background-color: transparent;
}

.dop-to-cart.added .dop-to-cart-icon {
    background-image: url(../../img/general/cart-icon.svg);
    transition: all 0.3s ease;
}

.dop-to-cart-icon {
    height: 24px;
    width: 24px;
    background-image: url(../../img/general/cart-icon-light.svg);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.dop-to-cart.added .dop-to-cart-icon::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background-image: url('../../img/general/added-icon.svg');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Спиннер при загрузке: простой CSS-спиннер (вращающийся круг) */
.dop-to-cart.loading  {
    background-color: var(--color-foreground-primary);
}

.dop-to-cart.added.loading .dop-to-cart-icon {
    background-image: none;
}

.dop-to-cart.loading .dop-to-cart-icon {
    background-image: none;
    border: 1px solid #f3f3f3;
    border-top: 2px solid transparent;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

.dop-to-cart.loading .dop-to-cart-icon::after {
    background-image: none;
}

/* Ключевые кадры для анимации спиннера */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dop-to-favourites {
    height: 27px;
    width: 24px;
    background-image: url(../../img/general/favourites-small-icon.svg);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;

    position: absolute;
    right: 30px;
    top: 30px;
}

.dop-to-favourites.added {
    background-image: url(../../img/general/favourites-small-dark-icon.svg);
}

.dop-to-favourites.animate {
    animation: like-bounce 0.6s ease-in-out;
}

/* Стикеры статусов */
.status-sticker-cont {
    display: flex;
    flex-direction: column;
    gap: 12px;

    position: absolute;
    top: 30px;
    left: 20px;
}

.status-sticker {
    padding: 6px 8px;
    border-radius: 24px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    font-size: 14px;
    line-height: 110%;
    font-weight: 500;
    letter-spacing: -0.2px;

    text-transform: lowercase; 

    width: fit-content;
}

.status-sticker.in {
    background-color: var(--color-foreground-primary);
    color: var(--color-background-primary);
}

.status-sticker.out {
    background-color: var(--color-background-primary);
    color: var(--color-foreground-primary);
    border: .8px solid var(--color-foreground-primary);
}


/* Адаптация на маленькие экраны (< 1920)*/
/* 1280 */
@media screen and (max-width: 1900px) {
    .products-product-cont {
        position: relative;
        flex: 0 1 calc((100% - 20px * 2) / 3);
        min-width: 354px;
    }
}

/* 1280 */
@media screen and (max-width: 1280px) {
    /* продукты */
    .products-product {
        height: fit-content;
        gap: 20px;
    }

    .products-product-cont {
        width: 31.597vw;
    }

    /* Стикеры статусов */
    .status-sticker-cont {
        gap: 8px;
    }

    .dop-des {
        width: 259px;
        flex-wrap: wrap;
    }

    .dop-des-ch {
        height: 38px;
    }
}

@media screen and (max-width: 1245px) {
    .products-product-cont {
        position: relative;
        flex: 0 1 calc((100% - 20px) / 2);
        min-width: 172px;
    }
}



/* 768 */
@media screen and (max-width: 1200px) {
    /* продукты */
    .name {
        font-size: 14px;
        line-height: 110%;

        height: 30px;
    }

    .dop-des-ch {
        font-size: 14px;
        line-height: 110%;
    }
}

/* 375 */
@media screen and (max-width: 725px) {
    /* продукты */
    .products {
        gap: 32px 7px;
    }

    .products-product-cont {
        position: relative;
        flex: 0 1 calc((100% - 8px) / 2);
        min-width: 164px;
    }

    .products-product-img {
        height: 156px;
    }

    .price {
        font-size: 18px;
        line-height: 110%;
        height: 36px;
        display: flex;
        align-items: center;
    }

    .name {
        font-size: 12px;
        line-height: 110%;

        height: 26px;
    }

    .dop-des {
        gap: 4px;
    }

    .dop-des-ch {
        padding: 0 8px;
        height: 23px;

        font-size: 12px;
        line-height: 110%;
    }

    .dop-to-cart {        
        height: 36px;
        width: 49px;

        top: calc(20px + 156px);
    }

    .dop-to-cart-icon {
        height: 16px;
        width: 18px;
    }

    .dop-to-cart.added .dop-to-cart-icon::after {
        bottom: -3.57px;
        right: -2.64px;
        width: 10.29px;
        height: 10.29px;
    }

    .dop-to-cart.loading .dop-to-cart-icon {
        border-radius: 50%;
        width: 18px;
        height: 18px;
    }

    .dop-to-favourites {
        height: 18px;
        width: 22px;

        right: 12px;
        top: 12px;
    }

    /* Стикеры статусов */
    .status-sticker-cont {
        flex-direction: column;
        gap: 4px;

        top: 12px;
        left: 8px;
    }

    .status-sticker {
        padding: 4px 6px;
        gap: 4px;

        font-size: 10px;
        line-height: 110%;
    }

    .status-sticker.in img {
        width: 4px;
        height: 4px;

        object-fit: contain;
    }
}

@media screen and (max-width: 360px) {
    .products-product-cont {
        position: relative;
        flex: 0 1 100%;
        min-width: 100%;
    }
}

