body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  color: #333;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #004080;
  padding: 15px;
  color: white;
  flex-wrap: wrap; /* Para garantir que o layout seja flexível em telas menores */
}

.cart-and-buttons {
  display: flex;
  justify-content: flex-end; /* Alinha os botões e o carrinho à direita */
  align-items: center;
  gap: 10px;
  order: 1;
}

.logo img {
  width: 200px;
  height: auto;
  max-width: 100%;
}

.navbar {
  padding: 1rem 2rem;
}

.navbar ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.navbar a {
  color: white;
  text-decoration: none;
  font-family: Arial, sans-serif;
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
  position: relative;
  transition: color 0.3s ease;
}

.navbar a:hover {
  color: #4CAF50;
}

/* Animação do sublinhado */
.navbar a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #4CAF50;
  transition: width 0.3s ease;
}

.navbar a:hover::after {
  width: 100%;
}

/* Animação ao clicar */
.navbar a:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

.social {
  display: flex;
  gap: 50px;
}

.socials a {
  color: white;
  text-decoration: none;
  font-size: 35px;
  margin: 0 10px;
  transition: color 0.3s ease;
}

.socials a:hover {
  color: #357ae9;
  border-radius: 200px;
  border-color: aqua;
}

.auth-buttons {
  order: 1; /* Coloca os botões à esquerda */
}

.auth-buttons button {
  margin-left: 10px;
  padding: 8px 15px;
  border: none;
  cursor: pointer;
  background: #ffcc00;
  color: #004080;
  font-weight: bold;
  border-radius: 5px;
  order: 2;
}

/* Grid de produtos */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 colunas por fileira */
  gap: 50px;
  padding: 30px;
  justify-items: center; /* Para centralizar os itens */
  align-items: start;
  grid-template-rows: auto;
}

.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 100%; /* Para garantir que o card ocupe toda a largura disponível */
  max-width: 320px; /* Tamanho máximo do card */
  min-width: 250px;
}

.product-card img {
  max-width: 100%;
  height: auto;
  max-height: 150px; /* Limitar o tamanho da imagem */
  object-fit: contain; /* Manter a proporção da imagem */
  margin-bottom: 15px; /* Espaçamento entre a imagem e os detalhes */
}

.product-card .buttons {
  margin-top: auto;
}

.product-card button {
  margin-top: 10px;
  padding: 8px;
  width: 100%;
  border: none;
  background: #004080;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

footer {
  background-color: #004080;
  color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-content {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1200px;
  width: 100%;
  flex-wrap: nowrap;
  justify-content: center;
}

.footer-content p {
  margin: 0;
  font-size: 16px;
  white-space: nowrap;
}

.socials-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.socials-footer a {
  color: white;
  text-decoration: none;
  font-size: 20px;
  margin-right: 10px;
  transition: color 0.3s ease;
}

.socials-footer a:hover {
  color: #ffcc00;
}

@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 colunas para telas menores */
  }
}

@media (max-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 colunas para telas menores */
  }
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: 1fr; /* 1 coluna para telas ainda menores */
  }

  .footer-content {
    flex-direction: column;
    gap: 5px;
  }

  .footer-content p {
    white-space: normal;
    text-align: center;
  }

  .product-card {
    max-width: 100%;
  }
}

/* 🛒 Carrinho de Compras */
.cart-icon {
  position: relative;
  cursor: pointer;
  font-size: 24px;
  margin-left: 20px;
  margin-right: 100px;
  order: 3;
}

.cart-icon i {
  color: white;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -10px;
  background: red;
  color: white;
  font-size: 14px;
  font-weight: bold;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  display: none;
}

/* Estiliza o popup do carrinho */
.cart-popup {
  position: fixed;
  top: 60px;
  right: 20px;
  width: 300px;
  background: white;
  border: 1px solid #ddd;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 8px;
  z-index: 1000;
  display: none;
}

.cart-popup.active {
  display: block;
}

/* Adicione ao seu arquivo CSS */
.cart-popup .cart-content {
  max-height: 70vh; /* 70% da altura da tela */
  overflow-y: auto; /* Adiciona barra de rolagem vertical quando necessário */
  padding-right: 10px; /* Espaço para a barra de rolagem */
}

.cart-items {
  max-height: 50vh; /* Ajuste conforme necessário */
  overflow-y: auto;
}

/* Estiliza a barra de rolagem */
.cart-items::-webkit-scrollbar {
  width: 8px;
}

.cart-items::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.cart-items::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Ícones de remover */
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #ddd;
}

/* Estiliza o botão de remover como quadrado com bordas arredondadas */
.cart-item .remove-item {
  background: none;
  border: 2px solid #ddd;
  color: red;
  font-size: 20px;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.cart-item .remove-item:hover {
  background-color: #f8f8f8;
}

/* Estilo para o botão de fechar do popup */
#close-cart {
  background: #ff4c4c;
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
  border-radius: 8px;
}

.cart-total {
  font-weight: bold;
  margin-top: 10px;
}

/* Botão fechar - Posicionamento do "X" do Carrinho */
#close-cart {
  background: red;
  color: white;
  border: none;
  padding: 5px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#close-cart:hover {
  background-color: #ff3333;
}
