body {
  background: url('../img/bg/fondo-galeria.webp') center / cover no-repeat;
}

.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  max-width: 1400px;
  margin: 30px auto;
  padding: 20px;
}

.photo {
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  border: 2px solid white;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo img:hover {
  cursor: pointer;
}

.visor {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.visor.oculto {
  display: none;
}

#imagen-activa {
  object-fit: contain;
  width: 70%;
  height: 70%;
  box-shadow: 0 0 20px #000;
  border-radius: 10px;
}

#cerrar,
.nav-btn {
  position: absolute;
  font-size: 40px;
  color: var(--text-color);
  cursor: pointer;
  z-index: 1001;
  background: none;
  border: none;
}

#cerrar {
  top: 30px;
  right: 50px;
}

.nav-btn:hover {
  color: var(--icon-info-color);
}

.nav-btn:first-of-type {
  left: 30px;
}

.nav-btn:last-of-type {
  right: 30px;
}

#btnTop {
  position: fixed;
  bottom: 30px;
  right: 10px;
  background: var(--main-bg-color);
  color: var(--text-color);
  width: 55px;
  height: 55px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  border: none;
  font-size: 20px;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: 0.3s ease;
  z-index: 999;
}

#btnTop.show {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}

#btnTop:hover {
  transform: translateY(-3px);
  background-color: var(--color-rosa);
}