.gallery-lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.gallery-lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.gallery-lightbox-counter {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.gallery-lightbox-close {
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.gallery-lightbox-close:hover {
    background: #e0e0e0;
}

.gallery-lightbox-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem 2rem 2rem;
    min-height: 0; /* Important for flex child */
    width: 100%;
}

.gallery-lightbox-main .slick-list,
.gallery-lightbox-main .slick-track {
    height: 100%;
}

.gallery-lightbox-main .slick-slide {
    height: 100%;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox-main img {
    max-height: 80vh;
    max-width: 100%;
    object-fit: contain;
}

.gallery-lightbox-main video {
    max-height: 80vh;
    max-width: 100%;
}

/* Ensure HTML block inside main slider looks correct */
.gallery-lightbox-main .slider-html-block {
    max-height: 80vh;
    max-width: 600px; /* Stats block max width */
    width: 100%;
    transform: scale(1.2);
    transform-origin: center center;
}

.gallery-lightbox-thumbs {
    height: 120px;
    padding: 10px 0;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
    width: 100%;
}

.gallery-lightbox-thumbs .slick-slide {
    margin: 0 5px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, border 0.2s;
    height: 80px;
    box-sizing: border-box;
    border: 2px solid transparent;
}

.gallery-lightbox-thumbs .slick-slide:hover {
    opacity: 0.8;
}

.gallery-lightbox-thumbs .slick-current {
    opacity: 1;
    border: 2px solid #000;
}

.gallery-lightbox-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* HTML block inside thumbs */
.gallery-lightbox-thumbs .thumb-html-block {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: #ECF1F5;
}

.gallery-lightbox-thumbs .thumb-html-block-inner {
    transform: scale(0.2);
    transform-origin: top left;
    width: 500%;
    height: 500%;
    pointer-events: none;
}

/* Slick arrows customization */
.gallery-lightbox-main .slick-prev,
.gallery-lightbox-main .slick-next {
    width: 50px;
    height: 50px;
    background: #f0f0f0;
    border-radius: 50%;
    z-index: 5;
    transition: background 0.2s;
}

.gallery-lightbox-main .slick-prev:hover,
.gallery-lightbox-main .slick-next:hover {
    background: #e0e0e0;
}

.gallery-lightbox-main .slick-prev {
    left: 20px;
}

.gallery-lightbox-main .slick-next {
    right: 20px;
}

.gallery-lightbox-main .slick-prev:before,
.gallery-lightbox-main .slick-next:before {
    color: #000;
    font-size: 24px;
    line-height: 1;
}

/* Add JS hook cursor */
.js-gallery-item {
    cursor: pointer;
}
