/*
 * Горизонтальна стрічка карток товарів (головна: «Новинки», «Ви переглядали»;
 * картка товару: «Ви переглядали»). Стилі карток з css/product-card.css
 * в межах .product-strip: глобальний файл на картці товару і на головній
 * не підключається — там є власні елементи з класом .card.
 * При зміні css/product-card.css оновити й цей файл.
 */
.product-strip {
    padding-top: 2rem;
    padding-bottom: 2rem;
}
.product-strip-title {
    margin-bottom: 1rem;
}
.product-strip-row {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.product-strip-row > .card-wrap {
    scroll-snap-align: start;
}
.product-strip .card-wrap {
    padding-top: 13.5px;
    padding-bottom: 13.5px;
    position: relative;
}

@media (min-width: 768px) {
    .product-strip .card-wrap:hover .card {
        box-shadow: 2px 5px 8px 2px rgba(0,0,0,.1);
    }
}
@media (max-width: 767.98px) {
    .product-strip .card-wrap {
        padding: 7.5px;
    }
    .product-strip .card-row {
        margin-left: -4.5px;
        margin-right: -4.5px;
    }
}
.product-strip .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all var(--duration-long) ease;

    border-width: 0.1rem;
    border: 0.1rem solid rgba(0,0,0,.1);
    position: relative;
    box-sizing: border-box;
    border-radius: 24px;
}
@media (max-width: 767.98px) {
    .product-strip .card {
        border-radius: 12px;
    }
}
.product-strip .card.out-of-stock:after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #ffffffa6;
    z-index: 2;
    pointer-events: none;
}

.product-strip .card a.media {
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.product-strip .card a.media img {
    max-width: 80%;
    max-height: 80%;
    object-fit: cover;
    border-radius: 64px 64px 0 0;
    transition: transform 0.3s ease;
    display: block;
}
@media (min-width: 768px) {
    .product-strip .card-wrap:hover .card a.media img {
        transform: scale(1.1);
        border-radius: 64px 64px 0 0;
    }
}
@media (max-width: 767.98px) {
    .product-strip .card a.media img {
        border-radius: 12px 12px 0 0;
    }
}

.product-strip .card .percent-sale {
    background: var(--red);
    color: var(--color-default-10);
    position: absolute;
    left: 15px;
    top: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,.2);
}
@media (max-width: 767.98px) {
    .product-strip .card .percent-sale {
        left: 10px;
        top: 10px;
    }
}

.product-strip .card .card-content {
    flex: 1;
    overflow: auto;
    padding: 5px 15px 15px 15px;
    width: 100%;

    display: flex;
    flex-direction: column;
    justify-content: start;
}
@media (max-width: 767.98px) {
    .product-strip .card .card-content {
        padding: 5px 10px 10px;
    }
}
.product-strip .card .product-vendor {
    margin-top: 8px;
    margin-bottom: 0;
    word-wrap: break-word;
    line-height: normal;
    font-size: calc(var(--font-body-scale) * 12px);
    font-weight: 400;
    word-break: break-word;
}
.product-strip .card .product-name {
    font-size: calc(var(--font-heading-scale) * 16px);
    margin-top: 3px;
    margin-bottom: 0;
    font-weight: 500;
    word-break: break-word;
    text-align: left;
}
@media (max-width: 767.98px) {
    .product-strip .card .product-name {
        font-size: calc(var(--font-heading-scale) * 14px);
    }
}
/* Модель (gears → Події): розміри в наявності під назвою */
.product-strip .card .product-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    margin-bottom: 8px; /* відступ до ціни */
}
.product-strip .card .product-variants a {
    border: 1px solid var(--color-default-20);
    border-radius: 4px;
    padding: 0 6px;
    font-size: calc(var(--font-body-scale) * 12px);
    line-height: 1.6;
    color: var(--color-default-60);
}
.product-strip .card .product-variants a:hover {
    border-color: var(--color-default-100);
    color: var(--color-default-100);
}
.product-strip .card a {
    text-decoration: none;
}
.product-strip .card .price-sale {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: left;
    font-size: calc(var(--font-body-scale) * 18px);
    font-weight: 600;
    letter-spacing: 0;

    margin-top: auto;
}
@media (max-width: 767.98px) {
    .product-strip .card .price-sale {
        font-size: calc(var(--font-body-scale) * 18px);
        font-weight: 700;
    }
}

.product-strip .card .price {
    display: inline-block;
    margin: 0;
    letter-spacing: 0;
}
.product-strip .card .price-old small {
    font-size: calc(var(--font-body-scale) * 16px);
    text-decoration: line-through;
    color: #666666;
    display: inline-block;
    font-weight: 400;
    letter-spacing: 0;
}
@media (max-width: 767.98px) {
    .product-strip .card .price-old small {
        font-size: calc(var(--font-body-scale) * 16px);
        font-weight: 400;
    }
}
.product-strip .card .wishlist {
    margin-left: auto;
    cursor: pointer;
}
.product-strip .card .wishlist i {
    color: var(--wishlist-color);
}
.product-strip .card-wrap:hover .card button[name=cart-add] {
    background-color: var(--color-button-hover);
}

.product-strip .card button[name=cart-add]:before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 39px;
    box-shadow: 0 0 0 rgba(18,18,18,0);
    transition: box-shadow .3s ease;
}

.product-strip .btn-out_of_stock {
    font-size: 12px;
}

/* Скидання правил lex/card/card.css (.card .price-sale …) для карток блоку на сторінці товару */
.product-strip .card .price-sale .price {
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}
.product-strip .card .price-sale .price-old {
    text-decoration: none;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: inherit;
}
.product-strip .card [name=wishlist-toggle] i {
    font-size: inherit;
}
.product-strip .card [name=wishlist-toggle]:hover {
    background-color: transparent;
}

/* Пропорції фото (catalog_photo_ratio, клас на <body>) — копія з css/product-card.css */
body.photo-ratio-4x5 .product-strip .card a.media {
    aspect-ratio: 4 / 5;
}
body.photo-ratio-3x4 .product-strip .card a.media {
    aspect-ratio: 3 / 4;
}
body.photo-ratio-4x3 .product-strip .card a.media {
    aspect-ratio: 4 / 3;
}

/* Вид картки «cover» (catalog_card_view, клас на <body>) — копія блоку з css/product-card.css */
body.card-view-cover .product-strip .card {
    border: none;
    border-radius: 0;
}
body.card-view-cover .product-strip .card .card-content {
    padding-left: 0;
    padding-right: 0;
}
body.card-view-cover .product-strip .card a.media img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}
body.card-view-cover.photo-rounded .product-strip .card a.media {
    border-radius: 16px;
}
@media (min-width: 768px) {
    body.card-view-cover .product-strip .card-wrap:hover .card {
        box-shadow: none;
    }
    body.card-view-cover .product-strip .card-wrap:hover .card a.media img {
        transform: none;
        border-radius: 0;
    }
}
@media (max-width: 767.98px) {
    body.card-view-cover.photo-rounded .product-strip .card a.media {
        border-radius: 12px;
    }
}
body.card-view-cover .product-strip .card-wrap:hover .card button[name=cart-add]:not(:hover) {
    background-color: var(--color-button);
}
