/* ==========================================================================
   Home · Categorías principales (escaparate) — 2026-10-14
   Plantilla: templates/_partials/categories-home.tpl (.mlfeat)
   ========================================================================== */
.mlfeat {
  --mlfeat-anchor: 50;            /* móvil: % del ancho donde se centra la activa (escritorio: tras el texto, por JS) */
  --mlfeat-item: 220px;
  --mlfeat-gap: 24px;
  --mlfeat-h: 400px;
  --mlfeat-ink: #fff;
  --mlfeat-muted: rgba(255, 255, 255, .72);
  /* 2026-10-14: misma familia que el hero (pizarra #1a2332/#2d3e50), un punto más profunda */
  --mlfeat-bg-1: #2d3e50;
  --mlfeat-bg-2: #1a2332;
  --mlfeat-bg-3: #0c121c;
  --mlfeat-glow: rgba(170, 196, 235, .16);
  --mlfeat-veil: 26, 35, 50;
  --mlfeat-accent: #ffffff;
  position: relative;
  width: 100%;
  min-height: var(--mlfeat-h);
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(ellipse 45% 70% at var(--mlfeat-ax, 45%) 55%, var(--mlfeat-glow), transparent 70%),
    linear-gradient(115deg, var(--mlfeat-bg-1) 0%, var(--mlfeat-bg-2) 42%, var(--mlfeat-bg-3) 100%);
  color: var(--mlfeat-ink);
  isolation: isolate;
}
.mlfeat *, .mlfeat *::before, .mlfeat *::after { box-sizing: border-box; }

