/* ==========================================================================
   Addon Specials Omnibus — front (ficha de producto)
   Linea legal "precio mas bajo 30 dias" + panel lateral "Historial de precios".
   Diseño: temp/entrega-omnibus (opcion A). Prefijo .mq- para no chocar.
   ========================================================================== */

/* ---------- Linea legal bajo el precio ---------- */
.mq-price__legal {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 12.5px; line-height: 1.4; color: #6d626f;
}
.mq-price__info {
  flex: none; width: 18px; height: 18px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #d3b6da; border-radius: 50%; background: none;
  font: inherit; font-size: 11px; font-weight: 600; line-height: 1;
  color: #b957c5; cursor: pointer;
}
.mq-price__info:hover, .mq-price__info:focus-visible { border-color: #b957c5; }

/* Segunda referencia (ultimo precio fuera de promocion). Deliberadamente MENOS
   prominente que el descuento legal de arriba: es un dato adicional y no puede
   competir visualmente con el porcentaje del art. 6 bis.
   Va dentro de .mq-price__legal (que ya es flex con wrap) y ocupa el ancho
   completo para caer a su propia linea, sin necesidad de que la tienda le asigne
   un `order` en su contenedor de precios. */
.mq-price__original {
  flex-basis: 100%;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 1px;
  font-size: 12.5px; line-height: 1.4; color: #8a8189;
}
/* Bloque informativo de un producto SIN rebaja que anunciar: solo cifras
   etiquetadas, en pequeño y apagadas. No lleva porcentaje ni tachado a proposito
   — en cuanto los llevara pasaria a ser un anuncio de reduccion. */
.mq-price__legal--info { gap: 2px; }
/* La fila va en flex-nowrap para que el boton (i) no baje solo a una linea vacia
   cuando el texto llena el ancho (pasaba en movil): el span se estrecha y envuelve
   por dentro, y la (i) se queda al lado alineada a la primera linea. */
.mq-price__legal--info .mq-price__original {
  margin-top: 0; display: flex; flex-wrap: nowrap; align-items: baseline; gap: 6px;
}
.mq-price__legal--info .mq-price__original > span { min-width: 0; }
.mq-price__legal--info .mq-price__info { flex: none; }

.mq-price__original .mq-price__pct {
  background: #f4f1f5; color: #8a8189;
  font-size: 11px; font-weight: 600; padding: 2px 6px;
}

/* ---------- Panel lateral: historial de precios ---------- */
.mq-history[hidden] { display: none; }
.mq-history { position: fixed; inset: 0; z-index: 3000; display: flex; justify-content: flex-end; }
.mq-history__backdrop { flex: 1; background: rgba(27, 20, 25, .35); border: 0; padding: 0; cursor: pointer; }
.mq-history__panel {
  width: 470px; max-width: 92vw; background: #fff;
  display: flex; flex-direction: column; box-shadow: -8px 0 40px rgba(27, 20, 25, .18);
  animation: mq-slide-in .22s ease-out;
}
@keyframes mq-slide-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }

