/* Orçamento público (T29) — NR Representações (Fase 11) */
/* Tema claro; tokens Max; fluxo WhatsApp intacto */

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

html.theme-light { color-scheme: light; }

body.orc-body {
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--text);
  font-size: 15px;
  padding-bottom: 96px;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
}

.svg-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

/* ── Header ─────────────────────────────────────────────── */
.orc-header {
  background: var(--accent);
  color: #fff;
  padding: var(--space-5) var(--space-4);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-md);
}
.orc-header-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.orc-header-ic {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.orc-header h1 {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.orc-header p {
  font-size: var(--text-xs);
  opacity: 0.92;
  margin-top: 3px;
  line-height: 1.4;
}
.orc-brand-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.18);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 4px;
}

/* ── Conteúdo ───────────────────────────────────────────── */
.orc-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-4);
}

.orc-search-wrap {
  position: relative;
  margin-bottom: var(--space-2);
}
.orc-search-wrap .svg-ic {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}
.orc-search {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 15px;
  outline: none;
  background: var(--bg-surface);
  color: var(--text);
  font-family: var(--font-sans);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.orc-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-focus);
}

.orc-cats {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-3) 0 var(--space-2);
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.orc-cats::-webkit-scrollbar { display: none; }

.orc-cat {
  white-space: nowrap;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.orc-cat:hover { background: var(--bg-muted); }
.orc-cat.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.orc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: var(--space-2);
}
@media (min-width: 520px) {
  .orc-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.orc-prod {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.orc-prod-img {
  width: 100%;
  height: 90px;
  border-radius: var(--radius-md);
  background: var(--bg-muted) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  margin-bottom: var(--space-2);
  border: 1px solid var(--border);
}
.orc-prod-nome {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2px;
}
.orc-prod-desc {
  font-size: 11px;
  color: var(--text-subtle);
  line-height: 1.3;
  flex: 1;
  margin-bottom: 6px;
}
.orc-prod-preco {
  font-size: 14px;
  font-weight: 800;
  color: var(--success);
  margin-bottom: var(--space-2);
}
.orc-prod-preco small {
  color: var(--text-subtle);
  font-weight: 500;
  font-size: 11px;
}
.orc-prod-preco.muted {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.orc-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}
.orc-qbtn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--motion-fast);
}
.orc-qbtn:hover { background: var(--accent-soft); }
.orc-qval {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.orc-add-btn {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  transition: background var(--motion-fast);
}
.orc-add-btn:hover { background: var(--accent-hover); }

.orc-empty {
  text-align: center;
  color: var(--text-subtle);
  padding: 50px 20px;
  font-size: var(--text-sm);
  line-height: 1.5;
}
.orc-empty .svg-ic {
  display: block;
  margin: 0 auto 12px;
  color: var(--text-subtle);
}

/* ── Cart bar ───────────────────────────────────────────── */
#cartbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.1);
  padding: var(--space-3) var(--space-4);
  z-index: 30;
  transform: translateY(110%);
  transition: transform var(--motion-fast) var(--motion-ease);
}
#cartbar.show { transform: translateY(0); }

.orc-cartbar-row {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.orc-cart-info { flex: 1; min-width: 0; }
.orc-cart-qtd {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
}
.orc-cart-total {
  font-size: var(--text-xl);
  font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.orc-cart-fechar {
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: filter var(--motion-fast);
  white-space: nowrap;
}
.orc-cart-fechar:hover { filter: brightness(1.06); }

/* ── Bottom sheet carrinho ──────────────────────────────── */
#modal {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 40;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
#modal.show { display: flex; }

.orc-modal-box {
  background: var(--bg-surface);
  width: 100%;
  max-width: 680px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
@media (prefers-reduced-motion: no-preference) {
  #modal.show .orc-modal-box {
    animation: orc-sheet-in var(--motion-fast) var(--motion-ease) both;
  }
}
@keyframes orc-sheet-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.orc-modal-hd {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.orc-modal-hd h2 {
  font-size: var(--text-lg);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.orc-modal-x {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.orc-modal-body {
  padding: var(--space-4);
  overflow-y: auto;
  flex: 1;
}

.orc-ci {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}
.orc-ci-nome { flex: 1; min-width: 0; }
.orc-ci-nome small {
  display: block;
  color: var(--text-subtle);
  font-size: 12px;
  margin-top: 2px;
}
.orc-ci-x {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 4px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orc-fld { margin-top: var(--space-3); }
.orc-fld label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.orc-modal-ft {
  padding: var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
}
.orc-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  font-size: var(--text-base);
  font-weight: 600;
}
.orc-total-line b {
  font-size: var(--text-2xl);
  color: var(--success);
  font-variant-numeric: tabular-nums;
}
.orc-send-btn {
  width: 100%;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px;
  font-size: var(--text-base);
  font-weight: 800;
  cursor: pointer;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter var(--motion-fast);
}
.orc-send-btn:hover:not(:disabled) { filter: brightness(1.06); }
.orc-send-btn:disabled { opacity: 0.6; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  #modal.show .orc-modal-box { animation: none; }
}
