* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

.header {
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #fff;
}

.logo {
  max-height: 150px;
}

.menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.menu-link {
  color: #00a8a5;
  font-size: 16px;
  text-decoration: none;
  font-weight: bold;
}

.banner img {
  width: 100%;
  height: auto;
  display: block;
}

.container {
  padding: 20px;
}

.section-title {
  width: 100%;
  background-color: #00a8a5;
  color: #ffffff;
  font-size: 28px;
  text-align: center;
  padding: 15px 10px;
  margin: 20px 0 40px;
  text-transform: uppercase;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.card {
  border: 1px solid #ddd;
  padding: 15px;
  text-align: center;
  border-radius: 5px;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
}

.codigo-produto {
  font-weight: bold;
  margin-top: 10px;
}

.descricao-produto {
  font-size: 14px;
  color: #555;
}

.search-box {
  margin: 30px 0;
  text-align: center;
}

.search-box input {
  width: 90%;
  max-width: 400px;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 20px;
}

html {
  scroll-behavior: smooth;
}

@media (max-width: 768px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .section-title { font-size: 20px; }
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Arial, sans-serif; }

.header { height: 100px; display: flex; justify-content: center; align-items: center; background: #fff; border-bottom: 2px solid #00a8a5; }
.logo { max-height: 150px; }
.menu { display: flex; align-items: center; gap: 40px; }
.menu-link { color: #00a8a5; text-decoration: none; font-weight: bold; font-size: 18px; }

.banner img { width: 100%; height: auto; display: block; }

.container { padding: 20px; max-width: 1200px; margin: 0 auto; }
.section-title { 
  width: 100%; background-color: #00a8a5; color: #fff; 
  font-size: 26px; text-align: center; padding: 15px; 
  margin: 30px 0; text-transform: uppercase; border-radius: 4px;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 25px; }

.card { 
  border: 1px solid #eee; padding: 15px; text-align: center; 
  border-radius: 8px; transition: transform 0.2s; background: #fff;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.card img { width: 100%; height: 180px; object-fit: contain; margin-bottom: 10px; }

.codigo-produto { font-weight: bold; color: #333; font-size: 14px; }
.descricao-produto { font-size: 13px; color: #666; margin-top: 5px; min-height: 40px; }

.search-box { margin: 30px 0; text-align: center; }
.search-box input { 
  width: 90%; max-width: 500px; padding: 15px 25px; 
  border: 2px solid #00a8a5; border-radius: 30px; outline: none; font-size: 16px;
}

@media (max-width: 768px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .section-title { font-size: 18px; }
  .menu { gap: 15px; }
}

/* Botão Flutuante */
.back-to-top {
  display: none; /* Começa escondido */
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: #00a8a5;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9999; /* Valor alto para ficar acima de tudo */
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

/* Seta para cima (Desenho) */
.arrow-up {
  display: inline-block;
  width: 0; 
  height: 0; 
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 12px solid white;
  margin-bottom: 2px;
}

.back-to-top:hover {
  background-color: #007d7a;
  transform: scale(1.1);
}

/* Responsivo para Mobile */
@media (max-width: 600px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}

/* Espaço para o conteúdo não bater no rodapé */
body {
  padding-bottom: 60px;
}

.footer {
  width: 100%;
  background-color: #f8f8f8; /* Cinza bem claro */
  color: #666; /* Cor do texto */
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid #eee;
  font-size: 14px;
  margin-top: 40px;
}

/* Estilo do botão de impressão */
.print-btn {
  background-color: #00a8a5;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: background 0.3s;
}

.print-btn:hover {
  background-color: #007d7a;
}

/* Regras para a Impressão (PDF) */
@media print {
  /* 1. Remove busca, botões, elementos flutuantes e os links do menu */
  .search-box, 
  .print-btn, 
  .back-to-top,
  .footer, 
  #noResults,
  .menu-link { /* Remove "Unidade" e "Metro" do menu */
    display: none !important; 
  }

  /* 2. Ajuste do Header (Logo centralizada e menor) */
  .header {
    display: flex !important;
    justify-content: center !important; /* Centraliza o logo no PDF */
    height: auto !important;
    padding: 10px 0;
    border-bottom: 1px solid #00a8a5;
  }

  .logo {
    max-height: 60px !important;
  }

  /* 3. Grid Compacto (4 colunas fixas no PDF) */
  .grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* Força 4 colunas */
    gap: 10px !important; /* Reduz o espaço entre os cards */
  }

  .card {
    break-inside: avoid;
    padding: 10px !important;
    border: 1px solid #eee !important;
  }

  .card img {
    height: 120px !important; /* Diminui a imagem para caber no grid 4 colunas */
  }

  .descricao-produto {
    font-size: 11px !important; /* Texto menor para não quebrar o layout */
    min-height: auto !important;
  }

  /* 4. Ajustes de Títulos e Container */
  .container {
    padding: 0;
    margin: 0;
    max-width: 100%;
  }

  .section-title {
    background-color: #00a8a5 !important;
    -webkit-print-color-adjust: exact; 
    print-color-adjust: exact;
    color: white !important;
    font-size: 18px !important;
    padding: 8px;
    margin: 15px 0;
  }
}