/* ============================================================
   OPINIONES DE COMPRAS VERIFICADAS (octubre 2026) — prefijo de clases: op-
   · Página pública opiniones.html (/opiniones): js/opiniones-pagina.js
   · Ficha del juego (producto.html): bloque .op-ficha, js/opiniones-ficha.js
   · Home (index.html #opiniones): solo las miniaturas de fotos (.op-fotos-card), js/opiniones.js
   Las opiniones califican la EXPERIENCIA DE COMPRA en Pixeleros (entrega, instalación, atención), no el juego.

   CELULAR PRIMERO: todo se diseña para 360–430 px (una mano, pulgar) y se adapta hacia arriba. Controles >= 44 px,
   texto >= 12 px, sin desborde horizontal de la página (solo las filas de filtros y la galería se deslizan, dentro de su caja).
   Usa los tokens de styles.css (--hx-*, --hm-*) con respaldo. Los estados no dependen solo del color.
   El visor de las fotos es css/visor.css (clases pdp-visor-*).
   ============================================================ */

.op-wrap, .op-ficha, .hx-reviews {
  --op-surface: var(--hx-surface, #0d1428);
  --op-border: var(--hx-border, rgba(139, 92, 246, 0.22));
  --op-muted: var(--hm-muted, #9aa8c9);
  --op-text: var(--hm-text, #eef1fb);
  --op-gold: #fbbf24;
  --op-ok: #6ee7b7;
  --op-focus: #c4b5fd;
  --op-violet: #7c3aed;
}

/* El atributo hidden gana siempre (varias piezas son grid/flex) */
.op-wrap [hidden], .op-ficha[hidden], .op-ficha [hidden] { display: none !important; }

.op-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── Página ──────────────────────────────────────────────────── */
.op-wrap { display: grid; gap: 28px; min-width: 0; color: var(--op-text); }
.op-wrap > *, .op-contenido > * { min-width: 0; }
.op-wrap :where(h1, h2, h3, p, ul) { margin: 0; padding: 0; }
.op-contenido { display: grid; gap: 28px; }

.op-head {
  display: grid; gap: 10px; padding: 24px 20px; border-radius: 22px;
  background: var(--op-surface); border: 1px solid var(--op-border);
}
.op-kicker {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  color: var(--op-ok); font: 700 0.92rem/1.2 "Rajdhani", sans-serif; letter-spacing: 0.12em; text-transform: uppercase;
}
.op-kicker svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.op-title { font: 700 clamp(1.75rem, 1.2rem + 2.4vw, 2.9rem)/1.1 "Oxanium", sans-serif; color: var(--op-text); text-wrap: balance; }
.op-lead { color: #cfd8f3; font: 500 1.15rem/1.45 "Rajdhani", sans-serif; max-width: 62ch; }
.op-aviso { padding: 14px 16px; border-radius: 12px; background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.4); color: #fde68a; font: 600 1.02rem "Rajdhani", sans-serif; }

.op-wrap h2 { font: 700 clamp(1.3rem, 1.1rem + 0.9vw, 1.75rem)/1.2 "Oxanium", sans-serif; color: var(--op-text); }
.op-sec-cab { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; }
.op-sec-sub { margin-top: 4px !important; color: var(--op-muted); font: 500 1rem/1.4 "Rajdhani", sans-serif; }
.op-link-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; background: none; border: 0; cursor: pointer;
  color: #c4b5fd; font: 700 1rem "Rajdhani", sans-serif; text-decoration: underline; text-underline-offset: 3px;
}
.op-link-btn:hover { color: #fff; }

/* ── Resumen: promedio, barras, etiquetas ───────────────────── */
.op-resumen { display: grid; gap: 18px; padding: 20px; border-radius: 20px; background: var(--op-surface); border: 1px solid var(--op-border); }
.op-resumen-top { display: grid; grid-template-columns: minmax(104px, auto) minmax(0, 1fr); gap: 12px 22px; align-items: center; max-width: 720px; }
.op-prom { display: grid; justify-items: center; gap: 6px; text-align: center; }
.op-prom-num { font: 700 3.4rem/1 "Oxanium", sans-serif; color: #fff; }
.op-prom-cant { color: var(--op-muted); font: 600 1rem/1.3 "Rajdhani", sans-serif; }
.op-barras { list-style: none; display: grid; }
.op-barra {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 46px; align-items: center; gap: 10px;
  width: 100%; min-height: 44px; padding: 0 8px; border: 1px solid transparent; border-radius: 10px; background: none;
  color: #dfe4ff; font: 700 1rem "Rajdhani", sans-serif; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.op-barra:hover { background: rgba(124, 58, 237, 0.14); }
.op-barra[aria-pressed="true"] { background: rgba(124, 58, 237, 0.3); border-color: #a78bfa; color: #fff; }
.op-barra-n { display: inline-flex; align-items: center; gap: 4px; }
.op-barra-n svg { width: 14px; height: 14px; fill: var(--op-gold); }
.op-barra-pista { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.op-barra-relleno { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.op-barra-cant { text-align: right; color: var(--op-muted); font-variant-numeric: tabular-nums; }

.op-chips-wrap { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--op-border); }
.op-chips-t { color: var(--op-muted); font: 700 0.9rem "Rajdhani", sans-serif; letter-spacing: 0.1em; text-transform: uppercase; }
.op-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.op-chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--op-border); background: rgba(255, 255, 255, 0.04); color: #dfe4ff;
  font: 700 1rem "Rajdhani", sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.op-chip:hover { background: rgba(124, 58, 237, 0.16); }
.op-chip[aria-pressed="true"], .op-pill[aria-pressed="true"] { background: rgba(124, 58, 237, 0.38); border-color: #a78bfa; color: #fff; }
.op-chip-n { color: var(--op-muted); font-weight: 600; }
.op-chip[aria-pressed="true"] .op-chip-n, .op-pill[aria-pressed="true"] .op-chip-n { color: #e0d7ff; }

@media (min-width: 900px) {
  .op-resumen { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 28px; padding: 26px 28px; }
  .op-chips-wrap { padding: 0 0 0 28px; border-top: 0; border-left: 1px solid var(--op-border); }
}

/* ── Galería "Fotos de clientes" ────────────────────────────── */
.op-fotos { display: grid; gap: 12px; }
.op-galeria {
  list-style: none; display: flex; gap: 10px; padding-bottom: 8px !important; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: #4c3b8a transparent; -webkit-overflow-scrolling: touch;
}
.op-galeria > li { flex: 0 0 auto; scroll-snap-align: start; }

/* ── Miniaturas de fotos (galería, tarjetas, Home) ──────────── */
.op-fotos-card { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.op-foto {
  position: relative; display: block; width: 84px; height: 84px; padding: 0; overflow: hidden; cursor: zoom-in;
  border-radius: 12px; border: 1px solid var(--op-border, rgba(139, 92, 246, 0.22)); background: #0b1226;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.op-foto img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.op-foto:hover img { transform: scale(1.05); }
.op-foto:focus-visible { outline: 2px solid var(--op-focus, #c4b5fd); outline-offset: 2px; }
.op-foto--galeria { width: 120px; height: 120px; border-radius: 14px; }
.op-foto-est {
  position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px;
  border-radius: 999px; background: rgba(4, 7, 18, 0.8); color: #fff; font: 700 0.86rem/1.3 "Oxanium", sans-serif;
}
.op-foto-est svg { width: 12px; height: 12px; fill: var(--op-gold, #fbbf24); }
@media (min-width: 768px) {
  .op-foto--galeria { width: 148px; height: 148px; }
}
.hx-rev-fotos { margin: 2px 0 4px; }
.hx-rev-fotos .op-foto { width: 64px; height: 64px; border-radius: 10px; }

/* ── Filtros ────────────────────────────────────────────────── */
.op-lista { display: grid; gap: 14px; min-width: 0; }
.op-lista > * { min-width: 0; }
.op-filtros { display: grid; gap: 12px; }
.op-buscar { position: relative; }
.op-buscar input {
  width: 100%; min-height: 48px; padding: 0 52px 0 46px; border-radius: 14px; background: #0b1226;
  border: 1px solid var(--op-border); color: #fff; font: 500 1.05rem "Rajdhani", sans-serif; box-sizing: border-box;
}
.op-buscar input::placeholder { color: var(--op-muted); }
.op-buscar input:focus { border-color: #a78bfa; outline: 2px solid rgba(167, 139, 250, 0.45); outline-offset: 1px; }
.op-buscar-ico { position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; stroke: var(--op-muted); fill: none; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.op-buscar-borrar {
  position: absolute; right: 2px; top: 2px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  background: none; border: 0; border-radius: 12px; color: #dfe4ff; cursor: pointer;
}
.op-buscar-borrar svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.op-juegos {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); list-style: none; padding: 6px !important;
  max-height: min(320px, 52vh); overflow-y: auto; background: #0b1226; border: 1px solid #6d4fd1; border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); overscroll-behavior: contain;
}
.op-juegos [role="option"] {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 12px; border-radius: 10px;
  color: #eef1fb; font: 600 1.02rem/1.25 "Rajdhani", sans-serif; cursor: pointer;
}
.op-juegos [role="option"]:hover, .op-juegos [role="option"].is-activo { background: rgba(124, 58, 237, 0.3); }
.op-juegos [aria-selected="true"] .op-juego-nombre { color: #c4b5fd; }
.op-juego-nombre { min-width: 0; overflow-wrap: anywhere; }
.op-juego-n { flex: 0 0 auto; color: var(--op-muted); font: 500 0.92rem "Rajdhani", sans-serif; }
.op-juego-vacio { padding: 12px; color: var(--op-muted); font: 500 1rem "Rajdhani", sans-serif; }

.op-pills { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 2px 1px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.op-pills::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .op-pills { flex-wrap: wrap; overflow: visible; } }
.op-pill {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; min-width: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--op-border); background: rgba(255, 255, 255, 0.04); color: #dfe4ff;
  font: 700 1rem "Rajdhani", sans-serif; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.op-seg { flex: 0 0 auto; display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--op-border); }
.op-seg .op-pill { border-color: transparent; background: transparent; }
.op-seg .op-pill[aria-pressed="true"] { background: linear-gradient(135deg, var(--op-violet), #6d28d9); border-color: transparent; }

.op-sel { position: relative; flex: 0 0 auto; display: block; }
.op-sel select, .op-orden select {
  -webkit-appearance: none; appearance: none; min-height: 44px; max-width: 72vw; padding: 0 38px 0 16px; border-radius: 999px;
  border: 1px solid var(--op-border); background-color: rgba(255, 255, 255, 0.04); color: #dfe4ff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dfe4ff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 14px;
  font: 700 1rem "Rajdhani", sans-serif; cursor: pointer; box-sizing: border-box;
}
.op-sel select.is-activo { background-color: rgba(124, 58, 237, 0.38); border-color: #a78bfa; color: #fff; }
.op-sel select option, .op-orden select option { background: #0d1428; color: #fff; }

.op-activos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.op-activo {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px 0 16px; border-radius: 999px;
  background: rgba(124, 58, 237, 0.3); border: 1px solid #a78bfa; color: #fff; font: 700 1rem "Rajdhani", sans-serif; cursor: pointer;
}
.op-activo svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.op-limpiar {
  min-height: 44px; padding: 0 10px; background: none; border: 0; cursor: pointer; color: #c4b5fd;
  font: 700 1rem "Rajdhani", sans-serif; text-decoration: underline; text-underline-offset: 3px;
}

.op-cab { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.op-conteo { min-height: 1.4em; color: var(--op-muted); font: 600 1rem "Rajdhani", sans-serif; }
.op-orden { display: inline-flex; align-items: center; gap: 10px; color: var(--op-muted); font: 600 1rem "Rajdhani", sans-serif; }

/* ── Lista y tarjetas ───────────────────────────────────────── */
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.op-card {
  display: grid; gap: 10px; align-content: start; min-width: 0; padding: 18px; border-radius: 18px;
  background: var(--op-surface, #0d1428); border: 1px solid var(--op-border, rgba(139, 92, 246, 0.22)); color: var(--op-text, #eef1fb);
}
.op-card:focus { outline: none; }
.op-card:focus-visible { outline: 2px solid var(--op-focus, #c4b5fd); outline-offset: 3px; }
.op-card :where(p, ul) { margin: 0; padding: 0; }
.op-card-top { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.op-avatar {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff;
  background: linear-gradient(135deg, #7c3aed, #4f46e5); font: 700 1.15rem "Oxanium", sans-serif;
}
.op-quien { display: grid; gap: 4px; min-width: 0; }
.op-nombre { color: #fff; font: 700 1.05rem/1.2 "Oxanium", sans-serif; overflow-wrap: anywhere; }
.op-estrellas { display: inline-flex; gap: 2px; }
.op-estrellas svg { width: 18px; height: 18px; fill: rgba(255, 255, 255, 0.16); stroke: none; }
.op-estrellas svg.is-on { fill: var(--op-gold, #fbbf24); }
.op-estrellas--grande svg { width: 26px; height: 26px; }
.op-fecha { align-self: start; padding-top: 2px; color: var(--op-muted, #9aa8c9); font: 600 0.95rem/1.3 "Rajdhani", sans-serif; white-space: nowrap; }
.op-verif { color: #cdd6f1; font: 500 1rem/1.45 "Rajdhani", sans-serif; overflow-wrap: anywhere; }
.op-ok { display: inline-flex; align-items: center; gap: 4px; color: var(--op-ok, #6ee7b7); font-weight: 700; }
.op-ok svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.op-juego { color: #fff; font-weight: 700; }
a.op-juego { color: #c4b5fd; text-decoration: underline; text-decoration-color: rgba(196, 181, 253, 0.5); text-underline-offset: 3px; }
a.op-juego:hover { color: #fff; }
.op-texto { color: #eef1fb; font: 500 1.1rem/1.5 "Rajdhani", sans-serif; overflow-wrap: anywhere; white-space: pre-line; }
.op-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.op-tags li {
  padding: 3px 12px; border-radius: 999px; background: rgba(110, 231, 183, 0.1); border: 1px solid rgba(110, 231, 183, 0.35);
  color: #a7f3d0; font: 600 0.92rem/1.35 "Rajdhani", sans-serif;
}
.op-resp { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: rgba(124, 58, 237, 0.12); border-left: 3px solid var(--op-violet, #7c3aed); }
.op-resp-k { color: #c4b5fd; font: 700 0.86rem "Rajdhani", sans-serif; letter-spacing: 0.08em; text-transform: uppercase; }
.op-resp-t { color: #e0e6fb; font: 500 1.02rem/1.45 "Rajdhani", sans-serif; overflow-wrap: anywhere; white-space: pre-line; }

.op-mas-wrap { display: grid; justify-items: center; gap: 10px; }
.op-mas { min-height: 48px; padding: 0 28px; justify-content: center; }
.op-mas:disabled { opacity: 0.7; cursor: progress; }
.op-mas-error { color: #fecaca; font: 600 1rem "Rajdhani", sans-serif; text-align: center; }
.op-nota { text-align: center; color: var(--op-muted); font: 500 0.98rem/1.45 "Rajdhani", sans-serif; max-width: 62ch; margin: 0 auto !important; }

/* ── Estados vacíos y de error ──────────────────────────────── */
.op-vacio {
  display: grid; justify-items: center; gap: 10px; padding: 28px 20px; text-align: center; border-radius: 20px;
  background: var(--op-surface); border: 1px dashed rgba(139, 92, 246, 0.4);
}
.op-vacio--grande { padding: 40px 20px; }
.op-vacio h2, .op-vacio h3 { font: 700 1.3rem/1.25 "Oxanium", sans-serif; color: #fff; text-wrap: balance; }
.op-vacio p { max-width: 52ch; color: #cfd8f3; font: 500 1.08rem/1.45 "Rajdhani", sans-serif; }
.op-vacio-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: rgba(124, 58, 237, 0.18); color: #c4b5fd; }
.op-vacio-ico--aviso { background: rgba(251, 191, 36, 0.14); color: var(--op-gold); }
.op-vacio-ico svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.op-vacio-acc { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.op-vacio-acc .hm-btn { min-height: 48px; justify-content: center; }

/* Esqueleto de carga (mantiene la altura: la página no salta cuando llegan los datos) */
.op-estado { display: grid; gap: 16px; }
.op-esq-resumen, .op-esq { display: grid; gap: 12px; padding: 20px; border-radius: 18px; background: var(--op-surface, #0d1428); border: 1px solid var(--op-border, rgba(139, 92, 246, 0.22)); }
.op-esq-l {
  display: block; height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 25%, rgba(255, 255, 255, 0.14) 50%, rgba(255, 255, 255, 0.06) 75%);
  background-size: 220% 100%; animation: op-brillo 1.4s linear infinite;
}
.op-esq-l--corta { width: 38%; }
.op-esq-l--media { width: 64%; }
@keyframes op-brillo { to { background-position: -220% 0; } }

/* ── Ficha del juego ────────────────────────────────────────── */
.op-ficha { display: grid; gap: 16px; min-width: 0; color: var(--op-text); }
.op-ficha > * { min-width: 0; }
.op-ficha :where(h2, p) { margin: 0; }
.op-ficha-cab { display: grid; gap: 8px; }
.op-ficha-cab h2 { font: 700 clamp(1.3rem, 1.1rem + 0.9vw, 1.75rem)/1.2 "Oxanium", sans-serif; color: var(--op-text); text-wrap: balance; }
.op-ficha-prom { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.op-ficha-num { color: #fff; font: 700 2.2rem/1 "Oxanium", sans-serif; }
.op-ficha-cant { color: #cfd8f3; font: 600 1.05rem/1.35 "Rajdhani", sans-serif; }
.op-ficha-nota { color: var(--op-muted); font: 500 0.98rem/1.4 "Rajdhani", sans-serif; }
.op-ficha-sin { color: #cfd8f3; font: 600 1.08rem/1.4 "Rajdhani", sans-serif; }
.op-ficha-sin a { color: #c4b5fd; text-decoration: underline; text-decoration-color: rgba(196, 181, 253, 0.5); text-underline-offset: 3px; }
.op-ficha-sin a:hover { color: #fff; }
.op-ficha-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; align-items: start; }
.op-ficha-acc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.op-ficha-acc .hm-btn { min-height: 48px; justify-content: center; }

/* ── Home ───────────────────────────────────────────────────── */
.hx-rev-aclara { margin: 8px 0 0; max-width: 62ch; color: var(--op-muted); font: 500 1.02rem/1.4 "Rajdhani", sans-serif; }
.hx-rev-todas { min-height: 48px; justify-content: center; }
@media (max-width: 640px) {
  .hx-reviews .hx-head { align-items: stretch; }
  .hx-rev-todas { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .op-esq-l { animation: none; }
  .op-foto img { transition: none; }
  .op-foto:hover img { transform: none; }
}

/* ── Pantallas chicas ───────────────────────────────────────── */
@media (max-width: 480px) {
  .op-head { padding: 20px 16px; }
  .op-resumen { padding: 16px; }
  .op-resumen-top { gap: 8px 14px; }
  .op-prom-num { font-size: 2.8rem; }
  .op-estrellas--grande svg { width: 20px; height: 20px; }
  .op-card { padding: 16px; }
  .op-card-top { gap: 10px; }
}
