/* WordPress Popup Styles */
.wp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.wp-popup-overlay.show {
    opacity: 1;
}

.wp-popup-container {
    border-radius: 0 !important;
    box-shadow: none !important;
    width: auto;
    height: auto;
    max-height: 90vh;
    max-width: 90vw;
    overflow: visible;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    transition: transform 0.3s ease-in-out;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.wp-popup-overlay.show .wp-popup-container {
    transform: translate(-50%, -50%) scale(1);
}

.wp-popup-header {
    display: block;
    padding: 0;
    border: none;
    margin-bottom: 15px;
    width: 100%;
    text-align: center;
    background: inherit;
}

.wp-popup-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: inherit;
    text-align: center;
}

/* Wyraźny przycisk X */
.wp-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    color: #333;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    opacity: 0.8;
    text-decoration: none;
    box-shadow: none;
    outline: none;
    padding: 0;
}

.wp-popup-x-icon {
    font-size: 25px;
    line-height: 0.6;
    display: block;
    font-weight: 300;
}

.wp-popup-close:hover {
    color: #333;
    opacity: 0.8;
    background: none !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.wp-popup-close:hover {
    color: #000;
    opacity: 1;
    background: none !important;
}

.wp-popup-content {
    padding: 0 !important;
    line-height: 1.6;
    color: inherit;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: inherit;
}

.wp-popup-image {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.wp-popup-text {
    margin-bottom: 15px;
    padding: 0;
    width: 100%;
    background: inherit;
}

.wp-popup-content img {
    display: block;
    margin: 0 auto;
    max-width: 90vw;
    max-height: 90vh;
    height: auto;
    width: auto;
    box-shadow: none;
    border: none;
    background: none;
}

.wp-popup-content p {
    margin: 0 0 15px 0;
}

.wp-popup-content p:last-child {
    margin-bottom: 0;
}

/* Ukryte elementy */
.wp-popup-footer, 
.wp-popup-btn, 
.wp-popup-btn-primary, 
.wp-popup-btn:hover, 
.wp-popup-btn-primary:hover {
    display: none !important;
}

.wp-popup-btn:hover {
    display: none !important;
}

.wp-popup-btn-primary {
    display: none !important;
}

.wp-popup-btn-primary:hover {
    display: none !important;
}

/* Animacje wejścia */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.wp-popup-overlay.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

/* Responsywność */
@media (max-width: 768px) {
    .wp-popup-container {
        max-width: 95%;
        margin: 20px;
    }
    
    .wp-popup-title {
        font-size: 20px;
    }
    
    .wp-popup-header {
        padding: 15px 15px 0;
        margin-bottom: 15px;
    }
    
    .wp-popup-content {
        padding: 0 15px 15px;
    }
    
    .wp-popup-footer {
        padding: 0 15px 15px;
    }
}

@media (max-width: 480px) {
    .wp-popup-container {
        max-width: 100%;
        margin: 10px;
        border-radius: 4px;
    }
    
    .wp-popup-title {
        font-size: 18px;
    }
    
    .wp-popup-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}
