/* Checkout Betel */
/* =========================================================
   CHECKOUT DE PAGAMENTO
   ========================================================= */

[data-checkout-payment-form] {
    display: grid;
    min-width: 0;
    gap: 22px;
}

[data-checkout-payment-form] fieldset {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
    margin: 0;
    border: 1px solid var(--betel-border);
    border-radius: var(--radius-panel);
    padding: 22px;
    background: #fbfcfe;
    box-shadow: 0 10px 30px rgb(var(--betel-brand-rgb) / 5%);
}

[data-checkout-payment-form] legend {
    margin-left: -7px;
    padding: 0 7px;
    color: var(--betel-brand);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

[data-checkout-payment-form] fieldset > p {
    display: grid;
    min-width: 0;
    gap: 7px;
    margin: 0;
}

[data-checkout-payment-form] fieldset > p:has(#checkout-street),
[data-checkout-payment-form] fieldset > p:has(#checkout-complement) {
    grid-column: 1 / -1;
}

[data-checkout-payment-form] label {
    color: var(--betel-brand);
    font-size: 0.72rem;
    font-weight: 700;
}

[data-checkout-payment-form] input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    border: 1px solid var(--betel-border-strong);
    border-radius: var(--radius-control);
    padding: 10px 12px;
    background: var(--betel-surface);
    color: var(--betel-text);
    font-size: 0.82rem;
    line-height: 1.35;
    outline: 0;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background-color 160ms ease;
}

[data-checkout-payment-form] input:hover {
    border-color: var(--betel-accent);
}

[data-checkout-payment-form] input:focus-visible {
    border-color: var(--betel-accent);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--betel-focus);
}

[data-checkout-payment-form] input:user-invalid {
    border-color: var(--betel-danger);
}

[data-checkout-payment-form] > button {
    display: inline-flex;
    width: min(100%, 320px);
    min-height: 48px;
    align-items: center;
    justify-content: center;
    justify-self: start;
    border: 0;
    border-radius: var(--radius-control);
    padding: 11px 20px;
    background: var(--betel-brand);
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    transition:
        background-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

[data-checkout-payment-form] > button:focus-visible {
    outline: 3px solid var(--betel-focus);
    outline-offset: 3px;
}

[data-checkout-payment-form] > button:disabled {
    background: #aab5c5;
    cursor: wait;
}

[data-checkout-payment-form] > p {
    max-width: 540px;
    margin: -10px 0 0;
    color: var(--betel-text-muted);
    font-size: 0.7rem;
    line-height: 1.55;
}

[data-checkout-payment-form][aria-busy='true'] input {
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    [data-checkout-payment-form] > button:not(:disabled):hover {
        background: var(--betel-brand-hover);
        box-shadow: 0 10px 22px rgb(var(--betel-brand-rgb) / 18%);
        transform: translateY(-1px);
    }

    .cart-summary > button:not(:disabled):hover {
        background: var(--betel-brand-hover);
    }
}

@media (max-width: 700px) {
    [data-checkout-payment-form] fieldset {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding: 18px;
    }

    [data-checkout-payment-form] fieldset > p:has(#checkout-street),
    [data-checkout-payment-form] fieldset > p:has(#checkout-complement) {
        grid-column: auto;
    }

    [data-checkout-payment-form] > button {
        width: 100%;
        max-width: none;
    }
}

/* =========================================================
   AÇÕES DE FINALIZAÇÃO
   ========================================================= */

.cart-summary__checkout-form {
    display: block;
    width: 100%;
    margin: 18px 0 0;
}

.cart-summary .cart-summary__checkout-button,
.cart-summary .checkout-summary__submit {
    display: inline-flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--betel-action-buy, var(--betel-brand));
    border-radius: var(--radius-control);
    padding: 12px 18px;
    background: var(--betel-action-buy, var(--betel-brand));
    color: var(--white);
    font: inherit;
    font-size: 0.83rem;
    font-weight: 750;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition:
        background-color 150ms ease,
        border-color 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease;
}

.cart-summary .cart-summary__checkout-button svg,
.cart-summary .checkout-summary__submit svg {
    flex: 0 0 auto;
    transition: transform 150ms ease;
}

.cart-summary__checkout-help {
    margin: 10px 0 0;
    color: var(--betel-text-muted);
    font-size: 0.7rem;
    line-height: 1.5;
    text-align: center;
}

.cart-summary .checkout-summary__submit:disabled {
    border-color: var(--betel-border-strong);
    background: var(--betel-border);
    color: var(--betel-text-subtle);
    cursor: wait;
}

.cart-summary .cart-summary__checkout-button:focus-visible,
.cart-summary .checkout-summary__submit:focus-visible {
    outline: 3px solid var(--betel-focus);
    outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .cart-summary .cart-summary__checkout-button:hover,
    .cart-summary .checkout-summary__submit:not(:disabled):hover {
        border-color: var(
            --betel-action-buy-hover,
            var(--betel-brand-hover)
        );
        background: var(
            --betel-action-buy-hover,
            var(--betel-brand-hover)
        );
        box-shadow: 0 10px 22px rgb(var(--betel-brand-rgb) / 18%);
        transform: translateY(-1px);
    }

    .cart-summary .cart-summary__checkout-button:hover svg,
    .cart-summary .checkout-summary__submit:not(:disabled):hover svg {
        transform: translateX(3px);
    }
}

.cart-summary .cart-summary__checkout-button:active,
.cart-summary .checkout-summary__submit:not(:disabled):active {
    transform: translateY(0);
}

/* ENDEREÇO DE ENTREGA DA CONTA */
.checkout-delivery-intro {
    margin: 0 0 1.5rem;
    padding: 1.4rem;
    border: 2px solid #1267b2;
    border-radius: 14px;
    background:
        linear-gradient(
            135deg,
            rgba(18, 103, 178, 0.09),
            rgba(255, 255, 255, 0.96)
        );
}

.checkout-delivery-intro__badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: #1267b2;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.checkout-delivery-intro h2 {
    margin: 0.75rem 0 0.45rem;
    color: #062554;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.checkout-delivery-intro > p {
    max-width: 680px;
    margin: 0;
    color: #53647f;
    line-height: 1.6;
}

.checkout-delivery-recipient {
    display: grid;
    gap: 0.15rem;
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #c7d7ea;
    border-radius: 10px;
    background: #fff;
}

.checkout-delivery-recipient span {
    color: #6c7b94;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.checkout-delivery-recipient strong {
    color: #062554;
}

.checkout-delivery-recipient small {
    color: #6c7b94;
}

.checkout-delivery-intro .checkout-delivery-intro__saved {
    margin-top: 0.85rem;
    color: #087a47;
    font-size: 0.82rem;
    font-weight: 700;
}

.checkout-delivery-fields {
    border-color: #8eb8df;
    box-shadow: 0 16px 38px rgba(6, 37, 84, 0.07);
}

.checkout-delivery-fields legend {
    color: #095ba5;
}

@media (max-width: 700px) {
    .checkout-delivery-intro {
        padding: 1.1rem;
    }
}
