body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f2f2f2;
}

.miniaturas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 20px;
}

.miniaturas img {
  width: 320px;
  height: auto; /* Mantém a altura automática para não distorcer as imagens */
  max-height: 180px; /* Limita a altura para não estourar */
  object-fit: cover;
  cursor: pointer;
  border-radius: 5px;
  transition: transform 0.3s;
}

.miniaturas img:hover {
  transform: scale(1.03);
}

/* Modal */
.modal {
  position: fixed;
  display: none;
  z-index: 999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.4s ease;
}

.modal.ativo {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

#imagem-modal {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  animation: zoomIn 0.4s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.fechar {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 35px;
  color: #fff;
  cursor: pointer;
}

.seta {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  font-size: 35px;
  padding: 10px;
  border-radius: 10%;
  cursor: pointer;
  transition: background 0.3s;
}

.seta:hover {
  background: rgba(255, 255, 255, 0.5);
}

.seta.esquerda {
  left: 20px;
}

.seta.direita {
  right: 20px;
}

/* Responsivo para telas menores de 1200px */
@media (max-width: 1200px) {
  .miniaturas img {
    width: 250px; /* Ajusta o tamanho das imagens para telas médias */
    max-height: 160px;
  }
}

/* Responsivo para telas menores de 992px */
@media (max-width: 992px) {
  .miniaturas img {
    width: 220px; /* Ajusta o tamanho das imagens para telas menores */
    max-height: 150px;
  }
}

/* Responsivo para telas de 768px */
@media (max-width: 768px) {
  .miniaturas img {
    width: 200px; /* Ajusta o tamanho das imagens para tablets */
    max-height: 130px;
  }

  .modal {
    padding: 10px; /* Ajuste de padding para o modal em telas médias */
  }

  .fechar {
    font-size: 28px;
    top: 10px;
    right: 15px;
  }

  .seta {
    font-size: 30px;
    padding: 10px;
  }
}

/* Responsivo para telas menores de 600px */
@media (max-width: 600px) {
  .miniaturas img {
    width: 100%; /* Ajusta para ocupar toda a largura disponível em telas pequenas */
    height: auto; /* Mantém a proporção da imagem */
    max-height: 220px; /* Limita a altura das imagens */
  }

  .fechar {
    font-size: 28px;
    top: 10px;
    right: 15px;
  }

  .seta {
    font-size: 26px;
    padding: 8px;
  }

  /* Ajusta a largura do modal em telas menores */
  #imagem-modal {
    max-width: 80%;
  }
}
