/* =============================================================
   promo-popup.css
   Premium Interactive Popup — Dark Frame Design
   Bottom-Right Corner, Fully Responsive
   ============================================================= */

/* ── Reset scoped to popup elements only ───────────────────── */
#pp-root,
#pp-root *,
#pp-root *::before,
#pp-root *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
    /* Dark frame gradient */
    --pp-frame-gradient: linear-gradient(145deg, #2c3e6b 0%, #1a2540 40%, #0d1525 100%);
    --pp-frame-border: linear-gradient(145deg, #4a6fa5 0%, #2c3e6b 50%, #1a2540 100%);

    /* Button colors */
    --pp-btn-dark: #2a2a2a;
    --pp-btn-dark-hover: #3a3a3a;
    --pp-btn-text: #ffffff;

    /* Surfaces */
    --pp-surface: #ffffff;
    --pp-surface-alt: #f8f9fb;
    --pp-border: rgba(255,255,255,0.15);

    /* Text */
    --pp-ink: #ffffff;
    --pp-ink-secondary: rgba(255,255,255,0.75);
    --pp-title-shadow: 0 1px 4px rgba(0,0,0,0.4);

    /* Shape */
    --pp-radius-outer: 20px;
    --pp-radius-inner: 12px;
    --pp-radius-btn: 10px;

    /* Shadows */
    --pp-shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45), 0 8px 20px rgba(0, 0, 0, 0.3);

    /* Animation */
    --pp-transition: 0.32s cubic-bezier(0.34, 1.45, 0.64, 1);
    --pp-transition-fast: 0.18s ease-out;

    /* Typography */
    --pp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── Root — fixed bottom-right container ────────────────────── */
#pp-root {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 20px;
    font-family: var(--pp-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.26s ease, visibility 0.26s ease;
}

#pp-root.pp-show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ── Outer dark frame wrapper ───────────────────────────────── */
.pp-frame {
    position: relative;
    background: var(--pp-frame-gradient);
    border-radius: var(--pp-radius-outer);
    padding: 10px;
    box-shadow: var(--pp-shadow-lg),
                inset 0 1px 0 rgba(255,255,255,0.1),
                0 0 0 1px rgba(255,255,255,0.06);
    width: 100%;
    max-width: 420px;

    /* Subtle border shimmer */
    border: 1px solid rgba(74, 111, 165, 0.5);

    transform: translateX(28px) translateY(28px) scale(0.88);
    opacity: 0;
    transition: transform var(--pp-transition), opacity var(--pp-transition);
}

#pp-root.pp-show .pp-frame {
    transform: translateX(0) translateY(0) scale(1);
    opacity: 1;
}

/* ── Modal card — inner white area ──────────────────────────── */
.pp-modal {
    position: relative;
    background: var(--pp-surface);
    border-radius: calc(var(--pp-radius-outer) - 6px);
    overflow: hidden;
    width: 100%;
}

/* ── Header — title above image ─────────────────────────────── */
.pp-header {
    padding: 14px 18px 12px;
    background: transparent;
    /* Title sits on the dark frame, not inside white card */
    position: relative;
    /* Move title outside of pp-modal onto the frame */
}

/* Title rendered on dark background frame */
.pp-title-wrap {
    padding: 0 4px 10px;
    text-align: center;
}

.pp-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--pp-ink);
    letter-spacing: -0.2px;
    line-height: 1.3;
    word-wrap: break-word;
    text-shadow: var(--pp-title-shadow);
}

/* ── Image area ──────────────────────────────────────────────── */
.pp-image-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #d0d0d8 0%, #b8b8c4 100%);
    overflow: hidden;
    position: relative;
}

.pp-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--pp-transition-fast);
}

.pp-frame:hover .pp-image {
    transform: scale(1.04);
}

/* ── Footer — two dark buttons + close ─────────────────────── */
.pp-footer {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
    background: transparent;
}

/* Primary CTA button */
.pp-btn-cta {
    flex: 1;
    padding: 13px 12px;
    border-radius: 0;
    border: none;
    border-right: 1px solid rgba(255,255,255,0.12);
    background: var(--pp-btn-dark);
    color: var(--pp-btn-text);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
    transition: background var(--pp-transition-fast);
    white-space: nowrap;
    text-align: center;
    font-family: var(--pp-font);
}

.pp-btn-cta:first-child {
    border-radius: 0 0 0 calc(var(--pp-radius-outer) - 6px);
}

.pp-btn-cta:hover:not(:disabled) {
    background: var(--pp-btn-dark-hover);
}

.pp-btn-cta:active:not(:disabled) {
    background: #222;
}

.pp-btn-cta:focus-visible {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: -2px;
}

/* Secondary CTA button */
.pp-btn-cta2 {
    flex: 1;
    padding: 13px 12px;
    border-radius: 0;
    border: none;
    background: #3a3a3a;
    color: var(--pp-btn-text);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
    transition: background var(--pp-transition-fast);
    white-space: nowrap;
    text-align: center;
    font-family: var(--pp-font);
}

.pp-btn-cta2:hover:not(:disabled) {
    background: #4a4a4a;
}

.pp-btn-cta2:active:not(:disabled) {
    background: #2a2a2a;
}

.pp-btn-cta2:focus-visible {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: -2px;
}

/* Close button — small, in footer right */
.pp-btn-close {
    flex: 0 0 auto;
    width: 42px;
    height: auto;
    align-self: stretch;
    border-radius: 0 0 calc(var(--pp-radius-outer) - 6px) 0;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.12);
    background: #2a2a2a;
    color: rgba(255,255,255,0.6);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--pp-transition-fast);
    font-weight: 300;
}

.pp-btn-close:hover:not(:disabled) {
    background: #3a3a3a;
    color: #fff;
}

.pp-btn-close:active:not(:disabled) {
    background: #222;
}

.pp-btn-close:focus-visible {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: -2px;
}

/* Disabled state during lock */
.pp-ui-locked .pp-btn-cta,
.pp-ui-locked .pp-btn-cta2,
.pp-ui-locked .pp-btn-close {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    #pp-root,
    #pp-root.pp-show .pp-frame {
        transition: none !important;
    }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (min-width: 641px) {
    #pp-root {
        padding: 24px;
    }

    .pp-frame {
        max-width: 440px;
    }

    .pp-title {
        font-size: 1.2rem;
    }

    .pp-btn-cta,
    .pp-btn-cta2 {
        font-size: 0.9rem;
        padding: 14px 14px;
    }
}

@media (max-height: 640px) {
    #pp-root {
        padding: 12px;
    }

    .pp-frame {
        max-width: 360px;
        padding: 8px;
    }

    .pp-title {
        font-size: 1rem;
    }

    .pp-image-wrap {
        aspect-ratio: 16 / 8;
    }

    .pp-btn-cta,
    .pp-btn-cta2 {
        padding: 10px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 479px) {
    #pp-root {
        padding: 10px;
        align-items: center;
        justify-content: center;
        bottom: 0;
        right: 0;
        left: 0;
        top: auto;
    }

    .pp-frame {
        max-width: calc(100vw - 20px);
        padding: 8px;
    }

    .pp-title {
        font-size: 1rem;
    }

    .pp-image-wrap {
        aspect-ratio: 16 / 9;
    }

    .pp-btn-cta,
    .pp-btn-cta2 {
        padding: 11px 8px;
        font-size: 0.8rem;
    }
}

@media (max-width: 359px) {
    .pp-btn-close {
        display: none;
    }

    .pp-btn-cta,
    .pp-btn-cta2 {
        font-size: 0.75rem;
        padding: 10px 6px;
    }
}