/**
 * Product Image Lightbox - CSS dla powiększania obrazków w opisach produktów
 * Klasa .product-image-zoomable jest automatycznie dodawana do obrazków > 150x150px
 */

/* Kursor wskazujący możliwość kliknięcia */
.product-image-zoomable {
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
    height: unset;
}

.product-image-zoomable:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Overlay lightbox */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox-overlay.active {
    display: flex;
}

/* Kontener obrazka w lightbox */
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    animation: lightboxZoomIn 0.3s ease;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Przycisk zamknięcia */
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    background: none;
    border: none;
    width: 50px;
    height: 50px;
    line-height: 40px;
    text-align: center;
    transition: transform 0.2s ease;
}

.lightbox-close:hover,
.lightbox-close:focus {
    transform: scale(1.2);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Animacja pojawienia się */
@keyframes lightboxZoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsywność - na mobile lightbox zajmuje więcej miejsca */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 35px;
    }
}

/* Dodatkowe style dla lepszego UX */
.lightbox-content img {
    border-radius: 4px;
}

/* Wskaźnik ładowania */
.lightbox-overlay::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.lightbox-overlay.loaded::before {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}