/* =========================
   IndexSolar Benefit Cards v2.0.5
   Stagger + Smooth Hover + Fade Out + Responsive Grid
   ========================= */

/* ── Grid wrapper ── */
.ixbc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  width: 100%;
  align-items: stretch;
}

/* Tablet: 2 columnas */
@media (max-width: 900px) {
  .ixbc-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* Móvil pequeño: 2 columnas compactas */
@media (max-width: 480px) {
  .ixbc-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* ── Hover wrapper (zona estática) ── */
.benefit-card-hover-zone {
  position: relative;
  overflow: visible;
  height: 100%;
  min-height: inherit;
  transform: translateZ(0);
}

/* ── Tarjeta ── */
.benefit-card {
  --delay: 0ms;
  --hover-lift: 12px;

  position: relative;
  background: #ffffff;
  border-radius: 26px;
  padding: clamp(18px, 3vw, 34px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(29, 43, 83, 0.06);
  width: 100%;
  min-height: 280px;
  height: 100%;
  overflow: visible;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  opacity: 0;
  transform: translateZ(0) translateY(40px);
  will-change: transform, opacity;
  backface-visibility: hidden;

  /* Asegura que el contenido no se desborde en móvil */
  box-sizing: border-box;
}

/* ── Entrada ── */
.benefit-card.reveal {
  animation: cardRevealUp 700ms cubic-bezier(.22, 1, .36, 1) forwards;
  animation-delay: var(--delay);
  pointer-events: none;
}

@keyframes cardRevealUp {
  from { opacity: 0; transform: translateZ(0) translateY(40px); }
  to   { opacity: 1; transform: translateZ(0) translateY(0); }
}

/* ── Salida ── */
.benefit-card.exit {
  animation: cardExit 520ms cubic-bezier(.22, 1, .36, 1) forwards;
  pointer-events: none;
}

@keyframes cardExit {
  from { opacity: 1; transform: translateZ(0) translateY(0); }
  to   { opacity: 0; transform: translateZ(0) translateY(18px); }
}

/* ── Estado estable post-reveal ── */
.benefit-card.revealed {
  opacity: 1;
  transform: translateZ(0) translateY(0);
  animation: none;
  pointer-events: auto;
  transition:
    transform 520ms cubic-bezier(.22, 1, .36, 1),
    box-shadow 520ms cubic-bezier(.22, 1, .36, 1);
}

/* ── Hover / Tap ── */
.benefit-card.revealed.is-hovered {
  transform: translateZ(0) translateY(calc(-1 * var(--hover-lift)));
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.12);
}

/* ── Icono ── */
.benefit-card__icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: #eaf4e3;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  position: relative;
  overflow: hidden;
  transition: background 420ms cubic-bezier(.22, 1, .36, 1);
  flex-shrink: 0;
}

.benefit-card.revealed.is-hovered .benefit-card__icon {
  background: #5ea33b;
}

.benefit-card__icon img {
  position: absolute;
  width: 44px;
  height: 44px;
  object-fit: contain;
  transition: opacity 360ms cubic-bezier(.22, 1, .36, 1);
}

.icon-normal { opacity: 1; }
.icon-hover  { opacity: 0; }

.benefit-card.revealed.is-hovered .icon-normal { opacity: 0; }
.benefit-card.revealed.is-hovered .icon-hover  { opacity: 1; }

/* ── Textos ── */
.benefit-card__title {
  margin: 0 0 14px;
  color: #1d2b53;
  font-weight: 700;
  font-size: clamp(18px, 1.3vw, 34px);
  line-height: 1.15;
  word-break: break-word;
  overflow-wrap: break-word;
  width: 100%;
  text-align: center;
}

.benefit-card__text {
  margin: 0 auto;
  color: #3f536e;
  font-size: clamp(14px, 1vw, 22px);
  line-height: 1.4;
  max-width: 34ch;
  text-align: justify;
  text-justify: inter-word;
  word-break: break-word;
  overflow-wrap: break-word;
  width: 100%;
}

/* ── Ajustes móvil ── */
@media (max-width: 900px) {
  .benefit-card {
    --hover-lift: 7px;
  }

  .benefit-card__icon {
    width: 72px;
    height: 72px;
  }

  .benefit-card__icon img {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 520px) {
  .benefit-card {
    --hover-lift: 6px;
    align-items: center;
  }

  .benefit-card__title {
    font-size: clamp(13px, 3.8vw, 18px);
    text-align: center;
  }

  .benefit-card__text {
    font-size: clamp(11px, 2.8vw, 14px);
    max-width: 100%;
    text-align: justify;
    text-align-last: center;
    -moz-text-align-last: center;
    hyphens: auto;
  }
}

/* Móvil portrait: padding reducido para que quepan 2 columnas */
@media (max-width: 480px) {
  .benefit-card {
    padding: 14px 10px;
    min-height: unset;
    border-radius: 16px;
    align-items: center;
  }

  .benefit-card__icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    margin-bottom: 12px;
  }

  .benefit-card__icon img {
    width: 28px;
    height: 28px;
  }

  .benefit-card__title {
    font-size: clamp(12px, 3.5vw, 16px);
    margin-bottom: 8px;
    text-align: center;
  }

  .benefit-card__text {
    font-size: clamp(10px, 2.6vw, 13px);
    max-width: 100%;
    text-align: justify;
    text-align-last: center;
    -moz-text-align-last: center;
    hyphens: auto;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .benefit-card {
    opacity: 1;
    transform: none;
    animation: none !important;
    transition: none !important;
    pointer-events: auto !important;
  }
}
