/* =========================================================
   DISPONIBLES v2 · Salchichas de la Realeza
   Tarjetas con carrusel, filtros por línea/sexo, visor propio.
   Usa los tokens de styles.css (--primary, --gold, --bg, etc.)
   ========================================================= */

/* ---------- Video de bienvenida (hero) ---------- */
.ej-hero-video { display: flex; flex-direction: column; align-items: center; gap: 1rem; margin: 0 auto 1.6rem; }
.ej-hero-video__frame {
  position: relative; width: min(78vw, 300px); aspect-ratio: 9 / 16; overflow: hidden; border-radius: 26px;
  background: #15100a; box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
}
.ej-hero-video__frame::after {
  content: ""; position: absolute; inset: 0; border-radius: 26px; pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(222, 186, 128, .55);
}
.ej-hero-video__el { width: 100%; height: 100%; object-fit: cover; display: block; }
.ej-hero-video__sound {
  position: absolute; right: 12px; bottom: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(20, 13, 6, .55); backdrop-filter: blur(4px);
  color: #fff; font-size: .95rem; border: 1px solid rgba(255, 255, 255, .35); cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.ej-hero-video__sound:hover { background: rgba(20, 13, 6, .75); transform: scale(1.06); }
.ej-hero-video__sound[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); }
.ej-hero-video__caption {
  font-family: "Playfair Display", serif; font-style: italic; font-size: var(--step-1, 1.05rem);
  color: var(--text-soft, #62482f); text-align: center; margin: 0;
}
@media (min-width: 640px) { .ej-hero-video__frame { width: 260px; } }

/* ---------- Encabezado de la selección ---------- */
.ej-hero-note {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.2rem;
  margin: 1.4rem auto 0; padding: 0; list-style: none;
  font-size: .82rem; font-weight: 700; letter-spacing: .06em; color: var(--primary-2);
}
.ej-hero-note li { display: inline-flex; align-items: center; gap: .5rem; }
.ej-hero-note li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
}

/* ---------- Barra de filtros ---------- */
.ej-filterbar {
  position: sticky; top: calc(var(--header-height, 86px) + 10px); z-index: 40;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem 1.6rem;
  width: fit-content; max-width: 100%; margin: 0 auto 2.6rem; padding: .7rem 1.1rem;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-md);
}
.ej-filter { display: flex; align-items: center; gap: .55rem; }
.ej-filter__label {
  font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--primary-3);
}
.ej-filter__group { display: flex; flex-wrap: wrap; gap: .4rem; }
.ej-filter + .ej-filter { padding-left: 1.6rem; border-left: 1px solid var(--border); }
.ej-pill {
  min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--white); color: var(--primary);
  font: 700 .82rem/1 "Montserrat", Arial, sans-serif; letter-spacing: .02em;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.ej-pill em { font-style: normal; opacity: .55; margin-left: .35em; font-weight: 600; }
.ej-pill:hover { border-color: var(--primary-3); transform: translateY(-1px); }
.ej-pill[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--white); }
.ej-pill[aria-pressed="true"] em { opacity: .75; }
.ej-pill:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Sección por línea ---------- */
.ej-line { margin-top: 3.4rem; scroll-margin-top: 150px; }
.ej-line:first-of-type { margin-top: 0; }
.ej-line[hidden], .ej-card[hidden], .ej-empty[hidden] { display: none !important; }
.ej-line__head { max-width: 720px; margin: 0 auto 2.4rem; text-align: center; }
.ej-line__head h2 { margin: .1em 0 .35em; }
.ej-line__head p { color: var(--text-soft); margin: 0; }
.ej-line__head::after {
  content: ""; display: block; width: 64px; height: 2px; margin: 1.6rem auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ---------- Grilla y tarjeta ---------- */
.ej-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 32px; align-items: start; }
.ej-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: opacity .68s ease, box-shadow .35s ease, transform .35s ease;
}
@media (hover: hover) { .ej-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); } }
.ej-card:target { box-shadow: 0 0 0 3px var(--gold), var(--shadow-lg); }

