html.checkout-visible, html.checkout-visible body { overflow: hidden; }

.modal-payment {
    --cp-ink: #171717;
    --cp-muted: #505050;
    --cp-line: #d9d9d9;
    --cp-accent: #176648;
    --cp-gutter: clamp(16px, 4vw, 32px);
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: #fff;
    color: var(--cp-ink);
    text-align: left;
}
.modal-payment, .modal-payment * { box-sizing: border-box; }
.modal-payment [hidden] { display: none !important; }
.modal-payment .modal-payment-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    height: 100dvh;
    min-height: 0;
    background: #fff;
}
.modal-payment .checkout-header {
    flex: 0 0 auto;
    padding-top: env(safe-area-inset-top);
    background: #151515;
    color: #fff;
    border-bottom: 2px solid #383838;
}
.modal-payment .checkout-header-inner,
.modal-payment .checkout-body {
    width: 100%;
    max-width: 680px;
    margin-inline: auto;
    padding-inline: max(var(--cp-gutter), env(safe-area-inset-left)) max(var(--cp-gutter), env(safe-area-inset-right));
}
.modal-payment .checkout-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    gap: 16px;
}
.modal-payment .checkout-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 650;
    color: inherit;
}
.modal-payment .checkout-close-button {
    width: 44px;
    height: 44px;
    background: transparent;
    color: #fff;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
}
.modal-payment .checkout-close-button:hover { background: #ffffff1e; }
.modal-payment .checkout-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}
.modal-payment .checkout-body { padding-block: 12px 12px; }

