/* Frontend styles are deliberately prefixed to avoid theme CSS collisions. */
.aph-popup-backdrop[hidden] { display: none !important; }
.aph-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: rgba(12, 16, 23, .82);
    box-sizing: border-box;
    overflow: auto;
    animation: aph-popup-appear .18s ease-out both;
}
.aph-popup-backdrop *, .aph-popup-backdrop *::before, .aph-popup-backdrop *::after { box-sizing: border-box; }
.aph-popup-dialog {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    max-width: min(1000px, 100%);
    max-height: calc(100dvh - 48px);
    margin: auto;
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: 0 18px 65px rgba(0, 0, 0, .36);
}
.aph-popup-image {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    max-width: min(1000px, calc(100vw - 48px)) !important;
    max-height: calc(100dvh - 48px) !important;
    object-fit: contain !important;
    border-radius: 5px;
    border: none;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
}
.aph-popup-link { display: block; line-height: 0; background: transparent; border: none; }
.aph-popup-link:focus-visible { outline: 3px solid #fff; outline-offset: 5px; }
.aph-popup-close {
    appearance: none;
    -webkit-appearance: none;
    position: absolute !important;
    z-index: 2;
    top: -16px !important;
    right: -16px !important;
    display: grid !important;
    place-items: center;
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    min-width: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    color: #161616 !important;
    border: 2px solid #181818 !important;
    border-radius: 50% !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .35) !important;
    font-family: Arial, sans-serif !important;
    font-size: 28px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    text-decoration: none !important;
}
.aph-popup-close span { line-height: 1 !important; transform: translateY(-1px); }
.aph-popup-close:hover, .aph-popup-close:focus-visible { background: #f0f0f0 !important; }
.aph-popup-close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@keyframes aph-popup-appear { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 767px) {
    .aph-popup-backdrop { padding: 18px; }
    .aph-popup-dialog { max-width: 100%; max-height: calc(100dvh - 36px); }
    .aph-popup-image {
        max-width: calc(100vw - 36px) !important;
        max-height: calc(100dvh - 36px) !important;
    }
    .aph-popup-close { top: -11px !important; right: -11px !important; width: 38px !important; height: 38px !important; }
}
@media (prefers-reduced-motion: reduce) { .aph-popup-backdrop { animation: none; } }
