/* K2Tool photo area and viewer; horizontal Onliner thumbnails are the intended exception. */
.product-gallery[data-product-gallery] { --gallery-height: 350px; min-width: 0; }
[data-product-gallery] .product-gallery__stage { min-width: 0; position: relative; }
[data-product-gallery] .product-gallery__main {
    align-items: center; border: 0; border-radius: 0; display: flex; height: var(--gallery-height); justify-content: center;
    overflow: hidden; padding: 0; position: relative; touch-action: pan-y; width: 100%;
}
[data-product-gallery] a.product-gallery__main { cursor: pointer; }
[data-product-gallery] .product-gallery__main--empty { align-items: center; display: flex; justify-content: center; }
.bsv-gallery-track { display: flex; height: 100%; width: 100%; transition: transform .3s ease; }
.bsv-gallery-track.is-instant { transition: none; }
.bsv-gallery-slide { align-items: center; display: flex; flex: 0 0 100%; height: 100%; justify-content: center; min-width: 0; position: relative; }
[data-product-gallery] .bsv-gallery-slide img,
.bsv-gallery-modal .bsv-gallery-slide img {
    display: block; height: 100%; max-height: 100%; max-width: 100%;
    object-fit: scale-down; pointer-events: none; user-select: none; width: 100%;
}
.bsv-gallery-slide.is-error::after { color: #68707a; content: "Не удалось загрузить фото"; font: 15px/1.5 Arial, sans-serif; position: absolute; }
.bsv-gallery-slide.is-error img { visibility: hidden; }
[data-product-gallery] .product-gallery__rail,
.bsv-gallery-modal__rail { margin: 16px auto 0; min-width: 0; position: relative; width: 100%; }
[data-product-gallery] .product-gallery__thumbs,
.bsv-gallery-modal__thumbs {
    display: flex; flex-wrap: nowrap; gap: 4px; margin: 0;
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; padding: 2px;
    scrollbar-width: none; touch-action: pan-x pan-y;
}
[data-product-gallery] .product-gallery__thumbs::-webkit-scrollbar,
.bsv-gallery-modal__thumbs::-webkit-scrollbar { display: none; }
[data-product-gallery] .product-gallery__thumbs,
.bsv-gallery-modal__thumbs { user-select: none; }
[data-product-gallery] .product-gallery__rail:not(.is-short) [data-gallery-thumbs],
.bsv-gallery-modal__rail:not(.is-short) [data-gallery-thumbs],
[data-product-gallery] .product-gallery__rail:not(.is-short) .bsv-gallery-thumb,
.bsv-gallery-modal__rail:not(.is-short) .bsv-gallery-thumb { cursor: grab; }
[data-product-gallery] .product-gallery__rail.is-dragging [data-gallery-thumbs],
.bsv-gallery-modal__rail.is-dragging [data-gallery-thumbs],
[data-product-gallery] .product-gallery__rail.is-dragging .bsv-gallery-thumb,
.bsv-gallery-modal__rail.is-dragging .bsv-gallery-thumb { cursor: grabbing; }
[data-product-gallery] .bsv-gallery-thumb,
.bsv-gallery-modal .bsv-gallery-thumb {
    align-items: center; background: #fff; border: 1px solid rgba(14, 21, 26, .15);
    border-radius: 12px; box-sizing: border-box; cursor: pointer; display: flex;
    flex: 0 0 72px; height: 72px; justify-content: center; overflow: hidden;
    padding: 8px; transition: border-color .15s, box-shadow .15s; width: 72px;
}
[data-product-gallery] .bsv-gallery-thumb img,
.bsv-gallery-modal .bsv-gallery-thumb img { display: block; height: 100%; max-height: 100%; max-width: 100%; object-fit: contain; user-select: none; width: 100%; }
[data-product-gallery] .bsv-gallery-thumb:hover,
.bsv-gallery-modal .bsv-gallery-thumb:hover { border-color: #008bf8; }
[data-product-gallery] .bsv-gallery-thumb.is-active,
.bsv-gallery-modal .bsv-gallery-thumb.is-active { border-color: #008bf8; box-shadow: inset 0 0 0 1px #008bf8; }
.bsv-gallery-arrow,
.bsv-gallery-rail-arrow {
    align-items: center; background: #fff; border: 0; border-radius: 50%; color: #151515;
    cursor: pointer; display: flex; height: 40px; justify-content: center; padding: 0;
    position: absolute; width: 40px; z-index: 2;
}
.bsv-gallery-arrow { top: calc(50% - 20px); }
.bsv-gallery-arrow svg,
.bsv-gallery-rail-arrow svg { fill: none; height: 20px; stroke: currentColor; stroke-width: 1.5; width: 20px; }
.bsv-gallery-arrow--prev { left: 0; }
.bsv-gallery-arrow--next { right: 0; }
.bsv-gallery-arrow--prev svg,
.bsv-gallery-rail-arrow--prev svg { transform: rotate(180deg); }
.bsv-gallery-arrow:disabled { cursor: default; opacity: .3; }
.product-gallery__arrow { opacity: 0; transition: opacity .15s; }
[data-product-gallery]:hover .product-gallery__arrow,
[data-product-gallery]:focus-within .product-gallery__arrow { opacity: 1; }
[data-product-gallery]:hover .product-gallery__arrow:disabled,
[data-product-gallery]:focus-within .product-gallery__arrow:disabled { opacity: .3; }
.bsv-gallery-rail-arrow { box-shadow: 0 2px 12px rgba(20, 30, 40, .12); height: 36px; top: 20px; width: 36px; }
.bsv-gallery-rail-arrow--prev { left: -5px; }
.bsv-gallery-rail-arrow--next { right: -5px; }
.bsv-gallery-rail-arrow[hidden] { display: none !important; }
[data-product-gallery] a:focus-visible,
[data-product-gallery] button:focus-visible,
.bsv-gallery-modal button:focus-visible { outline: 2px solid #008bf8; outline-offset: 2px; }
.bsv-gallery-modal { align-items: center; background: rgba(0, 0, 0, .5); box-sizing: border-box; display: flex; inset: 0; justify-content: center; position: fixed; z-index: 100001; }
.bsv-gallery-modal[hidden] { display: none !important; }
.bsv-gallery-modal *, .bsv-gallery-modal *::before, .bsv-gallery-modal *::after { box-sizing: border-box; }
.bsv-gallery-modal__dialog {
    background: #fff; border-radius: 20px; display: grid; grid-template-rows: minmax(0, 1fr) auto;
    height: calc(100% - 28px); min-width: 0; overflow: hidden; padding: 32px 24px; position: relative; width: 90%;
}
.bsv-gallery-modal__counter { display: none; }
.bsv-gallery-modal__close { align-items: center; background: transparent; border: 0; color: #151515; cursor: pointer; display: flex; height: 24px; justify-content: center; padding: 0; position: absolute; right: 24px; top: 32px; width: 24px; z-index: 3; }
.bsv-gallery-modal__close svg { fill: none; height: 24px; stroke: currentColor; stroke-width: 1; width: 24px; }
.bsv-gallery-modal__stage { min-height: 0; min-width: 0; position: relative; }
.bsv-gallery-modal__viewport { height: 100%; margin: 0 57px; overflow: hidden; touch-action: none; }
.bsv-gallery-modal__rail { max-width: 550px; }
.bsv-gallery-modal__rail.is-short .bsv-gallery-modal__thumbs { justify-content: center; }
.bsv-gallery-modal__rail[hidden] { display: none !important; }
.product-gallery__pagination { display: none; }
.product-gallery__pagination[hidden] { display: none !important; }
.bsv-gallery-dot { align-items: center; background: none; border: 0; cursor: pointer; display: flex; flex: 0 0 auto; height: 20px; justify-content: center; padding: 0; width: 9px; }
.bsv-gallery-dot::before { background: #000; border-radius: 4px; content: ""; height: 4px; opacity: .35; width: 4px; }
.bsv-gallery-dot.is-active { width: 19px; }
.bsv-gallery-dot.is-active::before { opacity: 1; width: 14px; }
.bsv-gallery-dot.is-small::before { transform: scale(.66); }
.bsv-gallery-dot.is-tiny::before { transform: scale(.4); }
.bsv-gallery-dot[hidden] { display: none !important; }
@media (max-width: 991px) {
    .product-gallery[data-product-gallery] { --gallery-height: 330px; }
}
@media (max-width: 767px) {
    .product-gallery[data-product-gallery] { --gallery-height: 300px; }
    [data-product-gallery][data-gallery-ready] .product-gallery__rail { display: none; }
    [data-product-gallery] .product-gallery__pagination { display: flex; justify-content: center; }
    [data-product-gallery] .product-gallery__arrow { display: none; }
    .bsv-gallery-modal__dialog { border-radius: 0; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; padding: 24px 16px 26px; width: 100%; }
    .bsv-gallery-modal__counter { color: #575757; display: block; font: 14px/20px Arial, sans-serif; margin-bottom: 31.6px; }
    .bsv-gallery-modal__close { background: #f8f8f8; border-radius: 50%; height: 40px; right: 16px; top: 24px; width: 40px; }
    .bsv-gallery-modal__viewport { margin: 0; }
    .bsv-gallery-modal__arrow.bsv-gallery-arrow--prev { left: 8px; }
    .bsv-gallery-modal__arrow.bsv-gallery-arrow--next { right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .bsv-gallery-track, .product-gallery__arrow,
    [data-product-gallery] .bsv-gallery-thumb,
    .bsv-gallery-modal .bsv-gallery-thumb { transition: none; }
}
