/* Grid styles */
.realizacje-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 30px;
}
@media screen and (min-width:1025px) {
    .realizacje-grid {
            gap: 90px;
    }
}

button.custom-gallery-next,
button.custom-gallery-prev {
    background: #fff !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0px !important;
    transition: transform 0.2s;
}

.custom-gallery-next svg path,
.custom-gallery-prev svg path {
    stroke: #000;
}

button.custom-gallery-next:hover,
button.custom-gallery-prev:hover {
    background: #fecc00 !important;
}

.realizacje-item {
    width: 300px;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
}

.realizacje-item:hover {
    transform: scale(1.05);
}

.realizacje-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.realizacje-title {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

/* Lightbox styles - MAXIMUM PRIORITY */
#realizacje-lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.9) !important;
    z-index: 2147483647 !important;
    /* Maximum z-index */
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
    display: none !important;
}

#realizacje-lightbox.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Override any possible theme conflicts */
body.realizacje-lightbox-open {
    overflow: hidden !important;
}


.realizacje-lightbox-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    cursor: pointer !important;
}

.realizacje-lightbox-content {}

.realizacje-lightbox-container {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 1200px !important;
    max-height: 80vh !important;
    background: #1e2228;
}

.realizacje-lightbox-content img {
    width: 100%;
    object-fit: cover;
    height: 100% !important;
    max-height: 80vh !important;
}

.single-realizacje .realizacje-lightbox-body {
        max-height: 100% !important;
}
.custom-gallery-slider {
    height: 100% !important;
    max-height: 80vh !important;
    overflow-y: hidden;
}
#realizacje-lightbox * {
    box-sizing: border-box !important;
    flex-wrap: wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.realizacje-lightbox-body {
    width: 100% !important;
}

/* Lightbox navigation only - nie dotykaj Kadence gallery */
.realizacje-nav {
    background: transparent !important;
}

.realizacje-prev {
    position: absolute !important;
    left: -100px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s cubic-bezier(.4, 0, .2, 1);
}

.realizacje-next {
    position: absolute !important;
    right: -100px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s cubic-bezier(.4, 0, .2, 1);
}

.realizacje-prev:hover,
.realizacje-next:hover {
    transform: translateY(-50%) scale(1.1) !important;
}

.realizacje-close {
    top: 0px;
    right: 0px;
    position: absolute;
}

button.realizacje-close {
    padding: 5px;
    width: 40px;
    font-size: 50px;
    height: 40px;
    line-height: 32px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .realizacje-grid {
        gap: 16px;
    }

    .realizacje-item {
        width: 100%;
        max-width: 300px;
    }

    #realizacje-lightbox {
        padding: 10px;
    }

    .realizacje-lightbox-body {
        padding: 20px;
    }

    .realizacje-close {
        top: 10px;
        left: 10px;
        font-size: 36px;

    }

    button.realizacje-close {
        padding: 5px;
        width: 40px;
        font-size: 50px;
        height: 40px;
        line-height: 32px;
        margin-left: 5px;

    }

    .realizacje-lightbox-container {
        max-height: 90vh !important;
    }
}

@media (max-width:680px) {
    .realizacje-lightbox-content img {
        max-height: 260px !important;
    }

    .realizacje-next,
    .realizacje-prev {
        top: 35px !important;
    }

}

@media (max-width: 480px) {
    .realizacje-lightbox-body {
        padding: 15px;
    }
}

@media (min-width: 1025px) {
    .realizacje-lightbox-container {
        margin: 0px 80px;
        max-height: 80vh;
    }
}

@media (max-width: 1024px) {
    .realizacje-next {
        right: auto;
        top: auto;
        bottom: -80px;
        margin-left: 100px;
    }

    .realizacje-prev {
        left: auto;
        top: auto;
        bottom: -80px;
        margin-right: 100px;
    }

    .realizacje-prev img,
    .realizacje-next img {
        width: 30px !important;
        height: 20px !important;
    }
}

.realizacje-lightbox-content {
    max-height: 80vh !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.realizacje-lightbox-body {
    height: 100% !important;
    max-height: 80vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}
.single-realizacje .gb-element-b0f81ac0 {
    height: auto !important; /* lub inne wartości */
    max-height: none !important;
}

.gb-element-b0f81ac0 {
    height: 100% !important;
    max-height: 80vh !important;
}

.gb-element-b0f81ac0>div {
    height: 100% !important;
}

/* Single page realizacje styles - identyczne jak lightbox */
.realizacje-single-page {
    width: 100%;
}

.realizacje-single-page .custom-gallery-slider {
    height: auto !important;
    max-height: none !important;
}

.realizacje-single-page .custom-gallery-slider img {
    width: 100%;
    object-fit: cover;
    height: auto !important;
    max-height: none !important;
}