/* ════════════════════════════════════════════════════════════════════════
   Sistema de Orçamento — Serviços Gráficos
   Tema: Grafite Moderno + Azul Elétrico
   Estratégia: Mobile-first, CSS Custom Properties, Inter font
   ════════════════════════════════════════════════════════════════════════ */

/* ── 1. Variáveis ────────────────────────────────────────────────────────── */
:root {
  /* Paleta */
  --color-bg:           #f1f5f9;
  --color-surface:      #ffffff;
  --color-primary:      #1e293b;
  --color-primary-dk:   #0f172a;
  --color-accent:       #3b82f6;
  --color-accent-dk:    #2563eb;
  --color-accent-light: #dbeafe;
  --color-text:         #0f172a;
  --color-text-2:       #334155;
  --color-muted:        #64748b;
  --color-border:       #e2e8f0;
  --color-success:      #059669;
  --color-danger:       #dc2626;
  --color-danger-bg:    #fee2e2;
  --color-warning:      #d97706;
  --color-warning-bg:   #fef3c7;

  /* Tipografia */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-xs:   0.75rem;
  --font-sm:   0.875rem;
  --font-base: 1rem;
  --font-lg:   1.125rem;
  --font-xl:   1.25rem;
  --font-2xl:  1.5rem;
  --font-3xl:  2.25rem;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 4px 16px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.04);
  --shadow-lg: 0 8px 32px rgba(15,23,42,.12), 0 4px 12px rgba(15,23,42,.06);
  --shadow-sheet: 0 -8px 40px rgba(15,23,42,.20);

  /* Raios */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Transições */
  --t-fast:   150ms ease;
  --t-normal: 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 2. Reset e base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  font-size:   var(--font-base);
  color:       var(--color-text);
  background:  var(--color-bg);
  min-height:  100vh;
  -webkit-text-size-adjust: 100%;
}

/* ── 3. Header ───────────────────────────────────────────────────────────── */
.app-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dk) 100%);
  border-bottom: 3px solid var(--color-accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header__inner {
  display: flex;
  align-items: center;
  padding: 14px 0;
}

.app-header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header__icon {
  font-size: 1.75rem;
  color: var(--color-accent);
  flex-shrink: 0;
}

.app-header__title {
  margin: 0;
  font-size: var(--font-xl);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.app-header__subtitle {
  display: block;
  font-size: var(--font-xs);
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-top: 1px;
}

@media (min-width: 768px) {
  .app-header__icon   { font-size: 2.1rem; }
  .app-header__title  { font-size: var(--font-2xl); }
  .app-header__subtitle { font-size: 0.78rem; }
}

/* ── 4. Main layout ──────────────────────────────────────────────────────── */
.app-main {
  padding: 20px 0 100px; /* extra bottom for mobile safe area */
}

@media (min-width: 768px) {
  .app-main { padding: 32px 0 48px; }
}

/* ── 5. App Card (formulário) ────────────────────────────────────────────── */
.app-card {
  background:    var(--color-surface);
  border-radius: var(--r-lg);
  box-shadow:    var(--shadow-md);
  overflow:      hidden;
  margin-bottom: 20px;
}

.app-card__header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--color-border);
}

.app-card__header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.app-card__header-icon {
  color: var(--color-accent);
  font-size: 1.1rem;
}

.app-card__header-title {
  margin: 0;
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--color-text);
}

/* Barra de progresso dos passos */
.progress-bar-wrap {
  height: 5px;
  background: var(--color-border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-dk) 100%);
  border-radius: 99px;
  transition: width var(--t-normal);
}

.progress-label {
  margin: 0;
  font-size: var(--font-xs);
  color:      var(--color-muted);
  font-weight: 500;
}

.app-card__body {
  padding: 20px;
}

@media (min-width: 768px) {
  .app-card__header { padding: 24px 28px 20px; }
  .app-card__body   { padding: 20px 28px 28px; }
}

/* ── 6. Form Steps ───────────────────────────────────────────────────────── */
.form-step {
  margin-bottom: 20px;
  animation: stepIn 0.25s ease-out both;
}

.form-step:last-child { margin-bottom: 0; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-step__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size:   var(--font-sm);
  font-weight: 600;
  color:       var(--color-text-2);
  margin-bottom: 8px;
  cursor: default;
  user-select: none;
}

/* Dot numerado ao lado do label */
.step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width:  24px;
  height: 24px;
  border-radius: 50%;
  font-size:   11px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--color-accent);
  color:      #fff;
  transition: background var(--t-fast);
}

