/*---------------------------------*/
/* HERO                             */
/*---------------------------------*/
.instalaciones-hero {
  position: relative;
  height: 40vh;
  min-height: 260px;
  background-image: url("/assets/images/og-image.webp");
  background-size: cover;
  background-position: bottom;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.instalaciones-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
.instalaciones-hero-content {
  position: relative;
  z-index: 2;
  padding: 1rem;
}
.instalaciones-hero-content h2 {
  font-family: "Contrail One", sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--accent-1-color);
  margin-bottom: 0.5rem;
}
.instalaciones-hero-content p {
  font-size: 1.1rem;
  color: var(--base-color);
  opacity: 0.85;
}

/*---------------------------------*/
/* SECCIÓN PRINCIPAL                */
/*---------------------------------*/
.instalaciones-section {
  padding: 3rem 1.5rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

/*---------------------------------*/
/* CARRUSEL                         */
/*---------------------------------*/
.carrusel-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--accent-1-color);
  background: var(--bg-2-color);
  margin-bottom: 1.2rem;
}
.carrusel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.carrusel-slide {
  min-width: 100%;
  position: relative;
  cursor: zoom-in;
}
.carrusel-slide img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  display: block;
  transition: filter 0.3s;
}
.carrusel-slide:hover img {
  filter: brightness(0.8);
}
.carrusel-slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: var(--base-color);
  font-size: 1rem;
  font-weight: 600;
  pointer-events: none;
}
.zoom-hint {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.5);
  color: var(--base-color);
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.carrusel-slide:hover .zoom-hint {
  opacity: 1;
}

/*---------------------------------*/
/* BOTONES PREV / NEXT              */
/*---------------------------------*/
.carrusel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--accent-1-color);
  color: var(--base-color);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, color 0.3s;
}
.carrusel-btn:hover {
  background: var(--accent-1-color);
  color: var(--bg-1-color);
}
.carrusel-btn.prev { left: 1rem; }
.carrusel-btn.next { right: 1rem; }

/*---------------------------------*/
/* DOTS / INDICADORES               */
/*---------------------------------*/
.carrusel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-2-color);
  border: 1px solid var(--accent-1-color);
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}
.dot.activo {
  background: var(--accent-1-color);
  transform: scale(1.3);
}

/*---------------------------------*/
/* CONTADOR                         */
/*---------------------------------*/
.carrusel-counter {
  text-align: center;
  font-size: 0.9rem;
  color: var(--base-color);
  opacity: 0.6;
  margin-bottom: 2.5rem;
}

/*---------------------------------*/
/* MINIATURAS                       */
/*---------------------------------*/
.miniaturas-titulo {
  font-family: "Contrail One", sans-serif;
  color: var(--accent-2-color);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}
.miniaturas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.7rem;
}
.miniatura {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.2s;
}
.miniatura:hover,
.miniatura.activa {
  border-color: var(--accent-1-color);
  transform: scale(1.03);
}
.miniatura img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/*---------------------------------*/
/* LIGHTBOX                         */
/*---------------------------------*/
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}
#lightbox.abierto {
  display: flex;
}

/* Wrapper que contiene imagen + flechas → flechas centradas sobre la imagen */
.lightbox-img-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 90vw;
}

#lightbox-img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 8px;
  box-shadow: 0 0 60px rgba(0,0,0,0.8);
  object-fit: contain;
  display: block;
}
#lightbox-caption {
  color: var(--base-color);
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.85;
  text-align: center;
}
#lightbox-counter {
  color: var(--base-color);
  font-size: 0.85rem;
  opacity: 0.5;
}
.lightbox-cerrar {
  position: fixed;
  top: 1.2rem;
  right: 1.5rem;
  font-size: 2rem;
  color: var(--base-color);
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  transition: color 0.2s;
}
.lightbox-cerrar:hover { color: var(--accent-2-color); }

/* absolute dentro del wrapper → se centran respecto a la imagen */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--accent-1-color);
  color: var(--base-color);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.3s;
  -webkit-tap-highlight-color: transparent;
  z-index: 10;
}
.lightbox-nav:hover { background: var(--accent-1-color); color: var(--bg-1-color); }
.lightbox-nav.prev { left: 0.5rem; }
.lightbox-nav.next { right: 0.5rem; }

/*---------------------------------*/
/* MEDIA QUERIES                    */
/*---------------------------------*/
@media (max-width: 768px) {
  .carrusel-slide img { height: 260px; }
  .miniaturas-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  .lightbox-nav.prev { left: 0.3rem; }
  .lightbox-nav.next { right: 0.3rem; }
  .instalaciones-hero { background-position: center; }
}