:root {
  --primary: #DC2626;
  --primary-hover: #B91C1C;
  --primary-ink: #991B1B;
  --primary-tint: #FEE2E2;
  --dark: #1E293B;
  --dark-surface: #0F172A;
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-light: #475569;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --gray-pill: #F1F5F9;
  --border: #E2E8F0;
  --border-focus: #CBD5E1;
  --success: #166534;
  --success-tint: #DCFCE7;
  --warn: #92400E;
  --warn-tint: #FEF3C7;
  --radius-card: 16px;
  --radius-btn: 12px;
  --radius-pill: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Manrope', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Manrope', sans-serif;
  background-color: #F1F5F9;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.mobile-shell {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ── TELA DE LOGIN ── */
.login-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: #F8FAFC;
  text-align: center;
}

.login-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-tint);
  color: var(--primary-ink);
  font-weight: 800;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.login-brand-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 4px;
}

.login-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.login-box {
  width: 100%;
  background: #FFFFFF;
  border-radius: var(--radius-card);
  padding: 24px 20px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.input-group {
  margin-bottom: 14px;
  text-align: left;
}

.input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 46px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--dark);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  height: 48px;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-dark {
  width: 100%;
  height: 46px;
  background: var(--dark);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
}

/* ── HEADER CORPORATIVO LIMPO ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 14px 20px 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
}

.brand-badge {
  display: inline-block;
  background: #DC2626;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.user-avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #F1F5F9;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── BUSCA E FILTROS FLAT ── */
.search-row {
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 14px;
}

.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap svg {
  position: absolute;
  left: 14px;
  color: #94A3B8;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 42px 0 42px;
  font-size: 14px;
  color: var(--dark);
  outline: none;
  font-family: inherit;
}

.search-clear-btn {
  position: absolute;
  right: 6px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.search-input:focus {
  border-color: var(--primary);
  background: #FFFFFF;
}

/* ── CATEGORIAS EM PÍLULAS FLAT ── */
.category-scroller {
  display: flex;
  gap: 8px;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 16px;
}

.category-scroller::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--gray-pill);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.cat-pill.active {
  background: var(--dark);
  color: #FFFFFF;
  font-weight: 600;
}

/* ── GRID CORPORATIVO DE PRODUTOS COM IMAGEM ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px 110px 16px;
}

.product-card {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 10px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
}

.product-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.product-card-img-wrap {
  width: 100%;
  height: 115px;
  border-radius: 10px;
  background: #F8FAFC;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  position: relative;
  border: 1px solid #F1F5F9;
}

.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.product-card:hover .product-card-img {
  transform: scale(1.03);
}

.product-card-placeholder-icon {
  color: #94A3B8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.product-card-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--dark);
  line-height: 1.3;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}

.product-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #F8FAFC;
}

.product-card-price {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.product-card-badge-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}

.product-card-add-btn {
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--dark);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.product-card-add-btn:hover {
  background: var(--primary);
}

.product-card-qty-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #F1F5F9;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px;
}

.product-card-qty-btn {
  width: 34px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: #FFFFFF;
  color: var(--dark);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card-qty-btn.plus {
  background: var(--dark);
  color: #FFFFFF;
}

.product-card-qty-num {
  min-width: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--dark);
}

/* ── BARRA INFERIOR MODERNA E LIMPA ── */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 440px;
  min-height: 64px;
  padding: 4px 10px calc(4px + env(safe-area-inset-bottom)) 10px;
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
}

