/* ── Tokens ──────────────────────────────────────────────── */
:root {
  --primary:          #111111;
  --primary-active:   #242424;
  --primary-disabled: #e5e7eb;
  --ink:              #111111;
  --body:             #374151;
  --muted:            #6b7280;
  --muted-soft:       #898989;
  --hairline:         #e5e7eb;
  --hairline-soft:    #f3f4f6;
  --canvas:           #ffffff;
  --surface-soft:     #f8f9fa;
  --surface-card:     #f5f5f5;
  --surface-strong:   #e5e7eb;
  --surface-dark:     #101010;
  --on-dark:          #ffffff;
  --on-dark-soft:     #a1a1aa;
  --success:          #10b981;
  --success-bg:       #ecfdf5;
  --warning:          #f59e0b;
  --error:            #ef4444;

  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-pill: 9999px;
  --sp-xs: 8px; --sp-sm: 12px; --sp-md: 16px; --sp-lg: 24px;
  --sp-xl: 32px; --sp-xxl: 48px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--canvas); color: var(--body);
  font-size: 15px; line-height: 1.5;
}

/* ── Top Nav ─────────────────────────────────────────────── */
.top-nav {
  height: 64px; background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-xl);
  position: sticky; top: 0; z-index: 100;
}
.nav-left  { display: flex; align-items: center; gap: var(--sp-sm); }
.nav-logo  {
  width: 32px; height: 32px; background: var(--primary);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.nav-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.nav-sep   { color: var(--hairline); font-size: 20px; }
.nav-sub   { font-size: 13px; color: var(--muted); font-weight: 500; }

.nav-cart-btn {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 8px 14px; height: 36px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.nav-cart-btn:hover { border-color: var(--ink); background: var(--canvas); }
.nav-cart-badge {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); color: white;
  font-size: 10px; font-weight: 700;
  display: none; align-items: center; justify-content: center;
  border: 2px solid var(--canvas);
}
.nav-cart-badge.visible { display: flex; }
.nav-user {
  font-size: 13px; font-weight: 600; color: var(--muted);
  white-space: nowrap;
  display: flex; align-items: center;
}

/* ── Nav responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Nav */
  .top-nav { padding: 0 12px; gap: 6px; }
  .nav-sep, .nav-sub, .nav-user { display: none; }
  .nav-btn-label { display: none; }
  .nav-cart-btn  { padding: 8px 10px; gap: 0; }

}

/* ── Main ───────────────────────────────────────────────── */
.main { max-width: 1100px; margin: 0 auto; padding: var(--sp-xxl) var(--sp-xl); }

/* ── Screens ────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Section header ─────────────────────────────────────── */
.section-header { margin-bottom: var(--sp-xl); max-width: 780px; margin-left: auto; margin-right: auto; }
.section-header h1 {
  font-size: 34px; font-weight: 600; letter-spacing: -1px;
  color: var(--ink); line-height: 1.15; margin-bottom: var(--sp-xs);
}
.section-header p { font-size: 15px; color: var(--muted); max-width: 480px; }

/* ── Module grid ────────────────────────────────────────── */
/* ── Category selection grid ─────────────────────────────────────── */
.cat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-xl); max-width: 780px; margin: 0 auto;
}
@media (max-width: 680px) { .cat-grid { grid-template-columns: 1fr; } }

.cat-card {
  display: flex; align-items: flex-start; gap: var(--sp-lg);
  background: var(--surface-card); border: 1.5px solid var(--hairline);
  border-radius: var(--r-lg); padding: var(--sp-xl);
  cursor: pointer; transition: border-color .18s, box-shadow .18s, transform .15s;
  position: relative;
}
.cat-card:hover {
  border-color: var(--primary); box-shadow: 0 4px 20px rgba(99,102,241,.13);
  transform: translateY(-2px);
}
.cat-icon {
  flex-shrink: 0; width: 56px; height: 56px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-radius: var(--r-md); display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.cat-body { flex: 1; min-width: 0; }
.cat-title {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  line-height: 1.3; margin-bottom: 6px;
}
.cat-desc {
  font-size: 12px; color: var(--muted); line-height: 1.55; margin-bottom: 10px;
}
.cat-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.cat-arrow {
  flex-shrink: 0; color: var(--muted); align-self: center;
  transition: transform .18s, color .18s;
}
.cat-card:hover .cat-arrow { transform: translateX(4px); color: var(--primary); }

.module-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-lg); }
@media (max-width: 680px) { .module-grid { grid-template-columns: 1fr; } }

