
.flip-cards-module {
  width: 100%;
  padding: 0px 20px;
}

.flip-cards-title {
  text-align: center;
  margin-bottom: 50px;
}

/* Estilos para que el rich text del título H2 se vea bien */
.flip-cards-title h2,
.flip-cards-title p {
  margin: 0;
}

.flip-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
}


.flip-card {
  perspective: 1000px;
  height: 365px;
  width: 280px;  /* antes 315px */
  margin: 0 auto;
}


.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  overflow: hidden;
}

.flip-card-front {
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.flip-card-front img {
  width: 100%;
  height: 265px;
  object-fit: cover;
}

.flip-card-front-title {
  padding: 20px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 100px;
}

/* Estilos para que el rich text del H3 se vea bien */
.flip-card-front-title h3,
.flip-card-front-title p {
  margin: 0;
}

.flip-card-back {
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Overlay oscuro sobre la imagen de fondo */
.flip-card-back::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 20px;
  z-index: 1;
}

/* Efecto Glassmorphism - ahora con margen interno */
.flip-card-back::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  z-index: 2;
}

.glass-content {
  position: relative;
  z-index: 3;
  text-align: center;
  color: #fff;
  padding: 20px;
  width: 100%;
}

.glass-content p {
  margin: 0;
  line-height: 1.6;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (min-width: 1025px) {
  .flip-cards-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1320px;
    justify-items: center; /* 🔥 ESTO es lo que centra */
  }

  .flip-card {
    width: 100%;
    max-width: 280px;
  }
}

  
  .flip-cards-module {
    padding: 40px 15px;
  }
}


@media (max-width: 480px) {
  .flip-cards-container {
    grid-template-columns: 1fr;
  }
}

/* Clase adicional para móviles cuando se usa JS */
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

