﻿/* Cardápio público — responsivo, cores da marca (roxo + verde) */
@import url("tokens.css");

.cardapio-preview-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  padding: 0.65rem 1rem;
  background: #fef3c7;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.88rem;
  text-align: center;
}

.cardapio-preview-banner a {
  color: #b45309;
  font-weight: 700;
}

* {
  margin: 0;
  padding: 0;
}

html:has(body.page-cardapio) {
  overflow-x: hidden;
  max-width: 100%;
}

body.page-cardapio {
  color-scheme: light;
  overflow-x: hidden;
  max-width: 100%;
  font-family: var(--font);
  background:
    radial-gradient(900px 420px at 10% -8%, var(--brand-purple-glow), transparent 58%),
    radial-gradient(820px 460px at 100% 0%, var(--brand-green-glow), transparent 52%),
    linear-gradient(160deg, var(--surface-page-alt) 0%, #f0fdf4 55%, #ffffff 100%);
  color: var(--dark);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Header */
.app-header {
  background:
    radial-gradient(600px 240px at 15% 0%, rgba(255, 255, 255, 0.22), transparent 60%),
    linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--secondary) 100%);
  color: white;
  padding: clamp(1.35rem, 4vw, 2.35rem) max(1rem, env(safe-area-inset-right)) clamp(1.2rem, 3vw, 1.8rem) max(1rem, env(safe-area-inset-left));
  text-align: center;
  box-shadow: var(--shadow);
}

.app-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.25rem;
  width: 100%;
  max-width: min(56rem, 100%);
  margin: 0 auto;
  padding-inline: clamp(0.75rem, 2.5vw, 1.25rem);
  box-sizing: border-box;
}

.app-header__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: left;
  flex: 1 1 16rem;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding-inline: 0;
}

.app-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  flex: 0 0 auto;
}

.app-header__track,
.app-header__admin {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
}

.app-header__track:hover,
.app-header__admin:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: #fff;
  color: #fff;
}

.app-header__track:active,
.app-header__admin:active {
  transform: scale(0.98);
}

.modal-acompanhar__body .form-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--gray);
}

.app-header {
  width: 100%;
}

