/* ═══════════════════════════════════════════════════════════════
   LIGHTBOX · galería de fotos por proyecto · 2026-05-24
   ═══════════════════════════════════════════════════════════════ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 15, 14, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: clamp(40px, 6vh, 80px) clamp(20px, 4vw, 64px);
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.lightbox.is-open {
  display: flex;
  opacity: 1;
}

.lightbox-header {
  position: absolute;
  top: clamp(20px, 3vh, 36px);
  left: clamp(20px, 4vw, 56px);
  right: clamp(20px, 4vw, 56px);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  color: rgba(245,242,236,0.85);
  font-family: 'Belleza', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  z-index: 2;
}
.lb-title {
  font-family: 'Belleza', sans-serif;
  font-weight: 300;
  font-size: clamp(18px, 1.8vw, 24px);
  letter-spacing: 0.02em;
  text-transform: none;
  color: #fff;
}
.lb-counter {
  color: #8B7355;
  white-space: nowrap;
}

.lightbox-close {
  position: absolute;
  top: clamp(20px, 3vh, 36px);
  right: clamp(20px, 4vw, 56px);
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid rgba(245,242,236,0.4);
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
.lightbox-close:hover {
  background: #8B7355;
  border-color: #8B7355;
  transform: rotate(90deg);
}

.lightbox-stage {
  width: 100%;
  max-width: 1280px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-image {
  max-width: 100%;
  max-height: 64vh;
  object-fit: contain;
  box-shadow: 0 30px 100px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.lightbox-image.is-loaded { opacity: 1; }

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 1px solid rgba(245,242,236,0.4);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  color: #fff;
  font-family: 'Belleza', sans-serif;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
.lightbox-arrow:hover { background: #8B7355; border-color: #8B7355; }
.lightbox-arrow.prev { left: clamp(8px, 2vw, 24px); }
.lightbox-arrow.next { right: clamp(8px, 2vw, 24px); }
.lightbox-arrow.prev:hover { transform: translateY(-50%) translateX(-2px); }
.lightbox-arrow.next:hover { transform: translateY(-50%) translateX(2px); }
.lightbox-arrow[hidden] { display: none; }

/* THUMBNAILS strip · max 3 visibles con flechas para navegar */
.lightbox-thumbs {
  position: absolute;
  bottom: clamp(20px, 3vh, 40px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 3;
  max-width: calc(100% - 80px);
  width: min(540px, 90vw);
}
.lb-thumb-arrow {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid rgba(245,242,236,0.4);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #fff;
  font-family: 'Belleza', sans-serif;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, border-color 0.3s, opacity 0.3s;
}
.lb-thumb-arrow:hover:not(:disabled) {
  background: #8B7355;
  border-color: #8B7355;
}
.lb-thumb-arrow:disabled {
  opacity: 0.25;
  cursor: default;
}
.lb-thumb-viewport {
  flex: 1 1 auto;
  overflow: hidden;
  min-width: 0;
}
.lb-thumb-track {
  display: flex;
  gap: 10px;
  transition: transform 0.4s cubic-bezier(0.2, 0.6, 0.2, 1);
  will-change: transform;
}
.lb-thumb {
  aspect-ratio: 3 / 2;
  background: rgba(245,242,236,0.06);
  border: 1px solid rgba(245,242,236,0.18);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  opacity: 0.6;
  transition: opacity 0.3s, border-color 0.3s, transform 0.3s;
}
.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lb-thumb:hover { opacity: 0.9; border-color: rgba(245,242,236,0.5); }
.lb-thumb.is-active {
  opacity: 1;
  border-color: #8B7355;
}
.lightbox-thumbs[hidden] { display: none; }

/* Indicador "Click para ampliar" en thumbnails con varias fotos */
.port-item {
  position: relative;
}
.port-count {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(15,15,14,0.78);
  color: #fff;
  font-family: 'Belleza', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  padding: 6px 10px;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.port-item:hover .port-count { opacity: 1; }
@media (hover: none) {
  .port-count { opacity: 1; }
}

/* Body block scroll cuando lightbox abierto */
body.lb-open { overflow: hidden; }

@media (max-width: 720px) {
  .lightbox-arrow {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  .lightbox-image { max-height: 56vh; }
  .lightbox-header { font-size: 10px; }
  .lb-title { font-size: 16px; }
  .lightbox-thumbs {
    width: calc(100% - 32px);
    gap: 8px;
  }
  .lb-thumb-arrow { width: 30px; height: 30px; font-size: 12px; }
}
