/* =========================================================
   Sección Opciones de tratamiento
   (usa las variables definidas en styles/styles.css)
   ========================================================= */

.opc {
  background: var(--white);
  padding: clamp(48px, 7vw, 110px) var(--pad-x);
  scroll-margin-top: var(--header-h);
}

.opc__inner {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(28px, 4.5vw, 72px);
  align-items: start;
}

.opc__title {
  margin: 0 0 clamp(24px, 3.4vw, 46px);
  font-size: clamp(1.8rem, 3.4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--navy);
}

/* ---------- Tarjetas ---------- */
.opc__list { display: grid; gap: clamp(14px, 1.9vw, 26px); }

.opc-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(22px, 2.6vw, 36px) clamp(20px, 3.4vw, 52px) clamp(22px, 2.6vw, 36px) clamp(22px, 2.6vw, 34px);
  background: #edf4f8;
  color: var(--navy);
  transition: transform .45s var(--ease), box-shadow .45s ease, color .35s ease;
}
.opc-card--alt { background: #f7f9fc; }

.opc-card::after {                      /* barra azul izquierda */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 8px;
  background: var(--blue);
  transition: background .35s ease;
}
.opc-card::before {                     /* relleno que barre al hover */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .55s var(--ease);
}

.opc-card__title {
  margin: 0;
  font-size: clamp(1rem, 1.45vw, 1.3rem);
  font-weight: 800;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.opc-card__desc {
  margin: clamp(8px, 1vw, 14px) 0 0;
  font-size: clamp(.9rem, 1.1vw, 1.05rem);
  line-height: 1.6;
  color: var(--text-soft);
  transition: color .35s ease;
}

.opc-card__arrow {
  flex: none;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  transition: transform .4s var(--ease), background .35s ease, color .35s ease;
}
.opc-card__arrow svg { width: 22px; height: 22px; }

.opc-card:hover,
.opc-card:focus-visible {
  transform: translateX(10px);
  box-shadow: 0 18px 38px rgba(23, 54, 95, .2);
  color: var(--white);
}
.opc-card:hover::before,
.opc-card:focus-visible::before { transform: scaleX(1); }
.opc-card:hover::after,
.opc-card:focus-visible::after { background: #8dc0f5; }
.opc-card:hover .opc-card__desc,
.opc-card:focus-visible .opc-card__desc { color: rgba(255, 255, 255, .8); }
.opc-card:hover .opc-card__arrow,
.opc-card:focus-visible .opc-card__arrow {
  background: var(--blue);
  color: var(--white);
  transform: translate(4px, -4px) rotate(5deg);
}

/* ---------- Foto ---------- */
.opc__figure {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  margin: clamp(0px, 4vw, 60px) 0 0;
}
.opc__figure::before {                  /* marco decorativo desfasado */
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid var(--blue);
  transform: translate(0, 0);
  opacity: 0;
  transition: transform .9s var(--ease), opacity .5s ease;
}
.opc.is-in .opc__figure::before {
  transform: translate(16px, 16px);
  opacity: .55;
  transition-delay: .7s;
}

.opc__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 5 / 6;
  background: #cfdbea;
}
.opc__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;          /* ajusta el encuadre aquí */
  transform: scale(1.14);
  transition: transform 1.8s var(--ease);
}
.opc.is-in .opc__img { transform: scale(1); }

/* ---------- Animación de entrada / salida ---------- */
.js [data-op] {
  opacity: 0;
  transition: opacity .45s ease, transform .45s var(--ease), clip-path .5s var(--ease);
  transition-delay: 0s;                       /* salida: rápida */
}
.js [data-op="up"]    { transform: translateY(30px); }
.js [data-op="left"]  { transform: translateX(-60px); }
.js [data-op="reveal"] { clip-path: inset(0 0 0 100%); opacity: 1; }

.js .opc.is-in [data-op] {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
  transition-duration: .8s, .9s, 1.3s;
  transition-delay: var(--d, 0s);
}
/* Las tarjetas responden al hover sin retraso tras entrar */
.js .opc.is-in .opc-card { transition: opacity .8s ease var(--d, 0s), transform .9s var(--ease) var(--d, 0s), box-shadow .45s ease, color .35s ease; }
.js .opc.is-in .opc-card:hover,
.js .opc.is-in .opc-card:focus-visible { transform: translateX(10px); transition-delay: 0s, 0s, 0s, 0s; transition-duration: .8s, .45s, .45s, .35s; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .opc__inner { grid-template-columns: 1fr; }
  .opc__figure { position: relative; top: 0; margin: 0 16px 16px 0; max-width: 460px; width: 100%; justify-self: center; }
  .js [data-op="reveal"] { clip-path: inset(100% 0 0 0); }
  .opc-card:hover { transform: none; }
}

@media (max-width: 520px) {
  .opc-card__arrow { width: 38px; height: 38px; }
  .opc__figure::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .opc-card:hover { transform: none; }
}