.app-header__logo,
.brand-logo {
  width: var(--logo-size);
  height: var(--logo-size);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.app-header__brand > div {
  min-width: 0;
  flex: 1;
}

.app-header h1 {
  font-size: clamp(1.55rem, 5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.app-header p {
  font-size: clamp(0.8rem, 2.2vw, 0.875rem);
  opacity: 0.9;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
}

/* Main layout — uma coluna no mobile; duas colunas a partir de 768px */
.main-container {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: clamp(0.85rem, 2.6vw, 2rem);
  padding-left: max(clamp(0.85rem, 2.6vw, 2rem), env(safe-area-inset-left));
  padding-right: max(clamp(0.85rem, 2.6vw, 2rem), env(safe-area-inset-right));
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  align-items: start;
  box-sizing: border-box;
}

.cart-panel,
.pedido-panel {
  width: 100%;
  min-width: 0;
}

.pedido-panel {
  order: 2;
  grid-column: 1;
  min-width: 0;
}

.cart-panel {
  order: 1;
  grid-column: 1;
  position: relative;
  align-self: start;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .pedido-panel {
    order: 1;
    grid-column: 1;
  }

  .cart-panel {
    order: 2;
    grid-column: 2;
    position: sticky;
    top: max(1rem, env(safe-area-inset-top));
    max-height: calc(100dvh - 2rem);
    border: 1px solid var(--border);
  }
}

@media (max-width: 767px) {
  .pedido-panel {
    order: 2;
  }

  .cart-panel {
    order: 1;
    position: sticky;
    top: max(0.5rem, env(safe-area-inset-top));
    z-index: 40;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
  }

  .cart-panel .cart-items {
    max-height: min(40dvh, 320px);
  }
}

.cart-panel .cart-items {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(52dvh, 520px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Modal de atenção personalizado */
.attention-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.attention-modal.open {
  visibility: visible;
  opacity: 1;
}

.attention-content {
  background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
  border-radius: var(--radius);
  max-width: 500px;
  width: 90%;
  padding: 2rem;
  text-align: center;
  border: 2px solid var(--warning);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: pulse 0.5s ease;
}

.attention-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.attention-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--warning);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.attention-message {
  font-size: 1.2rem;
  color: var(--dark);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.attention-number {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-size: 2.5rem;
  font-weight: 800;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 1.5rem;
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
}

.attention-button {
  background: linear-gradient(135deg, var(--warning) 0%, #b45309 100%);
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s;
}

.attention-button:hover {
  transform: scale(1.05);
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Produtos grid */
.produtos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: clamp(0.85rem, 2.5vw, 1.25rem);
}

/* Card do produto */
.produto-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.produto-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.produto-card.selected {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px var(--brand-purple-glow);
}

.produto-imagem {
  background: linear-gradient(135deg, var(--brand-purple-soft) 0%, var(--brand-green-soft) 100%);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.produto-info {
  padding: 1rem;
}

.produto-nome {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.25rem;
}

.produto-descricao {
  font-size: 0.75rem;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.produto-preco {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

/* Modal de customização */
.modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  min-height: 100dvh;
  background: rgba(12, 18, 34, 0.72);
  backdrop-filter: blur(8px);
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.modal-backdrop.active,
.modal-backdrop.open {
  visibility: visible;
  opacity: 1;
}

.modal-backdrop > .modal,
.modal-backdrop > .attention-modal {
  cursor: auto;
  pointer-events: auto;
}

.modal {
  background: var(--surface-card, var(--surface));
  border-radius: var(--radius);
  border: 1px solid var(--surface-border-strong, var(--border));
  max-width: min(560px, calc(100vw - 1.5rem));
  width: 100%;
  max-height: min(92dvh, calc(100dvh - 1.5rem));
  margin: auto;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  -webkit-overflow-scrolling: touch;
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--text-on-brand);
  padding: 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.modal-header .modal-subtitle {
  color: rgba(255, 255, 255, 0.92);
  margin-top: 0.35rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gray-light);
  display: flex;
  gap: 0.75rem;
}

/* Form elements (padrão público — equivalente ao .field do painel) */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.field-required-mark {
  color: #dc2626;
  font-weight: 700;
  margin-left: 0.12em;
}

.form-label small {
  font-weight: normal;
  color: var(--gray);
  font-size: 0.7rem;
}

.field-native-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  border: 0 !important;
  padding: 0 !important;
  clip: rect(0 0 0 0) !important;
  overflow: hidden !important;
}

.tamanho-form-group {
  margin-bottom: 1.5rem;
}

.cardapio-section-heading {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.cardapio-section-heading__bar {
  flex: 0 0 4px;
  width: 4px;
  height: 1.35rem;
  border-radius: 999px;
  background: #f97316;
}

.cardapio-section-heading__title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}

.tamanho-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 600px) {
  .modal-tamanho .tamanho-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

@media (max-width: 520px) {
  .tamanho-card {
    position: relative;
    flex-wrap: wrap;
    padding: 0.55rem 0.6rem 0.6rem;
    gap: 0.45rem;
  }

  .tamanho-card__media {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
  }

  .tamanho-card__content {
    flex: 1 1 calc(100% - 58px);
    min-width: 0;
  }

  .tamanho-card__title {
    font-size: 0.88rem;
    padding-right: 2rem;
  }

  .tamanho-card__subtitle {
    font-size: 0.75rem;
  }

  .tamanho-card__price {
    font-size: 0.92rem;
  }

  .tamanho-card__action {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    margin-left: 0;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    font-size: 1.15rem;
  }
}

@media (max-width: 360px) {
  .tamanho-cards {
    grid-template-columns: 1fr;
  }

  .tamanho-card__title {
    padding-right: 0;
  }

  .tamanho-card__action {
    position: static;
    margin-left: auto;
  }
}

.tamanho-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.tamanho-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.tamanho-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.22);
}

.tamanho-card.selected {
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.35), 0 4px 14px rgba(15, 23, 42, 0.1);
}

.tamanho-card__media {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}

.tamanho-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tamanho-card__content {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.tamanho-card__title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}

.tamanho-card__subtitle {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.25;
}

.tamanho-card__price {
  margin-top: 0.12rem;
  font-size: 1rem;
  color: #15803d;
  font-weight: 800;
  line-height: 1.1;
}

.tamanho-card__action {
  margin-left: 0.15rem;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f97316;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
}

.tamanho-resumo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
  padding: 0.75rem 0.9rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.tamanho-resumo__nome {
  font-weight: 700;
  color: #111827;
}

.tamanho-resumo__trocar {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f97316;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

#btn-escolher-tamanho[hidden] {
  display: none !important;
}

.modal-tamanho {
  max-width: min(720px, 100%);
}

.modal-tamanho .modal-body {
  padding-top: 0.5rem;
}

.sabor-resumo-group {
  margin-bottom: 1.25rem;
}

.sabor-resumo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.9rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.sabor-resumo__nome {
  font-weight: 700;
  color: #111827;
}

.sabor-resumo__trocar {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f97316;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.sabores-list {
  display: grid;
  gap: 0.55rem;
  max-height: min(52dvh, 420px);
  overflow-y: auto;
  padding: 0.15rem;
}

.sabor-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid rgba(203, 213, 225, 0.85);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.sabor-option:hover {
  border-color: #fdba74;
  background: #fff7ed;
}

.sabor-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.22);
}

.sabor-option.selected {
  border-color: #f97316;
  background: #fff7ed;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.sabor-option__nome {
  font-weight: 700;
  color: #111827;
  font-size: 0.95rem;
}

.sabor-option__preco {
  font-size: 0.85rem;
  font-weight: 600;
  color: #15803d;
  white-space: nowrap;
}

select,
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--dark);
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

@media (max-width: 768px) {
  select,
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  textarea {
    font-size: 16px;
  }
}

select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(107, 33, 165, 0.1);
}

input.error,
input.input-invalid,
textarea.input-invalid,
select.input-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.field-error-hint {
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Ingredientes grid */
.ingredientes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  max-height: 250px;
  overflow-y: auto;
  padding: 0.25rem;
}

.ingrediente-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem;
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(203, 213, 225, 0.75);
  background: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.ingrediente-item:hover {
  background: #f5f3ff;
}

.ingrediente-item.selected {
  background: #f0fdf4;
  border-color: rgba(22, 163, 74, 0.5);
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.28);
}

