/* =========================
   Bonus Popup (Premium)
   ========================= */

/* Make sizing predictable inside the popup (prevents button sticking out) */
.bonus-popup-container,
.bonus-popup-container * {
    box-sizing: border-box;
}

.bonus-popup-container {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;

    background: rgba(0, 0, 0, 0.72);
    z-index: 999999;

    /* Center popup */
    display: grid;
    place-items: center;

    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity 180ms ease, visibility 180ms ease;
}

.bonus-popup-container.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.bonus-popup-container .bonus-popup {
    position: relative;
    width: min(90vw, 340px); /* keep same width, not wider */
    border-radius: 16px;

    /* Premium surface */
    background: linear-gradient(180deg, #171717 0%, #0b0b0b 100%);

    /* Depth + crisp edge */
    box-shadow:
        0 18px 60px rgba(0, 0, 0, 0.65),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);

    padding: 14px 16px 16px;
    text-align: center;

    /* Prevent any child (button/icon) from visually overflowing */
    overflow: hidden;

    transform: translateY(6px) scale(0.985);
    transition: transform 200ms ease;
}

.bonus-popup-container.is-visible .bonus-popup {
    transform: translateY(0) scale(1);
}

/* Close button (integrated) */
.bonus-popup-container .bonus-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;

    width: 40px;
    height: 40px;
    border-radius: 999px;

    border: 0;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition: background 160ms ease, transform 160ms ease;
}

.bonus-popup-container .bonus-popup-close svg {
    fill: rgba(255, 255, 255, 0.85);
}

.bonus-popup-container .bonus-popup-close:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: scale(1.03);
}

.bonus-popup-container .bonus-popup-close:active {
    transform: scale(0.98);
}

/* Logo area (stable block) */
.bonus-popup-container .bonus-popup-logo-wrap {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px 0 10px;
}

.bonus-popup-container .bonus-popup-logo {
    max-height: 72px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Offer text */
.bonus-popup-container .bonus-popup-text {
    margin: 0 0 14px 0;

    font-family: Roboto, sans-serif;
    font-weight: 800;
    font-size: clamp(18px, 4.2vw, 22px);
    line-height: 1.18;
    letter-spacing: -0.01em;

    color: rgba(255, 255, 255, 0.92);

    word-break: break-word;
    -webkit-font-smoothing: antialiased;
}

/* Button (fixed centering + no overflow) */
.bonus-popup-container .bonus-popup-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100%;
    max-width: 100%;          /* important */
    min-height: 46px;

    padding: 12px 12px;
    margin: 0 auto;           /* in case theme styles fight width */
    border-radius: 12px;

    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    box-shadow:
        0 10px 22px rgba(0, 0, 0, 0.35),
        inset 0 0 0 1px rgba(255, 255, 255, 0.10);

    font-family: Roboto, sans-serif;
    font-weight: 900;
    font-size: clamp(16px, 4.6vw, 20px);
    line-height: 1;

    color: #fff !important;
    text-decoration: none !important;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.bonus-popup-container .bonus-popup-button i {
    font-size: 16px;
    line-height: 1;
    opacity: 0.95;
    flex: 0 0 auto;
}

.bonus-popup-container .bonus-popup-button .bp-btn-label {
    min-width: 0;             /* allows ellipsis to work in flex */
    overflow: hidden;
    text-overflow: ellipsis;
}

.bonus-popup-container .bonus-popup-button:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.42),
        inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.bonus-popup-container .bonus-popup-button:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

/* Terms (more dim) */
.bonus-popup-container .bonus-popup-terms {
    margin: 10px 0 0 0;

    font-family: Roboto, sans-serif;
    font-size: 12px;
    line-height: 1.35;

    color: rgba(255, 255, 255, 0.42); /* dimmer than before */
    -webkit-font-smoothing: antialiased;
}

/* =========================
   Mobile optimization
   ========================= */
@media only screen and (max-width: 600px) {

    /* Slightly different “mobile feel”: tighter card, bigger tap, better spacing */
    .bonus-popup-container {
        background: rgba(0, 0, 0, 0.78);
        padding: 14px; /* breathing room from screen edges */
    }

    .bonus-popup-container .bonus-popup {
        width: min(92vw, 340px); /* still not wider */
        padding: 16px 14px 16px;
        border-radius: 18px;
        transform: translateY(10px) scale(0.99);
    }

    .bonus-popup-container.is-visible .bonus-popup {
        transform: translateY(0) scale(1);
    }

    .bonus-popup-container .bonus-popup-close {
        width: 44px;   /* better thumb target */
        height: 44px;
        top: 8px;
        right: 8px;
    }

    .bonus-popup-container .bonus-popup-logo-wrap {
        height: 64px;
        margin: 10px 0 12px;
    }

    .bonus-popup-container .bonus-popup-logo {
        max-height: 64px;
    }

    /* Mobile: slightly larger, more readable offer text (not just “smaller desktop”) */
    .bonus-popup-container .bonus-popup-text {
        font-size: clamp(18px, 5.2vw, 22px);
        line-height: 1.2;
        margin-bottom: 14px;
    }

    /* Mobile: taller button for easier tapping */
    .bonus-popup-container .bonus-popup-button {
        min-height: 50px;
        font-size: clamp(16px, 5vw, 20px);
        border-radius: 14px;
    }

    .bonus-popup-container .bonus-popup-terms {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.38);
        margin-top: 10px;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bonus-popup-container,
    .bonus-popup-container .bonus-popup,
    .bonus-popup-container .bonus-popup-close,
    .bonus-popup-container .bonus-popup-button {
        transition: none !important;
    }

    .bonus-popup-container .bonus-popup {
        transform: none !important;
    }
}

/* Premium corner badge */
.bonus-popup-container .bonus-popup-badge {
    position: absolute;
    top: 14px;
    left: -35px;

    width: 140px;
    text-align: center;

    background: #b91c1c; /* deep premium red */
    color: #ffffff;

    font-family: Roboto, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;

    padding: 4px 0;

    transform: rotate(-35deg);
    pointer-events: none;
}