/* Popup Wrapper & Overlay */
.ipp-popup-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ipp-popup-wrapper.is-visible {
    opacity: 1;
    visibility: visible;
}

.ipp-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

/* Popup Content Box - NOW ADAPTIVE */
.ipp-popup-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    max-width: 90%; /* For smaller screens */
    width: auto; /* Let content define width */
    max-height: 90vh; /* For smaller screens */
    padding: 15px; /* Reduced padding */
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: inline-flex; /* CHANGE: More reliable shrink-wrapping */
    flex-direction: column;
}

.ipp-popup-wrapper.is-visible .ipp-popup-content {
    transform: scale(1);
}

/* Close Button - REPOSITIONED AND RESTYLED */
.ipp-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(30, 30, 30, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
    transition: background-color 0.2s ease;
}
.ipp-popup-close:hover {
    background: rgba(0, 0, 0, 0.8);
}


/* Slider Container */
.ipp-slider-container {
    position: relative;
    overflow: hidden;
}

.ipp-slider-image-wrapper {
    text-align: center;
}

.ipp-slider-image-wrapper img {
    max-width: 100%;
    max-height: 80vh; /* Allow taller images */
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* Slider Navigation */
.ipp-slider-prev,
.ipp-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ipp-slider-prev:hover,
.ipp-slider-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.ipp-slider-prev {
    left: 10px;
}

.ipp-slider-next {
    right: 10px;
}

/* Slider Counter */
.ipp-slider-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

/* Call-to-Action Button */
.ipp-button-container {
    text-align: center;
    margin-top: 20px;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.ipp-popup-button {
    display: inline-block;
    background-color: #0073aa; /* WordPress blue */
    color: #fff;
    padding: 10px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.ipp-popup-button:hover {
    background-color: #005a87;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .ipp-popup-content {
        padding: 10px;
    }
    
    .ipp-popup-close {
        width: 25px;
        height: 25px;
        font-size: 18px;
        line-height: 25px;
        top: 5px;
        right: 5px;
    }

    .ipp-slider-prev,
    .ipp-slider-next {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

