/**
 * Product Gallery Zoom Styles
 * For Glina z Podlasia WooCommerce Store
 */

/* === ZOOM ICON === */
.woocommerce-product-gallery__image {
    position: relative;
    cursor: pointer;
}

.gzp-zoom-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.gzp-zoom-icon svg {
    width: 30px;
    height: 30px;
    color: #333;
}

.gzp-zoom-icon--visible {
    opacity: 1;
    visibility: visible;
}

/* Hover effect for image container */
.woocommerce-product-gallery__image:hover {
    cursor: pointer;
}

.woocommerce-product-gallery__image:hover img {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* === LIGHTBOX === */
.gzp-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.gzp-lightbox__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    cursor: pointer;
    z-index: 1;
    touch-action: manipulation;
}

.gzp-lightbox__content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    cursor: pointer;
    touch-action: manipulation;
}

.gzp-lightbox__image-wrapper {
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: default;
    z-index: 3;
}

.gzp-lightbox__image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    cursor: default;
    pointer-events: none;
}

/* Close button */
.gzp-lightbox__close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 48px;
    font-family: Arial, sans-serif;
    font-weight: 200;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.gzp-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

/* Navigation buttons */
.gzp-lightbox__prev,
.gzp-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 48px;
    font-family: Arial, sans-serif;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.gzp-lightbox__prev {
    left: 30px;
    padding-right: 2px;
}

.gzp-lightbox__next {
    right: 30px;
    padding-left: 2px;
}

.gzp-lightbox__prev:hover,
.gzp-lightbox__next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Counter */
.gzp-lightbox__counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .gzp-zoom-icon {
        width: 50px;
        height: 50px;
    }
    
    .gzp-zoom-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .gzp-lightbox__close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 36px;
        line-height: 0;
    }
    
    .gzp-lightbox__prev,
    .gzp-lightbox__next {
        width: 40px;
        height: 40px;
        font-size: 36px;
        line-height: 0;
    }
    
    .gzp-lightbox__prev {
        left: 10px;
        padding-right: 1px;
    }
    
    .gzp-lightbox__next {
        right: 10px;
        padding-left: 1px;
    }
    
    .gzp-lightbox__counter {
        bottom: 15px;
        padding: 6px 15px;
        font-size: 12px;
    }
    
    .gzp-lightbox__image-wrapper {
        max-width: 95%;
        max-height: 85vh;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .gzp-zoom-icon {
        width: 40px;
        height: 40px;
    }
    
    .gzp-zoom-icon svg {
        width: 20px;
        height: 20px;
    }
    
    /* Show zoom icon on mobile by default (no hover) */
    .gzp-zoom-icon {
        opacity: 0.7;
        visibility: visible;
    }
    
    .gzp-zoom-icon--visible {
        opacity: 1;
    }
}

/* === ELEMENTOR SPECIFIC ADJUSTMENTS === */
.elementor-widget-woocommerce-product-images .woocommerce-product-gallery__image {
    overflow: visible !important;
}

/* Ensure compatibility with Elementor's image borders */
.elementor-widget-woocommerce-product-images .woocommerce-product-gallery__image img {
    transition: transform 0.3s ease;
}

/* Fix for thumbnail gallery */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image {
    margin-bottom: 0;
}
