/* =========================================================
   РЕКОМЕНДУЕМЫЕ ТОВАРЫ — PREMIUM
   ========================================================= */

.viewed-products-section {
    position: relative;
    margin: 42px 0 50px;
    padding: 26px 24px 28px;

    background: linear-gradient(
        180deg,
        #fbfcfe 0%,
        #f7f9fc 100%
    );

    border: 1px solid #e1e7ef;
    border-radius: 20px;

    box-sizing: border-box;
    overflow: hidden;
}


/* =========================================================
   ШАПКА БЛОКА
   ========================================================= */

.viewed-products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
    margin-bottom: 22px;
}

.viewed-products-heading {
    min-width: 0;
}

.viewed-products-label {
    display: block;

    margin-bottom: 6px;

    font-size: 10px;
    line-height: 1;
    font-weight: 700;

    letter-spacing: 0.11em;
    text-transform: uppercase;

    color: #347bd5;
}

.viewed-products-header h3 {
    margin: 0;

    font-size: 23px;
    line-height: 1.2;
    font-weight: 700;

    color: #1f2630;
}


/* =========================================================
   СТРЕЛКИ
   ========================================================= */

.viewed-products-arrows {
    display: flex;
    align-items: center;

    gap: 8px;

    flex-shrink: 0;
}

.arrow-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    padding: 0;

    border: 1px solid #d8dee7;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.95);

    color: #4d5662;

    font-family: Arial, sans-serif;
    font-size: 24px;
    line-height: 1;

    cursor: pointer;

    box-shadow: 0 3px 9px rgba(25, 35, 50, 0.05);

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.arrow-btn:hover {
    background: #347bd5;
    border-color: #347bd5;

    color: #fff;

    box-shadow: 0 6px 16px rgba(52, 123, 213, 0.2);

    transform: translateY(-1px);
}


/* =========================================================
   ЛЕНТА
   ========================================================= */

.viewed-products-scroll {
    display: flex;

    width: 100%;
    gap: 16px;

    padding: 2px 2px 8px;

    overflow-x: auto;
    overflow-y: hidden;

    box-sizing: border-box;

    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;
}

.viewed-products-scroll::-webkit-scrollbar {
    display: none;
}


/* =========================================================
   КАРТОЧКА
   ========================================================= */

