/* =========================================================
   STRATEBIKE - FICHA DE MOTO: Wiki interactiva, selector de
   vista e información complementaria.
   Colores: sólo variables de tema.css (claro / oscuro).
========================================================= */

/* ---------- Barra superior y encabezado ---------- */
.wiki-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; color: var(--sb-titulo); }
.wiki-barra-enlaces { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.wiki-barra .volver-link { margin: 0; }
.wiki-marca { margin: 0 0 2px; color: var(--sb-texto-suave); font-size: calc(13px * var(--sb-escala-texto, 1)); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.wiki-header-lado { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.wiki-header .insignia-verif { margin-left: 6px; vertical-align: middle; }

/* ---------- Selector de vista ---------- */
.selector-vista {
  position: sticky;
  top: 8px;
  z-index: 15;
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 4px;
  border: 1px solid var(--sb-borde);
  border-radius: 14px;
  background: var(--sb-superficie-translucida);
  box-shadow: var(--sb-sombra);
  backdrop-filter: blur(8px);
}
.selector-vista button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--sb-titulo);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.selector-vista button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.selector-vista button:hover:not([disabled]) { background: var(--sb-azul-100); }
.selector-vista button[aria-selected="true"] { background: var(--sb-azul-800); color: #fff; }
.selector-vista button[disabled] { opacity: .45; cursor: not-allowed; }
.selector-vista button:focus-visible { outline: 3px solid var(--sb-acento); outline-offset: 2px; }
.selector-vista-nota { margin: -8px 0 18px; font-size: calc(13px * var(--sb-escala-texto, 1)); }
.vista-ficha[hidden] { display: none !important; }

/* ---------- Exploración interactiva ---------- */
.wi-exploracion { margin-bottom: 26px; }
.wi-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.wi-escena { min-width: 0; padding: 14px; border: 1px solid var(--sb-borde); border-radius: var(--radio-card, 16px); background: var(--sb-superficie); box-shadow: var(--sb-sombra); }
.wi-figura { scroll-margin-top: 68px; position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; background: var(--sb-foto); touch-action: manipulation; }
.wi-figura.con-dibujo { background: radial-gradient(circle at 50% 60%, var(--sb-superficie), var(--sb-superficie-2)); }
.wi-foto { display: block; width: 100%; height: 100%; object-fit: fill; user-select: none; -webkit-user-drag: none; }
.wi-dibujo { display: block; width: 100%; height: 100%; }
.wi-d-linea { fill: none; stroke: var(--sb-dibujo-trazo); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.wi-d-fina { opacity: .6; }
.wi-d-escape { opacity: .75; }
.wi-d-relleno { fill: var(--sb-dibujo-relleno); stroke: var(--sb-dibujo-trazo); stroke-width: 4; stroke-linejoin: round; }
.wi-d-oscuro { fill: var(--sb-dibujo-oscuro); stroke: var(--sb-dibujo-trazo); stroke-width: 4; }
.wi-d-cubierta { fill: none; stroke: var(--sb-dibujo-trazo); stroke-width: 22; }
.wi-d-llanta { fill: none; stroke: var(--sb-dibujo-oscuro); stroke-width: 5; }
.wi-d-disco { fill: none; stroke: var(--sb-dibujo-relleno); stroke-width: 7; }
.wi-d-faro { fill: #fef9c3; stroke: var(--sb-dibujo-trazo); stroke-width: 4; }
.wi-d-sombra { fill: var(--sb-borde); opacity: .6; }

/* Foco: se oscurece la foto salvo un círculo alrededor del componente elegido. */
.wi-foco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
  background: radial-gradient(circle at var(--wi-x, 50%) var(--wi-y, 50%), transparent 0, transparent 58px, var(--sb-foco) 128px);
}
.wi-figura.con-foco .wi-foco { opacity: 1; }

.wi-puntos { position: absolute; inset: 0; }
.wi-punto {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--sb-azul-600);
  color: #fff;
  font: 800 14px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: 0 3px 10px rgba(4, 18, 34, .4);
  transform: translate(-50%, -50%);
  transition: transform .15s ease, background .15s ease;
  cursor: pointer;
}
.wi-punto::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; }   /* zona táctil de 52 px */
.wi-punto::after { content: ""; position: absolute; inset: -7px; border: 2px solid var(--sb-azul-600); border-radius: 50%; opacity: 0; animation: wi-latido 2.6s ease-out infinite; }
.wi-punto.sin-datos { background: #7f8d9c; }
.wi-punto.sin-datos::after { display: none; }
.wi-punto:hover, .wi-punto:focus-visible { z-index: 3; transform: translate(-50%, -50%) scale(1.12); outline: none; }
.wi-punto:focus-visible { box-shadow: 0 0 0 4px var(--sb-acento); }
.wi-punto.activo { z-index: 4; background: var(--sb-acento); transform: translate(-50%, -50%) scale(1.22); }
.wi-punto.activo::after { border-color: var(--sb-acento); animation-duration: 1.6s; }
.wi-punto-nombre {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  padding: 5px 10px;
  border: 1px solid var(--sb-borde);
  border-radius: 9px;
  background: var(--sb-superficie);
  color: var(--sb-titulo);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--sb-sombra);
  opacity: 0;
  transform: translateX(-50%);
  pointer-events: none;
  transition: opacity .15s;
}
.wi-punto.etiqueta-abajo .wi-punto-nombre { top: calc(100% + 9px); bottom: auto; }
.wi-punto.etiqueta-izquierda .wi-punto-nombre { left: auto; right: -6px; transform: none; }
.wi-punto.etiqueta-derecha .wi-punto-nombre { left: -6px; transform: none; }
.wi-punto:hover .wi-punto-nombre, .wi-punto:focus-visible .wi-punto-nombre, .wi-punto.activo .wi-punto-nombre { opacity: 1; }
@keyframes wi-latido { 0% { transform: scale(.75); opacity: .9; } 70%, 100% { transform: scale(1.45); opacity: 0; } }

.wi-leyenda { margin: 8px 2px 0; color: var(--sb-texto-suave); font-size: calc(12px * var(--sb-escala-texto, 1)); text-align: center; }
.wi-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wi-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--sb-borde);
  border-radius: 999px;
  background: var(--sb-superficie);
  color: var(--sb-titulo);
  font: inherit;
  font-size: calc(14px * var(--sb-escala-texto, 1));
  font-weight: 700;
  cursor: pointer;
}
.wi-chip b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 50%; background: var(--sb-azul-100); font-size: calc(12px * var(--sb-escala-texto, 1)); }
.wi-chip:hover { border-color: var(--sb-enlace); }
.wi-chip.activo { border-color: var(--sb-azul-800); background: var(--sb-azul-800); color: #fff; }
.wi-chip.activo b { background: rgba(255, 255, 255, .2); }
.wi-chip.sin-datos { color: var(--sb-texto-tenue); }
.wi-chip:focus-visible, .wi-panel button:focus-visible { outline: 3px solid var(--sb-acento); outline-offset: 2px; }

/* Panel de características */
.wi-panel {
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 92px);
  overflow: auto;
  border: 1px solid var(--sb-borde);
  border-radius: var(--radio-card, 16px);
  background: var(--sb-superficie);
  box-shadow: var(--sb-sombra);
  overscroll-behavior: contain;
}
.wi-panel-barra { display: none; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 0; }
.con-seleccion .wi-panel-barra { display: flex; }
.wi-panel-asa { display: none; }
.wi-panel-general, .wi-panel-cerrar, .wi-panel-nav button, .wi-enlace {
  min-height: 38px;
  border: 1px solid var(--sb-borde);
  border-radius: 10px;
  background: var(--sb-superficie);
  color: var(--sb-titulo);
  font: inherit;
  font-size: calc(13px * var(--sb-escala-texto, 1));
  font-weight: 700;
  cursor: pointer;
}
.wi-panel-general { padding: 0 12px; }
.wi-panel-cerrar { width: 38px; font-size: calc(22px * var(--sb-escala-texto, 1)); line-height: 1; }
.wi-panel-cuerpo { padding: 16px 18px 18px; }
.wi-panel-cabecera { display: flex; gap: 12px; align-items: flex-start; }
.wi-panel-numero { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sb-acento); color: #1d252d; font-weight: 800; }
.wi-panel-titulo { margin: 0; color: var(--sb-titulo); font-size: calc(20px * var(--sb-escala-texto, 1)); }
.wi-panel-titulo:focus { outline: none; }
.wi-panel-ayuda { margin: 4px 0 12px; color: var(--sb-texto-suave); font-size: calc(13px * var(--sb-escala-texto, 1)); }
.wi-panel .ft-lista { margin: 0; }
.wi-faltan { margin-top: 10px; }
.wi-vacio { display: grid; gap: 4px; padding: 14px; border: 1px dashed var(--sb-borde); border-radius: 12px; background: var(--sb-superficie-2); color: var(--sb-texto-suave); font-size: calc(14px * var(--sb-escala-texto, 1)); }
.wi-vacio strong { color: var(--sb-texto); }
.wi-panel-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.wi-panel-nav button { padding: 0 12px; }
.wi-panel-pie { margin: 0; padding: 0 18px 16px; }
.wi-enlace { padding: 0 12px; border-style: dashed; }
.wi-claves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.wi-claves li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--sb-superficie-2); }
.wi-claves span { color: var(--sb-texto-suave); font-size: calc(12px * var(--sb-escala-texto, 1)); }
.wi-claves strong { color: var(--sb-titulo); font-size: calc(20px * var(--sb-escala-texto, 1)); }
.wi-claves small { margin-left: 3px; color: var(--sb-texto-suave); font-size: calc(12px * var(--sb-escala-texto, 1)); }