.nav-item {
  position: relative;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 48px;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 10px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 20px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active svg {
  stroke: var(--primary);
  stroke-width: 2.2;
}

/* ── BARRA FLUTUANTE DE CARRINHO (APARECE QUANDO HÁ ITENS) ── */
.floating-cart-pill {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 400px;
  height: 52px;
  background: var(--dark);
  color: #FFFFFF;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 45;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.cart-pill-count {
  background: var(--primary);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
  margin-right: 8px;
}

/* ── MODAIS E BOTTOM SHEETS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.product-detail-sheet {
  width: 100%;
  max-width: 440px;
  background: #FFFFFF;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 12px 22px 22px 22px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #CBD5E1;
  margin: 0 auto 14px auto;
}

.detail-close-btn,
.btn-fechar {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #F1F5F9;
  border: none;
  color: var(--dark);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.checkout-card {
  width: 100%;
  max-width: 420px;
  background: #FFFFFF;
  border-radius: 20px;
  padding: 22px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  margin: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.detail-img-hero {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0 12px 0;
  background: #F8FAFC;
  border-radius: 16px;
  overflow: hidden;
}

.detail-img-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.detail-close-inline {
  position: static;
  flex-shrink: 0;
}

.detail-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.25;
  margin: 0;
  flex: 1;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.detail-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.portion-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.portion-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
}

.portion-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portion-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--dark);
  color: #FFFFFF;
  border: none;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portion-btn.btn-sub {
  background: #E2E8F0;
  color: var(--dark);
}

.portion-count {
  font-size: 16px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.detail-action-bar {
  display: flex;
  align-items: center;
}

.detail-add-btn {
  width: 100%;
  height: 52px;
  padding: 0 20px;
  background: var(--primary);
  color: #FFFFFF;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.15s ease;
}

.detail-add-btn:hover:not(:disabled) {
  background: var(--primary-hover);
}

.detail-add-btn:disabled {
  background: #94A3B8;
  justify-content: center;
  cursor: not-allowed;
}

.detail-add-price {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 8px;
}

/* ── MODAL CHECKOUT ── */
.checkout-card-method {
  background: #F8FAFC;
  border: 1px solid var(--border);
  color: var(--dark);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkout-method-icon {
  width: 36px;
  height: 36px;
  background: #FEE2E2;
  color: #DC2626;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── MODAL SUCESSO ── */
.success-card {
  width: 100%;
  max-width: 340px;
  background: #FFFFFF;
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  margin: auto;
}

.success-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 32px;
  background: #DCFCE7;
  color: #16A34A;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
}

.success-msg {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 20px;
}

/* ── ESTOQUE E CARRINHO COFFEE SHOP ── */
.product-card.out-of-stock {
  opacity: 0.65;
}

.product-card-add-btn:disabled {
  background: #CBD5E1;
  color: #64748B;
  cursor: not-allowed;
}

.badge-stock-ok,
.badge-stock-low,
.badge-stock-empty {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.badge-stock-ok {
  background: var(--success-tint);
  color: var(--success);
}

.badge-stock-low {
  background: var(--warn-tint);
  color: var(--warn);
}

.badge-stock-empty {
  background: var(--primary-tint);
  color: var(--primary-ink);
}

/* ── CHECKOUT OPÇÕES DE PAGAMENTO ── */
.checkout-method-option {
  border: 1.5px solid var(--border);
  background: #FFFFFF;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.checkout-method-option.selected {
  border-color: var(--primary);
  background: #FEF2F2;
}

/* ── COFFEE BREAK CORPORATIVO ── */
.cb-package-card {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cb-package-card.selected {
  border-color: var(--primary);
  background: #FEF2F2;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.08);
}

.cb-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.cb-summary-card {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin: 6px 0 14px 0;
}

.cb-stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.cb-step-btn {
  border: 1px solid var(--border);
  background: #F8FAFC;
  color: var(--text-muted);
  border-radius: 10px;
  padding: 8px 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.cb-step-btn.active {
  background: #FEF2F2;
  border-color: var(--primary);
  color: var(--primary-ink);
}

.cb-step-btn.done {
  background: var(--success-tint);
  border-color: #86EFAC;
  color: var(--success);
}

.cb-nav-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn-secondary {
  height: 48px;
  padding: 0 18px;
  background: #F1F5F9;
  color: var(--dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:disabled {
  background: #94A3B8;
  cursor: not-allowed;
}

/* ── STATUS FILA (MEUS PEDIDOS) ── */
.status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-block;
}

.status-AguardandoPagamento {
  background: #FEF3C7;
  color: #92400E;
}

.status-Recebido {
  background: #DBEAFE;
  color: #1E40AF;
}

.status-EmPreparo {
  background: #FFEDD5;
  color: #9A3412;
}

.status-Pronto {
  background: #DCFCE7;
  color: #166534;
}

.status-Entregue {
  background: #F1F5F9;
  color: #475569;
}

.status-Cancelado {
  background: #FEE2E2;
  color: #991B1B;
}

.tipo-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: #F1F5F9;
  color: #475569;
}

.tipo-pill.cb {
  background: #EDE9FE;
  color: #5B21B6;
}
