/* vendovendo — 90s-web playful. El wordmark ES el sistema de diseño:
   magenta + sombra dura cyan, bordes de tinta, nada suave. Ver DESIGN.md. */

:root {
  --canvas: oklch(0.955 0 0);          /* #f0f0f0, el gris del wordmark */
  --ink: oklch(0.2 0 0);               /* #141414 */
  --magenta: oklch(0.71 0.28 335);     /* #f650e8 — superficies y logo, nunca texto chico */
  --cyan: oklch(0.82 0.14 215);        /* #2fd9f7 — sombras duras, focus */
  --wa: oklch(0.42 0.09 175);          /* verde whatsapp oscuro, blanco 7.7:1 */
  --sold: oklch(0.5 0.19 25);          /* rojo VENDIDO, blanco 5.4:1 */
  --display: "Jost", "Futura", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

::selection { background: var(--cyan); color: var(--ink); }

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ---------- portada ---------- */

.cover {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 6rem) 1.25rem 3rem;
  text-align: center;
}

.logo {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(3rem, 13vw, 5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--magenta); /* logo: excepción de logotipo, no es texto de lectura */
  text-shadow: 3px 3px 0 var(--cyan), 6px 6px 0 var(--cyan);
  transform: rotate(-3deg);
  animation: pop 0.5s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes pop {
  from { opacity: 0; transform: rotate(-8deg) scale(0.9); }
  to   { opacity: 1; transform: rotate(-3deg) scale(1); }
}

.tagline {
  margin: 1.5rem 0 0.25rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
}

.note { margin: 0; }

#pdf {
  margin-top: 1.75rem;
  padding: 0.7rem 1.5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
}
#pdf:hover { background: var(--cyan); }
#pdf:active { transform: translate(4px, 4px); box-shadow: none; }

.cover-pills { display: none; } /* solo existen en el PDF */

/* ---------- ticker ---------- */

.ticker {
  overflow: hidden;
  background: var(--magenta);
  border-block: 2px solid var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  padding: 0.45rem 0;
  white-space: nowrap;
}
.ticker-track { display: inline-flex; animation: ticker 22s linear infinite; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- índice ---------- */

.index {
  display: block;
  max-width: 760px;
  margin: 2rem auto 0;
  padding: 0 1.25rem;
}
.index-box {
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--cyan);
}
.index-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display);
}
.index-row + .index-row { border-top: 2px dashed var(--ink); }
.index-row:hover { background: var(--cyan); color: var(--ink); }
.index-title { flex: 1; min-width: 0; font-weight: 700; font-size: 0.95rem; }
.index-price { font-weight: 800; font-size: 0.95rem; white-space: nowrap; }
.index-sold { color: oklch(0.45 0 0); }
.index-sold .index-title { text-decoration: line-through; }
.index-stamp {
  padding: 0.05rem 0.5rem;
  font-weight: 800;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--sold);
  border: 2px solid var(--ink);
  transform: rotate(-4deg);
  white-space: nowrap;
}

/* con ancla, que el producto no quede pegado al borde */
.product { scroll-margin-top: 1.5rem; }

/* ---------- productos ---------- */

#products {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.product { padding: clamp(3rem, 7vw, 4.5rem) 0; }
.product + .product { border-top: 2px dashed var(--ink); }

.gallery-wrap { position: relative; }

/* galería: scroll horizontal nativo con snap, sin JS */
.gallery {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 6px 10px 0; /* aire para la sombra dura */
}
.gallery img {
  height: 340px;
  max-width: 100%;
  object-fit: cover;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--cyan);
  scroll-snap-align: start;
  flex-shrink: 0;
}
@media (max-width: 480px) { .gallery img { height: 290px; } }

.stamp {
  position: absolute;
  top: 1rem;
  left: -0.5rem;
  padding: 0.35rem 1rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--sold);
  border: 2px solid var(--ink);
  transform: rotate(-8deg);
}
.sold .gallery img { filter: grayscale(0.75); }

.product h2 {
  margin: 1.5rem 0 0.75rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.65rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.price { margin: 0 0 1rem; }
.tag {
  display: inline-block;
  padding: 0.3rem 1rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  background: var(--magenta);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--cyan);
  transform: rotate(-2deg);
}

