/* Własny popup galerii na cały ekran */
.gallery-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-popup-overlay.active {
    display: block;
    opacity: 1;
}

.gallery-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-popup-overlay.active .gallery-popup-container {
    pointer-events: auto;
}

.gallery-popup-overlay.active .gallery-popup-container {
    opacity: 1;
}

.gallery-popup-image-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100vh;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    box-sizing: border-box;
}

.gallery-popup-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.gallery-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.3s ease;
    font-family: Arial, sans-serif;
    font-weight: 300;
    display: block;
    padding: 10px;
}

.gallery-popup-close:hover {
    color: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
}

.gallery-popup-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #fff;
    font-size: 60px;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    font-weight: 300;
}

.gallery-popup-nav:hover {
    color: rgba(255, 255, 255, 0.8);
    transform: translateY(-50%) scale(1.2);
}

.gallery-popup-nav-prev {
    left: 20px;
}

.gallery-popup-nav-next {
    right: 20px;
}

.gallery-popup-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.gallery-popup-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 20px;
    border-radius: 20px;
    z-index: 10002;
}

.gallery-popup-title {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    max-width: 80%;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 4px;
}

.gallery-popup-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 18px;
    z-index: 10001;
}

/* Animacje */
@keyframes galleryFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gallery-popup-image {
    animation: galleryFadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-popup-image-wrapper {
        padding: 80px 20px 100px;
    }
    
    .gallery-popup-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 28px;
        line-height: 36px;
    }
    
    .gallery-popup-nav {
        font-size: 50px;
        padding: 5px 10px;
    }
    
    .gallery-popup-nav-prev {
        left: 10px;
    }
    
    .gallery-popup-nav-next {
        right: 10px;
    }
    
    .gallery-popup-counter {
        bottom: 20px;
        font-size: 14px;
        padding: 6px 16px;
    }
    
    .gallery-popup-title {
        top: 60px;
        font-size: 16px;
        max-width: 90%;
        padding: 8px 16px;
    }
}

/* Blokada scrollowania body gdy popup jest otwarty */
body.gallery-popup-open {
    overflow: hidden;
}

/* Ukryj header gdy popup jest otwarty - USUNIĘTE (powoduje skok scrolla) */
/*
body.gallery-popup-open #header,
body.gallery-popup-open #header-sticky-wrapper {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}
*/
