/* ==============================================
   SERVICIOS Y ESTADÍSTICAS
============================================== */

.services-section,
.stats-section-wrapper {
  width: 100%;
}

.services-section,
.stats-section-wrapper {
  margin: 0 auto;
  padding: 80px 20px; /* ← AÑADIDO: más espacio arriba y abajo */
}
/* ==============================================
   TÍTULO DE SECCIÓN — NUEVAS CLASES
============================================== */

.services-title-box {
  display: flex;
  flex-direction: column;
  align-items: center; /* ← AÑADIDO: centra todo */
}

.services-title-box-container {
  margin-bottom: 50px; /* ← AUMENTADO: era 30px */
  text-align: center; /* ← CAMBIADO: era left */
  display: flex;
  flex-direction: column;
  align-items: center; /* ← AÑADIDO: centra todo */
}

.services-title {
  font-size: 2rem;
  font-weight: 600;
  color: #000;
  margin: 0 0 15px 0; /* ← Espacio para la línea */
}

.services-title-line {
  width: 100%;
  /* max-width: 600px; */
  height: 4px;
  background: linear-gradient(
    to right,
    #e53935 0%,
    #e53935 30%,
    rgba(229, 57, 53, 0.3) 70%,
    rgba(229, 57, 53, 0) 100%
  );
  border-radius: 2px;
  display: block;
  margin: 0 auto;
}

/* ==============================================
   GRID DE SERVICIOS
============================================== */

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 700px); /* ← Aumentado de 600px a 700px */
  gap: 80px 50px; /* ← 80px vertical, 50px horizontal */
  margin-bottom: 60px;
  justify-content: center; /* ← ESTO CENTRA LAS CARDS */
}

.service-card {
  height: 450px; /* ← Aumentado de 380px a 450px */
  width: 700px; /* ← Aumentado de 600px a 700px */
  align-items: center;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  position: relative;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.service-image {
  width: 100%;
  height: 70%;
  object-fit: cover;
  object-position: center center; /* Puedes cambiar esto */
}

.service-image-move-bottom {
  object-position: center 0px;
}

/* Si quieres posición específica para cada imagen */
.service-card:nth-child(1) .service-image {
  object-position: center top; /* centrada */
}

.service-content {
  padding: 32px 26px 26px 26px; /* ← Aumentado proporcionalmente */
  display: flex;
  flex-direction: column;
  flex: 1;
}

.service-tag {
  display: block;
  color: #e53935;
  font-size: 0.85rem; /* ← Aumentado de 0.78rem */
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px; /* ← Aumentado de 6px */
  margin-top: 0;
}

.service-description {
  color: #555;
  font-size: 1.05rem; /* ← Aumentado (era 1px, probablemente un error) */
  line-height: 1.5; /* ← Aumentado de 1.4 */
  flex: 1;
  margin-top: -5px;
}

.service-link {
  position: absolute;
  bottom: 18px; /* ← Aumentado de 15px */
  right: 18px; /* ← Aumentado de 15px */
  font-size: 1.7rem; /* ← Aumentado de 1.5rem */
  font-weight: bold;
  color: #e53935;
  text-decoration: none;
  line-height: 1;
  transition: transform 0.2s ease;
}

.service-link:hover {
  transform: translateX(5px);
}

/* ==============================================
   ESTADÍSTICAS
============================================== */

.stats-section-wrapper {
  margin-top: -100px;
  max-width: 900px; /* ← AÑADE ESTO para limitar el ancho */
  margin-left: auto; /* ← AÑADE ESTO para centrar */
  margin-right: auto;
}

.stats-header {
  margin-bottom: 10px;
}

.stats-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-icon svg {
  width: 45px;
  height: 45px;
}

.stats-title {
  font-size: 1.8rem;
  font-weight: 500;
  color: #333;
}

.stats-layout {
  display: flex;
  flex-direction: row;
  gap: 40px;
  align-items: center;
}

.stats-image {
  flex: 1;
  border-radius: 10px;
  overflow: hidden;
  max-width: 350px;
}

.stats-image img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: opacity 0.3s ease-in-out;
}

.stats-content {
  flex: 1;
}

.stats-text {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #222;
  transition: opacity 0.3s ease-in-out;
}

