/**
 * Product Image Zoom Lightbox
 */

/* Zoom affordance on the main product image */
.gallery-main.is-zoomable {
    cursor: zoom-in;
}

/* Overlay */
.pg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    background: rgba(20, 10, 18, 0.95);
}

.pg-lightbox.open {
    display: block;
}

/* Stage that holds the current image */
.pg-stage {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
}

.pg-image {
    max-width: 90%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.12s ease-out;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
}

.pg-stage.zoomed .pg-image {
    cursor: grab;
}

.pg-stage.zoomed .pg-image:active {
    cursor: grabbing;
}

/* Zoom +/- controls (top-left) */
.pg-controls {
    position: absolute;
    top: 18px;
    left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.pg-controls button {
    width: 40px;
    height: 40px;
    font-size: 24px;
    line-height: 1;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pg-controls button:hover {
    background: var(--color-primary, #6b2d5b);
}

/* Close (top-right) */
.pg-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    font-size: 30px;
    line-height: 1;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 2;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.pg-close:hover {
    opacity: 1;
}

/* Prev / Next arrows */
.pg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    font-size: 22px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease;
}

.pg-nav:hover {
    background: var(--color-primary, #6b2d5b);
}

.pg-prev {
    left: 20px;
}

.pg-next {
    right: 20px;
}

/* Thumbnail strip (bottom) */
.pg-thumbs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    overflow-x: auto;
}

.pg-thumb {
    flex: 0 0 auto;
    width: 78px;
    height: 78px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    background: none;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.pg-thumb.active,
.pg-thumb:hover {
    opacity: 1;
    border-color: #f5d788;
}

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

/* Single-image products: hide nav + thumbs */
.pg-thumbs:empty,
.pg-thumbs:only-child {
    display: none;
}

@media (max-width: 600px) {
    .pg-stage {
        bottom: 100px;
        padding: 10px;
    }

    .pg-thumbs {
        height: 100px;
    }

    .pg-thumb {
        width: 60px;
        height: 60px;
    }

    .pg-nav {
        width: 38px;
        height: 38px;
    }
}
