.apptimal-voucher-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: inherit;
}

.apptimal-voucher-popup[aria-hidden="false"] {
    display: flex;
}

.apptimal-voucher-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.72);
    backdrop-filter: blur(8px);
}

.apptimal-voucher-popup__dialog {
    position: relative;
    width: min(100%, 980px);
    overflow: hidden;
    border-radius: 30px;
    background: linear-gradient(145deg, #ffffff 0%, #fffaf1 100%);
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.32);
    animation: apptimalVoucherPopIn 260ms ease-out;
    display: grid;
    gap: 0;
    outline: none;
}

.apptimal-voucher-popup__dialog.has-preview {
    grid-template-columns: minmax(360px, 1.1fr) minmax(310px, 0.9fr);
}

.apptimal-voucher-popup__dialog.no-preview {
    width: min(100%, 560px);
    grid-template-columns: 1fr;
}

.apptimal-voucher-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.08);
    color: #111827;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease;
    z-index: 4;
}

.apptimal-voucher-popup__close:hover,
.apptimal-voucher-popup__close:focus {
    background: rgba(17, 24, 39, 0.14);
    transform: rotate(90deg);
}

.apptimal-voucher-popup__media {
    padding: 34px;
    background:
        radial-gradient(circle at 18% 16%, color-mix(in srgb, var(--apptimal-popup-accent) 36%, transparent), transparent 32%),
        linear-gradient(160deg, #fff7df 0%, #fff 46%, #f8fafc 100%);
    border-right: 1px solid rgba(17, 24, 39, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.apptimal-voucher-popup__preview-wrap {
    width: 100%;
    transform: rotate(-1.2deg);
}

.apptimal-voucher-popup__preview-link {
    display: block;
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.18);
    text-decoration: none;
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.apptimal-voucher-popup__preview-link::before,
.apptimal-voucher-popup__preview-link::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff7df;
    transform: translateY(-50%);
    z-index: 2;
}

.apptimal-voucher-popup__preview-link::before {
    left: -17px;
}

.apptimal-voucher-popup__preview-link::after {
    right: -17px;
}

.apptimal-voucher-popup__preview-image,
.apptimal-voucher-popup__preview-frame {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 1;
    border: 0;
    background: #fff;
}

.apptimal-voucher-popup__preview-image {
    object-fit: contain;
}

.apptimal-voucher-popup__preview-frame {
    min-height: 260px;
}

.apptimal-voucher-popup__preview-caption {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
    color: #4b5563;
    font-size: 13px;
}

.apptimal-voucher-popup__preview-caption strong {
    color: #111827;
}

.apptimal-voucher-popup__content {
    padding: 52px 38px 42px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.apptimal-voucher-popup__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    padding: 7px 14px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--apptimal-popup-accent) 16%, white);
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.apptimal-voucher-popup__icon {
    width: 82px;
    height: 82px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: var(--apptimal-popup-accent);
    color: #fff;
    font-size: 46px;
    font-weight: 900;
    box-shadow: 0 18px 42px color-mix(in srgb, var(--apptimal-popup-accent) 40%, transparent);
}

.apptimal-voucher-popup h2 {
    margin: 0 0 12px;
    color: #111827;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.08;
}

.apptimal-voucher-popup__text {
    color: #4b5563;
    font-size: 17px;
    line-height: 1.6;
}

.apptimal-voucher-popup__text p {
    margin: 0 0 22px;
}

.apptimal-voucher-popup__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.apptimal-voucher-popup__button,
.apptimal-voucher-popup-trigger--button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    margin-top: 6px;
    padding: 0 28px;
    border-radius: 999px;
    background: var(--apptimal-popup-accent, #c79a3b);
    color: #fff !important;
    font-weight: 800;
    text-decoration: none !important;
    box-shadow: 0 16px 34px color-mix(in srgb, var(--apptimal-popup-accent, #c79a3b) 38%, transparent);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.apptimal-voucher-popup__button:hover,
.apptimal-voucher-popup__button:focus,
.apptimal-voucher-popup-trigger--button:hover,
.apptimal-voucher-popup-trigger--button:focus {
    transform: translateY(-2px);
    filter: brightness(0.96);
    box-shadow: 0 18px 40px color-mix(in srgb, var(--apptimal-popup-accent, #c79a3b) 48%, transparent);
}

.apptimal-voucher-popup__text-link {
    color: #374151;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

.apptimal-voucher-popup-open {
    overflow: hidden;
}

@keyframes apptimalVoucherPopIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 860px) {
    .apptimal-voucher-popup__dialog.has-preview {
        grid-template-columns: 1fr;
        width: min(100%, 620px);
    }

    .apptimal-voucher-popup__media {
        border-right: 0;
        border-bottom: 1px solid rgba(17, 24, 39, 0.08);
        padding: 28px 24px 0;
    }

    .apptimal-voucher-popup__preview-wrap {
        transform: none;
    }
}

@media (max-width: 520px) {
    .apptimal-voucher-popup {
        padding: 16px;
    }

    .apptimal-voucher-popup__content {
        padding: 32px 22px 28px;
    }

    .apptimal-voucher-popup__media {
        padding: 24px 18px 0;
    }

    .apptimal-voucher-popup__dialog {
        border-radius: 22px;
    }

    .apptimal-voucher-popup__preview-caption {
        flex-direction: column;
        align-items: flex-start;
    }

    .apptimal-voucher-popup__preview-frame {
        min-height: 190px;
    }
}
