/* KOSMOSTORE PRODUCT FALLBACK START */


/*
 * Родительские контейнеры должны удерживать
 * изображение-заглушку внутри своих границ.
 */

.product-card__media,
.related-card__image,
.product-main-image {
    position: relative;
}


/*
 * Универсальная заглушка.
 */

.product-fallback-image {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    isolation: isolate;
    background: #152231;
}


/*
 * Загруженная фотография.
 *
 * Правила с !important нужны, потому что обычные
 * фотографии товаров ранее получили белый фон,
 * внутренние отступы и object-fit: contain.
 */

.product-fallback-image img {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    object-fit: cover !important;
    object-position: 50% 56%;
    background: transparent !important;
    filter:
        saturate(0.86)
        contrast(0.96)
        brightness(0.82);
    transform: scale(1.01) !important;
    transition:
        filter 0.3s ease,
        transform 0.45s ease;
}


/*
 * Затемнение делает фотографию частью дизайна сайта
 * и помогает текстовой плашке хорошо читаться.
 */

.product-fallback-image::after {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(3, 10, 19, 0.03) 25%,
            rgba(3, 10, 19, 0.16) 55%,
            rgba(3, 10, 19, 0.76) 100%
        );
    pointer-events: none;
}


/*
 * Аккуратная отметка о том, что фотография
 * конкретного товара будет добавлена позже.
 */

.product-fallback-image__label {
    position: absolute;
    z-index: 3;
    right: 16px;
    bottom: 15px;
    left: 16px;
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    color: rgba(255, 255, 255, 0.9);
    border:
        1px solid rgba(255, 255, 255, 0.16);
    border-radius: 11px;
    background:
        rgba(5, 15, 27, 0.76);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(8px);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.12em;
    line-height: 1.3;
    text-align: center;
    text-transform: uppercase;
}


/*
 * Небольшое оживление карточки при наведении.
 */

.product-card:hover
.product-fallback-image img,
.related-card:hover
.product-fallback-image img {
    filter:
        saturate(0.95)
        contrast(0.98)
        brightness(0.88);
    transform: scale(1.045) !important;
}


/*
 * На большой странице товара изображение
 * показываем немного светлее.
 */

.product-main-image
.product-fallback-image img {
    object-position: 50% 52%;
    filter:
        saturate(0.9)
        contrast(0.97)
        brightness(0.88);
}

.product-main-image
.product-fallback-image__label {
    right: 24px;
    bottom: 22px;
    left: 24px;
    min-height: 42px;
    font-size: 10px;
}


/*
 * Заглушка не должна открывать галерею изображений.
 */

.product-fallback-image {
    cursor: default;
}


/*
 * Мобильная версия.
 */

@media (max-width: 700px) {
    .product-fallback-image img {
        object-position: 50% 54%;
    }

    .product-fallback-image__label {
        right: 10px;
        bottom: 10px;
        left: 10px;
        min-height: 32px;
        padding: 6px 9px;
        border-radius: 9px;
        font-size: 8px;
    }

    .product-main-image
    .product-fallback-image__label {
        right: 14px;
        bottom: 14px;
        left: 14px;
        min-height: 36px;
        font-size: 9px;
    }
}


/* KOSMOSTORE PRODUCT FALLBACK END */
