/* =========================
   SECCIÓN 3.1 / WHY US
========================= */

.why-section {
  position: relative;
  overflow: visible;
  background: var(--white);
  color: var(--black);
  padding: clamp(210px, 18vw, 300px) 0 var(--section-padding-y-lg);
}

/* =========================
   BANNER NEGRO DIAGONAL
========================= */

.why-banner {
  position: absolute;
  left: 50%;
  top: 70px;

  width: 145vw;
  height: clamp(92px, 8vw, 145px);

  display: flex;
  align-items: center;

  background: var(--black);
  color: var(--white);

  transform: translateX(-50%) rotate(-4deg);
  transform-origin: center;

  overflow: hidden;
  z-index: 5;
  pointer-events: none;
}

.why-banner-track {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: clamp(56px, 6vw, 110px);

  min-width: max-content;
  padding-right: clamp(56px, 6vw, 110px);

  animation: whyBannerMove 28s linear infinite;
}

.why-banner-track span {
  font-family: var(--font-heading);
  font-size: clamp(54px, 7vw, 118px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.why-banner-track em {
  color: var(--accent);
  font-style: normal;
  font-weight: 400;
}

/* =========================
   PILLS DETRÁS DEL BANNER
========================= */

.why-pills {
  position: absolute;
  left: 50%;
  top: 160px;

  width: 145vw;

  display: flex;
  align-items: center;

  transform: translateX(-50%) rotate(4deg);
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
}

.why-pills-track {
  flex: 0 0 auto;
  display: flex;
  gap: 18px;

  min-width: max-content;
  padding-right: 18px;

  animation: whyPillsMove 38s linear infinite reverse;
}

.why-pills-track span {
  min-height: clamp(48px, 4vw, 68px);
  padding: 0 clamp(26px, 3vw, 48px);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);

  color: var(--black);
  font-family: var(--font-heading);
  font-size: clamp(22px, 2.4vw, 42px);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* =========================
   CONTENIDO
========================= */

.why-container {
  position: relative;
  z-index: 6;
}

/* Imagen alineada hacia la izquierda */
.why-image {
  width: min(100%, 460px);
  height: 230px;

  margin: 0 0 100px 12%;

  border-radius: 48px;
  overflow: hidden;
  background: #ddd;
}

.why-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Entrada lateral */
.js .reveal-left {
  opacity: 0;
  transform: translateX(-90px);

  transition:
    opacity 0.9s ease,
    transform 1.05s cubic-bezier(.19, 1, .22, 1);

  will-change: transform, opacity;
}

.js .reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Grid editorial desfasado */
.why-grid {
  width: min(100%, 820px);
  margin-inline: auto;

  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 140px;
  row-gap: 105px;
}

.why-item {
  position: relative;
}

.why-item:nth-child(2) {
  transform: translateY(-58px);
}

.why-item:nth-child(3) {
  transform: translateY(34px);
}

.why-item:nth-child(4) {
  transform: translateY(-18px);
}

.why-icon-row {
  display: flex;
  align-items: center;
  gap: 22px;

  margin-bottom: 26px;
}

.why-icon-row span {
  font-size: 14px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.65);
}

.why-icon-row img {
  width: 90px;
  height: 90px;
  object-fit: contain;
}

.why-item h3 {
  font-size: clamp(26px, 2.4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.065em;
  font-weight: 900;

  margin-bottom: 28px;
}

/* Línea animada izquierda → derecha */
.why-line {
  width: 100%;
  height: 1px;

  background: rgba(0, 0, 0, 0.45);

  margin-bottom: 38px;

  transform: scaleX(0);
  transform-origin: left;

  transition: transform 0.9s cubic-bezier(.19, 1, .22, 1);
}

.why-item.is-visible .why-line {
  transform: scaleX(1);
}

.why-item p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

/* =========================
   ANIMACIONES
========================= */

@keyframes whyBannerMove {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

@keyframes whyPillsMove {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

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

@media (max-width: 1024px) {
  .why-section {
    padding: clamp(180px, 22vw, 240px) 0 var(--section-padding-y);
  }

  .why-banner {
    top: 70px;
  }

  .why-pills {
    top: 145px;
  }

  .why-grid {
    column-gap: 80px;
    row-gap: 90px;
  }

  .why-image {
    margin-left: 0;
  }
}

@media (max-width: 760px) {
  .why-section {
    overflow: hidden;
    padding: 180px 0 100px;
  }

  .why-banner {
    top: 72px;
    width: 150vw;
    height: 76px;
    transform: translateX(-50%) rotate(-5deg);
  }

  .why-banner-track {
    gap: 44px;
    padding-right: 44px;
    animation-duration: 24s;
  }

  .why-banner-track span {
    font-size: clamp(44px, 13vw, 66px);
  }

  .why-pills {
    top: 128px;
    width: 150vw;
    transform: translateX(-50%) rotate(5deg);
  }

  .why-pills-track {
    animation-duration: 34s;
  }

  .why-pills-track span {
    min-height: 44px;
    padding: 0 24px;
    font-size: clamp(18px, 6vw, 28px);
  }

  .why-image {
    width: 100%;
    height: 190px;
    border-radius: 34px;
    margin: 0 0 76px 0;
  }

  .why-grid {
    grid-template-columns: 1fr;
    gap: 76px;
  }

  .why-item:nth-child(1),
  .why-item:nth-child(2),
  .why-item:nth-child(3),
  .why-item:nth-child(4) {
    transform: none;
  }

  .why-item h3 {
    margin-bottom: 30px;
  }

  .why-line {
    margin-bottom: 30px;
  }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .why-banner-track,
  .why-pills-track {
    animation: none;
  }

  .reveal-left,
  .why-line {
    transition: none;
  }
}
/* =========================
   DARK MODE — Sección Why Us
========================= */

/* BANNER: fondo negro profundo siempre visible */
[data-theme="dark"] .why-banner {
  background: #0a0a0a;
}

/* PILLS: sin relleno, borde verde, texto blanco */
[data-theme="dark"] .why-pills-track span {
  background: transparent;
  border: 1px solid var(--accent);
  color: #ffffff;
}

/* BANNER TEXTO: "¿POR QUÉ" más delgado, "NOSOTROS?" bold */
[data-theme="dark"] .why-banner-track span {
  font-weight: 300;
  color: #f0f0f0;
}

[data-theme="dark"] .why-banner-track em {
  font-weight: 900;
  color: var(--accent);
}

/* NÚMEROS del grid: verde accent */
[data-theme="dark"] .why-icon-row span {
  color: rgba(180, 180, 180, 0.7);
  font-family: var(--font-number);
}

/* Títulos y párrafos del grid */
[data-theme="dark"] .why-item h3 {
  color: #f0f0f0;
}

[data-theme="dark"] .why-item p {
  color: rgba(255,255,255,0.6);
}

[data-theme="dark"] .why-line {
  background: rgba(255,255,255,0.2);
}

/* Imagen */
[data-theme="dark"] .why-image {
  background: #1a1a1a;
}

/* En dark mode los íconos negros se invierten a blanco */
[data-theme="dark"] .why-icon-row img {
  filter: invert(1);
}
