/* MotoCar360 — Billing / checkout (layout tipo checkout SaaS) */
:root {
    --checkout-bg: #f4f6f8;
    --checkout-surface: #ffffff;
    --checkout-border: #e2e8f0;
    --checkout-text: #0f172a;
    --checkout-muted: #64748b;
    --checkout-accent: #0d9488;
    --checkout-accent-dark: #0f766e;
    --checkout-radius: 12px;
    --checkout-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
    /* Alineado con checkout (Google Fonts en la vista): DM Sans / Outfit, con fallback sistema. */
    --font-sans: "DM Sans", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Outfit", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.checkout-body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font-sans);
    background: var(--checkout-bg);
    color: var(--checkout-text);
    font-size: 15px;
    line-height: 1.5;
}

/* ——— Top bar ——— */
.checkout-topbar {
    background: var(--checkout-surface);
    border-bottom: 1px solid var(--checkout-border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.checkout-topbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.checkout-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--checkout-text);
    text-decoration: none;
}

.checkout-brand img {
    height: 2.25rem;
    width: auto;
    border-radius: 8px;
    object-fit: cover;
}

.checkout-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.checkout-secure-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--checkout-accent-dark);
    background: rgba(13, 148, 136, 0.08);
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
}

.checkout-back-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--checkout-muted);
    text-decoration: none;
}

.checkout-back-link:hover {
    color: var(--checkout-text);
    text-decoration: underline;
}

/* ——— Breadcrumb ——— */
.checkout-breadcrumb {
    background: var(--checkout-bg);
    border-bottom: 1px solid var(--checkout-border);
}

.checkout-breadcrumb-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.65rem 1.25rem;
    font-size: 0.8125rem;
    color: var(--checkout-muted);
}

.checkout-breadcrumb a {
    color: var(--checkout-muted);
    text-decoration: none;
}

.checkout-breadcrumb a:hover {
    color: var(--checkout-accent-dark);
    text-decoration: underline;
}

.checkout-breadcrumb-sep {
    margin: 0 0.35rem;
    opacity: 0.6;
}

.checkout-breadcrumb-current {
    color: var(--checkout-text);
    font-weight: 500;
}

/* ——— Main layout ——— */
.checkout-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 3.5rem;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
    align-items: start;
}

@media (min-width: 900px) {
    .checkout-layout {
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 2.5rem;
    }
}

.checkout-primary {
    min-width: 0;
}

.checkout-page-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.5vw, 1.75rem);
    font-weight: 700;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
    color: var(--checkout-text);
}

.checkout-lead {
    margin: 0 0 1.25rem;
    color: var(--checkout-muted);
    font-size: 0.9375rem;
    max-width: 42rem;
}

.checkout-mp-trust-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.65rem;
    margin: 0 0 1.5rem;
    padding: 1.15rem 1.25rem 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
    border: 1px solid rgba(0, 158, 227, 0.2);
    border-radius: var(--checkout-radius);
    box-shadow: 0 4px 20px rgba(0, 158, 227, 0.08);
    max-width: 100%;
}

.checkout-mp-trust-banner-logo {
    display: block;
    width: min(280px, 100%);
    height: auto;
    max-height: 64px;
}

.checkout-mp-trust-banner-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--checkout-muted);
    max-width: 26rem;
}

.checkout-mp-trust-banner-text strong {
    color: #009ee3;
}

.checkout-mp-trust-banner-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #009ee3;
    text-decoration: none;
}

.checkout-mp-trust-banner-link:hover {
    text-decoration: underline;
}

.checkout-section {
    background: var(--checkout-surface);
    border: 1px solid var(--checkout-border);
    border-radius: var(--checkout-radius);
    padding: 1.5rem 1.35rem 1.75rem;
    box-shadow: var(--checkout-shadow);
}

.checkout-section-title {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--checkout-text);
}

.checkout-section-desc {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    color: var(--checkout-muted);
}

.checkout-payment-icons {
    list-style: none;
    margin: 0 0 0.85rem;
    padding: 0.35rem 0 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem 1.1rem;
}

.checkout-payment-icons li {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-payment-icons img {
    display: block;
    height: 32px;
    width: auto;
    max-width: 64px;
    object-fit: contain;
    filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.06));
}

.checkout-form {
    margin-top: 0.5rem;
}

.checkout-mp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.checkout-mp-row--card-start {
    margin-top: 0.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--checkout-border);
}

.checkout-mp-row--full {
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    .checkout-mp-grid {
        grid-template-columns: 1fr;
    }
}