.ingrediente-item:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

.ingrediente-item input {
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin: 0;
}

.ingrediente-item label {
  flex: 1;
  cursor: pointer;
  font-size: 0.875rem;
}

.limit-warning {
  font-size: 0.7rem;
  color: var(--secondary);
  margin-top: 0.25rem;
}

.ingredientes-picker {
  display: grid;
  gap: 0.55rem;
}

.ingredientes-summary {
  min-height: 2.5rem;
  padding: 0.65rem 0.75rem;
  border: 1.5px dashed var(--gray-light);
  border-radius: var(--radius-sm);
  background: #f9fafb;
  color: var(--gray);
  font-size: 0.8rem;
  line-height: 1.4;
}

.ingredientes-summary.has-items {
  color: var(--primary-dark);
  background: #f3e8ff;
  border-color: rgba(107, 33, 165, 0.25);
  font-weight: 600;
}

.ingredientes-count {
  color: var(--gray);
  font-size: 0.75rem;
}

.modal-subtitle {
  margin-top: 0.25rem;
  font-size: 0.82rem;
  opacity: 0.9;
}

/* Extras row */
.extras-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.extra-option {
  flex: 1;
  text-align: center;
  min-width: min(150px, 100%);
  padding: 0.9rem;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.extra-option.selected {
  border-color: rgba(22, 163, 74, 0.55);
  background: #f0fdf4;
}

.extra-option input {
  display: none;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--brand-gradient-btn);
  color: var(--text-on-brand);
  box-shadow: 0 10px 22px var(--brand-purple-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-secondary {
  background: var(--brand-purple-soft);
  color: var(--primary-dark);
  border: 1px solid rgba(167, 139, 250, 0.45);
}

.btn-secondary:hover {
  background: #d1d5db;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-block {
  width: 100%;
}

/* Painéis — superfície e overflow */
.cart-panel,
.pedido-panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  height: fit-content;
  overflow: hidden;
}

.pedido-form {
  padding: clamp(1rem, 2.5vw, 1.35rem);
}

.pedido-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-purple-soft) 0%, var(--brand-green-soft) 100%);
  border: 1px solid rgba(187, 247, 208, 0.85);
  color: var(--primary-dark);
  font-weight: 700;
}

