/*
 * Product Gallery Slider - Main Stylesheet
 */

/* --- General Wrapper --- */

.pgs-gallery-wrapper {
    
    margin-left: auto;
    margin-right: auto;
}

.pgs-gallery-container {
    position: relative;
    width: 100%;
    
    background-color: #ffffff;
    overflow: hidden;

}

/* --- Image Stack / Carousel --- */
.pgs-image-stack {
    width: 100%;
    height: 100%;
    scrollbar-width: none; /* Firefox */
    position: relative;
    display: flex;
    scroll-snap-type: x mandatory;
}
.pgs-image-stack::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.pgs-image-container {
    width: 100%;

    position: relative;
    overflow: hidden;
}

.pgs-image-to-zoom {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Desktop Specific Styles --- */
@media(min-width: 1024px){
    .pgs-image-stack > .pgs-image-container:first-of-type,.pgs-image-stack > .pgs-image-container:nth-of-type(2),.pgs-image-stack > .pgs-image-container:nth-of-type(4),.pgs-image-stack > .pgs-image-container:nth-of-type(5),.pgs-image-stack > .pgs-image-container:nth-of-type(7),.pgs-image-stack > .pgs-image-container:nth-of-type(8) {
        min-width:calc(50% - .8rem);
        width:calc(50% - .8rem);
        flex-grow: 1;
        flex-shrink: 1;
        flex-basis: calc(50% - 0.8rem);
    }
}
@media (min-width: 768px) {
    .pgs-gallery-wrapper {
    position: sticky;
    top: 66px;
    }
    .pgs-gallery-container {
        
        height: calc(100vh - 65px);
       
    
    }
    .pgs-image-stack {
        overflow-y: scroll;
        scroll-behavior: smooth;
        flex-wrap: wrap;
    }

    .pgs-image-to-zoom {
        cursor: zoom-in;
        transition: transform 0.3s ease-in-out;
        transform-origin: center center;
    }

    .pgs-image-to-zoom.zoomed {
        transform: scale(2);
        cursor: crosshair;
    }
    
}

/* --- Mobile Specific Styles --- */
@media (max-width: 767px) {
    .pgs-image-stack {
        display: flex;
        transition: transform 0.3s ease-out;
    }
    .pgs-image-container {
        flex: 0 0 100%;
    }
}


/* --- Desktop Slider Controls --- */
.pgs-slider-controls {
    position: absolute;
    left: 1.5rem; /* 24px */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem; /* 8px */
    z-index: 10;
}

.pgs-slider-btn {
    width: 3rem; /* 48px */
    height: 3rem; /* 48px */
    border-radius: 9999px;
    background-color: #ffffff;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    border: none;
    cursor: pointer;
}
.pgs-slider-btn:hover {
    background-color: #f3f4f6;
}
.pgs-slider-btn:active {
    transform: scale(0.9);
}
.pgs-slider-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pgs-slider-track-wrapper {
    background-color: #ffffff;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 0.375rem; /* 6px */
    display: flex;
    justify-content: center;
}

.pgs-slider-track {
    position: relative;
    height: 12rem; /* 192px */
    width: 0.5rem; /* 8px */
    background-color: #e5e7eb;
    border-radius: 9999px;
}

.pgs-slider-thumb {
    position: absolute;
    width: 100%;
    height: 2.5rem; /* 40px */
    background-color: #6b7280;
    border-radius: 9999px;
    cursor: grab;
}

/* Hide desktop slider on mobile */
@media (max-width: 767px) {
    .pgs-slider-controls {
        display: none;
    }
}


/* --- Mobile Navigation Dots --- */
.pgs-mobile-nav-dots {
    position: absolute;
    bottom: 1rem; /* 16px */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border-radius: 9999px;
    padding: 0.5rem; /* 8px */
    display: flex;
    gap: 0.5rem; /* 8px */
}

.pgs-mobile-nav-dots .dot {
    width: 0.5rem; /* 8px */
    height: 0.5rem; /* 8px */
    border-radius: 9999px;
    background-color: #9ca3af;
    transition: all 0.3s;
    cursor: pointer;
}
.pgs-mobile-nav-dots .dot.active {
    background-color: #374151;
    width: 1rem; /* 16px */
}

/* Hide mobile dots on desktop */
@media (min-width: 768px) {
    .pgs-mobile-nav-dots {
        display: none;
    }
}


/* --- Lightbox Styles --- */
.pgs-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none; /* Hidden by default */
}
.pgs-lightbox.active {
    display: flex;
}

.pgs-lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.pgs-lightbox-close {
    position: absolute;
    top: 1.25rem; /* 20px */
    right: 1.25rem; /* 20px */
    color: white;
    font-size: 3rem; /* 48px */
    font-weight: bold;
    border: none;
    background: none;
    cursor: pointer;
}
