/* Galería Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 60px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-overlay span {
  color: white;
  font-size: 1.1rem;
  font-weight: bold;
}

/* Modal */
.gallery-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.gallery-modal.active {
  display: flex;
}

.gallery-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  text-align: center;
}

.gallery-modal-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 5px;
}

.gallery-counter {
  color: white;
  font-size: 1.2rem;
  margin-top: 15px;
  font-weight: bold;
}

/* Botones del modal */
.gallery-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 50px;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
  transition: color 0.3s;
}

.gallery-close:hover {
  color: #ff4444;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  padding: 20px;
  cursor: pointer;
  transition: background 0.3s;
  z-index: 1001;
  border-radius: 5px;
}

.gallery-nav:hover {
  background: rgba(0, 0, 0, 0.8);
}

.gallery-prev {
  left: 20px;
}

.gallery-next {
  right: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .gallery-nav {
    font-size: 30px;
    padding: 15px;
  }

  .gallery-close {
    font-size: 40px;
    top: 10px;
    right: 15px;
  }
}