/* ---------- Información complementaria ---------- */
.info-seccion { margin: 26px 0; }
.info-seccion-cabecera h2 { margin: 0 0 4px; }
.info-seccion-cabecera p { margin: 0 0 12px; font-size: calc(14px * var(--sb-escala-texto, 1)); }
.info-tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.info-tarjeta { padding: 16px 18px; border: 1px solid var(--sb-borde); border-radius: var(--radio-card, 16px); background: var(--sb-superficie); box-shadow: var(--sb-sombra); }
.info-tarjeta h3 { margin: 0 0 8px; color: var(--sb-titulo); font-size: calc(16px * var(--sb-escala-texto, 1)); }
.info-tarjeta p { margin: 0; line-height: 1.55; }
.info-tarjeta ul { margin: 0; padding-left: 20px; color: var(--sb-texto); line-height: 1.55; }
.info-tarjeta.ancha { grid-column: 1 / -1; }
.info-tarjeta.destacada p { color: var(--sb-texto); font-size: calc(16px * var(--sb-escala-texto, 1)); }
.info-analisis .fortalezas { border-top: 4px solid var(--sb-verde); }
.info-analisis .debilidades { border-top: 4px solid var(--sb-rojo); }
.costo-precio-valor { margin: 4px 0 8px !important; color: var(--sb-titulo); font-size: calc(26px * var(--sb-escala-texto, 1)); font-weight: 800; }
.costo-nota { font-size: calc(13px * var(--sb-escala-texto, 1)); }
.costo-lista { display: grid; margin: 0; }
.costo-fila { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--sb-borde-suave); }
.costo-fila:first-child { border-top: 0; }
.costo-fila dt { color: var(--sb-texto-suave); }
.costo-fila dd { margin: 0; color: var(--sb-texto); font-weight: 800; white-space: nowrap; }
.costo-etiqueta { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--sb-alerta-fondo); color: var(--sb-alerta-texto); font-size: calc(11px * var(--sb-escala-texto, 1)); font-weight: 800; vertical-align: middle; }
.costo-etiqueta.confirmado { background: var(--sb-ok-fondo); color: var(--sb-ok-texto); }

