/* Contenedor de la galería */
.gallery {
  position: relative;
  width: 100%;
  overflow: hidden; /* Puedes mantenerlo */
}

/* Contenedor de ítems: SIN SCROLL y ajustable */
.gallery-container {
  display: flex;
  flex-wrap: wrap;        /* Permite varias filas */
  gap: clamp(0.75rem, 2vw, 1.5rem); /* Espaciado flexible */
  overflow: hidden;       /* Oculta desbordes */
}

/* Ítem de la galería: ahora responsive */
.gallery-item {
  flex: 1 1 calc(33.333% - 1rem);  /* 3 por fila, ajustables */
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}

/* Imagen */
.gallery-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Overlay azul */
.gallery-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 6, 68, 0.4);
  z-index: 1;
}

/* Texto overlay */
.text-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  opacity: 0; /* Inicia oculto */
  z-index: 2;
  animation: fadeInText 2s forwards;
  padding: 1rem;
  width: 90%;
  max-width: 90%;
  box-sizing: border-box;
}

.text-overlay .title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

.text-overlay .subtitle {
  font-size: 1rem;
  opacity: 0;
  animation: fadeInSubtitle 2s forwards 1s;
}

@keyframes fadeInText {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInSubtitle {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 768px) {
  .gallery-item {
    flex: 1 1 calc(50% - 1rem); /* 2 por fila en tablet */
  }
}

@media (max-width: 480px) {
  .gallery-item {
    flex: 1 1 100%; /* 1 por fila en móvil */
  }
}


/* Sección principal */
.impact-info {
  background: white;
  padding: 50px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column; /* Centrado vertical */
}

/* Contenedor de contenido */
.impact-info .content {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px;
  flex-wrap: wrap; /* Permite que se apilen en pantallas pequeñas */
}

/* Título */
.impact-info .content h2 {
  font-weight: bold;
  text-align: center;
  font-size: 2.3rem;
  color: #0d163e;
  max-width: 800px;
}

/* Línea separadora */
.line-separator {
  width: 6px;
  height: 170px;
  background-color: #c81851;
  border-radius: 4px;
}

/* Párrafo */
.impact-info p {
  font-size: 1.2rem;
  color: #0d163e;
  max-width: 550px;
  line-height: 1.6;
  text-align: justify;
}

/* RESPONSIVE: Tablet y Móvil */
@media (max-width: 1024px) {
  .impact-info .content {
    flex-direction: column;  /* Apila verticalmente */
    gap: 30px;               /* Reduce espacio */
    text-align: center;      /* Centra textos */
  }

  .line-separator {
    width: 120px;   /* Ahora horizontal */
    height: 6px;
  }

  .impact-info p {
    text-align: center; /* Centra texto en móvil */
    max-width: 90%;     /* Más ancho en pantallas chicas */
  }
}


/* SECCIÓN MAQUILA CNC */
/* ==== BASE STYLES ==== */
* {
  box-sizing: border-box;
}

.blog-slider {
  width: 100%;
  max-width: 1050px;
  margin: auto;
  background: #fff;
  box-shadow: 0px 14px 80px rgba(34, 35, 58, 0.2);
  padding: 25px;
  border-radius: 25px;
  overflow: hidden;
}

.blog-slider__item {
  display: flex;
  flex-direction: column;   /* Cambia de fila a columna para que imagen y texto estén uno debajo del otro */
  align-items: center;      /* Centra horizontalmente */
  justify-content: center;  /* Centra verticalmente dentro del slide */
  text-align: center;       /* Alinea el texto al centro */
  padding: 20px;            /* Espacio interno opcional */
  gap: 20px;                /* Espacio entre imagen y contenido */


}

.blog-slider__img {
  width: 550px;
  max-width: 100%;
  flex-shrink: 0;
  height: auto;
  aspect-ratio: 16/9;
  background: linear-gradient(10deg, #0d163e 0%, #0d163e 74%);
  box-shadow: 4px 13px 15px 1px rgba(6, 6, 68, 0.2);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
  margin-bottom: 20px;
}

.blog-slider__img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(147deg, rgba(6,6,68,0.2) 0%, rgba(6,6,68,0.25) 74%);
  border-radius: 20px;
}

.blog-slider__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.4s;
  border-radius: 20px;
}

.blog-slider__item.swiper-slide-active .blog-slider__img img {
  opacity: 1;
}

.blog-slider__content {
  flex: 1;
}

.blog-slider__title {
  font-size: 24px;
  font-weight: 700;
  color: #0d0925;
  margin-bottom: 20px;
  word-break: break-word;
}

.blog-slider__text {
  color: #4e4a67;
  margin-bottom: 30px;
  line-height: 1.5em;
  word-break: break-word;
}

.blog-slider__button {
  display: inline-flex;
  background: linear-gradient(10deg, #c81851 0%, #c81851 74%);
  padding: 15px 35px;
  border-radius: 50px;
  color: #fff;
  box-shadow: 0px 14px 80px rgba(252, 56, 56, 0.4);
  text-decoration: none;
  font-weight: 500;
  justify-content: center;
  text-align: center;
  letter-spacing: 1px;
}

.blog-slider__pagination {
  text-align: center;
  margin-top: 20px;
}

.blog-slider__pagination .swiper-pagination-bullet {
  width: 11px;
  height: 11px;
  display: inline-block;
  border-radius: 10px;
  background: #062744;
  opacity: 0.2;
  margin: 4px;
  transition: all 0.3s;
}

.blog-slider__pagination .swiper-pagination-bullet-active {
  opacity: 1;
  background: #c81851;
  height: 20px;
  box-shadow: 0px 0px 20px rgba(252, 56, 56, 0.3);
}

/* ==== RESPONSIVE ==== */

@media (max-width: 1024px) {
  .text-overlay .title {
    font-size: 1.5rem;
  }

  .blog-slider__item {
    flex-direction: column;
    text-align: center;
  }
  .blog-slider__img {
    transform: none; /* elimina desplazamiento lateral */
    max-width: 100%;
  }
  .blog-slider__content {
    padding: 0 15px;
  }

  .impact-info .content h2 {
    font-size: 1.5rem;
  }
  .impact-info p {
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .text-overlay .title {
    font-size: 1.5rem;
  }
  .impact-info .content h2 {
    font-size: 1.5rem;
  }
  .impact-info p {
    font-size: 1rem;
  }
  .blog-slider__title {
    font-size: 20px;
  }
  .blog-slider__text {
    font-size: 15px;
  }
  .blog-slider__button {
    padding: 10px 20px;
    font-size: 13px;
  }
  .blog-slider__pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
  }
  .blog-slider__pagination .swiper-pagination-bullet-active {
    height: 18px;
  }
}
