/* ============================================================
   Bibi Açaí — Estilos da loja pública
   Mobile first
   ============================================================ */

:root {
  --roxo: #4A1B6B;
  --roxo-escuro: #3A1254;
  --roxo-claro: #6B2F94;
  --amarelo: #FFD93D;
  --amarelo-claro: #FFE66B;
  --verde: #7FBF3F;
  --verde-escuro: #5A9A2A;
  --creme: #F5EFE0;
  --preto: #2C2C2A;
  --cinza: #888780;
  --cinza-claro: #D3D1C7;
  --cinza-bg: #F5EFE0;
  --branco: #FFFFFF;
  --vermelho: #E24B4A;
  --shadow: 0 4px 16px rgba(74, 27, 107, 0.08);
  --shadow-md: 0 8px 24px rgba(74, 27, 107, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cinza-bg);
  color: var(--preto);
  line-height: 1.5;
  font-weight: 400;
  padding-bottom: 80px; /* espaço pro carrinho flutuante */
}

a { color: var(--roxo); text-decoration: none; }

h1, h2, h3 { color: var(--roxo); line-height: 1.2; font-weight: 800; }

/* ============================================================
   CABEÇALHO
   ============================================================ */

.header {
  background: var(--roxo);
  color: var(--branco);
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.header-brand .b-wordmark {
  font-weight: 900;
  font-size: 28px;
  color: var(--amarelo);
  letter-spacing: -0.04em;
  line-height: 1;
}
.header-brand .b-sub {
  font-weight: 900;
  font-size: 16px;
  color: var(--verde);
  letter-spacing: -0.02em;
}

.header-user-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--branco);
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 20px;
}
.header-user-link:hover { background: rgba(255, 255, 255, 0.25); }

/* ============================================================
   BANNER FECHADA
   ============================================================ */
.banner-fechada {
  background: var(--amarelo);
  color: var(--roxo);
  padding: 10px 20px;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
}

/* ============================================================
   CATEGORIAS
   ============================================================ */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

.category {
  margin-bottom: 32px;
}

.category-title {
  font-size: 20px;
  margin-bottom: 12px;
  font-weight: 900;
  letter-spacing: -0.01em;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--amarelo);
  border-radius: 2px;
}

/* ============================================================
   CARDS DE PRODUTO
   ============================================================ */
.product-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 520px) {
  .product-grid { grid-template-columns: 1fr 1fr; }
}

.product-card {
  background: var(--branco);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(74, 27, 107, 0.06);
}
.product-card:active { transform: scale(0.98); }
.product-card:hover { box-shadow: var(--shadow-md); }

.product-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--roxo);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--amarelo);
}

.product-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.product-name {
  font-weight: 800;
  font-size: 15px;
  color: var(--roxo);
  line-height: 1.2;
}

.product-desc {
  font-size: 12px;
  color: var(--cinza);
  line-height: 1.4;
  flex: 1;
  margin-bottom: 4px;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.product-price {
  font-weight: 900;
  font-size: 16px;
  color: var(--roxo);
}

.btn-add {
  background: var(--verde);
  color: var(--branco);
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

/* ============================================================
   MODAL PRODUTO
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44, 15, 66, 0.7);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.active { display: flex; }

@media (min-width: 600px) {
  .modal-backdrop { align-items: center; }
}

.modal {
  background: var(--branco);
  width: 100%;
  max-width: 520px;
  border-radius: 20px 20px 0 0;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease-out;
}

@media (min-width: 600px) {
  .modal { border-radius: 20px; }
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--roxo);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  color: var(--amarelo);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--branco);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}

.modal-body { padding: 20px; }
.modal-name {
  font-weight: 900;
  font-size: 22px;
  color: var(--roxo);
  margin-bottom: 6px;
}
.modal-desc {
  color: var(--cinza);
  font-size: 14px;
  margin-bottom: 16px;
}
.modal-section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--cinza);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
  margin-top: 16px;
}

.complement-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(74, 27, 107, 0.08);
  gap: 8px;
  cursor: pointer;
}
.complement-item:last-child { border-bottom: none; }
.complement-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--roxo);
}
.complement-name {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
}
.complement-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--verde-escuro);
}

.observacao-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--cinza-claro);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 60px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(74, 27, 107, 0.08);
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--cinza-bg);
  position: sticky;
  bottom: 0;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--branco);
  border: 2px solid var(--cinza-claro);
  border-radius: 20px;
  padding: 2px;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  color: var(--roxo);
  border-radius: 50%;
}
.qty-btn:hover { background: var(--amarelo); }
.qty-value {
  font-weight: 900;
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

.btn-confirmar {
  flex: 1;
  background: var(--verde);
  color: var(--branco);
  border: none;
  padding: 12px;
  border-radius: 24px;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.btn-confirmar:disabled { background: var(--cinza-claro); cursor: not-allowed; }

/* ============================================================
   CARRINHO FLUTUANTE
   ============================================================ */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--roxo);
  color: var(--amarelo);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 40;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transform: translateY(100%);
  transition: transform 0.25s;
}

