.hpp-popup {
    display: none; /* Initially hidden, shown by JavaScript */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.hpp-popup-content {
    display: flex;
    width: 100%; /* Increased width */
    max-width: 1140px; /* Increased max-width for a larger popup */
    height: 520px; /* Increased height for a larger popup */
    border-radius: 0px;
    border-top: 0px;
    border-bottom: 0px solid #fff;
    overflow: hidden;
    position: relative; /* Ensure the close button positions relative to this */
}

.hpp-popup-left {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    overflow: hidden;
}

.hpp-popup-left img,
.hpp-popup-left video,
.hpp-popup-left iframe {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure media fills the space */
    display: block; /* Ensure media displays */
}

.hpp-popup-right {
    flex: 1;
    background: #fff;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative; /* Ensure the close button positions correctly */
}

.hpp-popup-right h2 {
    color: #000;
    font-size: 36px;
    margin-bottom: 20px;
}

.hpp-popup-right p {
    color: #000;
    font-size: 16px;
    margin-bottom: 20px;
}

.hpp-button {
    display: inline-block;
    background: #00005a;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    text-transform: uppercase;
}

.hpp-close {
    position: absolute;
    top: -10px;
    right: 0px;
    font-size: 44px;
    cursor: pointer;
    color: #fff;
    background: #00005a;
    border-radius: 0% 0% 0% 29%;
    width: 75px;
    height: 75px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10; /* Ensure it’s above other elements */
    transition: transform 0.3s ease; /* Smooth transition for the spin */
}

/* Media Query for Mobile Devices (below 768px) */
@media screen and (max-width: 768px) {
    .hpp-popup-content {
        flex-direction: column; /* Stack left (image/video) above right (text/button) */
        width: 95%; /* Slightly narrower for mobile */
        height: auto; /* Allow height to adjust based on content */
        max-height: 90vh; /* Prevent popup from exceeding viewport height */
        overflow-y: auto; /* Allow vertical scrolling if content overflows */
    }

    .hpp-popup-left {
        flex: none; /* Remove flex growth */
        width: 100%; /* Full width on mobile */
        height: 40vh; /* Fixed height for media, adjustable */
        max-height: 300px; /* Prevent media from being too tall */
        order: 1; /* Ensure image/video appears first (above) */
    }

    .hpp-popup-left img,
    .hpp-popup-left video,
    .hpp-popup-left iframe {
        height: 100%; /* Ensure media fits the container */
        object-fit: contain; /* Use contain to avoid cropping on mobile */
    }

    .hpp-popup-right {
        flex: none; /* Remove flex growth */
        width: 100%; /* Full width on mobile */
        padding: 15px; /* Slightly less padding for mobile */
        order: 2; /* Ensure text/button appears below image/video */
    }

    .hpp-popup-right h2 {
        font-size: 24px; /* Smaller heading for mobile (1.5rem equivalent) */
        margin-bottom: 15px;
    }

    .hpp-popup-right p {
        font-size: 14px; /* Smaller text for mobile (0.875rem equivalent) */
        margin-bottom: 15px;
    }

    .hpp-button {
        font-size: 0.8rem; /* Smaller button text for mobile */
        padding: 8px 16px; /* Slightly smaller padding */
    }

    .hpp-close {
        font-size: 30px; /* Smaller close button for mobile */
        width: 50px; /* Smaller close button size */
        height: 50px;
        top: -8px;
        right: 0px;
    }
}

/* Media Query for Very Small Screens (below 480px) */
@media screen and (max-width: 480px) {
    .hpp-popup-content {
        width: 98%; /* Almost full width for very small screens */
    }

    .hpp-popup-left {
        height: 30vh; /* Shorter media height for smaller screens */
        max-height: 200px;
    }

    .hpp-popup-right h2 {
        font-size: 20px; /* Even smaller heading (1.25rem equivalent) */
    }

    .hpp-popup-right p {
        font-size: 12px; /* Even smaller text (0.75rem equivalent) */
    }
}