.desc { margin: 0; white-space: pre-line; max-width: 62ch; text-wrap: pretty; }

.wa-row { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 1.5rem; }

.wa {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  font-family: var(--display);
  font-weight: 700;
  color: #fff;
  background: var(--wa);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
}
.wa:hover { filter: brightness(1.15); }
.wa:active { transform: translate(4px, 4px); box-shadow: none; }

.up {
  display: block;
  width: fit-content;
  margin-top: 1.5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
}
.up:hover { background: var(--cyan); }

/* ---------- lightbox ---------- */

.gallery img { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: oklch(0.2 0 0 / 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: calc(100vw - 5rem);
  max-height: calc(100vh - 5rem);
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--cyan);
  cursor: zoom-out;
}
.lightbox button {
  position: absolute;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--cyan);
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}
.lightbox button:hover { background: var(--cyan); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-count {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
}

/* ---------- pie ---------- */

footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
  text-align: center;
  border-top: 2px dashed var(--ink);
}
footer p { margin: 0 0 0.75rem; }
footer .fine { margin-top: 1rem; font-size: 0.85rem; color: oklch(0.45 0 0); }
footer img { image-rendering: pixelated; }

@media (prefers-reduced-motion: reduce) {
  .logo { animation: none; }
  .ticker-track { animation: none; }
  #pdf:active, .wa:active { transform: none; box-shadow: 4px 4px 0 var(--ink); }
}

/* ---------- PDF: cada .slide = diapositiva 16:9 (960×540px = 10×5.625in) ----------
   Layout "4b": la foto manda. Dos fotos lado a lado arriba, y una banda de texto
   abajo con título + nota breve + precio grande + contacto. */

@media print {
  @page { size: 960px 540px; margin: 0; }

  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

  body { background: #fff; }

  .slide {
    width: 960px;
    height: 540px;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    page-break-after: always;
    border: none;
  }

  #pdf, .wa-row, .sold, .ticker, .index, .up, .lightbox, footer { display: none !important; }

  #products { max-width: none; margin: 0; padding: 0; }

  /* portada */
  .cover {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--canvas);
  }
  .cover .logo { font-size: 5.5rem; animation: none; }
  .cover .tagline { margin-top: 2.5rem; font-size: 1.5rem; }
  .cover .note { font-size: 1.1rem; }
  .cover-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 2rem; }
  .cover-url,
  .cover-contact {
    display: inline-block;
    padding: 0.3rem 1.2rem;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.15rem;
    border: 2px solid var(--ink);
    box-shadow: 4px 4px 0 var(--cyan);
  }
  .cover-url { background: var(--magenta); }
  .cover-contact { background: #fff; }

  /* diapositiva de producto: fotos arriba (las primeras dos), banda de texto abajo */
  .product { display: flex; flex-direction: column; }
  .product + .product { border-top: none; }

  .gallery-wrap { flex: 1; min-height: 0; }
  .gallery { display: flex; gap: 0; overflow: hidden; padding: 0; height: 100%; }
  .gallery img {
    width: 50%;
    height: 100%;
    object-fit: cover;
    border: none;
    box-shadow: none;
  }
  .gallery img:first-child { border-right: 2px solid var(--ink); }
  .gallery img:only-child { width: 100%; border-right: none; }
  /* ponytail: solo las primeras dos fotos entran a la diapositiva */
  .gallery img:nth-child(n+3) { display: none; }

  .info {
    flex-shrink: 0;
    border-top: 2px solid var(--ink);
    padding: 1.3rem 2.25rem 1.2rem;
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 1.75rem;
    align-items: center;
  }
  .product h2 { grid-column: 1; margin: 0 0 0.2rem; font-size: 1.7rem; line-height: 1.1; }
  .price { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
  .tag { padding: 0.5rem 1.5rem; font-weight: 800; font-size: 2rem; box-shadow: 5px 5px 0 var(--cyan); }
  /* ponytail: en el PDF la descripción se recorta a ~2 líneas; sé breve */
  .desc { grid-column: 1; font-size: 0.9rem; line-height: 1.45; max-height: 2.9em; overflow: hidden; }

}
