.product-item-image-original {
    display: block;
    width: 100%;
    height: 460px;
    object-fit: cover;
}

.product-item-image-slider-slide-container {
    display: block;
    width: 100%;
    height: 460px;
    position: relative;
}

.product-item-image-slide {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 0;
}

.product-item-image-slide.active {
    pointer-events: auto;
    opacity: 1;
}

.product-item-image-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product_item_img {
    position: relative;
    user-select: none;
}

.product-item-image-slider-control-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    display: flex;
    align-items: flex-end;
    padding: 0 12px;
    pointer-events: none;
    opacity: 0;
    transition: .3s ease;
}

.product_item_img:hover .product-item-image-slider-control-container,
.bx-touch .product-item-image-slider-control-container {
    opacity: 1;
}

.product-item-image-slider-control {
    height: 2px;
    width: 100%;
    background: var(--secondary_color);
    margin-left: 4px;
    transition: .3s ease;
}

.product-item-image-slider-control:first-child {
    margin-left: 0;
}

.product-item-image-slider-control.active {
    background: var(--main_color);
}

.product-item .add-quick-view {
    position: absolute;
    z-index: 2;
    top: 46px;
    right: 7px;
    height: 30px;
    width: 30px;
    transition: .3s ease;
    cursor: pointer;
    opacity: 0;
}

.product-item .quick_view_link {
    width: 100%;
    height: 100%;
}

.bx-touch .product-item .add-quick-view {
    opacity: 1;
}

.product-item .add-quick-view svg {
    transition: .3s ease;
    position: absolute;
    top: 5px;
    left: 5px;
}

/* две лупы друг над другом: чёрная и серая для наведения. of-type, а не child — после
   иконок в ссылке идёт подпись, и серая лупа уже не последний элемент (TEAMBITRIX-22025) */
.product-item .add-quick-view svg:last-of-type {
    opacity: 0;
}

.product-item:hover .add-quick-view {
    opacity: 1;
}

.product-item .add-quick-view:hover svg:last-of-type {
    opacity: 1;
}

.product-item .add-quick-view:hover svg:first-of-type {
    opacity: 0
}

/* Подпись «Быстрый просмотр» под лупой (TEAMBITRIX-22025): появляется вместе со значком,
   правым краем по значку. Цвет — как у остальных второстепенных подписей сайта (модель
   в названии плитки), шрифт наследуется от сайта. Белая подложка в рамке — иначе на тёмном
   фото товара подпись не читается */
.product-item .add-quick-view__label {
    position: absolute;
    top: 100%;
    right: 6px;
    padding: 2px 6px;
    white-space: nowrap;
    font-size: 12px;
    line-height: 14px;
    font-weight: 400;
    color: var(--secondary-txt);
    background: #fff;
    border: 1px solid #d3d3d3;
}

.product-item {
    position: relative;
}

.product_card-flags {
    position: absolute;
    z-index: 2;
    top: 12px;
    left: 12px;
    pointer-events: none;
    user-select: none;
}

