/* ================================================
   LEFT: IMAGE GALLERY (STICKY)
   ================================================ */

.pg-product-gallery {
    width: 100%;
}

@media (min-width: 1024px) {
    .pg-product-gallery {
        width: 520px;
        flex-shrink: 0;
        position: sticky;
        top: 120px;
        align-self: flex-start;
        z-index: 10;
        height: fit-content;
    }
}

@media (min-width: 1400px) {
    .pg-product-gallery {
        width: 600px;
    }
}

/* Main Image Container */
.pg-product-main-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--pg-white);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    position: relative;
    margin-bottom: 16px;
}

.pg-product-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

/* ================================================
   IMAGE LIGHTBOX
   ================================================ */

.pg-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pg-lightbox.active {
    display: flex;
    opacity: 1;
}

.pg-lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.pg-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
    animation: pgLightboxZoomIn 0.3s ease;
}

@keyframes pgLightboxZoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.pg-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    height: auto;
    width: auto;
    display: block;
    border-radius: 2px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.pg-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: var(--pg-white);
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.8;
}

.pg-lightbox-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.pg-lightbox-close svg {
    width: 28px;
    height: 28px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .pg-lightbox-content {
        max-width: 95vw;
        max-height: 85vh;
    }

    .pg-lightbox-close {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        width: 36px;
        height: 36px;
    }

    .pg-lightbox-close svg {
        width: 20px;
        height: 20px;
    }
}

/* Thumbnail Gallery Container */
.pg-product-thumbs-container {
    position: relative;
    margin-top: 16px;
}

/* Thumbnail Gallery */
.pg-product-thumbs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 24px;
}

.pg-product-thumbs::-webkit-scrollbar {
    display: none;
}

.pg-product-thumb {
    flex: 0 0 auto;
    width: 63px;
    height: 63px;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    background: var(--pg-white);
    box-sizing: border-box;
}

.pg-product-thumb:hover {
    opacity: 0.8;
}

.pg-product-thumb.active {
    border-color: var(--pg-galaxy);
    border-width: 2px;
}

.pg-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Navigation Buttons */
.pg-thumb-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, background 0.2s;
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.pg-thumb-nav-btn:hover {
    background: rgba(255, 255, 255, 1);
}

.pg-thumb-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.pg-thumb-nav-btn svg {
    display: block;
    pointer-events: none;
}

.pg-thumb-nav-left {
    left: 4px;
}

.pg-thumb-nav-right {
    right: 4px;
}

