.gallery-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem;
  text-align: center;
}

.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.category-filters {
  margin-bottom: 3rem;
}

.curso-filters .filter-btn {
  font-weight: bold;
  border: 1px solid #ddd;
}

.gallery-title {
  font-size: 2rem;
  margin-bottom: 2rem;
}

.filter-btn {
  background: #eee;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 8px;
  font-size: 1rem;
  transition: background 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--color);
  color: #fff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.35s ease, transform 0.35s ease;
  visibility: visible;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transform: scale(1);
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.load-more-container {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

.display-none {
  display: none !important;
}

.gallery-item.hide {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.gallery-item.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 99999;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--color);
  color: white;
  font-size: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  z-index: 100000;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.lightbox-controls span {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
  padding: 20px;
  z-index: 100000;
  transition: color 0.3s;
}

.lightbox-controls span:hover {
  color: var(--color);
}

.lightbox-prev {
  left: 10px;
}

.lightbox-next {
  right: 10px;
}

@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .lightbox-close {
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    font-size: 2rem;
  }

  .lightbox-controls span {
    top: auto;
    bottom: 20px;
    transform: none;
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
    padding: 10px 25px;
    font-size: 2rem;
  }

  .lightbox-prev {
    left: 15%;
  }

  .lightbox-next {
    right: 15%;
  }

  .lightbox-img {
    max-width: 95%;
    max-height: 75vh;
  }
}

@media screen and (min-width: 768px) and (max-width: 991px) and (orientation: portrait) {
  section {
    margin: 0 2rem !important;
  }
}

.dark-mode .lightbox-controls span {
  color: #fff;
}

.dark-mode .filter-btn {
  background: #333;
  color: #eee;
}

.dark-mode .curso-filters .filter-btn {
  border-color: #444;
}