/* Контейнер кнопок: одна точка позиционирования в правом верхнем углу */
.gallery-btns {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.btn-360,
.btn-zoom {
    background: rgba(0,0,0,.55);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 14px;
    cursor: pointer;
}
.btn-360:hover,
.btn-zoom:hover { background: rgba(0,0,0,.75); }
.gallery { position: relative; }

.photo-box {
    max-width: 580px;
    margin: 0 auto 70px;
	aspect-ratio: 580 / 549;
	position: relative;
    isolation: isolate;
}
#product-photo,
#spinner360 img {
    width: 100%;
    height: auto;
    display: block;
}
#spinner360 {
    display: none;
    touch-action: none;
    cursor: grab;
    line-height: 0;
}
#spinner360.dragging { cursor: grabbing; }
#spinner360 img {
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}
.gallery.mode-360 #product-photo { display: none; }
.gallery.mode-360 #spinner360 { display: block; }
/* ===== Модалка «крупные фото»: белый полный экран ===== */
.modal-360b {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #fff;                 /* весь экран белый */
}
.modal-360b__backdrop {
    display: none;                    /* затемнение больше не нужно */
}
.modal-360b__body {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-360b__logo {
    position: absolute;
    top: 30px;
    left: 40px;
    z-index: 10002;
}
.modal-360b__logo img {
    max-height: 40px;                 /* подгоните под высоту лого в шапке */
    width: auto;
}
.modal-360b__close {
    position: absolute;
    top: 12px;
    right: 20px;
    z-index: 10002;
    background: none;
    border: none;
    font-size: 42px;
    line-height: 1;
    color: #8a8a8a;                   /* серый крестик на белом */
    cursor: pointer;
    padding: 6px;
}
.modal-360b__close:hover {
    color: #333;
}
.modal-360b__box {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}
.modal-360b__box img,
.modal-360b__box #spinnerModal img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

}
/* Курсор перетаскивания для кадров в модалке */
.modal-360b__box #spinnerModal {
    cursor: grab;
}
.modal-360b__box #spinnerModal.dragging {
    cursor: grabbing;
}

#spinnerModal img {
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}
/* На мобильных кнопку крупных фото и модалку не показываем */
@media (max-width: 991.98px) {
    .btn-zoom { display: none !important; }
}
/* Тень-эллипс под фото, как в старом слайдере */
.photo-box {
    position: relative; /* обязательно: :before позиционируется от бокса */
}
.photo-box.with-shadow:before {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(0,0,0,.2) 0, transparent 76%, transparent 100%);
    border-radius: 50%;
    height: 12px;
    left: 0;
    top: 230px;
    width: 180px;
}
.photo-box.with-shadow--big:before {
    top: auto;
	bottom: -30px;
    height: 30px;
    max-width: 942px;
    width: 100%;
}
@media (min-width: 992px) {
    .photo-box.with-shadow:before {
        left: 50%;
        margin-left: -90px;
    }
    .photo-box.with-shadow--big:before {
        margin-left: -275px;
        max-width: 550px;
    }
}