.step-dot--done {
  background: var(--color-success);
}

/* ── 7. Field Groups (ícone + select/input) ──────────────────────────────── */
.field-group {
  position: relative;
}

.field-icon {
  position:  absolute;
  left:      14px;
  top:       50%;
  transform: translateY(-50%);
  color:     var(--color-muted);
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
  transition: color var(--t-fast);
}

/* Select customizado */
.field-select {
  width:        100%;
  height:       52px;
  padding:      0 44px 0 44px;
  font-family:  var(--font);
  font-size:    var(--font-base); /* 16px: evita zoom no iOS Safari */
  font-weight:  500;
  color:        var(--color-text);
  background:   var(--color-surface);
  border:       2px solid var(--color-border);
  border-radius: var(--r-sm);
  appearance:   none;
  -webkit-appearance: none;
  /* Seta customizada (chevron azul) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:   no-repeat;
  background-position: right 14px center;
  background-size:     18px;
  cursor:       pointer;
  transition:   border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.field-select:hover:not(:disabled) {
  border-color: #cbd5e1;
}

.field-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.field-select:focus + .field-icon,
.field-group:has(.field-select:focus) .field-icon {
  color: var(--color-accent);
}

.field-select:disabled {
  background-color: var(--color-bg);
  color: var(--color-muted);
  cursor: not-allowed;
  opacity: .7;
}

/* Input customizado (quantidade) */
.field-input {
  width:        100%;
  height:       52px;
  padding:      0 16px 0 44px;
  font-family:  var(--font);
  font-size:    var(--font-base); /* evita zoom iOS */
  font-weight:  500;
  color:        var(--color-text);
  background:   var(--color-surface);
  border:       2px solid var(--color-border);
  border-radius: var(--r-sm);
  transition:   border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.field-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.field-hint {
  margin: 6px 0 0;
  font-size: var(--font-xs);
  color: var(--color-muted);
  min-height: 1em;
}

/* ── 8. Botão Calcular ───────────────────────────────────────────────────── */
.btn-calcular {
  display:        flex;
  align-items:    center;
  justify-content: center;
  gap:            8px;
  width:          100%;
  margin-top:     12px;
  padding:        0 24px;
  height:         52px;
  font-family:    var(--font);
  font-size:      var(--font-base);
  font-weight:    600;
  color:          #fff;
  background:     linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dk) 100%);
  border:         none;
  border-radius:  var(--r-sm);
  cursor:         pointer;
  box-shadow:     0 4px 14px rgba(59,130,246,.35);
  transition:     transform var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn-calcular:hover:not(:disabled) {
  transform:  translateY(-1px);
  box-shadow: 0 6px 20px rgba(59,130,246,.45);
}

.btn-calcular:active:not(:disabled) {
  transform:  translateY(0);
  box-shadow: 0 2px 8px rgba(59,130,246,.30);
}

.btn-calcular:disabled {
  opacity: .65;
  cursor:  not-allowed;
  transform: none;
}

.btn-calcular:focus-visible {
  outline: 3px solid var(--color-accent-light);
  outline-offset: 2px;
}

/* ── 9. Result Card (desktop e mobile) ───────────────────────────────────── */
.result-card {
  background:    var(--color-surface);
  border-radius: var(--r-lg);
  box-shadow:    var(--shadow-md);
  border-top:    4px solid var(--color-accent);
  overflow:      hidden;
  /* animação de entrada (desktop) */
  animation: stepIn 0.3s ease-out;
}

.result-card__body {
  padding: 20px;
}

/* Drag handle (só visível no mobile) */
.sheet-handle {
  display: none;
}

.result-card__top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.result-card__title {
  font-size:   var(--font-xs);
  font-weight: 700;
  color:       var(--color-muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin: 0;
}

.btn-icon-sm {
  display: inline-flex;
  align-items:  center;
  justify-content: center;
  width:  36px;
  height: 36px;
  border: 1.5px solid var(--color-border);
  border-radius: 50%;
  background: transparent;
  color:  var(--color-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn-icon-sm:hover {
  background:   var(--color-bg);
  border-color: var(--color-text-2);
  color:        var(--color-text);
}

.btn-icon-sm:focus-visible {
  outline: 3px solid var(--color-accent-light);
  outline-offset: 2px;
}

.result-service {
  font-size:  var(--font-sm);
  color:      var(--color-muted);
  margin:     0 0 16px;
  word-break: break-word;
  line-height: 1.4;
}

/* Caixa do preço em destaque */
.result-price-box {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dk) 100%);
  border-radius: var(--r-md);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}

.result-total-label {
  font-size:   var(--font-xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
}

.result-total-value {
  font-size:   var(--font-3xl);
  font-weight: 800;
  color:       #60a5fa;   /* blue-400 — contraste alto no fundo escuro */
  line-height: 1;
  letter-spacing: -.03em;
}

@media (min-width: 768px) {
  .result-total-value { font-size: 2.6rem; }
}

/* Tabela de detalhes */
.result-details {
  font-size: var(--font-sm);
  color:     var(--color-text-2);
  margin-bottom: 4px;
}

.detail-row {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  padding:         7px 0;
  border-bottom:   1px solid var(--color-border);
}

.detail-row:last-child { border-bottom: none; }

.detail-label { color: var(--color-muted); }
.detail-value { font-weight: 600; color: var(--color-text); }

/* Nota de fallback */
.result-nota {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--color-warning-bg);
  border: 1px solid #fde68a;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: var(--font-sm);
  color: #92400e;
  margin-top: 12px;
  line-height: 1.4;
}

.result-nota i { flex-shrink: 0; margin-top: 1px; }

/* Ações do resultado */
.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-outline-action {
  flex: 1;
  display: flex;
  align-items:     center;
  justify-content: center;
  gap:    6px;
  height: 44px;
  font-family:  var(--font);
  font-size:    var(--font-sm);
  font-weight:  600;
  color:        var(--color-accent);
  background:   transparent;
  border:       2px solid var(--color-accent);
  border-radius: var(--r-sm);
  cursor:  pointer;
  transition: background var(--t-fast), color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn-outline-action:hover {
  background: var(--color-accent-light);
}

.btn-ghost-action {
  flex: 1;
  display: flex;
  align-items:     center;
  justify-content: center;
  gap:    6px;
  height: 44px;
  font-family:  var(--font);
  font-size:    var(--font-sm);
  font-weight:  600;
  color:        var(--color-muted);
  background:   transparent;
  border:       2px solid var(--color-border);
  border-radius: var(--r-sm);
  cursor:  pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn-ghost-action:hover {
  background:   var(--color-bg);
  border-color: #cbd5e1;
  color:        var(--color-text-2);
}

/* ── 10. Adicionar ao pedido ─────────────────────────────────────────────── */
.btn-add-sacola {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:       8px;
  width:     100%;
  height:    48px;
  margin-top: 16px;
  font-family:  var(--font);
  font-size:    var(--font-base);
  font-weight:  600;
  color:        #fff;
  background:   linear-gradient(135deg, #059669 0%, #047857 100%);
  border:       none;
  border-radius: var(--r-sm);
  cursor:  pointer;
  box-shadow: 0 3px 12px rgba(5,150,105,.30);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn-add-sacola:hover {
  transform:  translateY(-1px);
  box-shadow: 0 5px 18px rgba(5,150,105,.40);
}

.btn-add-sacola:active { transform: translateY(0); }

.btn-add-sacola:focus-visible {
  outline: 3px solid #6ee7b7;
  outline-offset: 2px;
}

/* ── 11. Sacola de Pedidos ───────────────────────────────────────────────── */

/* Botão flutuante */
.btn-sacola-flutuante {
  position:   fixed;
  bottom:     calc(24px + env(safe-area-inset-bottom, 0px));
  right:      20px;
  z-index:    900;
  width:      58px;
  height:     58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dk) 100%);
  color:      #fff;
  border:     none;
  font-size:  1.35rem;
  box-shadow: 0 4px 18px rgba(59,130,246,.40);
  cursor:     pointer;
  display:    flex;
  align-items: center;
  justify-content: center;
  position:   fixed; /* sobrescreve absolute implícito */
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn-sacola-flutuante:hover {
  transform:  translateY(-2px) scale(1.05);
  box-shadow: 0 6px 24px rgba(59,130,246,.50);
}

.btn-sacola-flutuante:focus-visible {
  outline: 3px solid var(--color-accent-light);
  outline-offset: 3px;
}

.sacola-count {
  position:  absolute;
  top:       -3px;
  right:     -3px;
  min-width: 22px;
  height:    22px;
  padding:   0 4px;
  border-radius: 99px;
  background: #ef4444;
  color:      #fff;
  font-size:  11px;
  font-weight: 700;
  display:    flex;
  align-items: center;
  justify-content: center;
  border:     2px solid var(--color-surface);
}

/* Overlay da sacola */
.sacola-overlay {
  position:   fixed;
  inset:      0;
  background: rgba(15, 23, 42, 0.45);
  z-index:    1055;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.sacola-overlay.overlay-open {
  animation: overlayIn 200ms ease both;
}

/* Painel da sacola */
.sacola-panel {
  position:       fixed;
  z-index:        1060;
  background:     var(--color-surface);
  display:        flex;
  flex-direction: column;
  /* Mobile: bottom sheet */
  bottom:        0;
  left:          0;
  right:         0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  max-height:    88vh;
  box-shadow:    var(--shadow-sheet);
  transform:     translateY(100%);
  transition:    transform var(--t-normal);
}

.sacola-panel.sacola-open {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .sacola-panel {
    top:           0;
    bottom:        0;
    right:         0;
    left:          auto;
    width:         420px;
    max-height:    100vh;
    border-radius: var(--r-lg) 0 0 var(--r-lg);
    transform:     translateX(100%);
  }
  .sacola-panel.sacola-open { transform: translateX(0); }
}

.sacola-panel__header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         20px 20px 16px;
  border-bottom:   1px solid var(--color-border);
  flex-shrink:     0;
}

.sacola-panel__title {
  display:     flex;
  align-items: center;
  gap:         8px;
  font-size:   var(--font-lg);
  font-weight: 700;
  color:       var(--color-text);
}

.sacola-panel__title i { color: var(--color-accent); }

/* Lista de itens (área rolável) */
.sacola-items {
  flex:       1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding:    16px 20px;
  min-height: 80px;
}

.sacola-vazia {
  text-align: center;
  color:      var(--color-muted);
  font-size:  var(--font-sm);
  padding:    32px 0;
}

.sacola-item {
  background:    var(--color-bg);
  border:        1px solid var(--color-border);
  border-radius: var(--r-sm);
  padding:       12px 14px;
  margin-bottom: 10px;
}

.sacola-item:last-child { margin-bottom: 0; }

.sacola-item__top {
  display:     flex;
  align-items: flex-start;
  gap:         8px;
  margin-bottom: 6px;
}

.sacola-item__num {
  min-width:       20px;
  height:          20px;
  border-radius:   50%;
  background:      var(--color-accent);
  color:           #fff;
  font-size:       11px;
  font-weight:     700;
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  flex-shrink:     0;
}

.sacola-item__servico {
  flex:        1;
  font-size:   var(--font-sm);
  font-weight: 600;
  color:       var(--color-text);
  line-height: 1.35;
}

.sacola-item__remove {
  background:  none;
  border:      none;
  color:       var(--color-muted);
  cursor:      pointer;
  font-size:   0.85rem;
  padding:     0;
  line-height: 1;
  flex-shrink: 0;
  transition:  color var(--t-fast);
}

.sacola-item__remove:hover { color: var(--color-danger); }

.sacola-item__detail {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  gap: 8px;
}

.sacola-item__qtd   { font-size: var(--font-xs); color: var(--color-muted); }
.sacola-item__total { font-size: var(--font-sm); font-weight: 700; color: var(--color-text); }

/* Rodapé fixo da sacola */
.sacola-panel__footer {
  flex-shrink:  0;
  padding:      16px 20px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  border-top:   1px solid var(--color-border);
}

.sacola-total-row {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  padding:         8px 0 14px;
}

.sacola-total-label { font-size: var(--font-sm); font-weight: 600; color: var(--color-text-2); }
.sacola-total-value { font-size: var(--font-xl); font-weight: 800; color: var(--color-text); }

.btn-copy-pedido {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:       8px;
  width:     100%;
  height:    48px;
  margin-bottom: 8px;
  font-family:  var(--font);
  font-size:    var(--font-base);
  font-weight:  600;
  color:        #fff;
  background:   #25d366;
  border:       none;
  border-radius: var(--r-sm);
  cursor:  pointer;
  box-shadow: 0 3px 12px rgba(37,211,102,.35);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn-copy-pedido:hover {
  transform:  translateY(-1px);
  box-shadow: 0 5px 18px rgba(37,211,102,.45);
}

.btn-copy-pedido:focus-visible {
  outline: 3px solid #86efac;
  outline-offset: 2px;
}

.btn-limpar-sacola {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:       6px;
  width:     100%;
  height:    38px;
  font-family:  var(--font);
  font-size:    var(--font-sm);
  font-weight:  500;
  color:        var(--color-danger);
  background:   transparent;
  border:       1.5px solid var(--color-border);
  border-radius: var(--r-sm);
  cursor:  pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn-limpar-sacola:hover {
  background:   var(--color-danger-bg);
  border-color: var(--color-danger);
}

/* ── 13. Bottom Sheet (mobile) ───────────────────────────────────────────── */
.sheet-overlay {
  display:    none;
  position:   fixed;
  inset:      0;
  background: rgba(15, 23, 42, 0.45);
  z-index:    1040;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.sheet-overlay.overlay-open {
  display: block;
  animation: overlayIn 200ms ease both;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Previne scroll do body quando sheet está aberta */
body.no-scroll { overflow: hidden; }

@media (max-width: 767px) {
  /* Transforma o result-card em bottom sheet */
  #result-card:not(.d-none) {
    animation:     none !important;  /* usa apenas transform para o efeito de sheet */
    position:      fixed !important;
    bottom:        0 !important;
    left:          0 !important;
    right:         0 !important;
    top:           auto !important;
    z-index:       1050;
    border-radius: var(--r-xl) var(--r-xl) 0 0 !important;
    border-top:    none !important;
    max-height:    88vh;
    overflow-y:    auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow:    var(--shadow-sheet);
    /* Estado inicial: fora da tela (abaixo) */
    transform:     translateY(100%);
    transition:    transform var(--t-normal);
    /* Espaço para home bar do iPhone */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    /* Remove margin que posicionaria no fluxo normal */
    margin: 0 !important;
  }

  #result-card.sheet-open {
    transform: translateY(0) !important;
  }

  /* Handle visual de arrasto */
  .sheet-handle {
    display:       block;
    width:         40px;
    height:        5px;
    background:    var(--color-border);
    border-radius: 99px;
    margin:        14px auto 4px;
    flex-shrink:   0;
  }

  /* Mais espaço nos botões mobile */
  .result-card__body { padding: 16px 20px 24px; }

  .btn-calcular { height: 56px; font-size: var(--font-lg); }
}

/* ── 11. Toast Notifications ─────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom:   20px;
  left:     50%;
  transform: translateX(-50%);
  z-index:   2000;
  display:   flex;
  flex-direction: column;
  gap:       8px;
  width:     min(400px, calc(100vw - 32px));
  pointer-events: none;
}

@media (min-width: 768px) {
  .toast-stack {
    top:       20px;
    bottom:    auto;
    right:     20px;
    left:      auto;
    transform: none;
    width:     340px;
  }
}

.toast-msg {
  display:       flex;
  align-items:   center;
  gap:           10px;
  padding:       14px 16px;
  background:    var(--color-primary-dk);
  color:         #fff;
  border-radius: var(--r-sm);
  font-size:     var(--font-sm);
  font-weight:   500;
  box-shadow:    var(--shadow-lg);
  pointer-events: auto;
  animation:     toastIn 250ms cubic-bezier(0.4,0,.2,1) both;
  border-left:   4px solid var(--color-danger);
}

.toast-msg--success { border-left-color: var(--color-success); }
.toast-msg--warning { border-left-color: var(--color-warning); }

.toast-msg i { flex-shrink: 0; font-size: 1.1rem; }

.toast-msg__text { flex: 1; line-height: 1.4; }

.toast-msg__close {
  background:  none;
  border:      none;
  color:       #94a3b8;
  cursor:      pointer;
  padding:     2px;
  font-size:   1rem;
  line-height: 1;
  flex-shrink: 0;
}

.toast-msg.toast-exit {
  animation: toastOut 200ms ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(.95); }
}

/* ── 12. Footer ──────────────────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding:    20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  font-size:  var(--font-xs);
  color:      var(--color-muted);
}

/* ── 13. Acessibilidade / Focus Global ───────────────────────────────────── */
:focus-visible {
  outline:        3px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── 14. Utilitários ─────────────────────────────────────────────────────── */
.d-none { display: none !important; }

/* ── 15. Impressão ───────────────────────────────────────────────────────── */
@media print {
  .app-header,
  .app-main,
  .app-footer,
  .sheet-overlay,
  .toast-stack,
  .sacola-panel,
  .sacola-overlay,
  .btn-sacola-flutuante,
  .btn-add-sacola,
  #btn-novo,
  #btn-novo-desktop,
  .result-actions {
    display: none !important;
  }

  body { background: #fff; }

  #result-card {
    position: static !important;
    transform: none !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    border-top: 3px solid var(--color-primary) !important;
    border-radius: 0 !important;
    max-height: none !important;
  }

  .result-price-box {
    background: var(--color-primary) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .result-total-value { color: #60a5fa !important; }
}
