/**
 * VWA Realworks Connector - Gallery Styles
 *
 * @package VWA\RealworksConnector
 */

/* ==========================================================================
   Gallery
   ========================================================================== */

.vso-single-gallery {
    margin-bottom: var(--vso-spacing-xl);
}

.vso-gallery-main {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--vso-secondary);
    border-radius: var(--vso-radius-lg);
    overflow: hidden;
    cursor: pointer;
}

.vso-gallery-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--vso-transition);
}

.vso-gallery-main-image.loading {
    opacity: 0.5;
}

/* Thumbnails */
.vso-gallery-thumbnails {
    display: flex;
    gap: var(--vso-spacing-sm);
    margin-top: var(--vso-spacing-sm);
    overflow-x: auto;
    padding-bottom: var(--vso-spacing-xs);
    scrollbar-width: thin;
}

.vso-gallery-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--vso-radius);
    background: none;
    cursor: pointer;
    overflow: hidden;
    transition: border-color var(--vso-transition), opacity var(--vso-transition);
}

.vso-gallery-thumb:hover {
    opacity: 0.8;
}

.vso-gallery-thumb.active {
    border-color: var(--vso-primary);
}

.vso-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.vso-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--vso-transition), visibility var(--vso-transition);
}

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

.vso-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.vso-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.vso-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--vso-white);
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--vso-transition);
}

.vso-lightbox-close:hover {
    opacity: 1;
}

.vso-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--vso-white);
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--vso-transition), background var(--vso-transition);
}

.vso-lightbox-nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.vso-lightbox-prev {
    left: -70px;
}

.vso-lightbox-next {
    right: -70px;
}

.vso-lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--vso-white);
    font-size: 14px;
    opacity: 0.7;
}

/* Mobile lightbox */
@media (max-width: 768px) {
    .vso-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .vso-lightbox-prev {
        left: 10px;
    }

    .vso-lightbox-next {
        right: 10px;
    }

    .vso-lightbox-close {
        top: 10px;
        right: 10px;
    }

    .vso-lightbox-counter {
        bottom: 10px;
    }
}

/* ==========================================================================
   Gallery thumbnails scrollbar
   ========================================================================== */

.vso-gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.vso-gallery-thumbnails::-webkit-scrollbar-track {
    background: var(--vso-secondary);
    border-radius: 3px;
}

.vso-gallery-thumbnails::-webkit-scrollbar-thumb {
    background: var(--vso-border);
    border-radius: 3px;
}

.vso-gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: var(--vso-text-light);
}
