:root {
  --cor-primaria: #B47E68;
  --cor-secundaria: #B47E68;
  --cor-diversa: #c49987;
  --cor-title: #000;
  --cor-subtitle: #737373;
  --sombra: 0 4px 20px rgba(0, 0, 0, 0.1);
  --cor-asterisco: #e53935;
  --form-background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
  --form-background-tp: transparent;
  --form-section: rgba(255, 255, 255, 0.9);
  --form-section-sunlight: #f5f2ef;
}

#orderForm {
  max-width: 100%;
  margin: 2rem auto;
  padding: 2.5rem;
  background: var(--form-background-tp);
  border-radius: 16px;
  box-shadow: var(--sombra);
  font-family: poppins, system-ui, sans-serif;
  border: 1px solid #e0e7ff;
}

#orderForm h3 {
  text-align: center;
  margin: 0 0 1rem 0;
  color: #1a237e;
  font-size: 1.8rem;
  font-weight: 600;
}

.obrigatorio-msg {
  text-align: center;
  color: #666;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.asterisco {
  color: var(--cor-asterisco);
  margin-left: 2px;
  font-weight: bold;
}

.form-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--form-section-sunlight);
  border-radius: 12px;
  border: 1px solid #f0f4ff;
}

.form-section-a {
  max-width: 43%;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--form-section-sunlight);
  border-radius: 12px;
  border: 1px solid #f0f4ff;
}

.form-section-title {
  display: block;
  margin-bottom: 1.5rem;
  color: var(--cor-title);
  font-weight: 600;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.product-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.product-row select {
  flex: 1;
  padding: 0.8rem;
  border: 2px solid #e0e7ff;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  transition: all 0.3s ease;
}

.product-row select:focus {
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 3px rgba(45, 137, 239, 0.2);
}

.product-row input[type="number"] {
  width: 100px;
  padding: 0.8rem;
  border: 2px solid #e0e7ff;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
}

.add-line-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1rem 0 2rem 0;
  padding: 0.8rem 1.5rem;
  background: var(--cor-secundaria);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-line-btn:hover {
  background: #cda798;
  transform: translateY(-1px);
}

.remove-line-btn {
  background: #f9a59f;
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 20px;
  cursor: pointer;
  transition: background 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}

.remove-line-btn:hover {
  background: #d32f2f;
}

.flex-row-cp-localidade {
  display: flex;
  gap: 1rem;
}

.flex-col-cp {
  flex: 0 0 40%;
}

.flex-col-localidade {
  flex: 0 0 60%;
}

/* Regra genérica: NÃO incluir radio/checkbox aqui */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border: 2px solid #e0e7ff;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

/* Reset seguro para radio/checkbox (evita width:100% etc.) */
input[type="radio"],
input[type="checkbox"] {
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  border: none;
  box-shadow: none;
  vertical-align: middle;
}

input:focus,
textarea:focus {
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 3px rgba(45, 137, 239, 0.2);
  outline: none;
}

#orderForm input[type="submit"] {
  width: 100%;
  padding: 1rem;
  margin-top: 1.5rem;
  background: var(--cor-primaria);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

#orderForm input[type="submit"]:hover {
  background: var(--cor-diversa);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 137, 239, 0.3);
}

.flex-row-50 {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.flex-row-50 > .flex-col-50 {
  flex: 0 0 50%;
}

.reset-btn {
  width: 100%;
  background: #faa49e;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.reset-btn:hover {
  background: #f7776e;
}

input:invalid {
  border-color: #f44336 !important;
}

/* Opção de pagamento: alinhamento lateral e wrap seguro do texto */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: anywhere; /* quebra dentro da box */
  word-break: normal;
}

.payment-options label input[type="radio"] {
  flex-shrink: 0;
}

.payment-options label span {
  flex: 1 1 auto;
  min-width: 0; /* permite wrap em flex item */
}

@media (max-width: 700px) {
  #orderForm {
    width: 88vw;
    max-width: 88vw;
    margin: 0;
    padding: 0.5rem 0 0.5rem 0;
    border-radius: 0;
    box-shadow: none;
    background: none;
    border: none;
    box-sizing: border-box;
  }
  .form-section-a {
    max-width: 100%;
  }
  .product-row {
    flex-direction: column;
    align-items: stretch;
  }
  .product-row select,
  .product-row input[type="number"] {
    width: 100%;
  }
  .flex-row-cp-localidade {
    flex-direction: column;
  }
  .flex-col-cp,
  .flex-col-localidade {
    flex: 1 1 100%;
  }
  .flex-row-50 {
    flex-direction: column;
    gap: 0;
  }
  .flex-row-50 > .flex-col-50 {
    flex: 1 1 100%;
  }
}

/* Popup animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -60%);}
  to { opacity: 1; transform: translate(-50%, -50%);}
}
@keyframes fadeOut {
  from { opacity: 1;}
  to { opacity: 0;}
}