/* ================ CHECKOUT — single-page de alta conversão ================ */

.page-checkout {
    background: var(--bg-soft);
    min-height: 100vh;
}

/* ===== Header simples ===== */
.ck-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.ck-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.ck-logo img { display: block; max-height: 36px; width: auto; }
.ck-header-trust {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

/* ===== Layout principal ===== */
.ck-main { padding: 28px 16px 60px; }
.ck-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: flex-start;
}

/* ===== Coluna esquerda (form + result) ===== */
.ck-col-form {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 28px;
    min-width: 0;
}
/* Banner brinde no topo */
.ck-bonus-banner {
    display: block;
    margin: 0 0 22px;
    border-radius: 18px;
    overflow: hidden;
    border: 2px solid var(--primary);
    box-shadow: 0 6px 20px rgba(34, 115, 240, .18);
    transition: transform .2s, box-shadow .2s;
    background: #000;
}
.ck-bonus-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(34, 115, 240, .28);
}
.ck-bonus-banner img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}

.ck-h1 {
    font-size: 1.5rem;
    margin: 0 0 18px;
    color: var(--text);
}

/* Item brinde no resumo */
.ck-summary-bonus {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 0 0 12px;
    background: linear-gradient(135deg, var(--primary-tint) 0%, rgba(34, 197, 94, .12) 100%);
    border: 1px dashed var(--primary);
    border-radius: var(--radius);
}
.ck-summary-bonus-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ck-summary-bonus-text {
    flex: 1;
    line-height: 1.25;
    min-width: 0;
}
.ck-summary-bonus-text strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.ck-summary-bonus-text span {
    display: block;
    font-size: 11px;
    color: var(--text-soft);
    margin-top: 2px;
}
.ck-summary-bonus-tag {
    flex-shrink: 0;
    background: var(--success);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: .04em;
}

.ck-steps {
    display: flex;
    gap: 6px;
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
}
.ck-steps::-webkit-scrollbar { display: none; }
.ck-steps li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex: 1;
    justify-content: center;
}
.ck-steps li.active {
    background: var(--primary-tint);
    color: var(--primary);
}
.ck-steps li.done {
    background: rgba(34, 197, 94, .15);
    color: var(--success);
}
.ck-steps li span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}
.ck-steps li.active span { background: var(--primary); color: #fff; }
.ck-steps li.done span { background: var(--success); color: #fff; }

/* ===== Form ===== */
.ck-step {
    border: none;
    padding: 0;
    margin: 0 0 28px;
}
.ck-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin: 0 0 16px;
    padding: 0;
}
.ck-row { margin-bottom: 14px; }
.ck-row-2 { display: flex; gap: 14px; }
.ck-row-2 > .ck-field { flex: 1; min-width: 0; }
.ck-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.ck-row-cep { display: flex; }
.ck-field-cep { flex: 0 0 200px; max-width: 200px; }

/* Step actions (Voltar + Continuar) */
.ck-step-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    align-items: stretch;
}
.ck-step-actions .ck-back { flex: 0 0 auto; padding: 12px 20px; }
.ck-step-actions .ck-next,
.ck-step-actions .ck-submit { flex: 1; }
.ck-next {
    margin-top: 18px;
    height: 56px;
    font-size: 16px;
}

/* Bloco de seleção de frete */
.ck-shipping { margin-top: 18px; }
.ck-shipping-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin: 0 0 12px;
}
.ck-shipping-opt {
    display: block;
    cursor: pointer;
    margin-bottom: 8px;
    user-select: none;
}
.ck-shipping-opt input { display: none; }
.ck-shipping-card {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    transition: all .15s;
}
.ck-shipping-opt:hover .ck-shipping-card { border-color: var(--text); }
.ck-shipping-opt input:checked + .ck-shipping-card {
    border-color: var(--primary);
    background: var(--primary-tint);
}
.ck-shipping-logo {
    width: 90px;
    height: 28px;
    object-fit: contain;
    display: block;
}
.ck-shipping-info { line-height: 1.3; min-width: 0; }
.ck-shipping-info strong {
    display: block;
    font-size: 14px;
    color: var(--text);
}
.ck-shipping-info span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.ck-shipping-price { text-align: right; flex-shrink: 0; }
.ck-shipping-price strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.ck-shipping-free {
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
    background: rgba(34, 197, 94, .12);
    padding: 4px 10px;
    border-radius: 4px;
}

.ck-field { display: block; }
.ck-field span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.ck-field input,
.ck-field select {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    font-size: 16px; /* 16px previne auto-zoom do iOS Safari/TBA ao focar input */
    background: #fff;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.ck-field input:focus,
.ck-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 115, 240, .12);
}
.ck-field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5l5 5 5-5' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}
.ck-field.ck-field-error input {
    border-color: var(--danger);
    background: rgba(239, 68, 68, .03);
}
.ck-field.ck-field-error span { color: var(--danger); }
.ck-field-msg {
    display: block;
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
    min-height: 14px;
}