.stats-number {
  font-size: 2.8rem;
  font-weight: 800;
  color: #e53935;
  transition: opacity 0.3s ease-in-out;
}

.stats-label {
  font-size: 0.9rem;
  color: #666;
  transition: opacity 0.3s ease-in-out;
}

.stats-navigation {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

.nav-button {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: white;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-button:hover {
  background: #eee;
}

/* ==================================================
   CARDS DE SOSTENIBILIDAD - CENTRAR ÚLTIMA CARD
================================================== */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

/* 1 card on last row */
.cards-grid .card:nth-child(3n + 1):last-child {
  grid-column: 2;
}

/* 2 cards on last row */
.cards-grid .card:nth-last-child(2):nth-child(3n + 1) {
  grid-column: 1;
}

.cards-grid .card:last-child:nth-child(3n + 2) {
  grid-column: 3;
}
.card {
  background: white;
  border: 3px solid #e53935;
  border-radius: 20px;
  padding: 30px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  min-height: 265px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(229, 57, 53, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.card:hover::before {
  left: 100%;
}

.card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 12px 30px rgba(46, 145, 231, 0.3);
  border-color: #c62828;
}

.card-icon {
  width: 50px;
  height: 50px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
}

.card:hover .card-icon {
  transform: scale(1.2) rotate(5deg);
}

.card-icon svg {
  width: 100%;
  height: 100%;
  transition: all 0.3s ease;
}

.card:hover .card-icon svg {
  stroke: #1a3d6d;
  filter: drop-shadow(0 0 8px rgba(216, 43, 43, 0.5));
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  line-height: 1.3;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.card:hover .card-title {
  color: #1a3d6d;
  transform: scale(1.05);
}

.card-description {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
  transition: all 0.3s ease;
  opacity: 0.8;
}

.card:hover .card-description {
  opacity: 1;
  color: #333;
}

/* ==============================================
   RESPONSIVE
============================================== */

/* Tablets grandes */
@media (max-width: 1500px) {
  .services-grid {
    grid-template-columns: repeat(2, minmax(450px, 600px));
    gap: 60px 40px;
  }

  .service-card {
    width: 100%;
    max-width: 600px;
    height: 450px;
  }

  .service-tag {
    font-size: 0.75rem;
  }
}

@media (max-width: 1269px) {
  .service-image {
    height: 60%;
  }
}

/* Tablets */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, minmax(350px, 480px));
    gap: 50px 30px;
  }

  .service-card {
    height: 450px;
    max-width: 480px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .services-section,
  .stats-section-wrapper {
    padding: 50px 20px;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    justify-items: center;
    margin-top: 40px;
  }

  .service-card {
    height: 450px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }

  .service-content {
    text-align: start;
    padding: 24px 20px 20px 20px;
  }

  .service-link {
    bottom: 12px;
    right: 12px;
  }

  .services-title {
    font-size: 1.8rem;
  }

  .stats-section-wrapper {
    margin-top: -60px;
  }

  .stats-layout {
    flex-direction: column;
    gap: 30px;
  }

  .stats-image {
    max-width: 100%;
  }

  .stats-image img {
    height: 240px;
  }

  .stats-title {
    font-size: 1.6rem;
  }

  .stats-text {
    font-size: 1.1rem;
    margin-top: 20px;
    text-align: left;
  }

  .cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cards-grid .card {
    grid-column: auto !important; /* ← THIS FIXES IT */
    width: 100%;
  }
}

@media (max-width: 558px) {
  .services-section,
  .stats-section-wrapper {
    padding: 40px 15px;
  }

  .services-grid {
    gap: 30px;
    margin-top: 30px;
  }

  .service-card {
    height: 325px;
    max-width: 360px;
  }

  .service-image {
    height: 50%;
    max-width: 360px;
  }

  .services-title {
    font-size: 1.5rem;
  }

  .services-title-line {
  }

  .service-content {
    padding: 20px 16px 16px 16px;
  }

  .service-tag {
    font-size: 0.75rem;
  }

  .stats-title {
    font-size: 1.4rem;
  }

  .stats-text {
    font-size: 1rem;
  }

  .stats-number {
    font-size: 2.4rem;
  }

  .card {
    padding: 25px 15px;
    min-height: 160px;
  }

  .card-title {
    font-size: 1rem;
  }

  .card-description {
    font-size: 0.85rem;
  }
}