.mq-history__head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; border-bottom: 1px solid #efeaf0; }
.mq-history__title { font-size: 17px; font-weight: 600; color: #1b1419; }
.mq-history__x { width: 30px; height: 30px; border: 0; background: none; font-size: 20px; line-height: 1; color: #6d626f; cursor: pointer; }

.mq-history__body { flex: 1; overflow: auto; padding: 26px; display: flex; flex-direction: column; gap: 22px; }
.mq-history__prices { display: flex; flex-direction: column; gap: 6px; }
.mq-history__now { font-size: 26px; font-weight: 600; line-height: 1; color: #b957c5; }
.mq-history__line { font-size: 13px; color: #5d545f; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.mq-history__pct { background: #fbeef8; color: #b957c5; font-size: 11px; font-weight: 600; padding: 2px 6px; }
/* El del precio original, apagado: el que manda es el de la referencia de 30 dias. */
.mq-history__pct--soft { background: #f4f1f5; color: #8a8189; }
.mq-history__notes { display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.5; color: #5d545f; }
.mq-history__notes b { color: #1b1419; font-weight: 600; }
.mq-history__meta { color: #6d626f; }
.mq-history__saving { background: #eefaf0; color: #2f9e44; font-size: 11px; font-weight: 600; padding: 2px 6px; }

.mq-history__changes { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid #efeaf0; padding-top: 18px; }
.mq-history__changes-title { font-size: 13px; font-weight: 600; color: #1b1419; }
.mq-history__chart { display: flex; align-items: stretch; gap: 10px; }
.mq-history__chart svg { flex: 1; height: 90px; background: #fdfbfe; border: 1px solid #f4eef6; border-radius: 6px; }
.mq-history__chart-scale { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: #9b8fa0; padding: 2px 0; white-space: nowrap; }
.mq-history__chart-dates { display: flex; justify-content: space-between; font-size: 11px; color: #9b8fa0; }
.mq-history__more { font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; color: #b957c5; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.mq-history__legal { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid #efeaf0; padding-top: 18px; }
.mq-history__legal[hidden] { display: none; }
.mq-history__legal h3 { margin: 0; font-size: 14px; font-weight: 600; color: #1b1419; }
.mq-history__legal p { margin: 0; font-size: 13px; line-height: 1.65; color: #5d545f; }
.mq-history__foot { padding: 18px 26px; border-top: 1px solid #efeaf0; }
.mq-history__close { width: 100%; height: 48px; border: 0; background: #0a0a0a; color: #fff; font: inherit; font-size: 14px; font-weight: 600; letter-spacing: .08em; cursor: pointer; }
.mq-history__close:hover { background: #b957c5; }

/* ---------- Movil ---------- */
@media (max-width: 767px) {
  .mq-price__info { width: 20px; height: 20px; }
  .mq-history__panel { width: 100%; max-width: 100%; }
}

/* Nota del panel cuando no hay rebaja que anunciar. */
.mq-history__note {
  margin-top: 6px; padding: 8px 10px;
  background: #f7f4f8;
  font-size: 12.5px; line-height: 1.5; color: #6d626f;
}

/* ---------- Grafica de evolucion: lectura al senalar ---------- */
/* touch-action pan-y deja vivo el scroll vertical de la pagina y solo captura el
   gesto horizontal; sin seleccion de texto para que arrastrar el dedo no seleccione
   media pantalla. */
.mq-history__chart[data-mq-chart] { position: relative; cursor: crosshair; }
.mq-history__chart[data-mq-chart] svg { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.mq-history__marker { pointer-events: none; }

/* El globo FLOTA sobre la grafica (absolute), asi que aparecer y desaparecer no
   mueve ni un pixel del panel. Se ancla arriba para que en movil no quede debajo
   del dedo, y el JS lo centra sobre el punto frenandolo en los bordes. */
.mq-history__tip {
  position: absolute; top: 6px; left: 0; transform: translateX(-50%);
  z-index: 2; pointer-events: none; white-space: nowrap;
  padding: 5px 9px; border-radius: 4px;
  background: #1b1419; color: #fff;
  font-size: 11.5px; line-height: 1.35; text-align: center;
  box-shadow: 0 3px 12px rgba(27, 20, 25, .28);
}
.mq-history__tip[hidden] { display: none; }
.mq-history__tip b { display: block; font-size: 13px; font-weight: 600; }
.mq-history__tip span { opacity: .72; }
/* Pico del globo. */
.mq-history__tip::after {
  content: ''; position: absolute; top: 100%; left: 50%; margin-left: -4px;
  border: 4px solid transparent; border-top-color: #1b1419;
}

@media (max-width: 767px) {
  /* Mas alta en movil: el dedo necesita blanco donde caer sin tapar la linea. */
  .mq-history__chart svg { height: 120px; }
  .mq-history__tip { font-size: 12px; }
  .mq-history__tip b { font-size: 14px; }
}
