.coupon-bg-html {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 18px;
    background: rgba(15, 23, 42, 0.72);
    box-sizing: border-box;
    backdrop-filter: blur(4px);
}

body.coupon-popup-open {
    overflow: hidden !important;
}

html.banner-popup-open,
html.coupon-popup-open,
html.minisite-popup-scroll-locked,
html.popup-scroll-locked,
body.banner-popup-open,
body.coupon-popup-open,
body.minisite-popup-scroll-locked,
body.popup-scroll-locked {
    overflow: hidden !important;
    overscroll-behavior: none;
    height: 100%;
}

body.coupon-popup-open,
body.minisite-popup-scroll-locked,
body.popup-scroll-locked {
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}

.coupon-page-2 {
    isolation: isolate;
    position: relative;
    width: min(94vw, 920px);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.34);
    color: #172033;
    font-family: inherit;
    overscroll-behavior: contain;
}

.coupon-popup-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    min-height: 390px;
}

.coupon-popup-shell.has-manual-coupon {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
}

.popup-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2147483647;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #f3f6fb;
    color: #111827;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    transition: background 0.2s ease, transform 0.2s ease;
}

.popup-close-btn:hover,
.popup-close-btn:focus {
    background: #e8edf5;
    transform: scale(1.04);
    outline: none;
}

.coupon-html-panel {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 390px;
    padding: 38px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 252, 0.94)),
        repeating-linear-gradient(45deg, rgba(37, 99, 235, 0.05) 0, rgba(37, 99, 235, 0.05) 1px, transparent 1px, transparent 16px);
}

.coupon-html-content {
    width: 100%;
    max-width: 520px;
    text-align: center;
    overflow-wrap: anywhere;
}

.coupon-html-content .u-close-button,
.coupon-html-content .u-dialog-close-button,
.coupon-html-content .u-popup-close,
.coupon-html-content .u-close,
.coupon-html-content [class*="close-button"],
.coupon-html-content > .popup-close-btn {
    display: none !important;
    pointer-events: none !important;
}

.coupon-html-content img,
.coupon-html-content iframe,
.coupon-html-content video {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px;
}

.coupon-html-content table {
    max-width: 100% !important;
    margin-inline: auto;
}

.manual-coupon-panel {
    position: relative;
    z-index: 2147483646;
    display: flex;
    align-items: stretch;
    padding: 34px 30px;
    background: #f8fafc;
    border-left: 1px solid #e5eaf1;
}

.manual-coupon-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    min-height: 320px;
    padding: 24px;
    border: 1px dashed #98a6ba;
    border-radius: 14px;
    background: #ffffff;
    text-align: center;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    box-sizing: border-box;
}

.manual-coupon-eyebrow {
    margin: 0 0 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.manual-coupon-title {
    margin: 0 0 18px;
    color: #111827;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
}

.manual-coupon-code-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 2px dashed #111827;
    border-radius: 12px;
    background: #fff8e6;
    color: #111827;
    font-size: clamp(18px, 3vw, 25px);
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
    user-select: all;
}

.copy-coupon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    background: #111827;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.copy-coupon-btn:hover,
.copy-coupon-btn:focus {
    background: #2563eb;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
    transform: translateY(-1px);
    outline: none;
}

.copy-success {
    min-height: 20px;
    margin: 12px 0 0;
    color: #15803d;
    font-size: 14px;
    font-weight: 700;
    visibility: hidden;
}

.copy-success.is-visible {
    visibility: visible;
}

.u-popup-content {
    padding-right: 0 !important;
}

@media (min-width: 821px) {
    .u-popup-content {
        padding-right: 40% !important;
    }
}

@media (max-width: 820px) {
    .coupon-page-2 {
        width: min(96vw, 560px);
        border-radius: 16px;
    }

    .coupon-popup-shell {
        grid-template-columns: 1fr;
    }

    .coupon-popup-shell.has-manual-coupon {
        grid-template-columns: minmax(0, 1fr) minmax(240px, 290px);
    }

    .coupon-html-panel {
        min-height: auto;
        padding: 54px 22px 24px;
    }

    .manual-coupon-panel {
        padding: 0 18px 22px;
        border-left: 0;
        background: #ffffff;
    }

    .manual-coupon-wrapper {
        min-height: auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .coupon-popup-shell.has-manual-coupon {
        display: flex;
        flex-direction: column-reverse;
    }

    .coupon-html-panel {
        width: 100%;
        padding: 15px;
    }

    .coupon-html-content {
        width: 100%;
    }

    .coupon-html-content * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .manual-coupon-panel {
        width: 100%;
        padding: 14px;
        border-left: 0;
        border-bottom: 1px solid #e5eaf1;
    }

    .manual-coupon-wrapper {
        margin: 0;
    }
}
