/* Wave Açaí Pro — Front cliente (mobile-first) */

:root {
  --wave-primary: #6b21a8;
  --wave-primary-dark: #581c87;
  --wave-accent: #a855f7;
  --wave-success: #16a34a;
  --wave-danger: #dc2626;
  --wave-bg: #f8fafc;
  --wave-card: #ffffff;
  --wave-text: #0f172a;
  --wave-muted: #64748b;
  --wave-radius: 16px;
  --wave-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  --wave-logo-size: 80px;
  --category-h: 52px;
  --fab-bottom: 16px;
}

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--wave-bg);
  color: var(--wave-text);
  padding-bottom: calc(var(--fab-bottom) + env(safe-area-inset-bottom, 0px));
}

/* Header — logo centralizada (rola com a página) */
.wave-header {
  background: var(--wave-card);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 14px;
}

.wave-header--cor {
  background: var(--wave-header-cor, var(--wave-card));
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.wave-header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  width: 100%;
  max-width: 320px;
}

.wave-header-logo {
  width: var(--wave-logo-size, 80px);
  height: var(--wave-logo-size, 80px);
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(107, 33, 168, 0.2);
  border: 3px solid #f3e8ff;
}

.wave-header-nome {
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  color: var(--wave-text);
  letter-spacing: -0.02em;
}

.wave-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8125rem;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  margin-top: 2px;
}

.wave-status-badge.aberta {
  background: #dcfce7;
  color: var(--wave-success);
}

.wave-status-badge.fechada {
  background: #fee2e2;
  color: var(--wave-danger);
}

/* Category bar sticky */
.wave-category-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--wave-card);
  border-bottom: 1px solid #e2e8f0;
  height: var(--category-h);
}

.wave-category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 16px;
  height: 100%;
  align-items: center;
}

.wave-category-scroll::-webkit-scrollbar {
  display: none;
}

.wave-category-pill {
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  background: #f1f5f9;
  color: var(--wave-muted);
  border: 2px solid transparent;
  min-height: 36px;
  transition: all 0.2s ease;
}

.wave-category-pill.active {
  background: var(--wave-primary);
  color: #fff;
}

/* Hero slider */
.wave-hero {
  padding: 16px 0 8px;
}

.wave-hero-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 16px 8px;
  scrollbar-width: none;
}

.wave-hero-scroll::-webkit-scrollbar {
  display: none;
}

.wave-hero-card {
  flex: 0 0 85%;
  max-width: 320px;
  scroll-snap-align: center;
  background: linear-gradient(
    135deg,
    var(--wave-hero-start, var(--wave-primary)),
    var(--wave-hero-end, var(--wave-accent))
  );
  border-radius: var(--wave-radius);
  padding: 20px;
  color: #fff;
  min-height: 140px;
  box-shadow: var(--wave-shadow);
}

/* Produtos */
.wave-section {
  scroll-margin-top: calc(var(--category-h) + 12px);
  padding: 8px 16px 24px;
}

.wave-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.wave-product-card {
  display: flex;
  gap: 12px;
  background: var(--wave-card);
  border-radius: var(--wave-radius);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--wave-shadow);
  cursor: pointer;
  min-height: 96px;
  align-items: center;
  border: none;
  width: 100%;
  text-align: left;
}

.wave-product-card:active {
  transform: scale(0.98);
}

.wave-product-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}

.wave-product-price {
  color: var(--wave-primary);
  font-weight: 700;
  font-size: 1rem;
}

/* Modal */
.wave-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.wave-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.wave-modal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  background: var(--wave-card);
  border-radius: 20px 20px 0 0;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.wave-modal-overlay.open .wave-modal {
  transform: translateY(0);
}

.wave-modal-header {
  padding: 16px 16px 8px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.wave-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

.wave-modal-footer {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #e2e8f0;
  background: var(--wave-card);
  flex-shrink: 0;
}

.wave-grupo-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.wave-grupo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.wave-grupo-title {
  font-size: 0.9375rem;
  font-weight: 700;
}

.wave-grupo-counter {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--wave-primary);
  background: #f3e8ff;
  padding: 4px 8px;
  border-radius: 6px;
}

.wave-grupo-counter.complete {
  background: #dcfce7;
  color: var(--wave-success);
}