.ej-card--feature { grid-column: 1 / -1; flex-direction: row; }
.ej-card--feature .ej-media { flex: 0 0 46%; align-self: stretch; }
.ej-card--feature .ej-body { justify-content: center; padding: clamp(28px, 4vw, 56px); }
.ej-card--feature .ej-actions { margin-top: .6rem; }
.ej-card--feature .ej-name { font-size: clamp(2.4rem, 4.4vw, 3.6rem); }
.ej-flag {
  align-self: flex-start; display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1rem;
  padding: .45rem .9rem; border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--primary); background: linear-gradient(120deg, var(--gold-soft), var(--gold));
}
.ej-blurb { font-family: "Playfair Display", serif; font-style: italic; font-size: 1.15rem; line-height: 1.55; color: var(--text-soft); margin: .2rem 0 1.2rem; }

/* ---------- Carrusel ---------- */
.ej-media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #2a211a; isolation: isolate; }
.ej-media::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 34%; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgba(24, 14, 6, .62), transparent);
}
.ej-track {
  display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; outline-offset: -4px;
}
.ej-track::-webkit-scrollbar { display: none; }
.ej-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: center; overflow: hidden; background: #2a211a; }
.ej-slide img, .ej-slide video { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 36%; }
.ej-slide img { cursor: zoom-in; }
.ej-slide--land::before {
  content: ""; position: absolute; inset: -24px; background: var(--bg) center / cover no-repeat;
  filter: blur(24px) saturate(1.15) brightness(.82); transform: scale(1.05);
}
.ej-slide--land img { object-fit: contain; }
.ej-slide--video { cursor: pointer; }
.ej-play {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; width: 100%; height: 100%;
  background: none; border: 0; cursor: pointer; color: var(--white);
}
.ej-play span {
  display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%;
  background: rgba(24, 14, 6, .5); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .55);
  transition: transform .25s ease, background .25s ease;
}
.ej-play span::before {
  content: ""; margin-left: 5px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff;
}
.ej-play:hover span { transform: scale(1.08); background: rgba(24, 14, 6, .7); }
.ej-slide.is-playing .ej-play span { opacity: 0; transform: scale(.8); }
.ej-slide.is-playing .ej-vchip { opacity: .85; }
.ej-vchip {
  position: absolute; left: 14px; bottom: 44px; z-index: 3; pointer-events: none;
  padding: .4rem .75rem; border-radius: 999px; background: rgba(24, 14, 6, .6); color: #fff;
  font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}

.ej-chips { position: absolute; top: 14px; left: 14px; z-index: 4; display: flex; flex-wrap: wrap; gap: 6px; max-width: 70%; }
.ej-chip {
  padding: .42rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--primary);
  font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; backdrop-filter: blur(6px);
}
.ej-chip--line { background: var(--primary); color: var(--white); }
.ej-status {
  position: absolute; top: 14px; right: 14px; z-index: 4; display: inline-flex; align-items: center; gap: .45rem;
  padding: .42rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #166534;
  font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.ej-status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
  animation: ej-pulse 2.4s infinite;
}
@keyframes ej-pulse { 70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

.ej-nav {
  position: absolute; top: 50%; z-index: 4; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--primary); cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25); opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
.ej-nav svg { width: 18px; height: 18px; }
.ej-prev { left: 12px; } .ej-next { right: 12px; }
.ej-media:hover .ej-nav, .ej-media:focus-within .ej-nav { opacity: 1; }
.ej-nav:hover { transform: scale(1.08); }
.ej-nav[disabled] { opacity: 0 !important; pointer-events: none; }
@media (hover: none) { .ej-nav { display: none; } }

