/* ==========================================================================
   Primible — Cinta de productos (section-marquee.php, modo «Productos»)
   Pastillas con foto, nombre y precio; se detiene al pasar el mouse o al
   enfocar con el teclado; en pantallas táctiles se desliza con el dedo.
   ========================================================================== */

html .marquee.marquee--products {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, .06);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: #1d1d1f;
}

/* Desvanecido en los bordes */
.marquee--products::before,
.marquee--products::after {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: clamp(24px, 6vw, 90px);
  content: "";
  pointer-events: none;
}
.marquee--products::before { left: 0; background: linear-gradient(90deg, #1d1d1f, rgba(29, 29, 31, 0)); }
.marquee--products::after { right: 0; background: linear-gradient(270deg, #1d1d1f, rgba(29, 29, 31, 0)); }

.marquee--products .marquee-track {
  padding: 14px 0;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0;
}

.marquee--products .marquee-track > .marquee-group { gap: 12px; padding-right: 12px; }

/* Pausa al pasar el mouse o enfocar un producto */
.marquee--products:hover .marquee-track,
.marquee--products:focus-within .marquee-track { animation-play-state: paused; }

.mq-prod {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 6px 18px 6px 6px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: #2a2a2d;
  color: #fff !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: border-color .2s ease, background-color .2s ease;
}
.mq-prod:hover,
.mq-prod:focus-visible { border-color: rgba(214, 107, 255, .7); background: rgba(177, 20, 255, .18); outline: none; }

html .mq-prod img.mq-prod__img {
  width: 44px !important;
  height: 44px !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 50% !important;
  background: #1f1f21;
  object-fit: cover;
}

.mq-prod__txt { display: grid; line-height: 1.2; }
.mq-prod__name { font-size: 14px; font-weight: 600; }
.mq-prod__price,
.mq-prod__price .amount { color: #d66bff; font-size: 13px; font-weight: 500; }
.mq-prod__price del { margin-right: 4px; color: rgba(255, 255, 255, .4); }
.mq-prod__price ins { text-decoration: none; }

/* Táctil: sin animación, se desliza con el dedo */
@media (hover: none) {
  .marquee--products .marquee-track,
  .marquee--products .marquee-track.is-ready {
    width: auto;
    overflow-x: auto;
    padding: 12px 16px;
    animation: none !important;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .marquee--products .marquee-track::-webkit-scrollbar { display: none; }
  .marquee--products .marquee-group[aria-hidden="true"] { display: none !important; }
  .mq-prod { scroll-snap-align: start; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee--products .marquee-track,
  .marquee--products .marquee-track.is-ready { width: auto; overflow-x: auto; animation: none !important; }
  .marquee--products .marquee-group[aria-hidden="true"] { display: none !important; }
}

/* ---------- Acoplada abajo al hacer scroll ---------- */
.mq-close { display: none; }

html .marquee.marquee--products.is-docked {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 95;
  border-top: 1px solid rgba(214, 107, 255, .35);
  border-bottom: 0;
  background: rgba(29, 29, 31, .92);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 -18px 40px -20px rgba(0, 0, 0, .8);
  animation: mqDockIn .35s cubic-bezier(.2, .8, .2, 1) backwards;
  transition: transform .3s ease;
}
html .marquee.marquee--products.is-docked::before { background: linear-gradient(90deg, rgba(29, 29, 31, .95), rgba(29, 29, 31, 0)); }
html .marquee.marquee--products.is-docked::after { right: 44px; background: linear-gradient(270deg, rgba(29, 29, 31, .95), rgba(29, 29, 31, 0)); }
.marquee--products.is-docked.is-away { transform: translateY(110%); }

.marquee--products.is-docked .marquee-track { padding: 8px 0; }
.marquee--products.is-docked .mq-prod { height: 46px; padding: 4px 14px 4px 4px; }
html .marquee--products.is-docked .mq-prod img.mq-prod__img { width: 36px !important; height: 36px !important; }
.marquee--products.is-docked .mq-prod__name { font-size: 13px; }
.marquee--products.is-docked .mq-prod__price,
.marquee--products.is-docked .mq-prod__price .amount { font-size: 12px; }

.marquee--products.is-docked .mq-close {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: #2a2a2d;
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
}
.marquee--products.is-docked .mq-close:hover { border-color: #b114ff; background: #b114ff; }

/* El final de la página no queda tapado por la cinta */
html.mq-docked body { padding-bottom: 64px; }

@keyframes mqDockIn { from { transform: translateY(100%); } to { transform: none; } }

@media (hover: none) {
  .marquee--products.is-docked .marquee-track { padding: 8px 52px 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html .marquee.marquee--products.is-docked { animation: none; transition: none; }
}