.checkout-field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--checkout-muted);
    margin-bottom: 0.35rem;
}

/* Campos nativos y contenedores MP (iframe) — misma apariencia */
.mp-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
    border: 1px solid var(--checkout-border);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    box-sizing: border-box;
    background: #fafbfc;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    min-height: 2.75rem;
}

.mp-input:focus {
    outline: none;
    border-color: var(--checkout-accent);
    background: var(--checkout-surface);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.mp-field {
    margin-bottom: 1rem;
    min-height: 2.75rem;
    border: 1px solid var(--checkout-border);
    border-radius: 8px;
    background: #fafbfc;
    box-sizing: border-box;
    padding: 0.5rem 0.75rem;
    display: block;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.mp-field:focus-within {
    border-color: var(--checkout-accent);
    background: var(--checkout-surface);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

/* Iframe de Mercado Pago (cardForm iframe: true) */
.mp-field iframe {
    display: block;
    width: 100% !important;
    min-height: 2.5rem !important;
    height: 2.75rem !important;
    border: 0 !important;
    background: transparent !important;
    vertical-align: top;
    pointer-events: auto;
}

/* CardForm iframe: false — inputs nativos en el contenedor */
.mp-field input,
.mp-field select {
    display: block;
    width: 100% !important;
    max-width: 100%;
    min-height: 2.25rem;
    margin: 0 !important;
    padding: 0.2rem 0 !important;
    border: 0 !important;
    background: transparent !important;
    font: inherit !important;
    font-size: 0.9375rem !important;
    line-height: 1.35 !important;
    color: var(--checkout-text) !important;
    box-sizing: border-box !important;
    -webkit-appearance: none;
    appearance: none;
    cursor: text;
}

.mp-field input:focus,
.mp-field select:focus {
    outline: none !important;
    box-shadow: none !important;
}

.mp-field input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.checkout-hint {
    font-size: 0.8125rem;
    color: var(--checkout-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.checkout-hint--secondary {
    margin-top: -0.25rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0.85rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--checkout-border);
    font-size: 0.78rem;
}

.checkout-lead-next-hint {
    margin-top: 1rem;
    margin-bottom: 0;
}

.checkout-debug {
    font-size: 0.8125rem;
    color: var(--checkout-muted);
    margin-bottom: 1rem;
}

.checkout-debug code {
    font-size: 0.75rem;
    background: #f1f5f9;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
}

.checkout-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ——— Sidebar summary ——— */
.checkout-sidebar {
    position: sticky;
    top: 5.5rem;
}

.checkout-summary-card {
    background: var(--checkout-surface);
    border: 1px solid var(--checkout-border);
    border-radius: var(--checkout-radius);
    padding: 1.35rem 1.25rem;
    box-shadow: var(--checkout-shadow);
}

.checkout-summary-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--checkout-border);
    color: var(--checkout-text);
}

.checkout-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    font-size: 0.875rem;
}

.checkout-summary-item-name {
    color: var(--checkout-muted);
    line-height: 1.4;
    flex: 1;
}

.checkout-summary-item-price {
    font-weight: 600;
    color: var(--checkout-text);
    white-space: nowrap;
}

.checkout-summary-divider {
    height: 1px;
    background: var(--checkout-border);
    margin: 1rem 0;
}

.checkout-summary-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.checkout-summary-total {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--checkout-text);
}

.checkout-summary-note {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.45;
    color: #94a3b8;
}

.checkout-customer-card {
    margin-top: 1.25rem;
}

