/* Site Popup — modern promo modal */

.site-popup-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10100;
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top, 0px))
             max(16px, env(safe-area-inset-right, 0px))
             max(20px, env(safe-area-inset-bottom, 0px))
             max(16px, env(safe-area-inset-left, 0px));
    background: rgba(8, 10, 18, 0.58);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    opacity: 0;
    transition: opacity 320ms ease;
}

.site-popup-backdrop.site-popup-active {
    display: flex;
    opacity: 1;
}

.site-popup-backdrop.site-popup-closing {
    opacity: 0;
    pointer-events: none;
}

.site-popup-backdrop.site-popup-closing .site-popup-shell {
    transform: translateY(18px) scale(0.97);
    opacity: 0;
}

body.site-popup-locked {
    overflow: hidden;
}

.site-popup-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    width: 100%;
    max-width: min(92vw, 440px);
    max-height: min(92vh, 760px);
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1),
                opacity 320ms ease;
}

.site-popup-shell--wide {
    max-width: min(92vw, 560px);
}

.site-popup-backdrop.site-popup-active .site-popup-shell {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.site-popup-panel {
    position: relative;
    width: 100%;
    max-height: min(90vh, 720px);
    outline: none;
    overflow: visible;
}

/* Card shell */

.site-popup-card {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: min(90vh, 720px);
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 28px 70px rgba(0, 0, 0, 0.28),
        0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Close — sits above the card, on the backdrop */

.site-popup-close {
    position: relative;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    margin: 0 -35px -20px 0;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    background: transparent;
    color: #fff;
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.site-popup-close__inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.site-popup-close__icon {
    width: 0.875rem;
    height: 0.875rem;
    display: block;
    transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.site-popup-close:hover .site-popup-close__inner {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
    transform: scale(1.06);
}

.site-popup-close:hover .site-popup-close__icon {
    transform: rotate(90deg);
}

.site-popup-close:active .site-popup-close__inner {
    transform: scale(0.94);
}

.site-popup-close:focus-visible .site-popup-close__inner {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.site-popup-cta:focus-visible,
.site-popup-skip:focus-visible {
    outline: 2px solid var(--primary-color, #dd3327);
    outline-offset: 2px;
}

/* Image hero */

.site-popup-hero {
    position: relative;
    flex-shrink: 0;
    background: #f4f5f7;
}

.site-popup-hero__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    overflow: hidden;
}

.site-popup-hero__media--link {
    cursor: pointer;
    text-decoration: none;
}

.site-popup-hero__media--link:hover .site-popup-image {
    transform: scale(1.01);
}

.site-popup-hero__scrim {
    position: absolute;
    inset: auto 0 0 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent);
    pointer-events: none;
}

.site-popup-panel--hybrid .site-popup-hero__scrim {
    display: none;
}

.site-popup-image-shimmer {
    position: absolute;
    inset: 0;
    min-height: 180px;
    background: linear-gradient(110deg, #e5e7eb 8%, #f3f4f6 18%, #e5e7eb 33%);
    background-size: 200% 100%;
    animation: site-popup-shimmer 1.4s ease-in-out infinite;
}

.site-popup-image-shimmer.site-popup-hidden {
    display: none;
}

.site-popup-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(52vh, 520px);
    object-fit: contain;
    object-position: center;
    opacity: 0;
    transition: opacity 360ms ease, transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.site-popup-image.site-popup-loaded {
    opacity: 1;
}

/* Body */

.site-popup-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.35rem 1.5rem 1.5rem;
    overflow-y: auto;
    animation: site-popup-body-in 420ms cubic-bezier(0.16, 1, 0.3, 1) 60ms both;
}

.site-popup-panel--hybrid .site-popup-body {
    padding-top: 1.15rem;
}

.site-popup-panel--text .site-popup-body {
    padding-top: 1.35rem;
}

.site-popup-title {
    margin: 0;
    font-size: clamp(1.25rem, 2.8vw, 1.5rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.025em;
    color: #111827;
}

.site-popup-content {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #4b5563;
}

.site-popup-content p {
    margin: 0 0 0.75em;
}

.site-popup-content p:last-child {
    margin-bottom: 0;
}

.site-popup-content ul,
.site-popup-content ol {
    margin: 0 0 0.75em;
    padding-left: 1.2em;
}

.site-popup-content li + li {
    margin-top: 0.3em;
}

.site-popup-content a {
    color: var(--primary-color, #dd3327);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-popup-content strong {
    color: #111827;
    font-weight: 700;
}

.site-popup-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Footer / CTA */

.site-popup-footer {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.65rem;
    margin-top: 0.35rem;
    padding-top: 0.85rem;
    border-top: 1px solid #f0f1f4;
}

.site-popup-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    padding: 0.8rem 1.25rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color, #dd3327) 0%, #e84a3a 100%);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(221, 51, 39, 0.28);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.site-popup-footer--single .site-popup-cta {
    flex: 1 1 100%;
    width: 100%;
}

.site-popup-cta:hover {
    color: #fff;
    filter: brightness(1.04);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(221, 51, 39, 0.34);
}

.site-popup-cta:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(221, 51, 39, 0.24);
}

.site-popup-cta__arrow {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    transition: transform 160ms ease;
}

.site-popup-cta:hover .site-popup-cta__arrow {
    transform: translateX(3px);
}

.site-popup-skip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0.8rem 1.1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.site-popup-skip:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

.site-popup-skip:active {
    transform: scale(0.98);
}

/* Preview banner */

.site-popup-preview-banner {
    position: fixed;
    top: max(12px, env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 10110;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.88);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(8px);
}

.site-popup-preview-banner__dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
    animation: site-popup-pulse 1.6s ease-in-out infinite;
}

@keyframes site-popup-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes site-popup-body-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes site-popup-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
    .site-popup-backdrop,
    .site-popup-shell,
    .site-popup-close,
    .site-popup-close__inner,
    .site-popup-close__icon,
    .site-popup-image,
    .site-popup-hero__media--link,
    .site-popup-body,
    .site-popup-cta__arrow {
        transition: none;
        animation: none;
    }

    .site-popup-backdrop.site-popup-active .site-popup-shell {
        transform: none;
    }

    .site-popup-preview-banner__dot {
        animation: none;
    }
}

@media (max-width: 576px) {
    .site-popup-backdrop {
        align-items: flex-end;
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }

    .site-popup-shell {
        max-width: 100%;
        transform: translateY(100%);
    }

    .site-popup-backdrop.site-popup-active .site-popup-shell {
        transform: translateY(0);
    }

    .site-popup-backdrop.site-popup-closing .site-popup-shell {
        transform: translateY(100%);
    }

    .site-popup-card {
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }

    .site-popup-hero__media {
        min-height: 0;
    }

    .site-popup-image {
        max-height: min(44vh, 380px);
    }

    .site-popup-image-shimmer {
        min-height: 140px;
    }

    .site-popup-body {
        padding: 1.15rem 1.15rem 1.25rem;
    }

    .site-popup-panel--text .site-popup-body {
        padding-top: 1.15rem;
    }
}
