/* ============================================================
   Compra y movimiento — hoja aparte de styles.css.
   Lo que empuja a comprar en toda la web: botón «Comprar» de la
   cabecera, bloque de cierre con las tres panzas, dudas junto al
   botón de la ficha, pistas de envío, la panza que vuela a la
   cesta, la barra de lectura y la inclinación de las tarjetas.
   Usa los mismos tokens de :root que styles.css.
   ============================================================ */

/* ---------- Barra de lectura ----------
   Solo CSS: avanza con el scroll de la página. Donde el navegador no
   sabe hacerlo, se queda a cero y no molesta. */
.lectura {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 5px;
  background: var(--pink); border-bottom: 2px solid var(--ink);
  transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  [data-motion] .lectura { animation: lectura linear both; animation-timeline: scroll(root); }
}
@keyframes lectura { to { transform: scaleX(1); } }

/* ---------- Botón «Comprar» de la cabecera ----------
   En móvil no cabe junto a la cesta: allí manda el botón flotante. */
.comprar-btn {
  display: none; align-items: center; min-height: 48px; padding: 0.45rem 1.15rem;
  background: var(--ink); color: #fff; border: var(--line); border-radius: 999px;
  box-shadow: 3px 3px 0 var(--pink); font-weight: 800; text-decoration: none;
  transition: transform 220ms var(--out);
}
.comprar-btn:active { transform: translate(2px, 2px); }
@media (min-width: 560px) { .comprar-btn { display: inline-flex; } }
/* Con el menú completo a la vista y poco ancho, el botón apretaba los enlaces
   hasta partirlos en dos líneas: ahí ya está «Panzas» en el menú. */
@media (min-width: 1080px) and (max-width: 1279px) { .comprar-btn { display: none; } }

/* ---------- Pista de envío en las tarjetas ---------- */
.card__envio {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 0.7rem;
  background: #fff; border: 2px solid var(--ink); border-radius: 999px;
  padding: 0.15rem 0.65rem; font-weight: 800; font-size: 0.82rem;
}
.card__envio::before { content: ""; width: 0.8rem; height: 0.8rem; background: var(--grn); clip-path: var(--burst); }

/* ---------- Ficha: pago seguro y dudas junto al botón ---------- */
.pago-seguro { display: flex; align-items: center; justify-content: center; gap: 0.45rem; margin-top: 0.8rem; font-weight: 700; font-size: 0.95rem; }
.pago-seguro svg { width: 1rem; height: 1rem; flex: none; }

.dudas { margin-top: 2rem; }
.dudas__titulo { font-size: clamp(1.6rem, 3vw, 2rem); }
.faq--mini { gap: 0.6rem; margin-top: 1rem; }
.faq--mini details[open] { box-shadow: 4px 4px 0 var(--pink); }

/* ---------- Bloque de cierre: las tres panzas al final de cada página ---------- */
.cierre-compra { background: var(--yel); border-block: var(--line-gorda); overflow: clip; }
.cierre-compra__top { display: grid; gap: 2rem; align-items: center; }
.cierre-compra__muneco {
  --r: 2deg;
  justify-self: center; width: min(100%, 210px); overflow: hidden;
  background: var(--sky); border: var(--line-gorda); border-radius: 1.6rem;
  box-shadow: 8px 8px 0 var(--ink); transform: rotate(var(--r));
}
@media (min-width: 820px) {
  .cierre-compra__top { grid-template-columns: 1fr auto; }
  .cierre-compra__muneco { width: 250px; }
}

.tiques { list-style: none; padding: 0; display: grid; gap: 1.3rem; margin-top: clamp(2rem, 4vw, 3rem); }
.tique {
  --r: -0.6deg;
  display: grid; grid-template-columns: 88px 1fr; gap: 0.5rem 1rem; align-items: center;
  padding: 0.8rem; background: #fff; border: var(--line-gorda); border-radius: 1.4rem;
  box-shadow: 6px 6px 0 var(--ink); transform: rotate(var(--r));
  transition: transform 260ms var(--out), box-shadow 260ms var(--out);
}
.tiques > .tique:nth-child(2) { --r: 0.6deg; }
.tique__foto { display: block; overflow: hidden; background: var(--paper); border: var(--line); border-radius: 1rem; }
.tique__foto img { width: 100%; aspect-ratio: 1; object-fit: cover; mix-blend-mode: multiply; transition: transform 300ms var(--out); }
.tique__info h3 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); }
.tique__info h3 a { text-decoration: none; }
.tique__sub { font-weight: 600; font-size: 0.95rem; margin-top: 0.2rem; }
.tique__compra {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 0.7rem; border-top: 2px dashed var(--ink);
}
.tique__precio { font: 800 1.9rem/1 var(--disp); }
@media (min-width: 900px) {
  .tique { grid-template-columns: 110px 1fr auto; padding: 1rem 1.3rem 1rem 1rem; }
  .tique__compra { grid-column: auto; flex-direction: column; align-items: flex-end; padding-top: 0; border-top: 0; }
}

.garantias { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; }
.garantias li {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.95rem;
  background: #fff; border: 2px solid var(--ink); border-radius: 999px; font-weight: 700;
}
.garantias li::before { content: ""; flex: none; width: 0.9rem; height: 0.9rem; background: var(--pink); clip-path: var(--burst); }

/* ---------- La panza que vuela a la cesta ---------- */
.vuela {
  position: fixed; z-index: 80; width: 32px; height: 26px; margin: -13px 0 0 -16px;
  background: var(--skin); border: 3px solid var(--ink); border-radius: 50% 50% 46% 46%;
  pointer-events: none;
}
.vuela::after {
  content: ""; position: absolute; left: 50%; top: 45%; width: 6px; height: 6px; margin-left: -3px;
  border-radius: 50%; background: #c9825a;
}

/* ---------- Pasar el ratón ---------- */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .comprar-btn:hover { transform: translate(-2px, -2px) rotate(-3deg); }
  /* La tarjeta se inclina hacia donde está el ratón (lo calcula Movimiento.astro). */
  .card.inclina {
    transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-12px) scale(1.02);
    transition: transform 140ms var(--out);
  }
  .tique:hover { transform: translate(-4px, -4px) rotate(0); box-shadow: 10px 10px 0 var(--ink); }
  .tique:hover .tique__foto img { transform: scale(1.08) rotate(-3deg); }
  .cierre-compra__muneco:hover { transform: rotate(-2deg) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  .comprar-btn:active { transform: none; }
  .tique { transition: none; }
}
