/* Galería Simple para YC Engineering - Responsive */

.gallery-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  auto-rows: 1fr;
}

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

@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
  }

  .gallery-wrapper {
    padding: 30px 15px;
  }
}

@media (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
}

.gallery-item {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-item.visible {
  display: block;
  opacity: 1;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease;
  display: block;
}

@media (max-width: 768px) {
  .gallery-item img {
    height: 200px;
  }
}

@media (max-width: 576px) {
  .gallery-item img {
    height: 160px;
  }
}

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

/* Efecto de overlay al hacer hover */
.gallery-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 70%,
    rgba(0, 0, 0, 0.7) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

.load-more-container {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 40px;
  padding: 20px;
}

.load-more-btn {
  padding: 14px 40px;
  background-color: #000000;
  color: #ffffff;
  border: 2px solid #000000;
  font-family: 'avenir-lt-w01_35-light1475496', sans-serif;
  font-size: 16px;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
  min-width: 200px;
}

@media (max-width: 768px) {
  .load-more-btn {
    padding: 12px 30px;
    font-size: 14px;
    min-width: 160px;
  }
}

.load-more-btn:hover {
  background-color: #ffffff;
  color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.load-more-btn:active {
  transform: translateY(0);
}

.load-more-btn.hidden {
  display: none;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.lightbox.active {
  display: flex;
  animation: fadeInLightbox 0.3s ease;
}

@keyframes fadeInLightbox {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@media (max-width: 768px) {
  .lightbox img {
    max-width: 95%;
    max-height: 80%;
  }
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 50px;
  color: white;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
  line-height: 1;
  z-index: 10001;
}

.lightbox-close:hover {
  color: #ccc;
  transform: scale(1.1);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 60px;
  color: white;
  cursor: pointer;
  padding: 20px;
  user-select: none;
  transition: color 0.3s ease, transform 0.3s ease;
  z-index: 10001;
  opacity: 0.7;
}

.lightbox-nav:hover {
  color: white;
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

@media (max-width: 768px) {
  .lightbox-nav {
    font-size: 40px;
    padding: 10px;
  }
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* Contador de imágenes en lightbox */
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 14px;
  font-family: 'avenir-lt-w01_35-light1475496', sans-serif;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  border-radius: 20px;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}