.cart-bar.visible { transform: translateY(0); }

.cart-bar .cart-qty {
  background: var(--amarelo);
  color: var(--roxo);
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 13px;
  margin-right: 10px;
}

.cart-bar .cart-text {
  font-weight: 900;
  font-size: 15px;
  flex: 1;
}

.cart-bar .cart-total {
  font-weight: 900;
  font-size: 16px;
}

.cart-bar .cart-arrow {
  margin-left: 8px;
  font-size: 20px;
}

/* ============================================================
   PÁGINAS (checkout, rastreio, login)
   ============================================================ */
.page-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px;
}

.page-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--roxo);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--cinza);
  font-size: 14px;
  margin-bottom: 20px;
}

.section-box {
  background: var(--branco);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.section-box h3 {
  font-size: 15px;
  margin-bottom: 12px;
  font-weight: 800;
  color: var(--roxo);
}

.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--preto);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--cinza-claro);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  background: var(--branco);
}
.form-input:focus { outline: none; border-color: var(--roxo); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row-cep {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border: none;
  border-radius: 24px;
  font-family: inherit;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-transform: uppercase;
  width: 100%;
  text-decoration: none;
}

.btn-primary { background: var(--roxo); color: var(--amarelo); }
.btn-primary:disabled { background: var(--cinza-claro); color: var(--branco); cursor: not-allowed; }
.btn-verde { background: var(--verde); color: var(--branco); }
.btn-verde:disabled { background: var(--cinza-claro); cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--roxo); border: 2px solid var(--roxo); }

.btn-link {
  background: transparent;
  border: none;
  color: var(--roxo);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}

/* ============================================================
   ITEM DO PEDIDO (checkout e rastreio)
   ============================================================ */
.order-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(74, 27, 107, 0.08);
}
.order-item:last-child { border-bottom: none; }

.order-item-qty {
  font-weight: 900;
  font-size: 14px;
  color: var(--roxo);
  background: var(--amarelo);
  padding: 2px 8px;
  border-radius: 6px;
  height: fit-content;
}

.order-item-body { flex: 1; }
.order-item-name { font-weight: 800; font-size: 14px; }
.order-item-complementos { font-size: 12px; color: var(--cinza); margin-top: 2px; }
.order-item-price { font-weight: 800; font-size: 14px; color: var(--roxo); }

/* ============================================================
   TOTAIS
   ============================================================ */
.totals {
  border-top: 1px solid rgba(74, 27, 107, 0.1);
  margin-top: 10px;
  padding-top: 10px;
}
.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
}
.total-row.total-final {
  font-weight: 900;
  font-size: 18px;
  color: var(--roxo);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--cinza-claro);
}

/* ============================================================
   PAGAMENTO — seleção
   ============================================================ */
.pay-options {
  display: grid;
  gap: 8px;
}
.pay-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--cinza-claro);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--branco);
}
.pay-option.selected {
  border-color: var(--roxo);
  background: rgba(255, 217, 61, 0.1);
}
.pay-option input { accent-color: var(--roxo); width: 20px; height: 20px; }
.pay-option-icon { font-size: 22px; }
.pay-option-label { flex: 1; font-weight: 700; }

/* ============================================================
   TRACKING / STATUS TIMELINE
   ============================================================ */
.timeline {
  padding: 8px 0;
}
.timeline-step {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  position: relative;
}

.timeline-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: -12px;
  width: 2px;
  background: var(--cinza-claro);
}

.timeline-step.done:not(:last-child)::before { background: var(--verde); }

.timeline-bullet {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cinza-claro);
  color: var(--branco);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  z-index: 1;
}

.timeline-step.done .timeline-bullet { background: var(--verde); }
.timeline-step.current .timeline-bullet {
  background: var(--amarelo);
  color: var(--roxo);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 217, 61, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(255, 217, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 217, 61, 0); }
}

.timeline-body { flex: 1; padding-top: 4px; }
.timeline-title { font-weight: 800; font-size: 15px; color: var(--roxo); }
.timeline-time { font-size: 12px; color: var(--cinza); margin-top: 2px; }

/* ============================================================
   LOGIN CLIENTE — stepper
   ============================================================ */
.steps-hidden { display: none; }

/* ============================================================
   ALERTAS
   ============================================================ */
.alert {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
}
.alert-success { background: rgba(127, 191, 63, 0.15); color: var(--verde-escuro); }
.alert-error { background: rgba(226, 75, 74, 0.12); color: var(--vermelho); }
.alert-info { background: rgba(59, 130, 196, 0.1); color: #2B5F8F; }
.alert-warning { background: rgba(255, 217, 61, 0.2); color: #8B5A00; }

.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--branco);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
.text-muted { color: var(--cinza); }
.text-center { text-align: center; }
.text-small { font-size: 12px; }