/* ---------- Tablet y celular ---------- */
@media (max-width: 900px) {
  .wi-layout { grid-template-columns: minmax(0, 1fr); }
  .wi-escena { padding: 10px; }
  .wi-panel { position: static; max-height: none; }
  .wi-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .wi-chip { flex: none; scroll-snap-align: start; }
  .wi-punto { width: 30px; height: 30px; font-size: 13px; }
  .wi-punto-nombre { display: none; }
  .wi-foco { background: radial-gradient(circle at var(--wi-x, 50%) var(--wi-y, 50%), transparent 0, transparent 36px, var(--sb-foco) 86px); }

  /* Con un componente elegido, el panel sube desde abajo y deja la foto a la vista. */
  .con-seleccion .wi-panel {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    max-height: 54vh;
    border-width: 1px 0 0;
    border-radius: 20px 20px 0 0;
    box-shadow: var(--sb-sombra-fuerte);
    animation: wi-subir .22s ease-out;
  }
  .con-seleccion .wi-panel-barra { position: sticky; top: 0; z-index: 1; padding: 6px 12px 8px; background: var(--sb-superficie); }
  .con-seleccion .wi-panel-asa { display: grid; place-items: center; position: absolute; left: 50%; top: 0; width: 72px; height: 22px; padding: 0; border: 0; background: transparent; transform: translateX(-50%); cursor: pointer; }
  .wi-panel-asa span { width: 42px; height: 5px; border-radius: 999px; background: var(--sb-borde); }
  .con-seleccion .wi-panel-general { margin-top: 10px; }
  .con-seleccion .wi-panel-cerrar { margin-top: 10px; }
  .con-seleccion .wi-panel-cuerpo { padding-top: 4px; }
  body:has(.con-seleccion) { padding-bottom: 54vh; }
  .wiki-header-lado { align-items: flex-start; margin-top: 12px; }
  .selector-vista { width: 100%; }
  .selector-vista button { flex: 1; justify-content: center; padding: 0 10px; }
}
@media (max-width: 420px) {
  .selector-vista button svg { display: none; }
  .wi-claves strong { font-size: calc(18px * var(--sb-escala-texto, 1)); }
}
@keyframes wi-subir { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .wi-punto::after { animation: none; }
  .con-seleccion .wi-panel { animation: none; }
  .wi-foco { transition: none; }
}
@media print {
  .selector-vista, .wi-chips, .wiki-barra [data-tema-selector] { display: none; }
  .vista-ficha[hidden] { display: block !important; }
}

