/* Estilos mejorados para la galería */
.gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.gallery-header {
  text-align: center;
  margin-bottom: 30px;
}

.gallery-header h2 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: #333;
}

.gallery-header p {
  color: #666;
  font-size: 1.1rem;
}

.gallery-main {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.gallery-container {
  flex: 1;
  display: flex;
  gap: 20px;
  align-items: center;
}

.image-container {
  flex: 2;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.main-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
  /* Removido transition para evitar parpadeo */
}

.image-info {
  flex: 1;
  padding: 20px;
}

.image-title {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: #333;
  font-weight: 600;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.8));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.image-container:hover .image-overlay {
  opacity: 1;
}

.service-link {
  background: rgba(255,255,255,0.9);
  color: #333;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.service-link:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.service-tag {
  display: inline-block;
  background: #f0f0f0;
  color: #666;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-btn {
  background: rgba(255,255,255,0.9);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  color: #333;
}

.nav-btn:hover {
  background: white;
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.thumbnails {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.thumbnail {
  width: 80px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  border: 3px solid transparent;
}

.thumbnail.active {
  border-color: #667eea;
  transform: scale(1.1);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
  padding: 8px 4px 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.thumbnail:hover .thumbnail-overlay {
  opacity: 1;
}

.thumbnail-title {
  font-size: 0.7rem;
  font-weight: 500;
  text-align: center;
  display: block;
  line-height: 1.2;
}

.gallery-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
}

.refresh-gallery-btn {
  background: linear-gradient(135deg, #6491f1 0%, #4b92a2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.refresh-gallery-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(90, 176, 205, 0.321);
}

.refresh-gallery-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.gallery-counter {
  font-weight: 600;
  color: #666;
}

.current-image {
  color: #667eea;
  font-size: 1.2rem;
}

.gallery-error {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.gallery-error i {
  font-size: 3rem;
  color: #ddd;
  margin-bottom: 20px;
}

.retry-btn {
  background: #66c7ea;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 20px;
  transition: all 0.3s ease;
}

.retry-btn:hover {
  background: #509dbe;
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-main {
    flex-direction: column;
  }
  
  .gallery-container {
    flex-direction: column;
  }
  
  .image-container {
    width: 100%;
  }
  
  .main-image {
    height: 250px;
  }
  
  .image-info {
    text-align: center;
  }
  
  .gallery-controls {
    flex-direction: column;
    gap: 15px;
  }
  
  .gallery-header h2 {
    font-size: 2rem;
  }
  
  .nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}