/*
 * BSFTUI Gallery Lightbox
 * Стили общего галерейного lightbox: главное медиа + слайдер миниатюр.
 * Используется из bulbasoft-woogallery и bulbasoft-slider через
 * BSFT.ui.galleryLightbox.open(...).
 *
 * Переменные, которые контейнер выставляет из опций:
 *  --lb-main-image-height, --lb-main-image-height-tablet, --lb-main-image-height-mobile
 *  --lb-main-fixed-height (рассчитывается JS, приоритетно)
 */

/* Container inside lightbox dialog */
.bsftlb_container {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

/* Main media area */
.bsftlb_container .bsftlb_main_wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 0 12px 0;
}

.bsftlb_container #bsftlb_main_image {
    position: relative;
    width: 100%;
    height: var(--lb-main-fixed-height, var(--lb-main-image-height, 60vh));
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
    box-sizing: border-box;
}

.bsftlb_container #bsftlb_main_image img.bsftcart-main-image,
.bsftlb_container #bsftlb_main_image video.bsftcart-main-video {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
    background: transparent;
    display: block;
}

.bsftlb_container #bsftlb_main_image video.bsftcart-main-video:not([poster]) {
    background-color: #f8f9fa;
}

/* Staging layer used for cross-fade when swapping main media */
.bsftlb_container .bsftlb_staging {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

/* Thumbs area */
.bsftlb_container .bsftlb_thumbs_wrap {
    flex: 0 0 auto;
    padding-top: 12px;
}

.bsftlb_container .bsftlb_thumbs_wrap .bsftcart-thumb {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

.bsftlb_container .bsftlb_thumbs_wrap .bsftslide {
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
}

.bsftlb_container .bsftlb_thumbs_wrap .bsftslide:hover .bsftcart-thumb {
    opacity: 0.85;
}

.bsftlb_container .bsftslide.active {
    outline: 2px solid #007cba;
    outline-offset: -2px;
    border-radius: 6px;
}

.bsftlb_container .bsftslide.active .bsftcart-thumb {
    opacity: 1;
}

.bsftlb_container .bsftslide_bullet {
    width: 8px !important;
    height: 8px !important;
    background: rgba(0,0,0,0.3) !important;
}
.bsftlb_container .bsftslide_bullet.active {
    background: rgba(0,0,0,0.7) !important;
}

/* Responsive heights (used when --lb-main-fixed-height not computed yet) */
@media (max-width: 1024px) {
    .bsftlb_container #bsftlb_main_image {
        height: var(--lb-main-fixed-height, var(--lb-main-image-height-tablet, 50vh));
    }
}
@media (max-width: 767px) {
    .bsftlb_container #bsftlb_main_image {
        height: var(--lb-main-fixed-height, var(--lb-main-image-height-mobile, 45vh));
    }
}

/* Video thumbs in modal (same visual language as woogallery) */
.bsftlb_container .bsftcart-video-thumb {
    position: relative;
}

.bsftlb_container .bsftcart-video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    pointer-events: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

.bsftlb_container .bsftslide:hover .bsftcart-video-play-overlay {
    background: rgba(0, 0, 0, 0.85);
    transform: translate(-50%, -50%) scale(1.08);
}

.bsftlb_container .bsftcart-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #666;
    padding: 16px;
    text-align: center;
    border-radius: 4px;
    font-size: 12px;
}

/* Hover zoom layers (used only on image, inside modal) */
.bsftlb_container .bsft-zoom-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.bsftlb_container .bsft-zoom-image {
    position: absolute;
    inset: 0;
    display: block;
    background-repeat: no-repeat;
}

.bsftlb_container .bsft-zoom-lens {
    position: absolute;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
}