.viewed-product-card {
    flex: 0 0 calc((100% - 48px) / 4);
    min-width: 220px;

    display: flex;
    flex-direction: column;

    background: #fff;

    border: 1px solid #e4e9ef;
    border-radius: 17px;

    overflow: hidden;
    box-sizing: border-box;

    box-shadow:
        0 3px 10px rgba(25, 35, 50, 0.035),
        0 10px 24px rgba(25, 35, 50, 0.025);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.viewed-product-card:hover {
    transform: translateY(-4px);

    border-color: #d7e0eb;

    box-shadow:
        0 6px 16px rgba(25, 35, 50, 0.055),
        0 16px 32px rgba(25, 35, 50, 0.055);
}


/* =========================================================
   ФОТО ТОВАРА
   Фото является частью карточки:
   без рамки, разделителя и отдельного фона
   ========================================================= */

.viewed-product-media {
    display: flex !important;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 160px;

    padding: 20px 20px 8px;

    background: transparent;
    border: 0;

    box-sizing: border-box;
    overflow: hidden;

    text-decoration: none;
}

.viewed-product-media img {
    display: block !important;

    width: auto !important;
    height: auto !important;

    max-width: 88% !important;
    max-height: 100% !important;

    margin: 0 auto;

    object-fit: contain;

    transition: transform 0.3s ease;
}

.viewed-product-card:hover .viewed-product-media img {
    transform: scale(1.035);
}


/* =========================================================
   КОНТЕНТ
   ========================================================= */

.viewed-product-content {
    display: flex;
    flex-direction: column;

    flex: 1;

    padding: 10px 15px 15px;
}


/* =========================================================
   НАЗВАНИЕ
   ========================================================= */

.viewed-product-name {
    min-height: 38px;

    font-size: 14px;
    line-height: 1.35;
    font-weight: 650;

    color: #202631;

    overflow: hidden;
}

.viewed-product-name a {
    display: -webkit-box;

    color: inherit;
    text-decoration: none;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    overflow: hidden;

    transition: color 0.2s ease;
}

.viewed-product-name a:hover {
    color: #347bd5;
}


/* =========================================================
   ХАРАКТЕРИСТИКИ
   ========================================================= */

.viewed-product-features {
    display: flex;
    flex-direction: column;

    gap: 5px;

    margin-top: 10px;

    font-size: 12.5px;
    line-height: 1.35;

    color: #697382;
}

.feature-line {
    display: flex;
    align-items: flex-start;

    min-width: 0;
}

.feature-dot {
    width: 4px;
    height: 4px;

    flex: 0 0 4px;

    margin-top: 6px;
    margin-right: 7px;

    background: #9eabba;
    border-radius: 50%;
}

.feature-text {
    display: block;

    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feature-text strong {
    color: #737d89;
    font-weight: 500;
}


/* =========================================================
   ССЫЛКА "ПОДРОБНЕЕ"
   ========================================================= */

.viewed-product-footer {
    display: flex;
    justify-content: flex-end;

    margin-top: auto;
    padding-top: 13px;
}

.viewed-product-more {
    display: inline-flex;
    align-items: center;

    gap: 5px;

    color: #347bd5;

    font-size: 13px;
    line-height: 1;
    font-weight: 650;

    text-decoration: none;

    transition: color 0.2s ease;
}

.viewed-product-more span {
    display: inline-block;

    transition: transform 0.2s ease;
}

.viewed-product-more:hover span {
    transform: translateX(3px);
}


/* =========================================================
   НЕБОЛЬШИЕ ПК / НОУТБУКИ
   3 КАРТОЧКИ
   ========================================================= */

@media (max-width: 1200px) {

    .viewed-product-card {
        flex-basis: calc((100% - 32px) / 3);
        min-width: 225px;
    }

}


/* =========================================================
   ПЛАНШЕТ
   2 КАРТОЧКИ
   ========================================================= */

@media (max-width: 900px) {

    .viewed-products-section {
        padding: 22px 18px 24px;
    }

    .viewed-product-card {
        flex-basis: calc((100% - 16px) / 2);
        min-width: 220px;
    }

}


/* =========================================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ========================================================= */

@media (max-width: 768px) {

    .viewed-products-section {
        margin: 28px 0 34px;

        padding: 15px 0 15px 14px;

        border-radius: 16px;
    }


    /* Шапка */

    .viewed-products-header {
        align-items: center;

        gap: 10px;

        margin-bottom: 12px;

        padding-right: 14px;
    }

    .viewed-products-label {
        margin-bottom: 4px;

        font-size: 9px;
    }

    .viewed-products-header h3 {
        font-size: 19px;
        line-height: 1.2;
    }


    /* Стрелки */

    .viewed-products-arrows {
        gap: 6px;
    }

    .arrow-btn {
        width: 32px;
        height: 32px;

        font-size: 21px;

        box-shadow: none;
    }


    /* Лента */

    .viewed-products-scroll {
        gap: 10px;

        padding: 1px 14px 4px 0;

        scroll-snap-type: x proximity;
    }


    /* Карточка */

    .viewed-product-card {
        flex: 0 0 62%;

        min-width: 0;
        max-width: 235px;

        border-radius: 14px;

        scroll-snap-align: start;

        box-shadow:
            0 3px 10px rgba(25, 35, 50, 0.04);
    }

    .viewed-product-card:hover {
        transform: none;
    }


    /* Фото */

    .viewed-product-media {
        height: 112px;

        padding: 12px 12px 4px;
    }

    .viewed-product-media img {
        max-width: 90% !important;
        max-height: 100% !important;
    }

    .viewed-product-card:hover .viewed-product-media img {
        transform: none;
    }


    /* Контент */

    .viewed-product-content {
        padding: 8px 10px 11px;
    }


    /* Название */

    .viewed-product-name {
        min-height: 34px;

        font-size: 13px;
        line-height: 1.3;
    }


    /* Характеристики */

    .viewed-product-features {
        gap: 3px;

        margin-top: 7px;

        font-size: 11.5px;
        line-height: 1.3;
    }

    .feature-dot {
        width: 3px;
        height: 3px;

        flex: 0 0 3px;

        margin-top: 5px;
        margin-right: 6px;
    }

    .feature-text {
        white-space: nowrap;

        overflow: hidden;
        text-overflow: ellipsis;
    }


    /* Подробнее */

    .viewed-product-footer {
        padding-top: 9px;
    }

    .viewed-product-more {
        font-size: 12px;
    }

}


/* =========================================================
   МАЛЕНЬКИЕ ТЕЛЕФОНЫ
   ~1,5 КАРТОЧКИ
   ========================================================= */

@media (max-width: 390px) {

    .viewed-product-card {
        flex-basis: 66%;
        max-width: none;
    }

    .viewed-product-media {
        height: 105px;

        padding: 10px 10px 3px;
    }

    .viewed-products-header h3 {
        font-size: 18px;
    }

}


/* =========================================================
   МОБИЛЬНЫЕ 430–768 PX
   ПОЧТИ 2 КАРТОЧКИ
   ========================================================= */

@media (min-width: 430px) and (max-width: 768px) {

    .viewed-product-card {
        flex-basis: 47%;
        max-width: none;
    }

}