/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  color: #333;
}

/* Header */
header {
  background-color: #2c3e50;
  color: white;
  padding: 20px;
  text-align: center;
}

header h1 {
  margin-bottom: 15px;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 4px;
}

nav a:hover {
  background-color: #34495e;
}

/* Main - Layout em Coluna */
main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
}

/* Secção de Produtos */
#produtos {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  width: 100%;
}

#produtos h2 {
  color: #2c3e50;
  margin-bottom: 20px;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
}

/* Barra de Pesquisa */
.pesquisa-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  padding: 15px;
  background-color: #e8f4f8;
  border-radius: 6px;
  border: 1px solid #b8dce8;
}

.pesquisa-container label {
  font-weight: bold;
  color: #2c3e50;
  font-size: 14px;
}

.pesquisa-container input {
  flex: 1;
  padding: 10px 15px;
  border: 2px solid #3498db;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.3s;
}

.pesquisa-container input:focus {
  outline: none;
  border-color: #2980b9;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Wrapper para os filtros */
.filtros-wrapper {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Filtro de Categorias e Ordenação */
.filtro-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  flex: 1;
  min-width: 250px;
}

.filtro-container label {
  font-weight: bold;
  color: #2c3e50;
  font-size: 14px;
  white-space: nowrap;
}

.filtro-container select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  background-color: white;
  transition: border-color 0.3s;
}

.filtro-container select:hover {
  border-color: #3498db;
}

.filtro-container select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Container de Produtos - Flex */
.produto-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* Cada Produto (Article) */
article {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  width: calc(33.333% - 14px);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

article:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

article img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
}

article h3 {
  color: #2c3e50;
  margin-bottom: 8px;
  font-size: 18px;
}

article p {
  color: #666;
  margin-bottom: 8px;
  font-size: 14px;
}

article .preco {
  color: #e74c3c;
  font-weight: bold;
  font-size: 20px;
  margin: 10px 0;
}

article button {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

article button:hover {
  background-color: #2980b9;
}

article button:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
}

/* Wrapper do Cesto e Checkout */
#cesto-checkout-wrapper {
  width: 100%;
}

/* Cesto */
#cesto {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  width: 100%;
}

#cesto h2 {
  color: #2c3e50;
  margin-bottom: 20px;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
}

.cesto-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 400px;
  overflow-y: auto;
}

.cesto-vazio {
  text-align: center;
  color: #999;
  padding: 20px 0;
  font-style: italic;
}

.cesto-container article {
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.cesto-container article img {
  width: 60px;
  height: 60px;
}

.total-section {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 2px solid #ddd;
  display: none;
}

.total-section p {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

.remover-todos-btn {
  width: 100%;
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background-color 0.3s;
  margin-top: 10px;
}

.remover-todos-btn:hover {
  background-color: #c0392b;
}

/* Seção de Checkout */
.checkout-section {
  margin-top: 20px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 2px solid #3498db;
  display: none;
}

.checkout-section h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 18px;
  text-align: center;
}

.custo-total-checkout {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 20px;
}

.valor-checkout {
  color: #e74c3c;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #2c3e50;
  font-weight: normal;
}

.form-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  margin-top: 5px;
}

.form-group input[type="text"]:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.comprar-btn {
  width: 100%;
  background-color: #27ae60;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.3s;
  margin-top: 10px;
}

.comprar-btn:hover {
  background-color: #229954;
}

.comprar-btn:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
}

footer {
  background-color: #2c3e50;
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 30px;
}

footer p {
  margin: 5px 0;
}

@media (max-width: 768px) {
  article {
    width: calc(50% - 10px);
  }

  .filtros-wrapper {
    flex-direction: column;
  }

  .filtro-container {
    width: 100%;
  }

  .pesquisa-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .pesquisa-container input {
    width: 100%;
  }
}

@media (max-width: 480px) {
  article {
    width: 100%;
  }

  nav ul {
    flex-wrap: wrap;
    gap: 10px;
  }
}