/* Iceberg catalog experience R1: shared recent-product cards and product lightbox. */

/* Match the product-page "Недавно просмотренные" cards to the homepage pattern. */
body.ice-site .ice-recent-section > .product-slider,
body.ice-site .ice-recent-section > .product-slider > .product-slider__container {
    height: auto;
}

body.ice-site .ice-recent-section > .product-slider > .product-slider__container {
    padding-bottom: 32px;
    overflow: visible;
}

body.ice-site .ice-recent-section .swiper-slide,
body.ice-site .ice-recent-section .item-card {
    height: auto;
}

body.ice-site .ice-recent-section .item-card {
    position: relative;
    min-height: 100%;
}

body.ice-site .ice-recent-section .item-card__actions > .col:has(.fav) {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 40px;
    max-width: 40px;
    height: 40px;
    padding: 0;
}

body.ice-site .ice-recent-section .item-card__actions > .col:has(.fav) > [class*="col-"] {
    width: 40px;
    max-width: 40px;
    height: 40px;
    padding: 0;
    margin: 0 !important;
}

body.ice-site .ice-recent-section .fav {
    min-width: 40px;
    max-width: 40px;
    height: 40px;
    border: 1px solid rgba(10, 175, 194, .24);
    border-radius: 50%;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 6px 18px rgba(21, 36, 50, .12);
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

body.ice-site .ice-recent-section .fav:hover,
body.ice-site .ice-recent-section .fav.rs-in-favorite {
    border-color: var(--ice-brand, #0aafc2);
    background: #f0fbfc;
    box-shadow: 0 8px 22px rgba(10, 175, 194, .18);
}

body.ice-site .ice-recent-section .fav:hover svg {
    stroke: var(--ice-brand, #0aafc2);
}

body.ice-site .ice-recent-section .fav.rs-in-favorite svg {
    stroke: var(--ice-brand, #0aafc2);
    fill: var(--ice-brand, #0aafc2);
}

/* Make every main product image a clear, keyboard-accessible lightbox trigger. */
body.ice-site.ice-product-page .ice-product-gallery-lightbox {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    cursor: zoom-in;
}

body.ice-site.ice-product-page .ice-product-gallery-lightbox img {
    transition: transform .22s ease;
}

body.ice-site.ice-product-page .ice-product-gallery-lightbox:hover img {
    transform: scale(1.02);
}

body.ice-site.ice-product-page .ice-product-gallery-lightbox:focus-visible {
    outline: 3px solid var(--ice-brand, #0aafc2);
    outline-offset: -4px;
    border-radius: 16px;
}

body.ice-site.ice-product-page .ice-product-gallery-lightbox__hint {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid rgba(21, 36, 50, .12);
    border-radius: 999px;
    color: #152432;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 24px rgba(21, 36, 50, .14);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

body.ice-site.ice-product-page .ice-product-gallery-lightbox:hover .ice-product-gallery-lightbox__hint {
    color: #087f91;
    border-color: rgba(10, 175, 194, .45);
}

@media (max-width: 575.98px) {
    body.ice-site .ice-recent-section > .product-slider > .product-slider__container {
        padding-bottom: 24px;
    }

    body.ice-site .ice-recent-section .item-card__actions > .col:has(.fav) {
        top: 12px;
        right: 12px;
    }

    body.ice-site.ice-product-page .ice-product-gallery-lightbox__hint {
        right: 12px;
        bottom: 12px;
        width: 40px;
        padding: 8px;
        justify-content: center;
    }

    body.ice-site.ice-product-page .ice-product-gallery-lightbox__hint span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ice-site.ice-product-page .ice-product-gallery-lightbox img,
    body.ice-site .ice-recent-section .fav {
        transition: none;
    }
}