/* ===== Tabs de pagamento ===== */
.ck-pay-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}
.ck-pay-tab {
    cursor: pointer;
    user-select: none;
}
.ck-pay-tab input { display: none; }
.ck-pay-tab-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    transition: all .15s;
}
.ck-pay-tab-inner strong {
    display: block;
    font-size: 15px;
    color: var(--text);
}
.ck-pay-tab-inner small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.ck-pay-tab-inner svg { color: var(--text-muted); flex-shrink: 0; }
.ck-pay-tab:hover .ck-pay-tab-inner { border-color: var(--text); }
.ck-pay-tab input:checked + .ck-pay-tab-inner {
    border-color: var(--primary);
    background: var(--primary-tint);
}
.ck-pay-tab input:checked + .ck-pay-tab-inner strong { color: var(--primary); }
.ck-pay-tab input:checked + .ck-pay-tab-inner svg { color: var(--primary); }

/* ===== Botão submit ===== */
.ck-submit {
    margin-top: 8px;
    height: 56px;
    font-size: 16px;
    position: relative;
    gap: 10px;
}
.ck-submit:disabled { opacity: .65; cursor: wait; }
.ck-spinner { animation: none; }

.ck-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin: 12px 0 0;
}

/* ===== Resultado (PIX gerado / cartão processado) ===== */
.ck-result { margin-top: 8px; }

.ck-pix-block {
    text-align: center;
    padding: 0;
}
.ck-pix-head {
    background: rgba(50, 188, 173, .1);
    border: 1px solid rgba(50, 188, 173, .25);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 20px;
}
.ck-pix-head img { display: block; margin: 0 auto 8px; height: 36px; }
.ck-pix-head h2 {
    font-size: 1.1rem;
    color: #1a8076;
    margin: 0 0 4px;
}
.ck-pix-head p {
    font-size: 13px;
    color: var(--text-soft);
    margin: 0;
}
.ck-pix-amount {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin: 14px 0 18px;
}

.ck-pix-qr {
    width: 240px;
    height: 240px;
    margin: 0 auto 18px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.ck-pix-qr img { width: 100%; height: 100%; display: block; }

.ck-pix-copy {
    display: flex;
    gap: 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 14px;
}
.ck-pix-copy input {
    flex: 1;
    border: none;
    padding: 12px 14px;
    font: inherit;
    font-size: 12px;
    background: #fff;
    color: var(--text-soft);
    min-width: 0;
    text-overflow: ellipsis;
}
.ck-pix-copy input:focus { outline: none; }
.ck-pix-copy button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0 18px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
}
.ck-pix-copy button:hover { background: var(--primary-hover); }

.ck-pix-status {
    background: var(--bg-soft);
    border: 1px dashed var(--border);
    padding: 14px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 18px;
}
.ck-pix-status .ck-pulse {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--warning);
    border-radius: 50%;
    margin-right: 8px;
    animation: ck-pulse 1.4s ease-in-out infinite;
    vertical-align: middle;
}
@keyframes ck-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .35; transform: scale(.85); }
}
.ck-pix-status strong { color: var(--text); }
.ck-pix-status small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 4px; }

.ck-pix-howto {
    text-align: left;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 18px 14px;
    font-size: 14px;
    color: var(--text-soft);
    margin-bottom: 14px;
}
.ck-pix-howto > strong {
    color: var(--text);
    display: block;
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 700;
}
.ck-howto-steps {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ck-howto-steps li {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 12px;
    align-items: flex-start;
}
.ck-howto-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.ck-howto-steps b {
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    display: block;
    line-height: 1.35;
    margin-bottom: 3px;
}
.ck-howto-steps em { font-style: normal; font-weight: 700; color: var(--primary); }
.ck-howto-steps small {
    display: block;
    color: var(--text-muted);
    font-size: 12.5px;
    line-height: 1.5;
}
.ck-howto-help {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    background: var(--primary-tint);
    border: 1px solid rgba(34, 115, 240, .2);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.5;
}
.ck-howto-help svg { color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.ck-howto-help a { color: var(--primary); font-weight: 700; text-decoration: underline; }

/* ===== Toast minimalista ===== */
.ck-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%) translateY(20px);
    background: #111;
    color: #fff;
    padding: 11px 18px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity .18s ease, transform .22s cubic-bezier(.18,.89,.32,1.28);
}
.ck-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.ck-toast svg { color: #22c55e; }

#ck-pix-copy-btn.copied { background: #22c55e !important; color: #fff !important; border-color: #22c55e !important; }

/* ===== Card declined ===== */
.ck-decline {
    max-width: 100%;
}
.ck-decline-head {
    text-align: center;
    padding: 26px 20px;
    background: linear-gradient(180deg, rgba(239, 68, 68, .08) 0%, rgba(239, 68, 68, .02) 100%);
    border: 1px solid rgba(239, 68, 68, .3);
    border-radius: var(--radius-lg);
    margin-bottom: 18px;
}
.ck-decline-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: 0 6px 20px rgba(239, 68, 68, .25);
}
.ck-decline-head h2 {
    font-size: 1.4rem;
    color: var(--text);
    margin: 0 0 6px;
}
.ck-decline-reason {
    color: var(--text-soft);
    font-size: 14px;
    margin: 0;
}

