/* Checkout com cara de recibo de papel (views/js/checkout-modal.js) */

html.clc-lock, html.clc-lock body { overflow: hidden; }

.clc-overlay {
    --paper: #fbf8f3;
    --ink: #1d1a1c;
    --muted: #7b7276;
    --line: #e6ddd3;
    --pink: #e0177f;
    --pink-2: #ff2d9b;
    --green: #1f8a5b;
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px;
    background: rgba(8, 6, 8, .72);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility 0s linear .25s;
    font-family: 'Quicksand', system-ui, sans-serif;
}
.clc-overlay.open { opacity: 1; visibility: visible; transition: opacity .25s ease; }

.clc-sheet {
    position: relative;
    width: 100%; max-width: 420px;
    transform: translateY(28px) rotate(-.6deg);
    transition: transform .45s cubic-bezier(.2, .9, .25, 1.15);
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .55));
}
.clc-overlay.open .clc-sheet { transform: translateY(0) rotate(0); }

/* Papel com as bordas serrilhadas de cima e de baixo */
.clc-paper {
    position: relative;
    background: var(--paper);
    color: var(--ink);
}
.clc-scroll {
    max-height: min(84dvh, 760px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
}
.clc-scroll::-webkit-scrollbar { display: none; }
.clc-body { padding: 30px 26px 30px; }

.clc-close {
    position: absolute; top: -14px; right: -10px; z-index: 2;
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: #1d1a1c; color: #fff; border: 2px solid var(--paper);
    cursor: pointer; transition: transform .2s;
}
.clc-close:hover { transform: rotate(90deg); }

.clc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.clc-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--ink); }
.clc-logo { height: 24px; width: 24px; }
.clc-secure { display: flex; align-items: center; gap: 6px; margin: 12px 0 18px; font: 600 13px/1 'Quicksand', sans-serif; color: var(--green); }

.clc-cut { height: 1px; margin: 16px 0; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 11px); }

.clc-lines { font-family: 'Quicksand', sans-serif; }
.clc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.clc-row b { font-weight: 600; white-space: nowrap; }
.clc-row code { font: inherit; font-size: 12px; padding: 1px 6px; border-radius: 4px; background: #eaf5ef; }
.clc-sub { margin: 4px 0 10px; font: 400 12px/1.45 'Quicksand', sans-serif; color: var(--muted); }
.clc-green { color: var(--green); margin-top: 8px; }
.clc-total { font-size: 20px; }
.clc-total b { font-size: 24px; letter-spacing: -.02em; }
.clc-once { text-align: right; margin-top: 2px; font: 400 11px 'Quicksand', sans-serif; color: var(--muted); }


.clc-field { display: block; margin-bottom: 12px; }
.clc-field > span { display: block; margin-bottom: 6px; font: 600 14px 'Quicksand', sans-serif; color: var(--ink); }
.clc-field input, .clc-code input {
    width: 100%; box-sizing: border-box; height: 46px; padding: 0 14px;
    border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
    font: 500 16px 'Quicksand', sans-serif; outline: none; transition: border-color .2s, box-shadow .2s;
}
.clc-field input:focus, .clc-code input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(224, 23, 127, .12); }
.clc-field small { display: block; margin-top: 6px; font-size: 12px; line-height: 1.4; color: var(--muted); }

.clc-code { margin: 4px 0 6px; }
.clc-code summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--pink); }
.clc-code summary::-webkit-details-marker { display: none; }
.clc-code summary::before { content: "+ "; }
.clc-code[open] summary::before { content: "− "; }
.clc-code-row { display: flex; gap: 8px; margin-top: 10px; }
.clc-code-row input { text-transform: uppercase; font-family: 'Quicksand', sans-serif; font-size: 15px; }
.clc-mini { flex: none; padding: 0 16px; border-radius: 12px; border: 0; background: var(--ink); color: #fff; font: 600 14px 'Quicksand', sans-serif; cursor: pointer; }
.clc-code-msg { min-height: 0; margin: 8px 0 0; font-size: 13px; }
.clc-code-msg.ok { color: var(--green); }
.clc-code-msg.error { color: #c0263f; }

.clc-actions { display: grid; gap: 10px; margin-top: 16px; }
.clc-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; height: 54px; border-radius: 999px; border: 0; cursor: pointer;
    background: linear-gradient(180deg, var(--pink-2), var(--pink)); color: #fff;
    font: 700 16px 'Quicksand', sans-serif;
    box-shadow: 0 10px 22px -10px rgba(224, 23, 127, .8), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .15s, filter .2s;
}
.clc-btn:hover { filter: brightness(1.05); }
.clc-btn:active { transform: scale(.985); }
.clc-btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.clc-btn.done { background: var(--green); }
.clc-btn img { border-radius: 4px; }
.clc-btn.loading { pointer-events: none; opacity: .7; }
.clc-btn.loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: clc-spin .7s linear infinite; }

