/* Popup trang chủ NEWS P1 — ảnh theo tỉ lệ gốc, nút X trong khung, footer đè đáy ảnh */
#olaEventPopup.ola-popup-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 16px;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1000000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

#olaEventPopup.ola-popup-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#olaEventPopup .ola-popup-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 450px;
    width: min(92vw, 560px);
    max-height: min(calc(100vh - 32px), 640px);
    max-height: min(calc(100dvh - 32px), 640px);
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

#olaEventPopup.ola-popup-overlay.show .ola-popup-content {
    transform: scale(1);
}

#olaEventPopup .ola-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.95);
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    z-index: 10002;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transition: background 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
}

#olaEventPopup .ola-popup-close:hover {
    background: #dc2626;
    transform: scale(1.08);
}

#olaEventPopup .ola-popup-body {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
}

#olaEventPopup .ola-popup-body img {
    width: 100%;
    height: auto;
    display: block;
}

#olaEventPopup .ola-popup-body img[src*="noimage"] {
    object-fit: contain;
    background: #eef2f7;
    min-height: 220px;
}

#olaEventPopup .ola-popup-body--video {
    background: #000;
    line-height: 0;
    flex-shrink: 0;
    overflow: hidden;
}

#olaEventPopup .ola-popup-video {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    aspect-ratio: 16 / 9;
    height: auto;
    overflow: hidden;
    background: #000;
    border-radius: 0;
    box-sizing: border-box;
}

#olaEventPopup .ola-popup-video.ola-ad-video {
    aspect-ratio: 16 / 9;
    max-height: none;
    border-radius: 0;
}

#olaEventPopup .ola-popup-video .ad-yt-player,
#olaEventPopup .ola-popup-video iframe {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    transform: translate(-50%, -50%) scale(1.72) !important;
    transform-origin: center 38% !important;
    display: block !important;
    pointer-events: none !important;
    box-sizing: border-box;
}

#olaEventPopup .ola-popup-video.ola-ad-video--mp4 .ola-ad-video__mp4 {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    object-fit: cover !important;
    pointer-events: none !important;
    display: block !important;
}

#olaEventPopup .ola-popup-video .ola-ad-video__toolbar {
    bottom: 52px;
    left: 10px;
    right: 10px;
    z-index: 50;
}

#olaEventPopup.ola-popup-dismissed {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

#olaEventPopup .ola-popup-video .sound-toggle-btn,
#olaEventPopup .ola-popup-video .ad-expand-btn {
    position: static;
    pointer-events: auto;
}

#olaEventPopup .ola-popup-body--video + .ola-popup-footer,
#olaEventPopup .ola-popup-body--video ~ .ola-popup-footer {
    border-top: none;
}

#olaEventPopup .ola-popup-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 12px 16px 14px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #0f172a;
    border: none;
    border-top: 0;
    border-radius: 0 0 12px 12px;
    box-sizing: border-box;
    background: transparent;
}

#olaEventPopup .ola-popup-footer input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #0f172a;
}

#olaEventPopup .ola-popup-footer label,
#olaEventPopup .ola-popup-footer .ola-popup-hide,
#olaEventPopup .ola-popup-footer span {
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgb(97 55 55);
}

@media (max-width: 768px) {
    #olaEventPopup .ola-popup-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 15px;
    }

    #olaEventPopup .ola-popup-content {
        width: min(94vw, 560px);
        max-height: min(calc(100vh - 24px), 640px);
        max-height: min(calc(100dvh - 24px), 640px);
    }

    #olaEventPopup .ola-popup-video .ola-ad-video__toolbar {
        bottom: 50px;
        left: 8px;
        right: 8px;
        gap: 6px;
    }

    #olaEventPopup .ola-popup-video .ad-expand-btn__label,
    #olaEventPopup .ola-popup-video .sound-toggle-btn__label {
        display: none;
    }
}
