.hpip-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .78);
    box-sizing: border-box;
    /* Trạng thái ẩn (cũng là hiệu ứng khi đóng: mờ dần nhanh) */
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s linear .3s;
}
.hpip-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    /* Hiệu ứng khi mở: nền mờ hiện ra từ từ */
    transition: opacity .5s ease, visibility 0s linear 0s;
}
.hpip-dialog {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 96vw;
    max-height: 92vh;
    opacity: 0;
    transform: translateY(24px) scale(.94);
    transition: opacity .3s ease, transform .3s ease;
    will-change: opacity, transform;
}
.hpip-overlay.is-visible .hpip-dialog {
    opacity: 1;
    transform: none;
    /* Hiệu ứng khi mở: ảnh trượt nhẹ lên + phóng to dần, chậm lại ở cuối */
    transition: opacity .55s ease .08s, transform .7s cubic-bezier(.16, 1, .3, 1) .08s;
}
.hpip-dialog__link {
    display: block;
    line-height: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.hpip-dialog__image {
    display: block;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}
.hpip-close {
    position: absolute;
    top: -15px;
    right: -15px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font: 28px / 30px Arial, sans-serif;
    text-align: center;
    cursor: pointer;
    display: inline-block;
}
.hpip-close::after {
    content: 'x';
}
body.hpip-no-scroll { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .hpip-overlay,
    .hpip-overlay.is-visible,
    .hpip-dialog,
    .hpip-overlay.is-visible .hpip-dialog {
        transition-duration: .01s;
        transition-delay: 0s;
    }
    .hpip-dialog { transform: none; }
}
