/* Popup: A Secret End-Year Gift (template-parts/popup-end-year.php) */
.dey-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear .4s;
}
.dey-popup.is-open {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}
html.dey-lock,
html.dey-lock body {
    overflow: hidden;
}

/* Nền đen mờ phía sau */
.dey-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    opacity: 0;
    transition: opacity .35s ease;
}
.dey-popup.is-open .dey-overlay {
    opacity: 1;
}

/* Khung popup + hiệu ứng xuất hiện */
.dey-box {
    position: relative;
    width: min(652px, 100%); /* ảnh 650px + viền 1px mỗi bên */
    opacity: 0;
    transform: translateY(30px) scale(.88);
    transition: opacity .3s ease, transform .3s ease;
}
.dey-popup.is-open .dey-box {
    opacity: 1;
    transform: none;
    transition: opacity .45s ease .1s, transform .55s cubic-bezier(.2, 1.35, .4, 1) .1s;
}
.dey-link {
    display: block;
    border: 1px solid #30beb4; /* viền xanh ngọc mỏng */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 18px rgba(48, 190, 180, .35), 0 20px 60px rgba(0, 0, 0, .5);
}
.dey-link img {
    display: block;
    width: 100%;
    height: auto;
}

/* Nút X góc phải */
.dey-close {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 2;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #0f2a26;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
    transition: transform .2s ease, background .2s ease;
}
/* Dấu X vẽ bằng 2 đường chéo, luôn nằm chính giữa nút */
.dey-close::before,
.dey-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 45%;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    transform: translate(-50%, -50%) rotate(45deg);
}
.dey-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}
.dey-close:hover,
.dey-close:focus-visible {
    background: #f5a800;
    transform: rotate(90deg);
    outline: none;
}

@media (max-width: 767px) {
    .dey-box {
        width: min(322px, 100%); /* ảnh 320px + viền 1px mỗi bên */
    }
    .dey-close {
        top: -12px;
        right: -12px;
        width: 32px;
        height: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dey-box,
    .dey-popup.is-open .dey-box {
        transform: none;
        transition: opacity .2s ease;
    }
}