.ck-decline-detail {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 18px;
}
.ck-decline-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 1px dashed var(--border);
}
.ck-decline-row:last-child { border-bottom: none; }
.ck-decline-row strong {
    color: var(--text);
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .03em;
}

.ck-decline-help {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--text-soft);
}
.ck-decline-help strong {
    display: block;
    color: #92400e;
    margin-bottom: 8px;
    font-size: 13px;
}
.ck-decline-help ul {
    margin: 0;
    padding-left: 20px;
}
.ck-decline-help li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.ck-decline-pix {
    background: linear-gradient(135deg, rgba(50, 188, 173, .12) 0%, rgba(50, 188, 173, .06) 100%);
    border: 2px solid rgba(50, 188, 173, .35);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 12px;
}
.ck-decline-pix-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.ck-decline-pix-head img { flex-shrink: 0; }
.ck-decline-pix-head strong {
    display: block;
    color: #1a8076;
    font-size: 15px;
}
.ck-decline-pix-head small {
    display: block;
    color: var(--text-soft);
    font-size: 12px;
    margin-top: 2px;
}
.ck-decline-pix .btn-primary {
    background: #32BCAD;
    border-color: #32BCAD;
}
.ck-decline-pix .btn-primary:hover {
    background: #2a9d91;
    border-color: #2a9d91;
}

/* ===== Sucesso (após confirmação) ===== */
.ck-success {
    text-align: center;
    padding: 30px 20px;
}
.ck-success-check {
    width: 72px;
    height: 72px;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    animation: ck-pop .35s ease-out;
}
@keyframes ck-pop {
    0% { transform: scale(.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.ck-success h2 { font-size: 1.4rem; color: var(--text); margin-bottom: 8px; }
.ck-success p { color: var(--text-soft); margin-bottom: 20px; }

/* ===== Coluna direita: resumo ===== */
.ck-col-summary {}
.ck-summary-card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 22px;
    position: sticky;
    top: 90px;
}
.ck-summary-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin: 0 0 14px;
}
.ck-summary-items { margin-bottom: 14px; max-height: 280px; overflow-y: auto; }
.ck-summary-item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.ck-summary-item:last-child { border-bottom: none; }
.ck-summary-item-img {
    width: 56px; height: 56px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.ck-summary-item-img img { width: 100%; height: 100%; object-fit: contain; }
.ck-summary-item-info h4 {
    font-size: 13px; font-weight: 600;
    margin: 0 0 2px;
    color: var(--text);
    line-height: 1.3;
}
.ck-summary-item-info span { font-size: 11px; color: var(--text-muted); }
.ck-summary-item-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    text-align: right;
    white-space: nowrap;
}

.ck-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 14px;
    color: var(--text-soft);
}
.ck-summary-row.ck-summary-pix { color: var(--success); }
.ck-summary-row.ck-summary-pix span:last-child { font-weight: 700; }
.ck-summary-free { color: var(--success); font-weight: 600; }
.ck-summary-row.ck-summary-total {
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.ck-trust-row {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Empty state ===== */
.ck-empty {
    text-align: center;
    padding: 60px 20px;
}
.ck-empty h2 { font-size: 1.3rem; margin-bottom: 8px; }
.ck-empty p { color: var(--text-soft); margin-bottom: 22px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .ck-grid { grid-template-columns: 1fr; }
    .ck-col-summary { order: -1; }
    .ck-summary-card {
        position: static;
        padding: 18px;
    }
    .ck-summary-items { max-height: 200px; }
    .ck-col-form { padding: 22px 18px; }
}
@media (max-width: 540px) {
    .ck-row-2, .ck-row-3 { grid-template-columns: 1fr; }
    .ck-pay-tabs { grid-template-columns: 1fr; }
    .ck-h1 { font-size: 1.3rem; }
    .ck-steps li { font-size: 12px; padding: 8px 10px; }
    .ck-pix-qr { width: 200px; height: 200px; }
}