.product_item_price-and-colors {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.product_item_price {
    display: flex;
    align-items: flex-end;
}

.product_item_colors {
    display: flex;
    align-items: center;
}

.product_item_colors span {
    font-size: 11px;
    display: block;
    margin-left: 6px;
}

.product_item_colors img {
    width: 8px;
    height: 8px;
    border: 1px solid #D3D3D3;
    border-radius: 100%;
    margin-left: 4px;
}

.prod-of-day_timer_tiles {
    position: absolute;
    z-index: 10;
    bottom: 12px;
    left: 12px;
    background: var(--light_color);
    border: 1px solid var(--main_color);
    width: 136px;
    height: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-item_sm_tiles .product-item-image-slider-slide-container,
.product-item_sm_tiles .product-item-image-original {
    height: 300px;
}

.product-item_sm_tiles .product_item_title_separator {
    display: none;
}

.product-item_sm_tiles .product_item_title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 6px;
}

.product-item_sm_tiles .product_item_title a {
    max-width: 100%;
}

.product-item_sm_tiles .product_item_title .product_item_section_title {
    margin-top: 5px;
}

@media (max-width: 768px) {
    .product-item-image-slider-slide-container, .product-item-image-original {
        height: 360px;
    }

    .product-item_sm_tiles .product-item-image-slider-slide-container, .product-item_sm_tiles .product-item-image-original {
        height: 265px;
    }
}

@media (max-width: 576px) {
    .product-item_sm_tiles .product-item-image-slider-slide-container, .product-item_sm_tiles .product-item-image-original {
        height: 70vw;
    }

    .product__list.big_tiles .product_item_title {
        max-width: calc(100vw - 20px);
    }

    .product-item-image-slider-slide-container, .product-item-image-original {
        height: 68vw;
    }

    .product_item_title_separator {
        display: none !important;
    }

    .product_item_title {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .product_item_title a,
    .product_item_section_title {
        max-width: 100% !important;
    }

    .product_item_section_title {
        margin-top: 6px;
    }

    .product__list.big_tiles .product_item_title {
        flex-direction: row;
        align-items: center !important;
    }

    .product__list.big_tiles .product_item_section_title {
        margin-top: 0;
        max-width: 40%;
    }

    .product__list.big_tiles .product_item_title_separator {
        display: block !important;
    }
}
/* Панель покупки в плитке: выбор цвета/размера и «В корзину» (TEAMBITRIX-21763).
   На desktop панель появляется при наведении и лежит поверх сетки (position: absolute),
   поэтому соседние плитки не сдвигаются; сама плитка при наведении получает белую
   подложку с тенью. На touch-устройствах hover нет — панель показана всегда, в потоке. */
.product-item-container {
    position: relative;
}

.product-item-container:hover {
    z-index: 5;
}

.product-item {
    transition: box-shadow .25s ease;
}

.product-item-buy {
    position: absolute;
    left: -12px;
    right: -12px;
    top: 100%;
    z-index: 3;
    padding: 10px 12px 14px;
    background: #fff;
    box-shadow: 0 22px 30px -6px rgba(0, 0, 0, .10);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.product-item:hover {
    background: #fff;
    box-shadow: 0 0 0 12px #fff, 0 10px 30px 12px rgba(0, 0, 0, .10);
}

.product-item:hover .product-item-buy {
    opacity: 1;
    visibility: visible;
}

.product-item-buy__tree {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-item-buy__values {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 6px;
}

.product-item-buy__value {
    display: block;
    min-width: 30px;
    padding: 6px 7px;
    font-size: 12px;
    line-height: 1;
    text-align: center;
    color: #7a7a7a;
    border: 1px solid transparent;
    cursor: pointer;
    user-select: none;
    transition: color .2s ease, border-color .2s ease;
}

.product-item-buy__value:hover {
    color: #222;
    border-color: #d3d3d3;
}

.product-item-buy__value.selected {
    color: #222;
    border-color: #222;
}

.product-item-buy__value.disabled {
    color: #c4c4c4;
    text-decoration: line-through;
}

.product-item-buy__value.disabled.selected {
    color: #7a7a7a;
    border-color: #c4c4c4;
}

.product-item-buy__row_tsvet .product-item-buy__value {
    padding: 6px 10px;
}

.product-item-buy__row.is-required .product-item-buy__values {
    animation: product-item-buy-shake .5s ease;
}

@keyframes product-item-buy-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.product-item-buy__hint {
    display: none;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    color: #d0021b;
}

.product-item-buy__hint.is-visible {
    display: block;
}

.product-item-buy__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    margin-top: 16px;
    padding: 0 10px;
    background: var(--dark-btn-color, #222);
    border: 1px solid var(--dark-btn-color, #222);
    border-radius: 0;
    color: var(--theme-txt, #fff);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .3s ease, color .3s ease, opacity .3s ease;
}

.product-item-buy_no-tree .product-item-buy__btn {
    margin-top: 6px;
}

.product-item-buy__btn:hover {
    background: var(--dark-btn-hover, #454545);
    border-color: var(--dark-btn-hover, #454545);
}

.product-item-buy__btn:focus {
    outline: none;
}

.product-item-buy__btn.is-loading {
    pointer-events: none;
    opacity: .6;
}

.product-item-buy__btn.is-added {
    background: #fff;
    border-color: #222;
    color: #222;
}

/* touch-устройства: hover-состояния нет — панель всегда видна и стоит в потоке плитки */
.bx-touch .product-item:hover {
    background: transparent;
    box-shadow: none;
}

.bx-touch .product-item-buy {
    position: static;
    padding: 10px 0 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
}


@media (max-width: 576px) {
    .product-item-buy__btn {
        height: 40px;
        font-size: 11px;
    }
}

/* текст кнопки: общие правила шаблона для span внутри плитки перекрашивают его в цвет
   текста и меняют кегль — задаём явно */
.product-item-buy__btn .product-item-buy__btn-text {
    display: block;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* в слайдерах карточки товара (похожие, просмотренные, образы) панель не показываем:
   свайпер режет всё, что выходит за его границы, а сам блок здесь не нужен */
.product__slider .product-item-buy,
.catalog-products-viewed-container .product-item-buy,
.swiper-slide .product-item-buy {
    display: none;
}

.product__slider .product-item:hover,
.catalog-products-viewed-container .product-item:hover,
.swiper-slide .product-item:hover {
    background: transparent;
    box-shadow: none;
}

/* В листингах (каталог, поиск, избранное) название, цена и панель покупки выровнены
   по центру всегда — иначе при наведении текст «прыгал» слева в центр. Название не
   обрезается многоточием, а переносится на вторую строку. Слайдеры карточки товара
   (.product__slider) не трогаем. */
.product__list .product_item_title {
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.product__list .product_item_title a,
.product__list .product_item_title span {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
    text-align: center;
    align-self: center;
}

.product__list .product_item_title .product_item_section_title {
    max-width: none;
    flex-shrink: 1;
}

.product__list .product_item_price-and-colors {
    justify-content: center;
}

.product__list .product_item_colors {
    margin-left: 10px;
}

/* мобильная плитка (две в ряд): в строке не хватает места — «3 490» и «руб» разъезжались
   на две строки, а старая цена и процент скидки вставали в один ряд с новой. Сетка:
   новая цена над старой в одной колонке, каждая в одну строку, бейдж скидки — во второй
   колонке по центру высоты обеих цен */
@media (max-width: 576px) {
    .product_item_price {
        display: grid;
        grid-template-columns: auto auto;
        grid-template-rows: auto auto;
        justify-content: center;
        align-items: center;
        column-gap: 8px;
    }

    .product_item_price .product-item-price-current {
        grid-column: 1;
        grid-row: 1;
    }

    .product_item_price .product-item-price-old {
        grid-column: 1;
        grid-row: 2;
    }

    .product_item_price .product-item-label-discount {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .product_item_price .product-item-price-current span,
    .product_item_price .product-item-price-old span,
    .product_item_price .product-item-label-discount span {
        margin-left: 0;
        white-space: nowrap;
    }

    .product_item_price .product-item-price-current span,
    .product_item_price .product-item-price-old span {
        text-align: center;
        line-height: 1.3;
    }
}

/* панель последнего ряда выезжает за сетку и накрывала то, что стоит под ней
   («Показать ещё», пагинацию, «Очистить избранное») — пока курсор над панелью,
   кнопку не нажать. Резервируем под сеткой место под панель; на touch-устройствах
   панель в потоке и запас не нужен */
html:not(.bx-touch) .product__list {
    padding-bottom: 110px;
}