.clc-foot { margin: 16px 0 0; text-align: center; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.clc-msg { margin: 12px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink); }
.clc-msg.error { color: #c0263f; }
.clc-msg:empty { display: none; }
.clc-link { display: block; margin: 16px auto 0; background: none; border: 0; cursor: pointer; color: var(--muted); font: 600 13px 'Quicksand', sans-serif; }
.clc-link:hover { color: var(--ink); }

.clc-mini-sum { display: flex; justify-content: space-between; font: 500 14px 'Quicksand', sans-serif; }
.clc-h { margin: 0 0 14px; text-align: center; font-size: 18px; }
.clc-qr-wrap { display: grid; place-items: center; padding: 10px; margin: 0 auto 14px; width: 210px; border-radius: 16px; background: #fff; border: 1.5px solid var(--line); }
.clc-qr { width: 190px; height: 190px; image-rendering: pixelated; }
.clc-pix-code { width: 100%; box-sizing: border-box; margin-top: 8px; padding: 8px 10px; border: 0; border-radius: 8px; background: #f1ebe3; color: var(--muted); font: 400 11px 'Quicksand', sans-serif; text-overflow: ellipsis; }
.clc-steps { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.clc-steps li { counter-increment: s; display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.clc-steps li::before { content: counter(s); flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font: 600 11px 'Quicksand', sans-serif; }
.clc-wait { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 18px 0 0; font-size: 13px; color: var(--muted); }
.clc-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(31, 138, 91, .5); animation: clc-pulse 1.6s infinite; }
.clc-timer { font-family: 'Quicksand', sans-serif; color: var(--ink); }

.clc-loading { display: grid; place-items: center; gap: 12px; padding: 40px 0; color: var(--muted); font-size: 14px; }
.clc-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--pink); animation: clc-spin .8s linear infinite; }

.clc-done { text-align: center; padding: 26px 0 8px; }
.clc-done h4 { margin: 14px 0 6px; font-size: 22px; }
.clc-done p { margin: 0; color: var(--muted); }
.clc-check { width: 64px; height: 64px; }
.clc-check circle { stroke: var(--green); stroke-width: 2.5; stroke-dasharray: 160; stroke-dashoffset: 160; animation: clc-draw .6s ease forwards; }
.clc-check path { stroke: var(--green); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: clc-draw .4s .45s ease forwards; }

#clc-card-brick { margin: 0 -6px; }
#clc-stripe { margin: 0 -12px; min-height: 360px; }

@keyframes clc-spin { to { transform: rotate(360deg); } }
@keyframes clc-draw { to { stroke-dashoffset: 0; } }
@keyframes clc-pulse { 70% { box-shadow: 0 0 0 8px rgba(31, 138, 91, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 138, 91, 0); } }

@media (max-width: 520px) {
    .clc-overlay { align-items: flex-end; padding: 0; }
    .clc-sheet { max-width: none; transform: translateY(100%); }
    .clc-overlay.open .clc-sheet { transform: translateY(0); }
    .clc-scroll { max-height: 92dvh; }
    .clc-body { padding: 24px 18px calc(18px + env(safe-area-inset-bottom)); }
    .clc-close { top: 10px; right: 12px; border: 0; background: #ece4da; color: var(--ink); width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    .clc-sheet, .clc-overlay { transition: none; }
}
