/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #f9f9f9;
  color: #333;
  line-height: 1.6;
}

/* ===== HEADER ===== */
header {
  background: #004aad;
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header .logo a {
  color: #fff;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
}

header nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}

header nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: 0.3s;
}

header nav ul li a:hover {
  text-decoration: underline;
}

/* ===== FOOTER ===== */
footer {
  background: #004aad;
  color: #fff;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
}

/* ===== SEÇÕES ===== */
main {
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
}

/* ===== GRID DE PRODUTOS ===== */
.grid-produtos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card-produto {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  text-align: center;
  transition: 0.3s;
}

.card-produto:hover {
  transform: translateY(-4px);
}

.card-produto img {
  max-width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
}

.card-produto h2 {
  font-size: 1.2rem;
  margin: 0.8rem 0;
}

.card-produto p {
  font-weight: bold;
  margin-bottom: 0.8rem;
}

/* ===== BOTÕES ===== */
.btn {
  background: #004aad;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.3s;
  display: inline-block;
  text-decoration: none;
}

.btn:hover {
  background: #003580;
}

.btn-destaque {
  background: #28a745;
}

.btn-destaque:hover {
  background: #1e7e34;
}

/* ===== FORMULÁRIOS ===== */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

form input,
form select,
form textarea {
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
}

form button {
  align-self: flex-start;
}

/* ===== CARRINHO ===== */
/* ===== LISTA DO CARRINHO ===== */
.lista-carrinho {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
}

.item-carrinho {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.item-carrinho img {
  width: 70px;
  height: auto;
  border-radius: 8px;
}

.item-carrinho span {
  font-size: 1rem;
}

.item-carrinho .quantidade {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-carrinho .quantidade button {
  border: none;
  background: #eee;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 5px;
  font-size: 1rem;
  transition: 0.2s;
}

.item-carrinho .quantidade button:hover {
  background: #ccc;
}

.item-carrinho button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  transition: 0.2s;
}

.item-carrinho button:hover {
  color: red;
}

/* ===== TOTAL ===== */
.total-carrinho {
  text-align: right;
  margin-top: 15px;
  font-size: 1.3rem;
  font-weight: bold;
  color: #333;
}

/* ===== BOTÃO FINALIZAR ===== */
.btn-finalizar {
  display: block;
  margin: 20px auto;
  padding: 12px 25px;
  font-size: 1.1rem;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-finalizar:hover {
  background: #218838;
}

/* ===== MENSAGEM ===== */
.mensagem-visivel {
  margin-top: 15px;
  padding: 10px;
  text-align: center;
  border-radius: 6px;
  font-weight: bold;
  background: #28a745;
  color: white;
}

.mensagem-oculta {
  display: none;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 600px) {
  .item-carrinho {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    text-align: center;
  }

  .item-carrinho img {
    margin: 0 auto;
  }

  .total-carrinho {
    text-align: center;
  }
}


/* ===== PÁGINA PRODUTO ===== */
.produto-detalhe {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.produto-detalhe img {
  max-width: 300px;
  border-radius: 8px;
}

.produto-detalhe .info {
  flex: 1;
}

.produto-detalhe .preco {
  font-size: 1.5rem;
  color: #28a745;
  margin-bottom: 1rem;
}

/* ===== MENSAGENS ===== */
.mensagem-oculta {
  display: none;
}

.mensagem-sucesso,
.mensagem-erro,
.mensagem-info,
.mensagem-visivel {
  margin: 1rem 0;
  padding: 0.8rem;
  border-radius: 6px;
  font-weight: bold;
  text-align: center;
}

.mensagem-sucesso {
  background: #d4edda;
  color: #155724;
}

.mensagem-erro {
  background: #f8d7da;
  color: #721c24;
}

.mensagem-info {
  background: #cce5ff;
  color: #004085;
}

.mensagem-visivel {
  background: #d4edda;
  color: #155724;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  nav ul {
    flex-direction: column;
  }

  .produto-detalhe {
    flex-direction: column;
    align-items: center;
  }

  .acoes-carrinho {
    flex-direction: column;
  }

  /* ===== LISTA DE PRODUTOS DO PEDIDO ===== */
.item-carrinho,
.item-checkout {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  margin: 0.5rem 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-carrinho:hover,
.item-checkout:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.item-carrinho img,
.item-checkout img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 6px;
  background: #f9f9f9;
}

.item-carrinho span,
.item-checkout span {
  font-size: 0.95rem;
}

.item-carrinho .quantidade {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.item-carrinho button,
.item-checkout button {
  background: #ff4d4d;
  border: none;
  color: white;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.item-carrinho button:hover,
.item-checkout button:hover {
  background: #e60000;
}

/* ===== TOTAL DO CARRINHO E CHECKOUT ===== */
.total-carrinho,
#total-checkout,
#total-confirmacao {
  font-size: 1.2rem;
  font-weight: bold;
  color: #222;
  margin-top: 1rem;
}

.total-carrinho h2,
#resumo-pedido h2,
#resumo-final h2 {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  color: #333;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.3rem;
}

/* ===== BOTÃO PRINCIPAL ===== */
.btn-finalizar {
  display: inline-block;
  background: #007bff;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1rem;
  text-decoration: none;
  text-align: center;
}

.btn-finalizar:hover {
  background: #0056b3;
}

}
