/* Изолированная галерея товара. Файл подключается после legacy-темы. */
html body .product-gallery .product-gallery-viewer {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
}

html body .product-gallery .product-image-frame {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 320px !important;
    overflow: hidden !important;
}

html body .product-gallery .product-image-frame > img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 620px !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    object-fit: contain !important;
}

html body .product-gallery .product-gallery-thumbs {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 12px 0 0 !important;
    padding: 2px 2px 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

html body .product-gallery .product-gallery-thumb {
    display: block !important;
    flex: 0 0 72px !important;
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    margin: 0 !important;
    padding: 4px !important;
    border: 1px solid #dce3ea !important;
    border-radius: 10px !important;
    background: #fff !important;
    overflow: hidden !important;
    cursor: pointer !important;
}

html body .product-gallery .product-gallery-thumb.is-active {
    border: 2px solid #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12) !important;
}

html body .product-gallery .product-gallery-thumb > img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
}

html body .product-gallery .product-gallery-arrow {
    position: absolute !important;
    z-index: 4 !important;
    top: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(15, 23, 42, .12) !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .94) !important;
    color: #172033 !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .16) !important;
    cursor: pointer !important;
    transform: translateY(-50%) !important;
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease !important;
}

html body .product-gallery .product-gallery-arrow:hover {
    background: #fff !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .24) !important;
    transform: translateY(-50%) scale(1.04) !important;
}

html body .product-gallery .product-gallery-arrow:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .32) !important;
    outline-offset: 2px !important;
}

html body .product-gallery .product-gallery-arrow.is-prev {
    left: 12px !important;
}

html body .product-gallery .product-gallery-arrow.is-next {
    right: 12px !important;
}

html body .product-gallery .product-gallery-arrow > svg {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2.25 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

html body .product-gallery .product-gallery-counter {
    position: absolute !important;
    z-index: 3 !important;
    right: 14px !important;
    bottom: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 54px !important;
    min-height: 30px !important;
    padding: 4px 10px !important;
    border-radius: 999px !important;
    background: rgba(15, 23, 42, .78) !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: .01em !important;
}

@media (max-width: 720px) {
    html body .product-gallery .product-image-frame {
        min-height: 240px !important;
    }

    html body .product-gallery .product-image-frame > img {
        max-height: 480px !important;
    }

    html body .product-gallery .product-gallery-thumb {
        flex-basis: 60px !important;
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        max-width: 60px !important;
        min-height: 60px !important;
        max-height: 60px !important;
    }

    html body .product-gallery .product-gallery-arrow {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }

    html body .product-gallery .product-gallery-arrow.is-prev {
        left: 8px !important;
    }

    html body .product-gallery .product-gallery-arrow.is-next {
        right: 8px !important;
    }
}