.module-card {
  background: var(--surface-card);
  border: 1.5px solid transparent; border-radius: var(--r-lg);
  padding: var(--sp-xl); cursor: pointer;
  display: flex; flex-direction: column; gap: var(--sp-md);
  position: relative; user-select: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.module-card:hover  { border-color: var(--hairline); background: var(--canvas); box-shadow: 0 4px 16px rgba(0,0,0,.07); }
.module-card.selected { border-color: var(--primary); background: var(--canvas); box-shadow: 0 4px 16px rgba(0,0,0,.10); }

.mc-num {
  position: absolute; top: var(--sp-md); right: var(--sp-md);
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.module-card.selected .mc-num { background: var(--primary); color: #fff; }

.mc-icon {
  width: 48px; height: 48px; background: var(--surface-strong);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.module-card.selected .mc-icon { background: var(--primary); color: #fff; }

.mc-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.mc-title { font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.mc-desc  { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 4px; }

.mc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: var(--sp-sm); border-top: 1px solid var(--hairline); }
.mc-tag  { border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 2px 10px; font-size: 11px; font-weight: 500; color: var(--muted); background: var(--canvas); }

/* ── Action bar ─────────────────────────────────────────── */
.action-bar { margin-top: var(--sp-xxl); display: flex; align-items: center; justify-content: space-between; padding-top: var(--sp-lg); border-top: 1px solid var(--hairline); gap: var(--sp-md); flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--muted); }
.hint strong { color: var(--ink); font-weight: 600; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  height: 40px; border-radius: var(--r-md);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 20px; transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-active); }
.btn-primary:disabled { background: var(--primary-disabled); color: var(--muted); cursor: not-allowed; }
.btn-secondary { background: var(--canvas); color: var(--ink); border: 1px solid var(--hairline); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { height: 32px; font-size: 13px; padding: 0 12px; border-radius: var(--r-sm); }

/* ── Config screen ──────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: var(--sp-xl); }
.bc-link    { cursor: pointer; font-weight: 500; }
.bc-link:hover { color: var(--ink); }
.bc-sep     { color: var(--hairline); }
.bc-current { color: var(--ink); font-weight: 500; }

.type-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-card); border: 1px solid var(--hairline);
  border-radius: var(--r-pill); padding: 4px 12px;
  font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: var(--sp-md);
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

.config-header h1 { font-size: 30px; font-weight: 600; letter-spacing: -.8px; color: var(--ink); line-height: 1.2; margin-bottom: 6px; }
.config-header p  { font-size: 14px; color: var(--muted); }

.config-layout {
  display: grid; grid-template-columns: 1fr 300px;
  gap: var(--sp-xxl); align-items: start; margin-top: var(--sp-xl);
}
@media (max-width: 820px) { .config-layout { grid-template-columns: 1fr; } }

.config-form { display: flex; flex-direction: column; gap: var(--sp-xl); }

/* ── Fields ─────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 8px; }
.field-group > label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field-hint  { font-size: 12px; color: var(--muted); margin-top: -4px; }
.field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-md); }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.text-input {
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 10px 14px; height: 40px;
  font-family: inherit; font-size: 14px; color: var(--ink); width: 100%;
  transition: border-color .15s;
}
.text-input:focus { outline: none; border-color: var(--ink); }
.text-input::placeholder { color: var(--muted-soft); }
textarea.text-input { height: 80px; resize: vertical; }

/* ── Pills ──────────────────────────────────────────────── */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill  {
  display: flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--hairline); border-radius: var(--r-md);
  padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--muted);
  cursor: pointer; transition: all .1s; background: var(--canvas);
}
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill.on    { border-color: var(--primary); background: var(--primary); color: #fff; }
.pill-swatch {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,0.18); flex-shrink: 0;
}
.pill.on .pill-swatch { border-color: rgba(255,255,255,0.4); }

/* ── Stepper ─────────────────────────────────────────────── */
.stepper-body { min-height: 260px; }
.stepper-nav {
  display: flex; gap: 8px; margin-top: 24px; padding-top: 16px;
  border-top: 1px solid var(--hairline);
}
.stepper-nav .btn { flex: 1; }
.step-error {
  color: #dc2626; font-size: 12px; font-weight: 500;
  margin-top: 8px; padding: 8px 12px; background: #fef2f2;
  border: 1px solid #fecaca; border-radius: 6px; display: none;
}

/* ── Config sidebar ─────────────────────────────────────── */
.config-sidebar { display: flex; flex-direction: column; gap: var(--sp-md); position: sticky; top: 80px; }

.preview-card {
  background: var(--surface-card); border-radius: var(--r-lg);
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.preview-svg-box {
  border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.55);
  max-height: 160px;
}
.preview-svg-box svg { max-height: 160px; width: 100%; }
.mat-swatches { display: flex; gap: 6px; }
.mat-swatch-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mat-swatch { width: 100%; border-radius: 5px; overflow: hidden; border: 1.5px solid rgba(0,0,0,0.1); }
.mat-swatch-label {
  font-size: 9px; color: var(--muted); text-align: center;
  font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
}

.summary-card { background: var(--surface-card); border-radius: var(--r-lg); padding: var(--sp-xl); }
.summary-title {
  font-size: 14px; font-weight: 600; color: var(--ink);
  padding-bottom: var(--sp-md); border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--sp-md);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
}
.summary-chevron {
  font-size: 10px; color: var(--muted);
  transition: transform .2s; display: inline-block;
}
.summary-card.collapsed .summary-chevron { transform: rotate(-90deg); }
.summary-card.collapsed #summary-body { display: none; }
.summary-card.collapsed .summary-title { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.summary-empty { font-size: 13px; color: var(--muted-soft); text-align: center; padding: 16px 0; }
.s-row   { display: flex; justify-content: space-between; align-items: flex-start; font-size: 13px; padding: 5px 0; gap: var(--sp-md); }
.s-row + .s-row { border-top: 1px solid var(--hairline-soft); }
.s-label { color: var(--muted); flex-shrink: 0; }
.s-value { color: var(--ink); font-weight: 500; text-align: right; }

.add-actions { display: flex; flex-direction: column; gap: 8px; }

.cart-callout {
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: var(--sp-md);
  display: none; flex-direction: column; gap: var(--sp-sm);
}
.cart-callout.visible { display: flex; }
.cart-callout-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.cart-item-pill {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-card); border-radius: var(--r-sm);
  padding: 6px 10px; font-size: 12px;
}
.cart-item-pill-name { color: var(--ink); font-weight: 500; }
.cart-item-pill-qty  { color: var(--muted); }

/* ── Cart screen ────────────────────────────────────────── */
.cart-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--sp-xl); gap: var(--sp-md); flex-wrap: wrap; }
.cart-header h1 { font-size: 30px; font-weight: 600; letter-spacing: -.8px; color: var(--ink); }
.cart-header p  { font-size: 14px; color: var(--muted); margin-top: 4px; }