.ej-dots { position: absolute; left: 0; right: 0; bottom: 16px; z-index: 4; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.ej-dots i { width: 7px; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .5); transition: width .3s ease, background .3s ease; }
.ej-dots i.is-on { width: 22px; background: #fff; }
.ej-count {
  position: absolute; right: 14px; bottom: 12px; z-index: 4; padding: .3rem .65rem; border-radius: 999px;
  background: rgba(24, 14, 6, .55); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums;
}

/* ---------- Cuerpo de la tarjeta ---------- */
.ej-body { display: flex; flex-direction: column; padding: 26px 28px 30px; }
.ej-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--primary-3); }
.ej-name { margin: .15em 0 .1em; font-size: 2.1rem; line-height: 1.05; color: var(--primary); }
.ej-sub { margin: 0 0 1.2rem; color: var(--text-soft); font-size: .98rem; }
.ej-specs {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; margin: 0 0 1.5rem; padding: 1.1rem 0;
  border-block: 1px solid var(--border);
}
.ej-specs div { display: flex; flex-direction: column; gap: 2px; }
.ej-specs dt { font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--primary-3); }
.ej-specs dd { margin: 0; display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--text); }
.ej-swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); flex: none; }
.ej-swatch--chocolate { background: #5a3422; }
.ej-swatch--negro-fuego { background: linear-gradient(135deg, #17110d 58%, #b8742e 58%); }
.ej-swatch--chocolate-fuego { background: linear-gradient(135deg, #5a3422 58%, #b8742e 58%); }
.ej-swatch--arlequin-plata { background: linear-gradient(135deg, #9aa0a6 0%, #3a3a3c 35%, #c7cdd3 65%, #55585c 100%); }
.ej-actions { display: flex; flex-direction: column; gap: .8rem; margin-top: auto; }
.ej-actions .btn { width: 100%; }
.ej-link { align-self: center; font-size: .84rem; font-weight: 700; color: var(--primary-2); border-bottom: 1px solid var(--gold); padding-bottom: 2px; }
.ej-link:hover { color: var(--primary); }

.ej-empty { padding: 3rem 1rem; text-align: center; color: var(--text-soft); }
.ej-empty .btn { width: auto; margin-top: 1rem; }

/* ---------- Diferencias pelo largo / corto ---------- */
.ej-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 4rem 0 0; }
.ej-compare article { padding: 28px 30px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.ej-compare h3 { margin: 0 0 .5rem; font-family: "Playfair Display", serif; font-size: 1.5rem; color: var(--primary); }
.ej-compare ul { margin: .8rem 0 0; padding-left: 1.1rem; color: var(--text-soft); }
.ej-compare li { margin-bottom: .35rem; }

/* ---------- Visor ampliado ---------- */
.ejlb {
  position: fixed; inset: 0; z-index: 1000; display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 64px; background: rgba(20, 12, 6, .95);
}
.ejlb.is-open { display: flex; animation: ejlb-in .25s ease; }
@keyframes ejlb-in { from { opacity: 0; } to { opacity: 1; } }
.ejlb__stage { display: grid; place-items: center; width: 100%; height: calc(100vh - 120px); }
.ejlb__stage img, .ejlb__stage video { max-width: min(94vw, 1000px); max-height: 100%; object-fit: contain; border-radius: 10px; background: #000; }
.ejlb__cap { margin: 14px 0 0; color: rgba(255, 255, 255, .8); font-size: .85rem; letter-spacing: .06em; text-align: center; font-variant-numeric: tabular-nums; }
.ejlb button {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; transition: background .2s ease;
}
.ejlb button:hover { background: rgba(255, 255, 255, .28); }
.ejlb button svg { width: 20px; height: 20px; }
.ejlb__close { top: 18px; right: 18px; } .ejlb__prev { left: 14px; top: 50%; margin-top: -24px; } .ejlb__next { right: 14px; top: 50%; margin-top: -24px; }
body.ejlb-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .ej-card--feature { flex-direction: column; }
  .ej-card--feature .ej-media { flex-basis: auto; align-self: auto; aspect-ratio: 4 / 5; }
}
@media (max-width: 820px) {
  .ej-grid { grid-template-columns: 1fr; gap: 28px; }
  .ej-compare { grid-template-columns: 1fr; }
  .ej-filterbar { border-radius: 22px; padding: .8rem 1rem; top: calc(var(--header-height, 78px) + 6px); }
  .ej-filter + .ej-filter { padding-left: 0; border-left: 0; }
  .ej-filter { width: 100%; justify-content: space-between; }
  .ejlb { padding: 16px 12px; }
  .ejlb__prev, .ejlb__next { display: none; }
}
@media (max-width: 480px) {
  .ej-body { padding: 22px 20px 26px; }
  .ej-name { font-size: 1.8rem; }
  .ej-filterbar { position: static; gap: .55rem; padding: .75rem .8rem; }
  .ej-filter { flex-direction: row; align-items: center; gap: .4rem; }
  .ej-filter__label { flex: 0 0 48px; font-size: .62rem; letter-spacing: .1em; }
  .ej-filter__group { flex-wrap: nowrap; gap: .3rem; }
  .ej-pill { min-height: 36px; padding: 0 10px; font-size: .74rem; }
  .ej-pill em { margin-left: .25em; }
}
@media (prefers-reduced-motion: reduce) {
  .ej-card, .ej-pill, .ej-nav, .ej-play span, .ej-dots i { transition: none; }
  .ej-status::before, .ejlb.is-open { animation: none; }
  .ej-track { scroll-behavior: auto; }
}