.wave-grupo-counter.invalid {
  background: #fee2e2;
  color: var(--wave-danger);
}

.wave-adicional-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
  min-height: 48px;
}

.wave-adicional-item:last-child {
  border-bottom: none;
}

.wave-adicional-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--wave-primary);
  flex-shrink: 0;
}

.wave-adicional-item.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.wave-btn-primary {
  width: 100%;
  min-height: 48px;
  background: var(--wave-primary);
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wave-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wave-btn-primary:not(:disabled):active {
  background: var(--wave-primary-dark);
}

/* Carrinho flutuante */
.wave-cart-fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--fab-bottom) + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  background: var(--wave-primary);
  color: #fff;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(107, 33, 168, 0.4);
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
}

.wave-cart-badge {
  background: #fff;
  color: var(--wave-primary);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

/* Voltar ao topo */
.wave-back-top {
  position: fixed;
  right: 16px;
  bottom: calc(var(--fab-bottom) + 72px + env(safe-area-inset-bottom, 0px));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--wave-card);
  border: 1px solid #e2e8f0;
  box-shadow: var(--wave-shadow);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 35;
  color: var(--wave-primary);
}

.wave-back-top.visible {
  display: flex;
}

/* Checkout panel */
.wave-checkout-panel {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: var(--wave-bg);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.wave-checkout-panel.open {
  transform: translateX(0);
}

.wave-checkout-item {
  background: var(--wave-card);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--wave-shadow);
}

.wave-checkout-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wave-checkout-item-info {
  flex: 1;
  min-width: 0;
}

.wave-checkout-item-name {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}

.wave-checkout-item-meta {
  font-size: 0.75rem;
  color: var(--wave-muted);
  margin: 4px 0 0;
  line-height: 1.35;
}

.wave-checkout-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.wave-checkout-item-price {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--wave-primary);
  white-space: nowrap;
}

.wave-checkout-item-remove {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
}

.wave-checkout-item-remove:hover {
  background: #fecaca;
}

.wave-checkout-empty {
  text-align: center;
  font-size: 0.875rem;
  color: var(--wave-muted);
  padding: 24px 16px;
  margin: 0;
}

.wave-checkout-minimo-aviso {
  font-size: 0.8125rem;
  color: var(--wave-muted);
  margin: 0;
  padding-top: 4px;
}

.wave-checkout-minimo-aviso.is-below {
  color: #b91c1c;
  font-weight: 600;
}

.wave-checkout-tipo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wave-checkout-tipo-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 88px;
  padding: 14px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wave-checkout-tipo-opt i {
  font-size: 1.25rem;
  color: #64748b;
}

.wave-checkout-tipo-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.wave-checkout-tipo-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.2;
}

.wave-checkout-tipo-opt:has(:checked) {
  border-color: var(--wave-accent, #7c3aed);
  background: color-mix(in srgb, var(--wave-accent, #7c3aed) 10%, #fff);
}

.wave-checkout-tipo-opt:has(:checked) i {
  color: var(--wave-accent, #7c3aed);
}

.wave-checkout-retirada-aviso {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 0.875rem;
  line-height: 1.4;
}

.wave-checkout-retirada-aviso[hidden] {
  display: none;
}

.wave-checkout-retirada-aviso i {
  margin-top: 2px;
  flex-shrink: 0;
}

#checkoutCamposEntrega {
  display: grid;
  gap: 16px;
}

#checkoutCamposEntrega[hidden] {
  display: none;
}

#checkoutCamposEntrega .mt-4 {
  margin-top: 0;
}

.wave-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  background: var(--wave-card);
  min-height: 48px;
}

.wave-input:focus {
  outline: 2px solid var(--wave-accent);
  border-color: transparent;
}

.wave-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--wave-muted);
  margin-bottom: 6px;
  display: block;
}

@media (min-width: 768px) {
  .wave-header-nome {
    font-size: 1.25rem;
  }

  .wave-hero-card {
    flex: 0 0 45%;
  }

  .wave-modal {
    left: 50%;
    right: auto;
    width: 100%;
    max-width: 480px;
    transform: translate(-50%, 100%);
    border-radius: 20px 20px 0 0;
  }

  .wave-modal-overlay.open .wave-modal {
    transform: translate(-50%, 0);
  }
}
