:root {
  --cor-fundo: #401404;
  --cor-principal: #f2a649;
  --cor-principal-escuro: #ffffff;
  --cor-footer: #181717;
  --cor-texto: #ffd3c3;
  --cor-card: #672913;
  --cor-destaque: #f2f2f2;
  --cor-botao-reset: #401404;
}

body {
  font-family: "Quicksand", sans-serif;
  background: var(--cor-fundo);
  margin: 0;
  padding: 0;
  color: var(--cor-texto);
  line-height: 1.6;
}

header {
  text-align: center;
  padding: 2rem;
  background: var(--cor-principal);
  color: white;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
}

h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--cor-destaque);
  margin-bottom: 2rem;
  text-align: center;
}

.container {
  text-align: center;
  padding: 2rem;
}

/* --- Seção de Sabores Mais Populares (Layout Simples) --- */
.popular-cakes {
  margin-top: 3rem;
}

.cakes-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.cake-card {
  background: var(--cor-card);
  border-radius: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  max-width: 300px;
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.cake-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.cake-card img {
  width: 100%;
  border-radius: 0.8rem;
  margin-bottom: 1rem;
}

.cake-card h3 {
  font-size: 1.2rem;
  color: var(--cor-principal-escuro);
  margin-top: 0;
}

.cake-card p {
  font-size: 1rem;
}

.cake-card .price {
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--cor-destaque);
}

.order-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 1rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background-color: var(--cor-principal);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.order-btn:hover {
  background-color: var(--cor-principal-escuro);
}

/* --- Seção Outros Sabores (Layout com Grid Alternado) --- */
.other-flavors-alternated {
  margin-top: 4rem;
  padding: 2rem;
}

.other-flavors-alternated h2 {
  margin-bottom: 3rem;
}

.alternated-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: 900px;
  margin: 0 auto;
}

.alternated-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.alternated-row.reversed {
  grid-template-columns: 1fr 1fr;
}

.alternated-row.reversed .alternated-image {
  order: 2;
}

.alternated-row.reversed .alternated-info {
  order: 1;
}

/* Documentação: Ajuste para garantir que todas as imagens da grade alternada tenham a mesma proporção. */
.alternated-image img {
  width: 100%;
  /* NOVO: Usamos aspect-ratio para manter a proporção da imagem, removendo a altura fixa */
  aspect-ratio: 4 / 3;
  border-radius: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  object-fit: cover;
}

