/* Reset e Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #fafafa; color: #18181b; line-height: 1.5; }
img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* Cores */
:root {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #d1fae5;
    --secondary: #f59e0b;
    --secondary-light: #fef3c7;
    --text: #18181b;
    --text-muted: #71717a;
    --border: #e4e4e7;
    --border-focus: #059669;
    --bg: #fafafa;
    --bg-white: #ffffff;
    --error: #ef4444;
    --success: #22c55e;
}

/* Utilitários */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-white { color: white; }
.bg-white { background: var(--bg-white); }
.bg-primary { background: var(--primary); }
.bg-primary-light { background: var(--primary-light); }
.bg-secondary-light { background: var(--secondary-light); }
.rounded { border-radius: 0.5rem; }
.rounded-lg { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }
.shadow { box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.border { border: 1px solid var(--border); }
.border-2 { border: 2px solid var(--border); }
.border-dashed { border-style: dashed; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.hidden { display: none; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) {
    .md-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

/* Header */
.header { background: white; border-bottom: 1px solid var(--border); padding: 1rem 0; }
.header-content { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 0.5rem; }
.nav { display: flex; gap: 1.5rem; }
.nav a { color: var(--text-muted); text-decoration: none; font-size: 0.875rem; transition: color 0.2s; }
.nav a:hover { color: var(--primary); }
.header-actions { display: flex; gap: 0.75rem; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-weight: 500; font-size: 0.875rem; transition: all 0.2s; border: none; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #a1a1aa; cursor: not-allowed; opacity: 0.6; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-outline-gray { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline-gray:hover { background: #f4f4f5; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-icon { padding: 0.5rem; }
.btn-icon svg { width: 1.25rem; height: 1.25rem; }

/* Inputs */
.input-group { display: flex; flex-direction: column; gap: 0.375rem; }
.input-group label { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.input { padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 0.5rem; font-size: 1rem; transition: all 0.2s; background: white; width: 100%; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.input::placeholder { color: #a1a1aa; }
.input-bg { background: #f4f4f5; }
.input-error { border-color: var(--error); }
.input-error:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); }
.error-message { color: var(--error); font-size: 0.75rem; margin-top: 0.25rem; }

/* Select */
.select { padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 0.5rem; font-size: 1rem; background: white; cursor: pointer; width: 100%; }
.select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* Stepper */
.stepper { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; }
.step { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 9999px; font-size: 0.875rem; }
.step-inactive { background: transparent; color: var(--text-muted); }
.step-active { background: var(--primary-light); color: var(--primary); }
.step-completed { background: var(--primary); color: white; }
.step-line { width: 2rem; height: 2px; background: var(--border); }
.step-line-completed { background: var(--primary); }

/* Cards */
.card { background: white; border-radius: 0.75rem; border: 1px solid var(--border); padding: 1.5rem; }
.card-shadow { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }

/* Page Title */
.page-title { text-align: center; margin-top: 2rem; }
.page-title h1 { font-size: 2rem; font-weight: 700; color: var(--text); }
.page-title p { color: var(--text-muted); margin-top: 0.5rem; }

/* Checkout Layout */
.checkout-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin-top: 2rem; }
@media (min-width: 1024px) {
    .checkout-layout { grid-template-columns: 1fr 380px; }
}

/* Main Content */
.main-content { background: white; border-radius: 0.75rem; border: 1px solid var(--border); padding: 1.5rem; }

/* Sidebar */
.sidebar { position: sticky; top: 1rem; }
.summary-card { background: white; border-radius: 0.75rem; border: 1px solid var(--border); padding: 1.5rem; }
.summary-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.summary-item { display: flex; justify-content: space-between; padding: 0.5rem 0; font-size: 0.875rem; border-bottom: 1px solid #f4f4f5; }
.summary-item:last-child { border-bottom: none; }
.summary-total { display: flex; justify-content: space-between; padding-top: 1rem; margin-top: 0.5rem; border-top: 2px solid var(--text); font-weight: 700; font-size: 1.125rem; }
.payment-badge { background: #f4f4f5; padding: 0.75rem; border-radius: 0.5rem; text-align: center; font-size: 0.875rem; color: var(--text-muted); margin-top: 1rem; }

/* Adicionar Item */
.add-item-form { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }
.add-item-form .select { flex: 2; }
.add-item-form .input { flex: 1; max-width: 100px; }
.add-item-form .btn { white-space: nowrap; }

/* Lista de Itens */
.items-list { display: flex; flex-direction: column; gap: 1rem; }
.item-card { display: flex; align-items: center; justify-content: space-between; padding: 1rem; background: #fafafa; border-radius: 0.5rem; border: 1px solid var(--border); }
.item-info { flex: 1; }
.item-name { font-weight: 600; font-size: 1rem; }
.item-price { color: var(--text-muted); font-size: 0.875rem; }
.item-controls { display: flex; align-items: center; gap: 0.5rem; }
.quantity-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: white; border-radius: 0.25rem; font-size: 1.25rem; color: var(--text-muted); }
.quantity-btn:hover { border-color: var(--primary); color: var(--primary); }
.quantity-value { min-width: 2rem; text-align: center; font-weight: 600; }
.item-remove { color: var(--error); padding: 0.5rem; cursor: pointer; }
.item-remove:hover { opacity: 0.7; }

/* Empty State */
.empty-state { border: 2px dashed var(--border); border-radius: 0.75rem; padding: 3rem; text-align: center; color: var(--text-muted); }

/* Radio Cards */
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.radio-card { position: relative; border: 2px solid var(--border); border-radius: 0.75rem; padding: 1rem; cursor: pointer; transition: all 0.2s; }
.radio-card:hover { border-color: var(--primary); }
.radio-card.selected { border-color: var(--secondary); background: var(--secondary-light); }
.radio-card input { position: absolute; opacity: 0; }
.radio-card-title { font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.radio-card-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.25rem; }
.radio-badge { position: absolute; top: -10px; right: 10px; background: var(--secondary); color: white; font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.75rem; border-radius: 9999px; }

/* Footer */
.footer { background: var(--primary-dark); color: white; padding: 3rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 0.5rem; }
.footer a { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 0.875rem; }
.footer a:hover { color: white; }
.footer-bottom { text-align: center; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.875rem; color: rgba(255,255,255,0.6); }

/* Loading */
.loading { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.spinner { width: 2rem; height: 2rem; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Payment Page */
.payment-container { max-width: 600px; margin: 2rem auto; }
.payment-card { background: white; border-radius: 1rem; border: 1px solid var(--border); padding: 2rem; text-align: center; }
.payment-timer { display: inline-flex; align-items: center; gap: 0.5rem; background: #fef3c7; color: #92400e; padding: 0.5rem 1rem; border-radius: 9999px; font-size: 0.875rem; font-weight: 500; margin-bottom: 1.5rem; }
.qr-code { width: 250px; height: 250px; margin: 0 auto 1.5rem; background: #f4f4f5; display: flex; align-items: center; justify-content: center; border-radius: 0.5rem; }
.qr-code img { max-width: 100%; max-height: 100%; }
.copy-area { background: #f4f4f5; border-radius: 0.5rem; padding: 1rem; text-align: left; margin-bottom: 1.5rem; }
.copy-area-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.copy-area-text { font-family: monospace; font-size: 0.75rem; word-break: break-all; color: var(--text); line-height: 1.6; }
.payment-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.payment-status { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2rem 0; }
.payment-spinner { width: 3rem; height: 3rem; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
.payment-status-text { color: var(--text-muted); }
.payment-details { text-align: left; padding: 1rem 0; border-top: 1px solid var(--border); margin-top: 1rem; }
.payment-details-item { display: flex; justify-content: space-between; padding: 0.5rem 0; font-size: 0.875rem; }
.support-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text-muted); text-decoration: none; font-size: 0.875rem; margin-top: 1rem; }
.support-link:hover { color: var(--primary); }

/* Animations */
.fade-in { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 768px) {
    .nav { display: none; }
    .header-content { flex-wrap: wrap; gap: 1rem; }
    .add-item-form { flex-direction: column; }
    .add-item-form .input { max-width: none; }
    .payment-actions { grid-template-columns: 1fr; }
}