:root {
  --bg: #faf8f4;
  --texto: #1a1a1a;
  --destaque: #b04f2e;
  --concluido: #2d6a4f;
  --linha: #e5e0d6;
  --card: #ffffff;
  --suave: #7a736a;
}

* { box-sizing: border-box; }

/* Garante que [hidden] esconda mesmo elementos com display: flex/grid definido */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--texto);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.topo {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.marca {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.2px;
}
.marca span { color: var(--destaque); }
.pedido-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
.pedido-num {
  font-size: 0.8rem;
  color: var(--suave);
  font-weight: 500;
}
.cliente-nome {
  font-family: "Fraunces", serif;
  font-size: 1.05rem;
  font-weight: 500;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--linha);
  border-radius: 16px;
  padding: 22px 20px;
  margin-bottom: 16px;
}
.center { text-align: center; }
.card h1 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.4rem;
  margin: 8px 0 6px;
}
.card p { color: var(--suave); line-height: 1.5; margin: 6px 0 0; }
.emoji-grande { font-size: 2.6rem; }

.titulo-tl {
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
  margin: 0 0 18px;
}

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 26px 44px;
  min-height: 34px;
}
.timeline li:last-child { padding-bottom: 0; }
/* Linha vertical conectando os pontos */
.timeline li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 30px;
  bottom: -4px;
  width: 2px;
  background: var(--linha);
}
.timeline li:last-child::before { display: none; }
/* Bolinha da etapa */
.timeline .ponto {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
  background: var(--bg);
  border: 2px solid var(--linha);
}
.timeline .conteudo-etapa { padding-top: 4px; }
.timeline .etapa-label {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
}
.timeline .etapa-data {
  font-size: 0.82rem;
  color: var(--suave);
  margin-top: 2px;
}

/* Estados das etapas */
.timeline li.done .ponto {
  background: var(--concluido);
  border-color: var(--concluido);
}
.timeline li.done .ponto,
.timeline li.current .ponto { filter: none; }
.timeline li.done::before { background: var(--concluido); }

.timeline li.current .ponto {
  background: var(--destaque);
  border-color: var(--destaque);
  box-shadow: 0 0 0 4px rgba(176, 79, 46, 0.15);
}
.timeline li.current .etapa-label { color: var(--destaque); }

.timeline li.pending .ponto { opacity: 0.55; }
.timeline li.pending .etapa-label { color: var(--suave); font-weight: 500; }

/* Fotos */
.fotos-card h2, .escolha-card h2 {
  font-family: "Fraunces", serif;
  font-size: 1.15rem;
  margin: 0 0 14px;
}
.fotos { display: grid; grid-template-columns: 1fr; gap: 10px; }
.fotos img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

/* Total */
.total-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.total-card span { color: var(--suave); font-size: 0.9rem; }
.total-card strong {
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  color: var(--destaque);
}

/* Escolha de entrega */
.botoes-escolha { display: grid; gap: 10px; }
.btn-escolha {
  font-family: "DM Sans", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid var(--destaque);
  background: var(--card);
  color: var(--destaque);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-escolha:hover { background: var(--destaque); color: #fff; }

#form-retirada,
#form-correios { margin-top: 16px; display: grid; gap: 8px; }
#form-retirada label,
#form-correios label { font-weight: 600; font-size: 0.92rem; }
#form-retirada select,
#form-correios input,
#form-correios textarea {
  font-family: "DM Sans", sans-serif;
  font-size: 1rem;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--linha);
  background: var(--bg);
  width: 100%;
  resize: vertical;
}
#form-correios label { margin-top: 4px; }
#form-correios input:focus,
#form-correios textarea:focus,
#form-retirada select:focus {
  outline: none;
  border-color: var(--destaque);
}

/* Tipo de envio (PAC / SEDEX) */
.modo-frete {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--linha);
  border-radius: 12px;
}
.modo-titulo { font-weight: 600; font-size: 0.92rem; }
.radio-frete {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
}
.radio-frete input { width: auto; accent-color: var(--destaque); transform: scale(1.2); }
.radio-frete em { color: var(--destaque); font-style: normal; font-weight: 600; }
.aviso-frete {
  margin: 12px 0 4px;
  padding: 10px 12px;
  background: #f3ede2;
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--texto);
}

/* Página de boas-vindas */
#welcome .btn-whats.welcome-whats { margin-top: 18px; }
#welcome .insta { display: inline-block; margin-top: 12px; }
.btn-primario {
  font-family: "DM Sans", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 15px;
  border-radius: 12px;
  border: none;
  background: var(--destaque);
  color: #fff;
  cursor: pointer;
}
.btn-primario:disabled { opacity: 0.6; cursor: default; }
.btn-voltar {
  background: none;
  border: none;
  color: var(--suave);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px;
}
.erro-inline { color: var(--destaque); font-weight: 500; margin-top: 12px; }

.confirmado-card p {
  color: var(--texto);
  font-size: 1.05rem;
  margin-top: 8px;
}

/* Rodapé */
.rodape {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.btn-whats {
  display: inline-block;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 1rem;
}
.insta { color: var(--suave); text-decoration: none; font-size: 0.9rem; }

/* Spinner */
.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  border: 3px solid var(--linha);
  border-top-color: var(--destaque);
  border-radius: 50%;
  animation: girar 0.8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
