.gallery-section {
  width: 90%;
  max-width: 1000px;
  margin: 40px auto 50px auto;
  text-align: center;
}

.gallery-section .main-image {
  display: flex;
  justify-content: center; 
}

.gallery-section .main-image img {
  width: 100%;
  max-width: 600px;
  height: auto;
  object-fit: contain;
  border-radius: var(--radio);
  margin-bottom: 20px;
  box-shadow: var(--sombra);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: block; 
}

.gallery-section .main-image img:hover {
  transform: scale(1.02);
  box-shadow: var(--sombra-hover);
}

.gallery-section .carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  position: relative;
}

.gallery-section .track {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery-section .card {
  flex: 0 0 auto;
}

.gallery-section .card img {
  width: 120px;
  height: 140px;
  object-fit: cover;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.3s ease;
  filter: grayscale(60%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gallery-section .card img:hover {
  transform: scale(1.05);
  filter: grayscale(0%);
  box-shadow: 0 8px 20px rgba(0,134,172,0.2);
}

.gallery-section .card img.active {
  filter: grayscale(0%);
  border: 2px solid var(--teal);
  box-shadow: 0 4px 12px rgba(0,134,172,0.3);
  transform: scale(1.02);
}

.gallery-section .btn {
  font-size: 28px;
  width: 44px;
  height: 44px;
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.gallery-section .btn:hover {
  background: var(--azul);
  color: var(--blanco);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 16px rgba(11,61,145,0.2);
}

.gallery-section .btn.prev {
  left: -50px;
}

.gallery-section .btn.next {
  right: -50px;
}

.fullscreen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.95);
  z-index: 9999;
  display: none;  
  justify-content: center;
  align-items: center;
}

.fullscreen-overlay.active {
  display: flex; 
}

.fullscreen-overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  object-fit: contain;
}

.fullscreen-overlay .close-btn {
  position: absolute;
  top: 25px;
  right: 35px;
  font-size: 48px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.fullscreen-overlay .close-btn:hover {
  background: var(--rojo);
  transform: rotate(90deg);
}

@media (max-width: 900px) {
  .gallery-section .btn.prev {
    left: -40px;
  }
  .gallery-section .btn.next {
    right: -40px;
  }
}

@media (max-width: 768px) {
  .gallery-section .btn {
    display: none;
  }
  
  .gallery-section .track {
    gap: 10px;
  }
  
  .gallery-section .card img {
    width: 90px;
    height: 105px;
  }
  
  .fullscreen-overlay .close-btn {
    top: 15px;
    right: 15px;
    font-size: 36px;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 580px) {
  .gallery-section .card img {
    width: 75px;
    height: 90px;
  }
}

@media (max-width: 480px) {
  .gallery-section .card img {
    width: 65px;
    height: 80px;
  }
}