/* Popup Overlay */
.pnbelopa-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--pn-z-modal, 100000);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

.pnbelopa-popup-overlay.show {
    display: flex !important;
}

/* Saat popup aktif: widget floating tetap TERLIHAT tapi turunkan z-index
   ke belakang overlay (overlay z-index = --pn-z-modal: 100000).
   `pointer-events: none` cegah accidental click di widget yg ke-tint.
   `.uwy` UserWay pakai inline z-index sangat tinggi via !important —
   override perlu !important juga (issue.md §2.1 exception 3rd-party). */
body.pnbelopa-popup-open #fab-toggle,
body.pnbelopa-popup-open .back-to-top,
body.pnbelopa-popup-open #sitappa-widget,
body.pnbelopa-popup-open [class*="whatsapp"],
body.pnbelopa-popup-open [class*="accessibility"],
body.pnbelopa-popup-open [id*="whatsapp"],
body.pnbelopa-popup-open [id*="accessibility"] {
    z-index: 1;
    pointer-events: none;
}

body.pnbelopa-popup-open .uwy {
    z-index: 1 !important;
    pointer-events: none;
}

/* Popup Container */
.pnbelopa-popup-container {
    position: relative;
    animation: slideIn 0.3s ease-in-out;
}

/* Popup Content */
.pnbelopa-popup-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 90vw;
    max-height: 90vh;
}

.pnbelopa-popup-image {
    display: block;
    width: 100%;
    height: auto;
}

/* Close Button */
.pnbelopa-popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: #c62828;
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.pnbelopa-popup-close:hover {
    background: #b71c1c;
    transform: rotate(90deg);
}

.pnbelopa-popup-close:focus {
    outline: none;
}

/* Link Styling */
.pnbelopa-popup-content a {
    display: block;
    cursor: pointer;
}

.pnbelopa-popup-content a:hover {
    opacity: 0.95;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .pnbelopa-popup-content {
        max-width: var(--popup-mobile-width, 85vw) !important;
        max-height: 80vh;
    }

    .pnbelopa-popup-close {
        top: -10px;
        right: -10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}
