/* ============================================
   LIGHTBOX / VISOR DE GALERÍA DE PROYECTOS
   ============================================ */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 35, 0.96);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  padding: 20px;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  max-height: 95vh;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  animation: lbFadeUp 0.4s ease;
}

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

.lightbox-image-wrap {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.lightbox-close svg {
  width: 22px;
  height: 22px;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}

.lightbox-arrow:hover {
  background: var(--primary, #2AABE2);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-arrow-prev { left: 20px; }
.lightbox-arrow-next { right: 20px; }

.lightbox-arrow svg {
  width: 22px;
  height: 22px;
}

.lightbox-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.lightbox-arrow:disabled:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-50%);
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  z-index: 2;
}

/* Info panel */
.lightbox-info {
  background: white;
  border-radius: 12px;
  padding: 32px;
  overflow-y: auto;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.lightbox-category {
  display: inline-block;
  color: var(--primary, #2AABE2);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.lightbox-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--secondary, #1B2A3D);
  line-height: 1.3;
  margin-bottom: 16px;
}

.lightbox-description {
  color: #666;
  line-height: 1.7;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.lightbox-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: #F5F7FA;
  border-radius: 10px;
  margin-bottom: 24px;
}

.lightbox-meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.lightbox-meta-item svg {
  width: 18px;
  height: 18px;
  stroke: var(--primary, #2AABE2);
  fill: none;
  stroke-width: 2;
  min-width: 18px;
}

.lightbox-meta-label {
  color: #888;
  font-weight: 500;
  min-width: 70px;
}

.lightbox-meta-value {
  color: #333;
  font-weight: 600;
}

.lightbox-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}

.lightbox-thumb {
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: #eee;
}

.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox-thumb.active {
  border-color: var(--primary, #2AABE2);
  transform: scale(1.05);
}

.lightbox-thumb:hover {
  border-color: var(--primary, #2AABE2);
}

.lightbox-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: #25D366;
  color: white;
  border-radius: 50px;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.2s;
  margin-top: auto;
}

.lightbox-cta:hover {
  background: #1fb855;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.lightbox-cta svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Mobile */
@media (max-width: 900px) {
  .lightbox-container {
    grid-template-columns: 1fr;
    gap: 12px;
    max-height: 95vh;
    overflow-y: auto;
  }

  .lightbox-image-wrap {
    min-height: 300px;
    max-height: 50vh;
  }

  .lightbox-image {
    max-height: 50vh;
  }

  .lightbox-info {
    padding: 24px;
    max-height: none;
    overflow-y: visible;
  }

  .lightbox-title {
    font-size: 1.2rem;
  }

  .lightbox-arrow {
    width: 40px;
    height: 40px;
  }

  .lightbox-arrow-prev { left: 10px; }
  .lightbox-arrow-next { right: 10px; }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
  }
}
