/* Galería compacta en una sola hilera, con despliegue completo bajo demanda. */
#instalaciones.gallery-carousel-ready .project-gallery {
  display: block;
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%);
}

#instalaciones {
  scroll-margin-top: 88px;
}

#instalaciones.gallery-carousel-ready .project-gallery::-webkit-scrollbar {
  display: none;
}

#instalaciones .gallery-carousel-track {
  display: flex;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
}

#instalaciones .gallery-carousel-group {
  display: flex;
  align-items: stretch;
  gap: 18px;
  padding-right: 18px;
}

#instalaciones .gallery-carousel-group .project-gallery-card {
  display: block !important;
  flex: 0 0 clamp(270px, 28vw, 360px);
  width: clamp(270px, 28vw, 360px);
  min-width: 0;
  border-radius: 18px;
  scroll-snap-align: center;
}

#instalaciones .gallery-carousel-group .project-gallery-card picture {
  display: block;
  aspect-ratio: 3 / 2;
}

#instalaciones .gallery-carousel-group .project-gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* La galería permanece sin títulos ni descripciones visibles. */
#instalaciones .project-gallery-copy,
#instalaciones .gallery-disclosure {
  display: none !important;
}

#instalaciones .gallery-status {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#instalaciones .gallery-actions {
  margin-top: 24px;
}

#instalaciones .gallery-more {
  min-width: 150px;
  border-color: #0b4c73;
  color: #082f4b;
  font-weight: 850;
}

#instalaciones .gallery-more:hover,
#instalaciones .gallery-more:focus-visible {
  border-color: #0b4c73;
  outline-color: #0b4c73;
}

/* Vista completa al pulsar “Ver más”. */
#instalaciones.gallery-carousel-ready[data-gallery-expanded="true"] .project-gallery {
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}

#instalaciones[data-gallery-expanded="true"] .gallery-carousel-track {
  display: block;
  width: 100%;
}

#instalaciones[data-gallery-expanded="true"] .gallery-carousel-group[aria-hidden="true"] {
  display: none;
}

#instalaciones[data-gallery-expanded="true"] .gallery-carousel-source {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 0;
}

#instalaciones[data-gallery-expanded="true"] .gallery-carousel-source .project-gallery-card {
  flex: none;
  width: auto;
}

/* Azul editorial más oscuro, con soporte claro para mantener contraste. */
.process-card .process-icon {
  background-color: #0b4c73 !important;
}

.solution-card .solution-icon {
  box-sizing: border-box;
  padding: 11px;
  border: 1px solid #bfd4df;
  border-radius: 18px;
  background: #eaf2f6;
  filter: brightness(0) saturate(100%) invert(25%) sepia(36%) saturate(1346%) hue-rotate(160deg) brightness(88%) contrast(95%);
}

@media (max-width: 980px) {
  #instalaciones[data-gallery-expanded="true"] .gallery-carousel-source {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 640px) {
  #instalaciones.gallery-carousel-ready .project-gallery {
    width: 100%;
    margin-left: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }

  #instalaciones .gallery-carousel-group {
    gap: 12px;
    padding-right: 12px;
  }

  #instalaciones .gallery-carousel-group .project-gallery-card {
    flex-basis: min(calc(100vw - 40px), 320px);
    width: min(calc(100vw - 40px), 320px);
    overflow: hidden;
    border-radius: 16px;
  }

  #instalaciones .gallery-carousel-group .project-gallery-card picture {
    aspect-ratio: 4 / 5;
  }

  #instalaciones[data-gallery-expanded="true"] .gallery-carousel-source {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #instalaciones[data-gallery-expanded="true"] .gallery-carousel-source .project-gallery-card {
    width: auto;
  }

  #instalaciones .gallery-more {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  #instalaciones.gallery-carousel-ready .project-gallery {
    scroll-snap-type: x mandatory;
    -webkit-mask-image: none;
    mask-image: none;
  }

  #instalaciones .gallery-carousel-group[aria-hidden="true"] {
    display: none;
  }

  #instalaciones .gallery-carousel-source .project-gallery-card {
    scroll-snap-align: center;
  }
}