/* ---- Escenario de imágenes ---- */
.mlfeat__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  touch-action: pan-y;
  user-select: none;
  z-index: 0;
}
.mlfeat__track {
  position: absolute;
  inset: 0;
  column-gap: var(--mlfeat-gap);
}
.mlfeat__item {
  position: absolute;
  top: 50%;
  left: 0;
  width: var(--mlfeat-item);
  height: var(--mlfeat-item);
  margin-top: calc(var(--mlfeat-item) / -2 - 16px);
  display: block;
  transform: translateX(var(--x, -200%));
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mlfeat__visual {
  display: block;
  width: 100%;
  height: 100%;
  opacity: .32;
  transform: scale(.72);
  filter: saturate(.6) brightness(.8);
}
.mlfeat.is-ready .mlfeat__item { transition: transform .6s cubic-bezier(.22, .7, .2, 1); }
.mlfeat.is-ready .mlfeat__visual { transition: opacity .6s ease, transform .6s cubic-bezier(.22, .7, .2, 1), filter .6s ease; }
.mlfeat.is-ready .mlfeat__item.is-jump { transition: none; }
.mlfeat__item.is-before .mlfeat__visual { opacity: .22; }
.mlfeat__item.is-active { z-index: 1; }
.mlfeat__item.is-active .mlfeat__visual {
  opacity: 1;
  transform: scale(1.12);
  filter: drop-shadow(0 26px 34px rgba(0, 0, 0, .45));
  cursor: pointer;
}
.mlfeat__item:not(.is-active):hover .mlfeat__visual { opacity: .55; }
.mlfeat__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* ---- Texto superpuesto (izquierda) ---- */
.mlfeat__info {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(42%, 520px);
  min-height: var(--mlfeat-h);
  padding: 30px 32px 76px clamp(20px, 4.2vw, 60px); /* 30/11/2026: 50 → 76, el texto sube y no pisa los puntos; bloque en 400 px */
  pointer-events: none;
}
.mlfeat__info::before {          /* velo para que el texto se lea sobre las imágenes anteriores */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(var(--mlfeat-veil), .86) 0%, rgba(var(--mlfeat-veil), .6) 60%, rgba(var(--mlfeat-veil), 0) 100%);
}
.mlfeat .mlfeat__eyebrow {
  margin: 0 0 28px;
  padding: 0;
  color: var(--mlfeat-muted);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: left;
}
.mlfeat__panels { display: grid; }
.mlfeat__panel {
  grid-area: 1 / 1;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .35s ease, transform .35s ease, visibility 0s linear .35s;
}
.mlfeat__panel.is-active {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity .45s ease .1s, transform .45s ease .1s, visibility 0s;
  pointer-events: auto;
}
.mlfeat .mlfeat__name {
  margin: 0 0 14px;
  padding: 0;
  color: var(--mlfeat-ink);
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.08;
  letter-spacing: -.8px;
  text-transform: none;
  text-align: left;
}
.mlfeat__copy {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  max-width: 400px;
  margin: 0 0 26px;
  color: var(--mlfeat-muted);
  font-size: 14px;
  line-height: 1.6;
}
.mlfeat__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; }
/* 30/11/2026: CTA a la derecha del precio, translúcido como el «Comprar» del hero (?cta=transparente) */
.mlfeat .mlfeat__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;                /* 30/11/2026 (Álvaro): un poco más grande (11/22, .8rem) */
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 0 1px #fff;
  color: #fff;
  font-size: .9rem;
  font-weight: 400;
  letter-spacing: .3px;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .2s ease;
}
.mlfeat .mlfeat__cta svg { width: 18px; height: 18px; transition: transform .2s; }
.mlfeat .mlfeat__cta:hover { color: #fff; transform: translateY(-1px); }
.mlfeat .mlfeat__cta:hover svg { transform: translateX(3px); }
.mlfeat .mlfeat__cta:focus-visible,
.mlfeat__item:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.mlfeat__price { color: var(--mlfeat-muted); font-size: 16px; line-height: 1.4; } /* 30/11/2026 (Álvaro): 20 → 16 */
.mlfeat__price b { color: var(--mlfeat-ink); font-weight: 500; }

/* ---- Navegación ---- */
.mlfeat__nav {
  position: absolute;
  right: clamp(20px, 3vw, 44px);
  bottom: 24px;
  left: clamp(20px, 4.2vw, 60px);
  z-index: 3;
  /* El espacio vacío de la navegación no debe interceptar enlaces del carrusel. */
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.mlfeat__nav > * { pointer-events: auto; }
.mlfeat__dots { display: flex; align-items: center; gap: 6px; margin-right: auto; }
.mlfeat__nav .mlfeat__dots { order: -1; }
.mlfeat .mlfeat__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .3);
  cursor: pointer;
  transition: width .3s ease, background-color .3s ease;
}
.mlfeat .mlfeat__dot:hover { background: rgba(255, 255, 255, .6); }
.mlfeat .mlfeat__dot.is-active { width: 24px; background: var(--mlfeat-accent); }
.mlfeat .mlfeat__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.mlfeat .mlfeat__btn:hover { border-color: #fff; background: rgba(255, 255, 255, .1); }
.mlfeat .mlfeat__btn svg { width: 20px; height: 20px; }
.mlfeat .mlfeat__dot:focus-visible,
.mlfeat .mlfeat__btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

@media (max-width: 1199px) {
  .mlfeat { --mlfeat-item: 200px; }
}

/* ---- Móvil: imagen arriba, texto debajo ---- */
@media (max-width: 767px) {
  .mlfeat {
    --mlfeat-anchor: 50;
    --mlfeat-item: 200px;
    --mlfeat-gap: 8px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 12px;
    background:
      radial-gradient(ellipse 80% 40% at 50% 30%, var(--mlfeat-glow), transparent 70%),
      linear-gradient(170deg, var(--mlfeat-bg-1) 0%, var(--mlfeat-bg-2) 45%, var(--mlfeat-bg-3) 100%);
  }
  .mlfeat__stage { position: relative; inset: auto; order: 1; height: 250px; margin-top: 8px; } /* sin CTA bajo la imagen */
  .mlfeat__item { margin-top: calc(var(--mlfeat-item) / -2 - 12px); }
  .mlfeat__item.is-before .mlfeat__visual { opacity: .32; }
  .mlfeat__item.is-active .mlfeat__visual { transform: scale(1.05); }
  .mlfeat__info { display: contents; }
  .mlfeat__info::before { content: none; }
  .mlfeat .mlfeat__eyebrow { order: 0; margin: 0; padding: 26px 20px 0; font-size: 11px; }
  .mlfeat__panels { order: 2; padding: 6px 20px 0; }
  .mlfeat .mlfeat__name { margin-bottom: 10px; font-size: 28px; }
  .mlfeat__copy { margin-bottom: 20px; font-size: 13px; }
  .mlfeat__nav { position: static; order: 4; padding: 22px 20px 24px; justify-content: space-between; gap: 8px; }
  .mlfeat__nav .mlfeat__dots { order: 0; margin: 0; gap: 4px; } /* 30/11/2026: puntos en medio, flechas a los lados */
  .mlfeat .mlfeat__btn { flex: none; }
  .mlfeat .mlfeat__btn { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .mlfeat.is-ready .mlfeat__item,
  .mlfeat.is-ready .mlfeat__visual,
  .mlfeat .mlfeat__cta,
  .mlfeat__panel,
  .mlfeat__panel.is-active { transition: none; }
}
