/* Estilos exclusivos da página de pedido */

.pedido-body { background: var(--tint); }
.pedido-body .site-header .header-inner { justify-content: space-between; }
.back-link {
  text-decoration: none; font-size: 0.92rem; font-weight: 600;
  color: var(--muted); transition: color 0.18s var(--ease);
}
.back-link:hover { color: var(--blue); }

.pedido-main { padding: 56px 0 96px; }
.pedido-grid { max-width: 720px; margin: 0 auto; }

.pedido-form-wrap h1, .pedido-review h1 { font-size: clamp(1.7rem, 4.4vw, 2.6rem); margin-bottom: 14px; }
.pedido-form-wrap .lead, .pedido-review .lead { font-size: 1.02rem; margin-bottom: 36px; max-width: 560px; }

.pedido-form, .pedido-review .resumo {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 34px;
}
.pedido-form fieldset { border: 0; margin-bottom: 34px; min-width: 0; }
.pedido-form legend {
  font-size: 0.76rem; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--blue);
  margin-bottom: 18px; padding: 0;
}

.field { margin-bottom: 20px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row .field { min-width: 0; }
.field-numero { grid-template-columns: 0.7fr; }
.field-row:has(.field-numero) { grid-template-columns: 1fr 0.55fr; }
.field-row:has(.field-estado) { grid-template-columns: 1fr 1fr 0.5fr; }
.field label, .label-as-text {
  display: block; font-size: 0.9rem; font-weight: 700;
  color: var(--navy); margin-bottom: 7px;
}
.opt { font-weight: 500; color: var(--muted); }

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="url"],
.field textarea {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--text);
  background: var(--white); border: 1px solid var(--line);
  border-radius: 10px; padding: 13px 15px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: #D93025; box-shadow: 0 0 0 3px rgba(217,48,37,0.10);
}
.field input:disabled { background: var(--tint); color: var(--muted); }
.field textarea { resize: vertical; }

.hint { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 7px; }
.error-msg { display: block; font-size: 0.82rem; color: #D93025; margin-top: 6px; font-weight: 600; }

/* CEP */
.cep-row { display: flex; align-items: center; gap: 12px; }
.cep-row input { max-width: 160px; }
.cep-status { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.cep-status.buscando { color: var(--blue); }
.cep-status.ok { color: #1E8E3E; }
.cep-status.erro { color: #D93025; }

/* opções de versão, cada uma com quantidade própria */
.option-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.option-card {
  position: relative; margin: 0; min-width: 0;
  border: 2px solid var(--line); border-radius: var(--r);
  padding: 14px; text-align: center;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.option-card.is-active { border-color: var(--blue); background: rgba(26,115,232,0.04); }
.option-card .thumb {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 8px;
  overflow: hidden; margin-bottom: 10px; background: var(--tint);
}
.option-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.option-card span { display: block; font-size: 0.9rem; font-weight: 700; color: var(--navy); margin-bottom: 10px; }

/* quantidade (reutilizado por versão) */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 100px; overflow: hidden; }
.qty-btn {
  width: 40px; height: 40px; border: 0; background: var(--white);
  font-size: 1.15rem; color: var(--navy); cursor: pointer;
  transition: background 0.18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.qty-btn:hover { background: var(--tint); }
.qty input {
  width: 44px; height: 40px; text-align: center;
  border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  font-family: inherit; font-size: 0.95rem; font-weight: 700; color: var(--navy);
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: none; }

.form-note { font-size: 0.84rem; margin-top: 16px; text-align: center; }

/* resumo (usado na etapa de revisão) */
.resumo h2 {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 12px; margin-top: 26px;
}
.resumo h2:first-child { margin-top: 0; }
.resumo dl { display: flex; flex-direction: column; gap: 9px; margin-bottom: 8px; }
.resumo dl > div { display: flex; justify-content: space-between; gap: 14px; font-size: 0.94rem; }
.resumo dt { color: var(--muted); }
.resumo dd { color: var(--navy); font-weight: 700; text-align: right; }
.resumo dl > div.linha-total { padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }
.resumo dl > div.linha-total dt { font-weight: 700; color: var(--navy); }
.resumo dl > div.linha-total dd { font-size: 1.15rem; color: var(--blue); }
.resumo dd.frete-gratis { color: #1E8E3E; }

.resumo-checks { list-style: none; display: flex; flex-direction: column; gap: 9px; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--line); }
.resumo-checks li {
  font-size: 0.87rem; color: var(--muted);
  display: flex; align-items: flex-start; gap: 9px;
}
.resumo-checks li::before {
  content: ''; width: 15px; height: 15px; flex-shrink: 0; margin-top: 3px;
  border-radius: 50%; background: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 10px; background-repeat: no-repeat; background-position: center;
}

.preco-tabela {
  font-size: 0.85rem; color: var(--muted);
  background: var(--tint); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 18px;
}
.preco-tabela strong { color: var(--navy); }

/* destaque de preço na revisão */
.price-highlight {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px; margin-bottom: 20px;
}
.price-highlight-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.price-highlight-value { font-size: 2.2rem; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.frete-gratis-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; font-weight: 700; color: #1E8E3E;
  background: rgba(30,142,62,0.1); padding: 6px 14px; border-radius: 100px;
  margin-top: 4px;
}
.frete-gratis-badge::before {
  content: ''; width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E8E3E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* etapa de revisão */
.review-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }

/* estados de erro na revisão (voltar ao formulário) */
[hidden] { display: none !important; }

@media (max-width: 720px) {
  .pedido-main { padding: 32px 0 96px; }
  .pedido-form-wrap .lead, .pedido-review .lead { margin-bottom: 26px; }
  .pedido-form, .pedido-review .resumo { padding: 22px 18px; border-radius: var(--r); }
  .pedido-form fieldset { margin-bottom: 26px; }

  .field-row,
  .field-row:has(.field-numero),
  .field-row:has(.field-estado) {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .field-row .field { margin-bottom: 20px; }
  .field-row .field:last-child { margin-bottom: 20px; }

  .cep-row { flex-wrap: wrap; }
  .cep-row input { max-width: none; flex: 1 1 140px; }

  .option-cards { gap: 10px; }
  .option-card { padding: 10px; }
  .qty-btn, .qty input { height: 44px; }
  .qty-btn { width: 44px; }

  .btn-lg { padding: 16px 24px; font-size: 1rem; }
  .review-actions { gap: 10px; }
}

@media (max-width: 380px) {
  .option-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .qty-btn { width: 38px; }
  .qty input { width: 38px; }
}
