/* Website popup (resources/views/site/partials/popup.blade.php + popup.js). Loaded only while a popup is live.
   The image is shown whole — never cropped or stretched (object-fit: contain, height from its own shape). */
.site-popup {
    width: min(960px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 0;
    border-radius: var(--radius, 20px);
    background: var(--surface, #fff);
    color: var(--ink, #0E1033);
    box-shadow: 0 30px 80px -20px rgba(14, 16, 51, .55);
    overflow: visible;
}
.site-popup::backdrop { background: rgba(14, 16, 51, .72); }
.site-popup[open] { animation: site-popup-in .22s ease-out; }
@keyframes site-popup-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .site-popup[open] { animation: none; } }

.site-popup-box { position: relative; display: flex; flex-direction: column; max-height: calc(100dvh - 32px); padding: 10px; }
.site-popup-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 120px);
    object-fit: contain;
    border-radius: calc(var(--radius, 20px) - 8px);
    background: #F3F4FA;
}
.site-popup-actions { display: flex; justify-content: center; padding: 12px 6px 4px; }
.site-popup-cta { min-height: 48px; padding-inline: 28px; font-size: 1rem; }

/* Close: always visible over the image corner, 44 px tap target. */
.site-popup-close {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 2;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--ink, #0E1033);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(14, 16, 51, .35);
}
.site-popup-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.site-popup-close:hover { background: var(--indigo, #3D3BC8); }
.site-popup-close:focus-visible { outline: 3px solid #FFC94D; outline-offset: 2px; }

/* The page behind can't scroll while the popup is open. */
html.site-popup-open, html.site-popup-open body { overflow: hidden; }

@media (max-width: 640px) {
    .site-popup { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
    .site-popup-box { padding: 6px; max-height: calc(100dvh - 24px); }
    .site-popup-img { max-height: calc(100dvh - 110px); }
    /* Inside the box on phones so it never sits off-screen. */
    .site-popup-close { top: 10px; right: 10px; width: 40px; height: 40px; }
    .site-popup-cta { width: 100%; justify-content: center; }
}