.alternated-info {
  padding: 2rem;
  background: var(--cor-card);
  border-radius: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.alternated-info h3 {
  font-size: 2rem;
  color: var(--cor-principal-escuro);
  margin-bottom: 1rem;
}

.alternated-info p {
  font-size: 1.1rem;
  color: var(--cor-texto);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.alternated-info .order-btn {
  background-color: var(--cor-principal);
  color: #fff;
  border-radius: 0.5rem;
  display: inline-block;
  width: auto;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  margin-top: 0;
}

.alternated-info .order-btn:hover {
  background-color: var(--cor-principal-escuro);
}

/* --- Botões Genéricos --- */
button {
  background-color: var(--cor-principal);
  border: none;
  color: white;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 1.5rem;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:hover {
  background-color: var(--cor-principal-escuro);
}

/* --- Modal --- */
.modal {
  display: none;
  position: fixed;
  z-index: 10;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #401404;
  border-radius: 1.5rem;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease-in-out;
  position: relative;
}

.step {
  display: none;
  animation: slideIn 0.4s ease-out;
}

.step.active {
  display: block;
}

.close-btn {
  background: none;
  border: none;
  padding: 0;
  position: absolute;
  top: 10px;
  right: 20px;
  color: var(--cor-texto);
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-btn:hover,
.close-btn:focus {
  color: var(--cor-destaque);
  text-decoration: none;
}

select {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  margin-top: 1rem;
  border-radius: 1rem;
  border: 1px solid #ccc;
  background-color: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23733917%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13%205.1L146.2%20202.7%2018.4%2074.5a17.6%2017.6%200%200%200-25%2025l129.5%20129.5a17.6%2017.6%200%200%200%2025%200l129.5-129.5a17.6%2017.6%200%200%200%200-25%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 0.8rem;
  padding-right: 2.5rem;
  transition: border-color 0.3s ease;
}

select:hover,
select:focus {
  border-color: var(--cor-principal);
  outline: none;
}

.price-box {
  background-color: var(--cor-fundo);
  padding: 1.5rem;
  margin-top: 1.5rem;
  font-weight: bold;
  border-radius: 1rem;
  color: var(--cor-destaque);
  font-size: 1.5rem;
  border: 2px solid var(--cor-principal);
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.price-box.show {
  opacity: 1;
}

.summary {
  text-align: left;
  margin-top: 1rem;
}

.summary p strong {
  color: var(--cor-principal-escuro);
}

.form-group {
  margin-top: 1rem;
  text-align: left;
}

.form-group input {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  border-radius: 0.8rem;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.form-group input:focus {
  border-color: var(--cor-principal);
  outline: none;
}

/* Documentação: Ajusta o alinhamento dos botões no modal para ficarem centralizados,
   melhorando o visual em telas maiores. */
.modal-actions {
  display: flex;
  justify-content: center; /* NOVO: Centraliza os botões */
  gap: 1rem;
  margin-top: 1.5rem;
}

.send-btn {
  background-color: #25d366;
}

.send-btn:hover {
  background-color: #128c7e;
}

/* Documentação: Reduz o padding vertical para diminuir a altura do rodapé. */
footer {
  background: var(--cor-footer);
  color: #fff;
  padding: 2rem 0; /* NOVO: Padding reduzido para uma altura mais compacta */
  margin-top: 4rem;
}

/* Documentação: Centraliza o conteúdo do rodapé em vez de alinhar nas bordas, usando justify-content. */
.footer-content {
  display: flex;
  justify-content: center; /* NOVO: Centraliza as seções de contato e redes sociais */
  gap: 5rem; /* NOVO: Adiciona um espaço entre os itens para um visual mais limpo */
  flex-wrap: wrap;
  text-align: left;
}

.footer-section {
  flex: 1;
  min-width: 200px;
}

.footer-section h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: white;
}

.footer-section p {
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.footer-section a {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-section a:hover {
  color: var(--cor-fundo);
}

.social-icons {
  display: flex;
  gap: 1rem;
}

.social-icons a {
  color: #fff;
  font-size: 1.5rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.social-icons a:hover {
  color: var(--cor-fundo);
  transform: scale(1.1);
}

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Documentação: Estilo para as mensagens de erro do formulário. */
.error-message {
  color: red;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: block;
}

/* Novo estilo para destacar campos com erro */
.input-error {
  border-color: red !important;
}

/* NOVO: Estilo para a label dos campos no modal */
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--cor-texto);
}
/* --- Media Queries --- */
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  .modal-actions {
    flex-direction: column; /* NOVO: Faz com que os botões fiquem um embaixo do outro em telas menores */
  }

  /* NOVO: Regras para os cards populares */
  .popular-cakes .cake-card {
    max-width: 100%;
    margin: 1rem 0;
  }

  /* NOVO: Ajustes para a seção de Outros Sabores */
  .other-flavors-alternated {
    padding: 1rem;
  }

  .alternated-grid {
    gap: 2rem; /* Espaço entre os cartões */
  }

  .alternated-row,
  .alternated-row.reversed {
    /* TRANSFORMA A GRADE EM UMA ÚNICA COLUNA SEMPRE EM TELAS PEQUENAS */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
  }

  /* Remove as regras de 'order' que causavam a inconsistência */
  .alternated-row.reversed .alternated-image {
    order: unset; /* Remove a ordem forçada */
  }
  .alternated-row.reversed .alternated-info {
    order: unset; /* Remove a ordem forçada */
    text-align: left;
  }

  .alternated-image img {
    width: 100%; /* Garante que a imagem ocupe 100% da largura */
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  .alternated-info {
    padding: 2rem;
    background: var(--cor-card);
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: left; /* NOVO: Garante que o alinhamento do texto seja sempre à esquerda */
  }

  .alternated-info h3,
  .alternated-info p,
  .alternated-info .order-btn {
    text-align: left; /* Alinha o texto à esquerda para consistência */
  }

  /* Footer */
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* Documentação: Garante que os botões do modal tenham uma largura fixa em telas menores,
   evitando que se tornem muito grandes e desproporcionais. */
@media (max-width: 480px) {
  .modal-actions button {
    width: 100%;
  }
}
