/* ── App Download Popup ── */
#adp-popup.adp-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: hsla(0, 0%, 0%, 0.6);
    display: flex;              /* ✅ bỏ !important */
    align-items: center;
    justify-content: center;
    animation: adpFadeIn 0.3s ease;
    backdrop-filter: blur(2px);
}

#adp-popup.adp-overlay.adp-hidden {
    display: none !important;   /* ✅ giữ !important để thắng display:flex */
}

@keyframes adpFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes adpSlideUp {
    from { transform: translateY(30px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.adp-container {
    position: relative;
    display: flex;
    align-items: flex-end;
    animation: adpSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 95vw;
}

.adp-close {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 10;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.25s;
    line-height: 1;
}
.adp-close:hover {
    background: rgba(0,0,0,0.8);
    color: #ff4d4d;
    transform: rotate(90deg) scale(1.15);
}

.adp-frame {
    height: 402px;
    width: auto;
    display: block;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.adp-frame-fallback {
    height: 402px;
    width: 300px;
    background: linear-gradient(145deg, #ff8c00, #ff5500);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(255,85,0,0.45);
}

.adp-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px 14px;
    text-align: center;
}

.adp-title {
    margin: 0;
    font-size: 11.5px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #232c2b;
    line-height: 1.3;
}

.adp-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    display: block;
}

.adp-body {
    margin: 0;
    font-size: 11px;
    color: #232c2b;
    line-height: 1.5;
}

.adp-download-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.adp-qr {
    height: 80px;
    width: 80px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.adp-badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.adp-badge {
    display: flex;
    align-items: center;
}

.w-28 {
    width: 7rem;
}

/* ── Show Download Button ── */
#showDownloadPopup {
    position: fixed;
    bottom: 9rem;
    right: 1rem;
    z-index: 97;
    overflow: visible;
    cursor: pointer;
}

#showDownloadPopup img {
    width: 130px;
    height: 100%;
    object-fit: cover;
    display: block;
    animation: downloadPopupZoomRotate 2.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,.1));
    transform-origin: center center;
}

#showDownloadPopup:hover img {
    transform: scale(1.1);
}

#closeShowPopup {
    position: absolute;
    top: -4px;
    right: -4px;
    z-index: 10;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
}

#closeShowPopup:hover {
    background: rgba(0,0,0,0.9);
    transform: rotate(90deg) scale(1.15);
}

@keyframes downloadPopupZoomRotate {
    0%   { filter: drop-shadow(0 4px 6px rgba(0,0,0,.1));        transform: scale(.9)  rotate(0deg);  }
    12%  { filter: drop-shadow(0 12px 20px rgba(255,215,0,.3));  transform: scale(1.15) rotate(0deg);  }
    18%  { filter: drop-shadow(0 12px 20px rgba(255,105,180,.4));transform: scale(1.15) rotate(-6deg); }
    24%  { filter: drop-shadow(0 12px 20px rgba(135,206,250,.4));transform: scale(1.15) rotate(6deg);  }
    30%  { filter: drop-shadow(0 14px 24px rgba(255,215,0,.5));  transform: scale(1.15) rotate(-7deg); }
    36%  { filter: drop-shadow(0 14px 24px rgba(255,105,180,.5));transform: scale(1.15) rotate(7deg);  }
    42%  { filter: drop-shadow(0 12px 20px rgba(135,206,250,.4));transform: scale(1.15) rotate(-5deg); }
    48%  { filter: drop-shadow(0 12px 20px rgba(255,215,0,.4));  transform: scale(1.15) rotate(5deg);  }
    55%  { filter: drop-shadow(0 12px 20px rgba(255,215,0,.3));  transform: scale(1.15) rotate(0deg);  }
    65%  { filter: drop-shadow(0 4px 6px rgba(0,0,0,.1));        transform: scale(.9)  rotate(0deg);  }
    100% { filter: drop-shadow(0 4px 6px rgba(0,0,0,.1));        transform: scale(.9)  rotate(0deg);  }
}

@media (min-width: 1024px) {
    #showDownloadPopup {
        bottom: 10rem;
        right: 2rem;
        background: transparent;
    }
    #showDownloadPopup img {
        width: 200px;
    }
    #closeShowPopup {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 400px) {
    .adp-frame   { height: 340px; }
    .adp-content { height: 195px; padding: 6px 10px 10px; }
    .adp-qr      { height: 62px; width: 62px; }
    .adp-badge   { width: 108px; }
}