.gallery {
  padding: 20px;
  font-family: Arial, sans-serif;
  background-color: #ffff;
}

/* Filtros */
.gallery-filters {
  margin-bottom: 20px;
  text-align: center;
}

.gallery-filters__list {
  display: flex;
  justify-content: center;
  gap: 15px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.gallery-filters__list--filter {
  cursor: pointer;
  padding: 10px 15px;
  color: #1e1e1e;
  border-radius: 5px;
  transition: background-color 0.3s;
  font-family: Montserrat;
  font-size: 16px;
}

.gallery-filters__list--filter:hover {
  background-color: #0fc5aa;
  color: #fff;
}

.gallery-filters__list--filter.active {
  background-color: #0fc5aa;
  color: #fff;
  font-weight: bold;
}

/* Imagens */
.gallery-imgs {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  width: 100%;
}

.cards-list {
  display: flex;
  flex-wrap: wrap; /* Mantém o flex-wrap para desktop */
  gap: 15px;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

/* Cards */
.cards-list_img {
  position: relative;
  overflow: hidden;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #fff;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
  opacity: 0;
  flex: 1 1 100%; /* Ocupa 100% no mobile */
  max-width: 100%; /* Ocupa 100% no mobile */
}

.cards-list_img.loaded {
  opacity: 1;
}

.card-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.card-description {
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  text-align: center;
  padding: 10px;
  font-size: 0.9rem;
  position: absolute; /* Posição absoluta para o hover no desktop */
  bottom: 0;
  left: 0;
  width: 100%;
  opacity: 0; /* Inicialmente invisível */
  transition: opacity 0.3s;
}

.cards-list_img:hover .card-description {
  opacity: 1; /* Mostra a descrição no hover */
}

.gallery-visualizer__btn--prev {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  color: #fff;
  font-size: 18px;
  transition: color 0.3s;
}

.gallery-visualizer__btn--next {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  color: #fff;
  font-size: 18px;
  transition: color 0.3s;
}

/* Media Queries */
@media screen and (min-width: 768px) {
  .cards-list_img {
    flex: 1 1 calc(50% - 20px);
    max-width: calc(50% - 20px);
  }
  .card-description {
    position: absolute; /* Garante que a posição absoluta se mantenha */
    opacity: 0; /* Mantém a descrição oculta por padrão */
  }
}

@media screen and (min-width: 1024px) {
  .cards-list_img {
    flex: 1 1 calc(25% - 20px);
    max-width: calc(25% - 20px);
  }
}

@media (max-width: 767px) {
  /* Estilos para mobile */
  .card-description {
    position: relative;
    opacity: 1;
    margin-top: 5px;
    background-color: #fff;
    color: #1e1e1e;
  }
}

.gallery-paginator {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  margin: 20px 0;
}
.gallery-paginator__buttons {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  gap: 1.2rem;
}

.gallery-paginator__buttons--prev,
.gallery-paginator__buttons--next {
  border-radius: 15px;
  width: 90px;
  height: 70px;
  background-color: #fcfcfc;
  border: none;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  color: #1e1e1e;
  font-family: Montserrat;
  font-size: 14px;
}

.gallery-paginator__buttons--current {
  color: #1e1e1e;
  text-decoration: none;
  font-family: Montserrat;
  font-size: 16px;
  font-weight: bold;
}

/* Visualizador de Imagem */
.gallery-visualizer {
  display: none; /* Oculto por padrão */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8); /* Fundo escuro com transparência */
  z-index: 1000; /* Garante que fique acima de outros elementos */
  justify-content: center;
  align-items: center;
}

.gallery-visualizer.active {
  display: flex; /* Exibe a div quando a classe "active" é adicionada */
  flex-direction: column;
}

.gallery-visualizer__img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  object-fit: contain; /* Garante que a imagem seja redimensionada proporcionalmente */
  margin: auto; /* Centraliza a imagem */
}

/* Ajustes adicionais para responsividade */
@media screen and (max-width: 768px) {
  .gallery-visualizer__img {
    max-width: 80%; /* Reduz o tamanho máximo em telas menores */
    max-height: 80%;
  }
}

.gallery-visualizer__description {
  margin-top: 20px; /* Espaço entre a imagem e a descrição */
  color: #fff;
  text-align: center;
  font-size: 1.2rem;
  max-width: 90%; /* Limita a largura da descrição */
  word-wrap: break-word; /* Quebra linhas longas */
}