.checkout-customer-dl {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.checkout-customer-row {
    margin: 0;
}

.checkout-customer-row dt {
    margin: 0 0 0.2rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.checkout-customer-row dd {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--checkout-text);
    word-break: break-word;
}

a.checkout-customer-link {
    color: var(--checkout-accent-dark);
    font-weight: 600;
    text-decoration: none;
}

a.checkout-customer-link:hover {
    text-decoration: underline;
}

.btn-pay {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 0.9rem 1.25rem;
    margin-top: 0.5rem;
    background: linear-gradient(180deg, var(--checkout-accent) 0%, var(--checkout-accent-dark) 100%);
    color: #fff !important;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
    transition: filter 0.15s, transform 0.1s;
}

.btn-pay:hover {
    filter: brightness(1.06);
}

.btn-pay:active {
    transform: translateY(1px);
}

.btn-pay:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* ——— Config / alert card ——— */
.checkout-card--full {
    max-width: 40rem;
    margin: 0 auto;
}

.checkout-card {
    background: var(--checkout-surface);
    border-radius: var(--checkout-radius);
    padding: 1.75rem;
    box-shadow: var(--checkout-shadow);
    border: 1px solid var(--checkout-border);
}

.checkout-alert code {
    font-size: 0.8125rem;
    background: #f1f5f9;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.checkout-alert ul {
    margin: 1rem 0 1rem 1.25rem;
}

.checkout-alert li {
    margin-bottom: 0.5rem;
}

.checkout-success-title {
    color: var(--checkout-accent-dark) !important;
}

.checkout-meta {
    font-size: 0.875rem;
    color: var(--checkout-muted);
    margin-top: 0.5rem;
}

.checkout-meta code {
    font-size: 0.8125rem;
    word-break: break-all;
}

.btn-pay-secondary {
    margin-top: 0.75rem;
    background: var(--checkout-surface);
    color: var(--checkout-accent-dark) !important;
    border: 2px solid var(--checkout-accent);
    box-shadow: none;
}

/* ——— Overlay “procesando pago” ——— */
body.checkout-busy {
    overflow: hidden;
}

.checkout-busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.checkout-busy-overlay[hidden] {
    display: none !important;
}

.checkout-busy-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.35rem;
    background: var(--checkout-surface);
    padding: 1.85rem 2rem 1.75rem;
    border-radius: var(--checkout-radius);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.22);
    border: 1px solid var(--checkout-border);
    max-width: 22rem;
    width: 100%;
    pointer-events: auto;
}

.checkout-busy-spinner {
    width: 2.75rem;
    height: 2.75rem;
    border: 3px solid #e2e8f0;
    border-top-color: var(--checkout-accent);
    border-radius: 50%;
    animation: checkout-busy-spin 0.8s linear infinite;
}

@keyframes checkout-busy-spin {
    to {
        transform: rotate(360deg);
    }
}

.checkout-busy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3rem;
    padding: 0.9rem 1.35rem;
    background: linear-gradient(180deg, var(--checkout-accent) 0%, var(--checkout-accent-dark) 100%);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
    text-align: center;
    line-height: 1.3;
    user-select: none;
    pointer-events: none;
}

/* ——— Certificación Mercado Pago ——— */
.checkout-mp-cert {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(135deg, rgba(0, 158, 227, 0.06) 0%, rgba(15, 23, 42, 0.03) 100%);
    border: 1px solid rgba(0, 158, 227, 0.22);
    border-radius: 10px;
}

.checkout-mp-cert-brand {
    margin-bottom: 0.65rem;
}

.checkout-mp-cert-logo {
    display: block;
    height: auto;
    max-width: 16rem;
    width: 100%;
}

.checkout-mp-cert-text {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--checkout-muted);
}

.checkout-mp-cert-text strong {
    color: var(--checkout-text);
}

.checkout-mp-cert-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: #009ee3;
    text-decoration: none;
}

.checkout-mp-cert-link:hover {
    text-decoration: underline;
}

.checkout-mp-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.6875rem;
    color: var(--checkout-muted);
}

.checkout-mp-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.45rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #0369a1;
    background: #e0f2fe;
    border-radius: 4px;
    border: 1px solid #bae6fd;
}

.checkout-mp-footerline {
    margin-top: 1.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--checkout-border);
    text-align: center;
}

.checkout-mp-footerline-logo {
    display: block;
    margin: 0 auto 0.65rem;
    height: auto;
    max-width: 12.5rem;
    opacity: 0.95;
}

.checkout-mp-footerline-text {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.45;
    color: #94a3b8;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.checkout-mp-footerline-text a {
    color: #009ee3;
    font-weight: 600;
    text-decoration: none;
}

.checkout-mp-footerline-text a:hover {
    text-decoration: underline;
}

.checkout-summary-mp {
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--checkout-border);
    text-align: center;
}

.checkout-summary-mp-logo {
    display: block;
    margin: 0 auto 0.5rem;
    height: auto;
    max-width: 11rem;
}

.checkout-summary-mp-text {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.45;
    color: #94a3b8;
}

/* ——— Lead / datos previos al pago ——— */
.checkout-field-error {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #b91c1c;
    margin-top: -0.5rem;
    margin-bottom: 0.35rem;
}

.checkout-field-error--block {
    display: block;
    margin: -0.5rem 0 0.75rem;
}

.checkout-lead-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
    padding: 1rem 1.1rem;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--checkout-border);
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
}

.checkout-lead-consent input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    accent-color: var(--checkout-accent);
    cursor: pointer;
}

.checkout-lead-consent-text {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--checkout-muted);
}

.mp-input--error {
    border-color: #f87171;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.35);
}