/* style.css da estilo a todos los <button> (relleno azul, ancho completo en el
   celular, desplazamiento al pasar el mouse): acá se neutraliza para estos controles. */
.wi-exploracion button:not(.wi-punto), .selector-vista button { width: auto; box-shadow: none; }
.wi-exploracion button:not(.wi-punto):hover, .selector-vista button:hover { transform: none; box-shadow: none; }
.wi-punto:hover { background: var(--sb-azul-600); }
.wi-punto.sin-datos:hover { background: #7f8d9c; }
.wi-punto.activo:hover { background: var(--sb-acento); }
.wi-chip:hover { background: var(--sb-superficie); }
.wi-chip.activo:hover { background: var(--sb-azul-800); }
.wi-panel-general:hover, .wi-panel-cerrar:hover, .wi-panel-nav button:hover, .wi-enlace:hover { background: var(--sb-azul-100); }
.wi-panel-cerrar { padding: 0; }
.selector-vista button[aria-selected="true"]:hover { background: var(--sb-azul-800); }
.wi-exploracion button.wi-panel-cerrar { width: 38px; min-width: 38px; }

/* Textos largos: recortados hasta «Leer más» */
.info-tarjeta.recortada:not(.abierta) p { display: -webkit-box; -webkit-line-clamp: 7; line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.info-tarjeta.destacada.recortada:not(.abierta) p { -webkit-line-clamp: 5; line-clamp: 5; }
.info-leer-mas { width: auto !important; margin-top: 8px; padding: 6px 12px !important; border: 1px solid var(--sb-borde) !important; border-radius: 9px; background: var(--sb-superficie) !important; color: var(--sb-enlace) !important; font-size: calc(13px * var(--sb-escala-texto, 1)) !important; font-weight: 800; box-shadow: none !important; transform: none !important; }
.info-leer-mas:hover { background: var(--sb-azul-100) !important; }