.pedido-preview strong {
  font-size: 1.1rem;
}

.cart-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 68%, var(--secondary) 100%);
  color: white;
  padding: 1rem 1.15rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

.cart-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
}

.cart-items {
  max-height: min(48dvh, 460px);
  overflow-y: auto;
  padding: 0.65rem;
}

.cart-item {
  padding: 0.75rem;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cart-item-header span {
  min-width: 0;
}

.cart-item-header span:first-child {
  flex: 1 1 12rem;
  overflow-wrap: anywhere;
}

.cart-item-header span:last-child {
  flex: 0 0 auto;
  white-space: nowrap;
}

.cart-item-details {
  color: var(--gray);
  white-space: pre-line;
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

.cart-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.cart-item-actions form {
  flex: 1 1 calc(33.333% - 0.35rem);
  min-width: min(100%, 7.5rem);
  margin: 0;
  display: flex;
}

.cart-item-actions .cart-item-edit,
.cart-item-actions .cart-item-repeat,
.cart-item-actions .cart-item-remove {
  flex: 1 1 auto;
  width: 100%;
  justify-content: center;
  text-align: center;
}

.cart-item-remove,
.cart-item-repeat,
.cart-item-edit {
  color: var(--danger);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  min-height: 40px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.cart-item-repeat {
  color: var(--primary-dark);
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.cart-item-edit {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.cart-item.is-editing {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.pedido-panel.is-editing .cart-header {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 68%, #60a5fa 100%);
}

.form-edit-hint {
  display: none;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.85rem;
  font-weight: 600;
}

.pedido-panel.is-editing .form-edit-hint {
  display: block;
}

.entrega-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.entrega-auth-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.entrega-auth-tab {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--dark);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.entrega-auth-tab.is-active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-color: transparent;
}

.entrega-hint {
  display: none;
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--gray);
  line-height: 1.45;
}

.entrega-cpf-aviso {
  display: none;
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  color: #5b21b6;
  font-size: 0.875rem;
  line-height: 1.45;
}

.entrega-cpf-aviso:not([hidden]) {
  display: block;
}

.entrega-hint.is-visible {
  display: block;
}

.entrega-section {
  display: none;
  margin-bottom: 0.25rem;
}

.entrega-section.is-visible {
  display: block;
}

.entrega-section--pagamento {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(203, 213, 225, 0.85);
}

.entrega-pagamento-total {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  color: var(--dark);
}

.entrega-pagamento-total strong {
  color: var(--primary-dark);
  font-size: 1.05rem;
}

.form-obrigatorio {
  color: #dc2626;
  font-weight: 800;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#forma_pagamento.is-invalid,
#forma_pagamento:invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

#forma_pagamento:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--brand-purple-glow);
}

.entrega-section-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(203, 213, 225, 0.85);
}

.troco-dinheiro {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.troco-dinheiro .form-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.entrega-logado-box {
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  font-size: 0.88rem;
}

.entrega-logado-box strong {
  color: var(--primary-dark);
}

.entrega-logado-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.entrega-logado-acoes .btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.82rem;
  text-decoration: underline;
}

.entrega-form [data-campo] {
  display: none;
}

.entrega-form [data-campo].is-visible {
  display: block;
}

.entrega-form input[type="password"],
.entrega-form input[type="email"] {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--dark);
  font-size: 1rem;
}

.entrega-form input[type="password"]:focus,
.entrega-form input[type="email"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(107, 33, 165, 0.1);
}

.auth-recuperar {
  margin: -0.35rem 0 0;
  font-size: 0.82rem;
}

.auth-recuperar-label {
  margin: 0 0 0.5rem;
  color: var(--gray);
  font-size: 0.8rem;
}

.auth-recuperar-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auth-recuperar-acoes .btn-recuperar-canal {
  flex: 1 1 calc(50% - 0.25rem);
  min-height: 42px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--primary-dark);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-recuperar-acoes .btn-recuperar-canal:hover {
  border-color: var(--primary);
  background: #f5f3ff;
}

.entrega-opcao {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 0.875rem;
}

.entrega-opcao input {
  margin-top: 0.15rem;
  width: auto;
}

.modal-entrega .modal-footer {
  flex-wrap: wrap;
}

.modal-entrega .modal-footer .btn {
  flex: 1 1 auto;
  min-width: min(100%, 140px);
}

.repeat-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-top: 0.25rem;
}

.repeat-actions .btn-repeat {
  min-height: 44px;
  font-size: 0.9rem;
}

.cart-total {
  padding: 1rem;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.125rem;
}

.cart-actions {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.empty-cart {
  text-align: center;
  padding: 2rem;
  color: var(--gray);
}

/* Flash message */
.flash-message {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--success);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  animation: slideIn 0.3s ease;
  z-index: 1000;
}

@media (min-width: 768px) {
  .main-container {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  }
}

@media (min-width: 1280px) {
  .main-container {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  }

  .produtos-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .produtos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-header {
    text-align: center;
    padding: max(0.85rem, env(safe-area-inset-top)) max(0.65rem, env(safe-area-inset-right)) 0.9rem max(0.65rem, env(safe-area-inset-left));
  }

  .app-header__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding-inline: 0;
  }

  .app-header__brand {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
    width: 100%;
    max-width: 100%;
    text-align: left;
  }

  .app-header__logo,
  .brand-logo {
    width: clamp(2.5rem, 11vw, 3rem);
    height: clamp(2.5rem, 11vw, 3rem);
  }

  .app-header h1 {
    font-size: clamp(1.1rem, 4.2vw, 1.35rem);
    line-height: 1.2;
  }

  .app-header p {
    font-size: 0.72rem;
    line-height: 1.35;
    margin-top: 0.15rem;
  }

  .app-header__actions {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .app-header__track,
  .app-header__admin {
    width: 100%;
    max-width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    white-space: normal;
    line-height: 1.3;
  }

  .main-container {
    padding: 0.65rem max(0.65rem, env(safe-area-inset-left)) 0.85rem max(0.65rem, env(safe-area-inset-right));
    gap: 0.65rem;
  }

  .cart-header {
    padding: 0.75rem 0.85rem;
  }

  .cart-header h2 {
    font-size: 1rem;
  }

  .pedido-form {
    padding: 0.85rem;
  }

  .modal {
    max-width: min(560px, calc(100vw - 1.25rem));
    max-height: min(90dvh, calc(100dvh - 1.25rem));
  }

  .modal-tamanho {
    max-width: min(720px, calc(100vw - 1.25rem));
  }

  .modal-header {
    padding: 1rem 1.1rem;
  }

  .modal-body {
    padding: 1rem 1.1rem;
  }

  .modal-footer {
    padding: 0.85rem 1.1rem;
  }

  .sabor-option {
    flex-wrap: wrap;
  }

  .sabor-option__preco {
    margin-left: auto;
  }

  .pedido-preview {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .pedido-preview strong {
    font-size: 1.05rem;
  }

  .modal-footer,
  .extras-row {
    flex-direction: column;
  }

  .modal-footer .btn,
  .extra-option {
    width: 100%;
  }

  .ingredientes-grid {
    grid-template-columns: 1fr;
    max-height: 52dvh;
  }

  .flash-message {
    left: max(0.75rem, env(safe-area-inset-left));
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .cart-item-actions form,
  .cart-item-actions .cart-item-edit {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .cart-item-actions .cart-item-edit,
  .cart-item-actions .cart-item-repeat,
  .cart-item-actions .cart-item-remove {
    width: 100%;
  }

  .entrega-auth-tab {
    flex: 1 1 100%;
    text-align: center;
  }

  .auth-recuperar-acoes .btn-recuperar-canal {
    flex: 1 1 100%;
  }
}

@media (max-width: 400px) {
  .app-header__brand {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
  }

  .app-header__brand > div {
    text-align: center;
    width: 100%;
  }

  .app-header p {
    max-width: 18rem;
    margin-inline: auto;
  }
}

@media (max-width: 380px) {
  .produtos-grid {
    grid-template-columns: 1fr;
  }

  .app-header h1 {
    font-size: 1.1rem;
  }

  :root {
    --logo-size: clamp(2.35rem, 12vw, 2.75rem);
  }

  .ingrediente-item {
    padding: 0.5rem;
  }

  .btn {
    font-size: 0.9rem;
    min-height: 44px;
  }

  .attention-number {
    font-size: 1.8rem;
    padding: 0.5rem 1rem;
  }

  .attention-title {
    font-size: 1.4rem;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .modal-backdrop {
    padding: max(0.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
  }

  .modal {
    max-height: min(88dvh, calc(100dvh - 1rem));
  }

  .ingredientes-grid {
    max-height: 38dvh;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: #94a3b8;
    --gray: #334155;
  }

  .produto-card,
  .cart-panel,
  .pedido-panel {
    border-width: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .produto-card,
  .attention-modal,
  .modal-backdrop,
  .btn,
  .attention-button {
    transition: none;
  }

  .produto-card:hover {
    transform: none;
  }
}

.site-footer {
  width: 100%;
  max-width: 100%;
  margin-top: clamp(1.5rem, 4vw, 2rem);
  padding: 1rem max(1rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  border-top: 1px solid var(--border);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--gray);
  background: rgba(255, 255, 255, 0.65);
}

.site-footer__copy,
.site-footer__dev {
  width: 100%;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.site-footer__copy {
  margin: 0 auto 0.35rem;
}

.site-footer__dev {
  margin: 0 auto;
  font-size: 0.78rem;
}

.site-footer__dev span {
  font-weight: 600;
  color: var(--primary-dark);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.err-message {
  background: #fee2e2;
  color: var(--danger);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.success-message {
  background: #d1fae5;
  color: var(--success);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.app-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(7px);
}

.app-dialog-backdrop.open {
  display: flex;
}

.app-dialog {
  width: min(100%, 24rem);
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-lg);
  padding: 1.25rem;
  color: var(--dark);
  outline: none;
}

.app-dialog-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--primary-dark);
}

.app-dialog-message {
  margin: 0 0 1.15rem;
  color: var(--gray);
  line-height: 1.45;
}

.app-dialog-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.app-dialog-btn {
  border: 0;
  border-radius: var(--radius-sm);
  min-height: 42px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.app-dialog-btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
}

.app-dialog-btn-secondary {
  background: #f1f5f9;
  color: var(--dark);
  border: 1px solid var(--border);
}

@media (max-width: 480px) {
  .app-dialog {
    width: 100%;
  }

  .app-dialog-actions {
    flex-direction: column-reverse;
  }

  .app-dialog-btn {
    width: 100%;
  }
}

/* Telas amplas — conteúdo legível sem esticar demais */
@media (min-width: 1400px) {
  .main-container {
    max-width: 1440px;
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 3vw, 2.5rem);
    grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  }

  .app-header__brand {
    max-width: 1440px;
    margin-inline: auto;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .produtos-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (pointer: coarse) {
  .btn,
  .extra-option,
  .ingrediente-item,
  .produto-card,
  .attention-button {
    min-height: var(--touch-min, 44px);
  }
}