.modal-payment .checkout-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #dedede;
    border-radius: 12px;
    background: #f5f5f5;
}
.modal-payment .checkout-summary-main { display: flex; gap: 9px; align-items: center; min-width: 0; }
.modal-payment .checkout-campaign-thumb { flex: none; width: 40px; height: 40px; border-radius: 7px; object-fit: cover; }
.modal-payment .checkout-summary-title { min-width: 0; }
.modal-payment .checkout-summary-title strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    font-size: .88rem;
    line-height: 1.3;
}
.modal-payment .checkout-summary-title span,
.modal-payment .checkout-quantity {
    display: block;
    margin-bottom: 3px;
    color: var(--cp-muted);
    font-size: .72rem;
}
.modal-payment .checkout-summary-value { text-align: right; font-variant-numeric: tabular-nums; }
.modal-payment .checkout-total { font-size: .95rem; white-space: nowrap; }
.modal-payment .checkout-selected-numbers {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 83px;
    overflow: auto;
    padding: 8px 0 0;
    margin: 0;
    border-top: 1px solid #dedede;
    list-style: none;
}
.modal-payment .checkout-selected-numbers li {
    min-width: 35px;
    padding: 5px 8px;
    border-radius: 5px;
    background: #252525;
    color: white;
    text-align: center;
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
}
.modal-payment label:not(.checkout-terms) {
    display: block;
    margin: 0 0 6px;
    font-size: .94rem;
    font-weight: 650;
}
.modal-payment input:not([type="checkbox"]):not([type="hidden"]) {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin: 0 0 14px;
    padding: 9px 11px;
    border: 1px solid #bcbcbc;
    border-radius: 9px;
    background: #fff;
    color: var(--cp-ink);
    font: inherit;
    font-size: 16px;
}
.modal-payment .checkout-step-title { margin: 0 0 14px; font-size: 1.08rem; }
.modal-payment .form-1 h4 { margin: 14px 0 0; color: var(--cp-muted); font-size: .8rem; line-height: 1.45; font-weight: 400; }
.modal-payment a { color: #272727; text-decoration: underline; }
.modal-payment .checkout-feedback:empty { display: none; }
.modal-payment .checkout-feedback, .modal-payment .message-cpf p {
    color: #9b2828;
    font-size: .83rem;
    margin: 0 0 10px;
}
.modal-payment .checkout-primary, .modal-payment .checkout-reserve-button {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 9px;
    padding: 10px;
    background: var(--cp-accent);
    color: #fff;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}
.modal-payment #btn-continue { background: #191919; }
.modal-payment button:disabled { opacity: .55; cursor: default; }
.modal-payment :is(button,input,a):focus-visible { outline: 2px solid #424242; outline-offset: 2px; }
.modal-payment .checkout-back-button {
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
    border: 0;
    background: transparent;
    color: #272727;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.modal-payment .password-container { position: relative; }
.modal-payment .password-container input { padding-inline-end: 50px !important; }
.modal-payment .checkout-password-toggle {
    position: absolute;
    inset: 0 0 auto auto;
    min-width: 44px;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: var(--cp-muted);
    cursor: pointer;
}
.modal-payment .logradouro { display: grid; grid-template-columns: 1fr minmax(70px, 30%); gap: 10px; }

.modal-payment .checkout-buyer-card, .modal-payment .checkout-promotion {
    margin-bottom: 14px;
    border: 1px solid var(--cp-line);
    border-radius: 12px;
    padding: 13px;
    background: #f6f6f6;
}
.modal-payment .checkout-buyer-main { display: flex; align-items: center; gap: 9px; }
.modal-payment .checkout-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    height: 36px;
    border-radius: 9px;
    background: #242424;
    color: #fff;
    font-weight: 650;
}
.modal-payment .checkout-buyer-info { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.modal-payment .checkout-buyer-info > span { display: block; color: var(--cp-muted); font-size: .65rem; font-weight: 700; }
.modal-payment .checkout-buyer-info strong { display: block; font-size: .89rem; }
.modal-payment .checkout-buyer-info small { display: block; color: var(--cp-muted); margin-top: 4px; font-size: .74rem; }
.modal-payment #checkout-buyer-email-wrap { margin-left: .3em; }
.modal-payment :is(#checkout-change-buyer,#checkout-phone-confirm,.checkout-phone-cancel) {
    min-height: 38px;
    padding: 6px 8px;
    border: 1px solid #cecece;
    border-radius: 8px;
    background: #fff;
    color: #242424;
    font: inherit;
    font-size: .77rem;
    cursor: pointer;
}
.modal-payment .checkout-phone-editor { margin-top: 12px; }
.modal-payment .checkout-phone-editor-row { display: flex; gap: 7px; }
.modal-payment .checkout-phone-editor-row input { margin: 0 !important; }
.modal-payment .checkout-phone-cancel { margin-top: 6px; }
.modal-payment #checkout-phone-feedback { display: block; color: #9b2828; }
.modal-payment .checkout-security-line {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
    border-top: 1px solid var(--cp-line);
    color: var(--cp-muted);
    margin-top: 10px;
    padding-top: 8px;
    font-size: .7rem;
}
.modal-payment .checkout-security-line strong { color: var(--cp-accent); }
.modal-payment .checkout-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #fff;
    border-top: 1px solid var(--cp-line);
}
.modal-payment .checkout-actions-inner {
    max-width: 680px;
    margin-inline: auto;
    padding: 9px 0 5px;
}
.modal-payment .checkout-terms {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    margin: 0 0 8px;
    color: var(--cp-muted);
    font-size: .78rem;
    line-height: 1.4;
}
.modal-payment .checkout-terms > input[type="checkbox"] {
    position: static;
    display: block;
    width: 16px;
    min-width: 0;
    max-width: 16px;
    height: 16px;
    min-height: 0;
    padding: 0;
    margin: 1px 0 0;
    accent-color: var(--cp-accent);
}
.modal-payment .checkout-terms > span { min-width: 0; overflow-wrap: break-word; }
.modal-payment .checkout-promotion { background: #edf8f2; color: #14583e; font-size: .84rem; }
.modal-payment .checkout-promotion p { margin: 7px 0; }
.modal-payment .checkout-promotion-heading { display: flex; align-items: center; gap: 6px; }
.modal-payment .checkout-promotion-badge { padding: 3px 6px; border-radius: 5px; background: #176648; color: #fff; font-size: .68rem; }
.modal-payment .checkout-secure-footer {
    flex: 0 0 auto;
    padding: 7px 12px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--cp-line);
    background: #f6f6f6;
    text-align: center;
    color: #373737;
    font-size: .79rem;
    font-weight: 650;
}
.modal-payment .checkout-secure-footer i { color: var(--cp-accent); margin-right: 3px; }
