/* Podstawowe style popup */
.custom-popup {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
    place-items: center;
    padding: 10px;
    box-sizing: border-box;
}

/* When popup is shown, block body scroll */
body.popup-open {
    overflow: hidden;
}

/* Domyślne tło dla popup z tekstem */
.popup-content {
    background-color: #fefefe;
    padding: 10px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    position: relative;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    animation: popupFadeIn 0.3s ease-out;
}

/* Przezroczyste tło dla popup tylko z obrazami */
.popup-content.image-only {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    width: auto !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    border-radius: 0 !important;
    min-height: auto !important;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.popup-body {
    margin-top: 20px;
    line-height: 1.6;
    white-space: normal;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    flex-grow: 1;
}

/* Body bez paddingu dla obrazów */
.popup-body.image-only {
    margin-top: 0 !important;
    padding: 0 !important;
}

.popup-footer {
    text-align: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Footer bez tła dla obrazów */
.popup-footer.image-only {
    background: transparent !important;
    border: none !important;
    margin-top: 15px !important;
    padding: 0 !important;
}

.popup-ok-button {
    background: var(--eliq-blue, #007bff);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    font-size: 14px;
}

.popup-ok-button:hover {
    background: var(--eliq-blue-hover, #0056b3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

/* Style dla obrazów w popup */
.popup-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Style dla obrazów z modułu */
.popup-images {
    margin-bottom: 15px;
    text-align: center;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.single-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.single-image img {
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Slider dla wielu obrazów */
.image-slider {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slides-wrapper {
    position: relative;
    width: 100%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide {
    display: none;
    text-align: center;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.slide.active {
    display: flex;
}

.slide img {
    border-radius: 8px;
    box-shadow: none;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Przyciski slidera */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    padding: 12px 15px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.prev-btn {
    left: 15px;
}

.next-btn {
    right: 15px;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Kropki slidera */
.slider-dots {
    text-align: center;
    margin-top: 20px;
}

.dot {
    display: inline-block;
    height: 12px;
    width: 12px;
    margin: 0 6px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dot.active,
.dot:hover {
    background-color: var(--eliq-blue, #007bff);
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

/* Formatowanie tekstu - style dla TinyMCE */
.popup-body p[style*="text-align: center"] {
    text-align: center !important;
}

.popup-body p[style*="text-align: right"] {
    text-align: right !important;
}

.popup-body p[style*="text-align: left"] {
    text-align: left !important;
}

/* Text alignment classes that TinyMCE might add */
.popup-body .text-center,
.popup-body [style*="text-align: center"] {
    text-align: center !important;
}

.popup-body .text-right,
.popup-body [style*="text-align: right"] {
    text-align: right !important;
}

.popup-body .text-left,
.popup-body [style*="text-align: left"] {
    text-align: left !important;
}

/* Bold text */
.popup-body b,
.popup-body strong {
    font-weight: 700;
}

/* Links styling */
.popup-body a {
    color: #e70046;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.popup-body a:hover {
    color: #c9003c;
    text-decoration: none;
}

/* Preserve other common text formatting */
.popup-body em,
.popup-body i {
    font-style: italic;
}

.popup-body u {
    text-decoration: underline;
}

/* Lists */
.popup-body ul,
.popup-body ol {
    margin-left: 20px;
    margin-bottom: 1em;
    padding-left: 15px;
}

.popup-body ul li,
.popup-body ol li {
    margin-bottom: 0.5em;
}

/* Headers */
.popup-body h1,
.popup-body h2,
.popup-body h3,
.popup-body h4 {
    margin-bottom: 0.5em;
    font-weight: 600;
}

/* Paragraphs */
.popup-body p {
    margin: 0 0 1em 0;
    padding: 0;
    display: block;
}

/* Responsywne style */
@media (max-width: 768px) {
    .custom-popup {
        padding: 5px;
    }

    .popup-content {
        width: 95%;
        max-width: none;
        margin: 10px;
        padding: 15px;
    }

    .popup-content.image-only {
        max-width: 98vw !important;
        max-height: 85vh !important;
        margin: 5px !important;
    }

    .popup-body {
        font-size: 16px;
        margin-top: 15px;
    }

    .popup-body img {
        max-width: 100%;
        max-height: 75vh;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .popup-images {
        max-height: 75vh;
    }

    .popup-images img,
    .single-image img {
        max-width: 100%;
        max-height: 75vh;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .image-slider,
    .slider-container {
        max-height: 75vh;
    }

    .slide img {
        max-height: 75vh;
        max-width: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .slider-btn {
        font-size: 16px;
        padding: 10px 12px;
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .custom-popup {
        padding: 2px;
    }

    .popup-content {
        width: 98%;
        margin: 5px;
        padding: 10px;
        max-height: 95vh;
    }

    .popup-content.image-only {
        max-width: 99vw !important;
        max-height: 90vh !important;
        margin: 2px !important;
    }

    .popup-body {
        font-size: 14px;
        margin-top: 15px;
    }

    .popup-body img {
        max-width: 100%;
        max-height: 80vh;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .popup-images {
        max-height: 80vh;
        margin-bottom: 10px;
    }

    .popup-images img,
    .single-image img {
        max-width: 100%;
        max-height: 80vh;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .image-slider,
    .slider-container,
    .slides-wrapper {
        max-height: 80vh;
    }

    .slide img {
        max-height: 80vh;
        max-width: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .popup-footer {
        padding: 12px 15px;
    }

    .popup-footer.image-only {
        margin-top: 10px !important;
    }

    .popup-ok-button {
        padding: 10px 25px;
        font-size: 13px;
    }

    .slider-btn {
        font-size: 14px;
        padding: 8px 10px;
    }
}

@media (max-height: 600px) {
    .popup-images,
    .single-image img,
    .image-slider,
    .slider-container,
    .slide img {
        max-height: 70vh !important;
    }
}

/* Dodatkowe style dla kompatybilności */
.popup-text-content {
    line-height: 1.6;
    color: #333;
}

.popup-text-content h1,
.popup-text-content h2,
.popup-text-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #222;
}

.popup-text-content p {
    margin-bottom: 10px;
}

.popup-text-content a {
    color: #e70046;
    text-decoration: underline;
}

.popup-text-content a:hover {
    color: #c9003c;
    text-decoration: none;
}

/* Style dla przypadku gdy są tylko obrazy bez tekstu */
.popup-images:last-child {
    margin-bottom: 0;
}

/* Przyciski slidera */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    padding: 12px 15px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.prev-btn {
    left: 15px;
}

.next-btn {
    right: 15px;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Kropki slidera */
.slider-dots {
    text-align: center;
    margin-top: 20px;
}

.dot {
    display: inline-block;
    height: 12px;
    width: 12px;
    margin: 0 6px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dot.active,
.dot:hover {
    background-color: var(--eliq-blue, #007bff);
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

/* Formatowanie tekstu - style dla TinyMCE */
.popup-body p[style*="text-align: center"] {
    text-align: center !important;
}

.popup-body p[style*="text-align: right"] {
    text-align: right !important;
}

.popup-body p[style*="text-align: left"] {
    text-align: left !important;
}

/* Text alignment classes that TinyMCE might add */
.popup-body .text-center,
.popup-body [style*="text-align: center"] {
    text-align: center !important;
}

.popup-body .text-right,
.popup-body [style*="text-align: right"] {
    text-align: right !important;
}

.popup-body .text-left,
.popup-body [style*="text-align: left"] {
    text-align: left !important;
}

/* Bold text */
.popup-body b,
.popup-body strong {
    font-weight: 700;
}

/* Links styling */
.popup-body a {
    color: #e70046;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.popup-body a:hover {
    color: #c9003c;
    text-decoration: none;
}

/* Preserve other common text formatting */
.popup-body em,
.popup-body i {
    font-style: italic;
}

.popup-body u {
    text-decoration: underline;
}

/* Lists */
.popup-body ul,
.popup-body ol {
    margin-left: 20px;
    margin-bottom: 1em;
    padding-left: 15px;
}

.popup-body ul li,
.popup-body ol li {
    margin-bottom: 0.5em;
}

/* Headers */
.popup-body h1,
.popup-body h2,
.popup-body h3,
.popup-body h4 {
    margin-bottom: 0.5em;
    font-weight: 600;
}

/* Paragraphs */
.popup-body p {
    margin: 0 0 1em 0;
    padding: 0;
    display: block;
}

/* Responsywne style */
@media (max-width: 768px) {
    .popup-content {
        width: 95%;
        max-width: none;
        margin: 10px;
        padding: 15px;
    }

    .popup-content.image-only {
        max-width: 95vw !important;
        margin: 20px !important;
    }

    .popup-body {
        font-size: 16px;
        margin-top: 15px;
    }

    .popup-body img {
        max-width: 100%;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .popup-images img,
    .single-image img {
        max-width: 100%;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .slider-btn {
        font-size: 16px;
        padding: 10px 12px;
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .popup-content {
        width: 98%;
        margin: 5px;
        padding: 10px;
        max-height: 95vh;
    }

    .popup-content.image-only {
        max-width: 98vw !important;
        margin: 10px !important;
        max-height: 95vh !important;
    }

    .popup-body {
        font-size: 14px;
        margin-top: 15px;
    }

    .popup-body img {
        max-width: 100%;
        width: 100%;
        height: auto;
        max-height: 70vh;
        object-fit: contain;
    }

    .popup-images img,
    .single-image img {
        max-width: 100%;
        width: 100%;
        height: auto;
        max-height: 70vh;
        object-fit: contain;
    }

    .popup-footer {
        padding: 12px 15px;
    }

    .popup-ok-button {
        padding: 10px 25px;
        font-size: 13px;
    }

    .slider-btn {
        font-size: 14px;
        padding: 8px 10px;
    }
}

/* Dodatkowe style dla kompatybilności */
.popup-text-content {
    line-height: 1.6;
    color: #333;
}

.popup-text-content h1,
.popup-text-content h2,
.popup-text-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #222;
}

.popup-text-content p {
    margin-bottom: 10px;
}

.popup-text-content a {
    color: #e70046;
    text-decoration: underline;
}

.popup-text-content a:hover {
    color: #c9003c;
    text-decoration: none;
}

/* Style dla przypadku gdy są tylko obrazy bez tekstu */
.popup-images:last-child {
    margin-bottom: 0;
}

.popup-ok-button {
    background: var(--eliq-blue, #007bff);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    font-size: 14px;
}

.popup-ok-button:hover {
    background: var(--eliq-blue-hover, #0056b3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

/* Style dla obrazów w popup */
.popup-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Style dla obrazów z modułu */
.popup-images {
    margin-bottom: 15px;
    text-align: center;
}

.single-image img {
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* Slider dla wielu obrazów */
.image-slider {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.slider-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.slides-wrapper {
    position: relative;
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide {
    display: none;
    text-align: center;
    padding: 0;
    box-sizing: border-box;
}

.slide.active {
    display: block;
}

.slide img {
    border-radius: 8px;
    box-shadow: none; /* Usuwamy podwójny cień */
}

/* Przyciski slidera */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    padding: 12px 15px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.prev-btn {
    left: 15px;
}

.next-btn {
    right: 15px;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Kropki slidera */
.slider-dots {
    text-align: center;
    margin-top: 20px;
}

.dot {
    display: inline-block;
    height: 12px;
    width: 12px;
    margin: 0 6px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dot.active,
.dot:hover {
    background-color: var(--eliq-blue, #007bff);
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

/* Formatowanie tekstu - style dla TinyMCE */
.popup-body p[style*="text-align: center"] {
    text-align: center !important;
}

.popup-body p[style*="text-align: right"] {
    text-align: right !important;
}

.popup-body p[style*="text-align: left"] {
    text-align: left !important;
}

/* Text alignment classes that TinyMCE might add */
.popup-body .text-center,
.popup-body [style*="text-align: center"] {
    text-align: center !important;
}

.popup-body .text-right,
.popup-body [style*="text-align: right"] {
    text-align: right !important;
}

.popup-body .text-left,
.popup-body [style*="text-align: left"] {
    text-align: left !important;
}

/* Bold text */
.popup-body b,
.popup-body strong {
    font-weight: 700;
}

/* Links styling */
.popup-body a {
    color: #e70046;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.popup-body a:hover {
    color: #c9003c;
    text-decoration: none;
}

/* Preserve other common text formatting */
.popup-body em,
.popup-body i {
    font-style: italic;
}

.popup-body u {
    text-decoration: underline;
}

/* Lists */
.popup-body ul,
.popup-body ol {
    margin-left: 20px;
    margin-bottom: 1em;
    padding-left: 15px;
}

.popup-body ul li,
.popup-body ol li {
    margin-bottom: 0.5em;
}

/* Headers */
.popup-body h1,
.popup-body h2,
.popup-body h3,
.popup-body h4 {
    margin-bottom: 0.5em;
    font-weight: 600;
}

/* Paragraphs */
.popup-body p {
    margin: 0 0 1em 0;
    padding: 0;
    display: block;
}

/* Responsywne style */
@media (max-width: 768px) {
    .popup-content {
        max-width: 95vw;
        margin: 20px;
    }

    .popup-content.has-text {
        padding: 15px;
    }

    .popup-body.has-text {
        font-size: 16px;
        margin-top: 15px;
        padding: 15px;
    }

    .popup-body img {
        max-width: 100%;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .popup-images img,
    .single-image img {
        max-width: 100%;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .slider-btn {
        font-size: 16px;
        padding: 10px 12px;
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .popup-content {
        max-width: 98vw;
        margin: 10px;
        max-height: 95vh;
    }

    .popup-content.has-text {
        padding: 10px;
    }

    .popup-body.has-text {
        font-size: 14px;
        margin-top: 15px;
        padding: 10px;
    }

    .popup-body img {
        max-width: 100%;
        width: 100%;
        height: auto;
        max-height: 70vh;
        object-fit: contain;
    }

    .popup-images img,
    .single-image img {
        max-width: 100%;
        width: 100%;
        height: auto;
        max-height: 70vh;
        object-fit: contain;
    }

    .popup-footer.has-text {
        padding: 12px 15px;
    }

    .popup-ok-button {
        padding: 10px 25px;
        font-size: 13px;
    }

    .slider-btn {
        font-size: 14px;
        padding: 8px 10px;
    }
}

/* Dodatkowe style dla kompatybilności */
.popup-text-content {
    line-height: 1.6;
    color: #333;
}

.popup-text-content h1,
.popup-text-content h2,
.popup-text-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #222;
}

.popup-text-content p {
    margin-bottom: 10px;
}

.popup-text-content a {
    color: #e70046;
    text-decoration: underline;
}

.popup-text-content a:hover {
    color: #c9003c;
    text-decoration: none;
}

/* Style dla przypadku gdy są tylko obrazy bez tekstu */
.popup-images:last-child {
    margin-bottom: 0;
}

.popup-ok-button {
    background: var(--eliq-blue);
    color: white;
    border: none;
    padding: 5px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.popup-ok-button:hover {
    background: var(--eliq-blue-hover);
}

/* Style dla obrazów w popup */
.popup-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Formatowanie tekstu - style dla TinyMCE */
.popup-body p[style*="text-align: center"] {
    text-align: center !important;
}

.popup-body p[style*="text-align: right"] {
    text-align: right !important;
}

.popup-body p[style*="text-align: left"] {
    text-align: left !important;
}

/* Text alignment classes that TinyMCE might add */
.popup-body .text-center,
.popup-body [style*="text-align: center"] {
    text-align: center !important;
}

.popup-body .text-right,
.popup-body [style*="text-align: right"] {
    text-align: right !important;
}

.popup-body .text-left,
.popup-body [style*="text-align: left"] {
    text-align: left !important;
}

/* Bold text */
.popup-body b,
.popup-body strong {
    font-weight: 700;
}

/* Links styling */
.popup-body a {
    color: #e70046;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.popup-body a:hover {
    color: #c9003c;
    text-decoration: none;
}

/* Preserve other common text formatting */
.popup-body em,
.popup-body i {
    font-style: italic;
}

.popup-body u {
    text-decoration: underline;
}

/* Lists */
.popup-body ul,
.popup-body ol {
    margin-left: 20px;
    margin-bottom: 1em;
    padding-left: 15px;
}

.popup-body ul li,
.popup-body ol li {
    margin-bottom: 0.5em;
}

/* Headers */
.popup-body h1,
.popup-body h2,
.popup-body h3,
.popup-body h4 {
    margin-bottom: 0.5em;
    font-weight: 600;
}

/* Paragraphs */
.popup-body p {
    margin: 0 0 1em 0;
    padding: 0;
    display: block;
}

/* Style dla obrazów z modułu */
.popup-images {
    margin-bottom: 20px;
    text-align: center;
}

.single-image img {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}
.image-slider {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.slider-container {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.slides-wrapper {
    position: relative;
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide {
    display: none;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
}

.slide.active {
    display: block;
}

.slide img {
    border-radius: 4px;
}

/* Przyciski slidera */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    z-index: 10;
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 0.95);
}

/* Kropki slidera */
.slider-dots {
    text-align: center;
    margin-top: 15px;
}

.dot {
    display: inline-block;
    height: 12px;
    width: 12px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active,
.dot:hover {
    background-color: #007bff;
}

/* Responsywne style */
@media (max-width: 768px) {
    .popup-content {
        width: 95%;
        max-width: none;
        margin: 10px;
        padding: 15px;
    }

    .popup-body {
        font-size: 16px; /* Większy tekst na telefonie */
        margin-top: 15px;
    }

    .popup-body img {
        max-width: 100%;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .popup-images img,
    .single-image img {
        max-width: 100%;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .slider-btn {
        font-size: 16px;
        padding: 8px 10px;
    }

    .prev-btn {
        left: 5px;
    }

    .next-btn {
        right: 5px;
    }
}

@media (max-width: 480px) {
    .popup-content {
        width: 98%;
        margin: 5px;
        padding: 10px;
        max-height: 95vh;
    }

    .popup-body {
        font-size: 14px;
        margin-top: 15px;
    }

    .popup-body img {
        max-width: 100%;
        width: 100%;
        height: auto;
        max-height: 70vh; /* Maksymalnie 70% wysokości ekranu */
        object-fit: contain;
    }

    .popup-images img,
    .single-image img {
        max-width: 100%;
        width: 100%;
        height: auto;
        max-height: 60vh;
        object-fit: contain;
    }

    .popup-footer {
        padding: 12px 15px;
    }

    .popup-ok-button {
        padding: 8px 20px;
        font-size: 13px;
    }

    .slider-btn {
        font-size: 14px;
        padding: 6px 8px;
    }
}

/* Dodatkowe style dla kompatybilności */
.popup-text-content {
    line-height: 1.6;
    color: #333;
}

.popup-text-content h1,
.popup-text-content h2,
.popup-text-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #222;
}

.popup-text-content p {
    margin-bottom: 10px;
}

.popup-text-content a {
    color: #e70046;
    text-decoration: underline;
}

.popup-text-content a:hover {
    color: #c9003c;
    text-decoration: none;
}

/* Style dla przypadku gdy są tylko obrazy bez tekstu */
.popup-images:last-child {
    margin-bottom: 0;
}

@media (min-width: 1024px) {
    .custom-popup .popup-content.image-only {
        max-width: 30vw !important; /* było 95vw */
        max-height: 30vh !important; /* było 90vh */
    }
    .custom-popup .popup-body img,
    .custom-popup .slide img {
        max-width: 30vw !important;
        max-height: 30vh !important;
    }
}

.popup-footer {
    margin-top: 30px !important; /* zwiększa odstęp od treści popupu */
    padding-top: 10px;           /* dodatkowy „luz” wewnątrz footera */
}

.popup-footer.image-only {
    margin-top: 30px !important; /* dla wariantu z samym obrazkiem */
}