.cart-layout { display: grid; grid-template-columns: 1fr 280px; gap: var(--sp-xxl); align-items: start; }
@media (max-width: 820px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-list { display: flex; flex-direction: column; gap: 10px; }
.cart-empty {
  text-align: center; padding: var(--sp-xxl) var(--sp-xl);
  background: var(--surface-card); border-radius: var(--r-lg);
}
.cart-empty p { font-size: 14px; color: var(--muted); margin-top: var(--sp-xs); }

.cart-item {
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); overflow: hidden;
  display: grid; grid-template-columns: 130px 1fr auto;
}
.cart-item-thumb {
  background: #f0fdf4; border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 8px; gap: 6px; min-height: 130px;
}
.cart-item-thumb svg, .cart-item-thumb > div > svg { display: block; }
.cart-thumb-qty {
  font-size: 12px; font-weight: 700; color: #166534;
  background: #dcfce7; border-radius: var(--r-pill);
  padding: 2px 10px; letter-spacing: .2px;
}
.cart-item-body { padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.cart-item-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.cart-item-name { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.cart-spec-grid { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin-top: 2px; }
.cart-spec-key  { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cart-spec-val  { font-size: 11px; font-weight: 500; color: var(--ink); }
.cart-spec-hl   { color: #166534; font-weight: 600; }
.cart-item-actions {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 12px; gap: 8px; border-left: 1px solid var(--hairline-soft);
}
.btn-remove {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 11px; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px; border-radius: var(--r-sm);
  transition: color .15s, background .15s;
}
.btn-remove:hover { color: var(--error); background: #fef2f2; }

/* Quantity stepper inside cart item */
.cart-qty-stepper {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
  overflow: hidden; margin-bottom: 8px;
}
.cart-qty-btn {
  background: var(--surface-2); border: none; cursor: pointer;
  width: 28px; height: 28px; font-size: 16px; line-height: 1;
  color: var(--text-secondary); transition: background .15s, color .15s;
  flex-shrink: 0;
}
.cart-qty-btn:hover:not(:disabled) { background: var(--primary); color: #fff; }
.cart-qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.cart-qty-input {
  width: 40px; height: 28px; border: none; border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline); text-align: center;
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  background: var(--surface-card);
  -moz-appearance: textfield;
}
.cart-qty-input::-webkit-inner-spin-button,
.cart-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.cart-total-card { background: var(--surface-card); border-radius: var(--r-lg); padding: var(--sp-xl); position: sticky; top: 80px; }
.cart-total-title { font-size: 14px; font-weight: 600; color: var(--ink); padding-bottom: var(--sp-md); border-bottom: 1px solid var(--hairline); margin-bottom: var(--sp-md); }
.total-row  { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; }
.total-row + .total-row { border-top: 1px solid var(--hairline-soft); }
.total-label  { color: var(--muted); }
.total-value  { color: var(--ink); font-weight: 500; }
.total-divider { height: 1px; background: var(--hairline); margin: var(--sp-sm) 0; }
.grand-total  { display: flex; justify-content: space-between; align-items: center; margin-top: var(--sp-md); padding-top: var(--sp-md); border-top: 1.5px solid var(--ink); }
.grand-label  { font-size: 14px; font-weight: 600; color: var(--ink); }
.grand-value  { font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -.5px; }
.grand-note   { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: right; }
.cart-cta     { margin-top: var(--sp-lg); display: flex; flex-direction: column; gap: 8px; }
.cart-item-price {
  display: flex; align-items: baseline; gap: 5px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--hairline-soft);
}
.cart-item-price-val  { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -.3px; }
.cart-item-price-note { font-size: 11px; color: var(--muted); }
.grand-price  { font-size: 22px; font-weight: 600; color: #166534; letter-spacing: -.5px; }
.grand-total-price { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.grand-price-label { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ── Materiais screen ───────────────────────────────────── */
.mat-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:var(--sp-lg); flex-wrap:wrap; gap:var(--sp-md); }
.mat-header h1 { font-size:26px; font-weight:600; letter-spacing:-.6px; color:var(--ink); }
.mat-header p  { font-size:13px; color:var(--muted); margin-top:3px; }

.mat-tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:var(--sp-lg); }
.mat-tab {
  padding:5px 14px; border-radius:var(--r-pill); font-size:13px; font-weight:500;
  border:1px solid var(--hairline); background:var(--canvas); color:var(--muted);
  cursor:pointer; transition:all .15s; white-space:nowrap;
}
.mat-tab:hover { border-color:var(--ink); color:var(--ink); }
.mat-tab.active { background:var(--ink); border-color:var(--ink); color:#fff; }
.mat-tab-dot { display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:5px; vertical-align:middle; }

.mat-toolbar { display:flex; align-items:center; justify-content:space-between; margin-bottom:var(--sp-sm); }
.mat-count { font-size:12px; color:var(--muted); }

.mat-table-wrap { border:1px solid var(--hairline); border-radius:var(--r-lg); overflow:hidden; }
.mat-table { width:100%; border-collapse:collapse; font-size:13px; }
.mat-table thead th {
  background:var(--surface-card); padding:10px 14px; text-align:left;
  font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.5px;
  color:var(--muted); border-bottom:1px solid var(--hairline); white-space:nowrap;
}
.mat-table tbody tr { border-bottom:1px solid var(--hairline-soft); transition:background .1s; }
.mat-table tbody tr:last-child { border-bottom:none; }
.mat-table tbody tr:hover { background:var(--surface-soft); }
.mat-table td { padding:11px 14px; vertical-align:middle; }
.mat-td-code { font-size:11px; color:var(--muted); font-family:monospace; }
.mat-td-name { font-weight:500; color:var(--ink); }
.mat-td-desc { font-size:11px; color:var(--muted); margin-top:1px; }
.mat-cat-badge {
  display:inline-block; padding:2px 8px; border-radius:var(--r-pill);
  font-size:10px; font-weight:600; white-space:nowrap;
}
.mat-td-price { font-weight:600; color:var(--ink); text-align:right; }
.mat-td-custo { color:var(--muted); text-align:right; }
.mat-td-markup { text-align:right; color:var(--muted); }
.mat-td-un { text-align:center; }
.mat-td-actions { text-align:right; white-space:nowrap; }
.mat-btn-edit {
  background:none; border:1px solid var(--hairline); border-radius:var(--r-sm);
  padding:4px 10px; font-size:12px; color:var(--muted); cursor:pointer;
  transition:all .15s;
}
.mat-btn-edit:hover { border-color:var(--ink); color:var(--ink); }
.mat-btn-del {
  background:none; border:none; padding:4px 8px; font-size:12px;
  color:var(--muted); cursor:pointer; border-radius:var(--r-sm); transition:all .15s;
}
.mat-btn-del:hover { color:var(--error); background:#fef2f2; }
.mat-empty { text-align:center; padding:var(--sp-xxl); color:var(--muted); font-size:14px; }
.mat-loading { text-align:center; padding:var(--sp-xl); color:var(--muted); font-size:13px; }

/* Modal */
.mat-modal-overlay {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,.45);
  z-index:300; align-items:center; justify-content:center; padding:var(--sp-lg);
}
.mat-modal-overlay.open { display:flex; }
.mat-modal {
  background:var(--canvas); border-radius:var(--r-xl); padding:var(--sp-xl);
  width:100%; max-width:520px; max-height:90vh; overflow-y:auto;
  box-shadow:0 24px 64px rgba(0,0,0,.18);
}
.mat-modal-title { font-size:18px; font-weight:600; color:var(--ink); margin-bottom:var(--sp-lg); }
.mat-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:var(--sp-md); }
.mat-form-grid .full { grid-column:1/-1; }
.mat-field label { display:block; font-size:12px; font-weight:600; color:var(--muted); margin-bottom:5px; text-transform:uppercase; letter-spacing:.4px; }
.mat-field input, .mat-field select {
  width:100%; padding:9px 12px; border:1px solid var(--hairline);
  border-radius:var(--r-md); font-size:14px; font-family:inherit;
  color:var(--ink); background:var(--canvas); transition:border-color .15s;
}
.mat-field input:focus, .mat-field select:focus { outline:none; border-color:var(--ink); }
.mat-field input[readonly] { background:var(--surface-card); color:var(--muted); }
.mat-modal-footer { display:flex; gap:10px; justify-content:flex-end; margin-top:var(--sp-xl); padding-top:var(--sp-md); border-top:1px solid var(--hairline); }
.mat-preview { background:var(--surface-soft); border-radius:var(--r-md); padding:var(--sp-sm) var(--sp-md); display:flex; justify-content:space-between; align-items:center; margin-top:var(--sp-md); }
.mat-preview-label { font-size:12px; color:var(--muted); }
.mat-preview-price { font-size:18px; font-weight:700; color:var(--ink); }

/* ── Print styles ───────────────────────────────────────── */
@media print {
  @page { margin: 14mm 12mm; }
  body > * { display: none !important; }
  #print-area { display: block !important; background: #fff; }
}
#print-area { display: none; }

.print-page { padding: 32px 40px; max-width: 800px; margin: 0 auto; font-family: 'Inter', sans-serif; color: #111; }
.print-logo-row { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #111; padding-bottom: 16px; margin-bottom: 24px; }
.print-logo-name { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.print-logo-sub  { font-size: 12px; color: #6b7280; margin-top: 2px; }
.print-meta { text-align: right; font-size: 12px; color: #374151; line-height: 1.7; }
.print-meta strong { color: #111; font-weight: 600; }
.print-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #6b7280; margin: 20px 0 10px; }
.print-item {
  display: grid; grid-template-columns: 120px 1fr;
  border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden;
  margin-bottom: 10px; page-break-inside: avoid;
}
.print-item-thumb {
  background: #f0fdf4; border-right: 1px solid #e5e7eb;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 8px; gap: 6px;
}
.print-item-body { padding: 12px 16px; }
.print-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.print-item-name { font-size: 14px; font-weight: 600; }
.print-item-qty  { font-size: 13px; font-weight: 700; color: #166534; background: #dcfce7; border-radius: 999px; padding: 2px 12px; }
.print-spec-grid { display: grid; grid-template-columns: 130px 1fr 130px 1fr; gap: 3px 12px; }
.print-spec-key  { font-size: 10px; color: #6b7280; }
.print-spec-val  { font-size: 11px; font-weight: 500; color: #111; }
.print-spec-hl   { color: #166534; font-weight: 600; }
.print-obs       { font-size: 11px; color: #374151; margin-top: 6px; padding-top: 6px; border-top: 1px solid #f3f4f6; }
.print-footer    { margin-top: 32px; padding-top: 16px; border-top: 1px solid #e5e7eb; display: flex; justify-content: space-between; font-size: 11px; color: #9ca3af; }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  border-radius: var(--r-lg); padding: 14px 20px;
  font-size: 14px; font-weight: 500;
  z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  transform: translateY(8px);
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-success { background: var(--surface-dark); color: var(--on-dark); }
.toast.toast-info    { background: var(--primary);      color: var(--on-dark); }

/* ── Fade animation ─────────────────────────────────────── */
.fade { animation: fadeUp .2s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Footer ─────────────────────────────────────────────── */
footer { background: var(--surface-dark); color: var(--on-dark-soft); padding: var(--sp-xxl) var(--sp-xl); margin-top: 96px; text-align: center; font-size: 13px; }
.footer-brand { font-size: 15px; font-weight: 600; color: var(--on-dark); margin-bottom: 6px; }

/* ── Calculated dimensions panel ───────────────────────── */
.calc-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--r-lg);
  padding: var(--sp-md) var(--sp-lg);
}
.calc-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-sm);
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid #bbf7d0;
}
.calc-title { font-size: 13px; font-weight: 600; color: #166534; }
.calc-badge {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
  color: #166534; background: #bbf7d0; border-radius: var(--r-pill);
  padding: 2px 8px;
}
.calc-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; padding: 4px 0;
}
.calc-row + .calc-row { border-top: 1px solid #d1fae5; }
.calc-label { color: #166534; }
.calc-value { font-weight: 600; color: #14532d; font-size: 13px; font-variant-numeric: tabular-nums; }
.calc-value.warn { color: var(--error); }
.calc-note-row { font-size: 11px; color: #4ade80; margin-top: var(--sp-xs); text-align: right; }

/* ── Manual link ────────────────────────────────────────── */
.manual-link {
  display: flex; align-items: center; gap: 8px;
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 10px 14px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  text-decoration: none; transition: border-color .15s, color .15s;
}
.manual-link:hover { border-color: var(--ink); color: var(--ink); }

/* ── Section divider inside form ────────────────────────── */
.form-section {
  display: flex; flex-direction: column; gap: var(--sp-xl);
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--hairline);
}
.stepper-body .form-section { border-top: none; padding-top: 0; }
.stepper-body .form-section + .form-section { margin-top: 24px; }
.form-section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted);
  margin-bottom: calc(-1 * var(--sp-sm));
}

/* ── Lead popup ─────────────────────────────────────────────── */
.lead-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-md);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.lead-overlay.open { opacity: 1; pointer-events: all; }

.lead-modal {
  background: var(--canvas); border-radius: var(--r-xl);
  width: 100%; max-width: 460px;
  padding: var(--sp-xl);
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  transform: translateY(12px);
  transition: transform .2s;
}
.lead-overlay.open .lead-modal { transform: translateY(0); }

.lead-close {
  position: absolute; top: 16px; right: 16px;
  width: 30px; height: 30px;
  background: var(--surface-card); border: none; border-radius: 50%;
  font-size: 14px; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.lead-close:hover { background: var(--hairline); color: var(--ink); }

.lead-modal-header { margin-bottom: var(--sp-lg); }
.lead-icon {
  width: 44px; height: 44px; border-radius: var(--r-lg);
  background: var(--surface-card);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-sm);
}
.lead-modal-header h2 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.lead-modal-header p  { font-size: 14px; color: var(--muted); }

.lead-form { display: flex; flex-direction: column; gap: var(--sp-md); }
.lead-field { display: flex; flex-direction: column; gap: 6px; }
.lead-field label {
  font-size: 13px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 6px;
}
.lead-optional { font-weight: 400; color: var(--muted); }
.lead-field input {
  height: 40px; padding: 0 12px;
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--canvas);
  transition: border-color .15s;
  outline: none;
}
.lead-field input:focus { border-color: var(--ink); }

.lead-error {
  font-size: 13px; color: var(--error);
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: var(--r-md); padding: 10px 12px;
}

.lead-success {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: var(--sp-md) 0;
  gap: var(--sp-sm);
}
.lead-success svg   { margin-bottom: 4px; }
.lead-success h2    { font-size: 20px; font-weight: 700; }
.lead-success p     { font-size: 14px; color: var(--muted); margin-bottom: var(--sp-sm); }

/* ── Meus Pedidos ───────────────────────────────────────────────── */
#orders-list { display: flex; flex-direction: column; gap: 12px; max-width: 860px; }

.order-card {
  background: var(--surface-card);
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow .18s;
}
.order-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.07); }

.order-card-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  cursor: pointer; user-select: none;
}
.order-card-header:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.order-card-meta {
  display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap;
}
.order-card-number {
  font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap;
}
.order-card-info {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0;
}
.order-card-date  { font-size: 12px; color: var(--muted); }
.order-card-total { font-size: 14px; font-weight: 600; color: var(--ink); }

.order-card-chevron {
  flex-shrink: 0; color: var(--muted);
  transition: transform .2s ease;
}

/* corpo colapsável */
.order-card-body {
  border-top: 1.5px solid var(--hairline);
  padding: 20px;
}

/* lista de itens dentro do pedido */
.order-items-list {
  display: flex; flex-direction: column; gap: 16px;
}

/* linha de um item */
.order-item-row {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 14px;
  background: var(--surface-alt, #f8f9fa);
  border-radius: var(--r-md);
  border: 1px solid var(--hairline-soft, #f0f0f0);
}

/* thumb SVG */
.order-item-thumb {
  position: relative; flex-shrink: 0;
  width: 220px; height: 220px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.order-item-thumb svg { max-width: 100%; max-height: 100%; display: block; }
.order-item-qty-badge {
  position: absolute; bottom: 5px; right: 6px;
  background: var(--ink); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 20px;
  line-height: 1.4;
}

/* info */
.order-item-info { flex: 1; min-width: 0; }
.order-item-type  { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.order-item-label { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 8px; line-height: 1.3; }

.order-item-specs  { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.order-item-spec-row {
  display: flex; gap: 6px; font-size: 12px; line-height: 1.5;
}
.order-item-spec-key { color: var(--muted); flex-shrink: 0; }
.order-item-spec-val { color: var(--ink); font-weight: 500; }
.order-item-spec-val.cart-spec-hl { color: var(--primary); }

.order-item-price {
  font-size: 13px; font-weight: 700; color: var(--ink);
  padding-top: 8px; border-top: 1px solid var(--hairline-soft, #f0f0f0);
}

@media (max-width: 520px) {
  .order-item-row   { flex-direction: column; }
  .order-item-thumb { width: 100%; height: 120px; }
  .order-card-header { flex-wrap: wrap; }
  .order-card-info  { flex-direction: row; gap: 8px; align-items: center; }
}

/* ── Face picker (seletor de posição do puxador) ───────────────────── */
.face-picker { display:flex; justify-content:center; margin:10px 0 4px; }
.face-picker-inner {
  display:grid;
  grid-template-columns:52px 72px 52px;
  grid-template-rows:28px 44px 28px;
  gap:3px;
  align-items:center;
  justify-items:center;
}
.face-picker-center {
  width:72px; height:44px;
  background:#e5e7eb; border:1.5px solid #d1d5db; border-radius:3px;
  justify-self:stretch; align-self:stretch;
}
.face-btn {
  font-size:11px; font-family:inherit;
  background:#f8fafc; border:1.5px solid #cbd5e1; border-radius:4px;
  color:#64748b; cursor:pointer; transition:all 0.12s;
  justify-self:stretch; align-self:stretch;
  padding:0; display:flex; align-items:center; justify-content:center;
}
.face-btn:hover:not(.face-disabled) { background:#e2e8f0; border-color:#94a3b8; }
.face-btn.on { background:#dbeafe; border-color:#3b82f6; color:#1d4ed8; font-weight:600; }
.face-btn.face-disabled { opacity:0.3; cursor:not-allowed; pointer-events:none; }

/* ── Payment Modal (MP Bricks) ──────────────────────────────────── */
.pay-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 400;
  align-items: center; justify-content: center; padding: var(--sp-lg);
}
.pay-modal-overlay.open { display: flex; }
.pay-modal-box {
  background: var(--canvas); border-radius: var(--r-xl);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
}
.pay-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: var(--sp-xl) var(--sp-xl) var(--sp-md);
}
.pay-modal-title    { font-size: 18px; font-weight: 600; color: var(--ink); }
.pay-modal-subtitle { font-size: 13px; color: var(--muted); margin-top: 3px; }
.pay-modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 4px; border-radius: var(--r-sm);
  display: flex; align-items: center; transition: color .15s;
}
.pay-modal-close:hover { color: var(--ink); }
#pay-brick-container { padding: 0 var(--sp-xl) var(--sp-xl); }

/* ── Order pay bar ──────────────────────────────────────────────── */
.order-pay-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px var(--sp-lg);
  background: #fffbeb; border-top: 1px solid #fde68a;
}
.order-pay-bar-label { font-size: 13px; color: #92400e; font-weight: 500; }
