/**
 * PhotoSwipe Lightbox Styles
 * Professional product image gallery lightbox
 */

/* Overlay */
.pswp-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Container */
.pswp-lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 80px 120px;
    box-sizing: border-box;
}

/* Close button */
.pswp-lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10;
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pswp-lightbox-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Navigation buttons */
.pswp-lightbox-prev,
.pswp-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.pswp-lightbox-prev:hover,
.pswp-lightbox-next:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.pswp-lightbox-prev {
    left: 15px;
}

.pswp-lightbox-next {
    right: 15px;
}

.pswp-lightbox-prev svg,
.pswp-lightbox-next svg {
    width: 40px;
    height: 40px;
    fill: black;
}

/* Image wrapper */
.pswp-lightbox-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Main image */
.pswp-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: zoom-in;
    transform-origin: center center;
}

.pswp-lightbox-image.loading {
    opacity: 0.5;
}

/* Zoomed state */
.pswp-lightbox-image-wrapper.zoomed {
    overflow: hidden;
}

.pswp-lightbox-image-wrapper.zoomed .pswp-lightbox-image {
    cursor: zoom-out;
    transition: transform 0.15s ease-out;
}

/* Thumbnails */
.pswp-lightbox-thumbnails {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    max-width: calc(100% - 40px);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.pswp-lightbox-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.pswp-lightbox-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.pswp-lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.pswp-lightbox-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pswp-lightbox-thumb:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.pswp-lightbox-thumb.active {
    opacity: 1;
    border-color: #fff;
}

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

/* Counter */
.pswp-lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

/* Product cover clickable styles */
.product-cover {
    cursor: zoom-in;
    position: relative;
}

.product-cover .layer {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
    z-index: 5;
}

.product-cover .layer:hover {
    opacity: 1;
    background: transparent;
    transform: scale(1.1);
}

.product-cover .layer i,
.product-cover .layer .zoom-in {
    color: #fff;
    font-size: 20px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .pswp-lightbox-container {
        padding: 50px 15px 100px;
    }
    
    .pswp-lightbox-prev,
    .pswp-lightbox-next {
        width: 40px;
        height: 60px;
    }
    
    .pswp-lightbox-prev {
        left: 5px;
    }
    
    .pswp-lightbox-next {
        right: 5px;
    }
    
    .pswp-lightbox-prev svg,
    .pswp-lightbox-next svg {
        width: 30px;
        height: 30px;
    }
    
    .pswp-lightbox-thumbnails {
        bottom: 10px;
        gap: 6px;
        padding: 8px;
    }
    
    .pswp-lightbox-thumb {
        width: 50px;
        height: 50px;
    }
    
    .pswp-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
    
    .pswp-lightbox-counter {
        top: 15px;
        left: 15px;
        font-size: 12px;
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    .pswp-lightbox-thumb {
        width: 40px;
        height: 40px;
    }
    
    .pswp-lightbox-thumbnails {
        gap: 4px;
        padding: 6px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .pswp-lightbox-prev,
    .pswp-lightbox-next {
        opacity: 0.9;
        background: rgba(255, 255, 255, 0.15);
    }
}
