/* Catálogo en vista "Revista" (solo computadora). La arma static/js/revista.js
   a partir de las mismas tarjetas de productos_grid.html. Las medidas en cqw son
   % del ancho del libro abierto (cada página mide 50cqw). */
.rv-vista { display: none; align-items: center; background: #fff; border: 1px solid #d1d5db; border-radius: 10px; padding: 3px; gap: 2px; }
.rv-vista span { font-size: 12px; color: #6b7280; padding: 0 8px; font-weight: 600; }
.rv-vista button { border: 0; background: none; border-radius: 7px; padding: 5px 11px; font-weight: 700; font-size: 13px; color: #6b7280; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.rv-vista button[aria-pressed="true"] { background: #2563eb; color: #fff; }
.rv-vista svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

.rv { --papel: #fbf8f1; --tinta-papel: #1d1a14; --gris-papel: #6b6253; --linea-papel: #d8cfbc; --portada: #133d25;
      --f-revista: 'Instrument Serif', Georgia, serif;
      display: none; gap: 12px; justify-items: center; margin-bottom: 8px; }
.rv-escena { position: relative; width: 100%; max-width: min(1060px, calc((100vh - 200px) * 1.5)); min-width: min(100%, 720px); perspective: 2600px; }
.rv-libro { position: relative; display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 1.5; filter: drop-shadow(0 22px 30px rgba(0,0,0,.2)); container-type: inline-size; }
.rv-pag { position: relative; background: var(--papel); color: var(--tinta-papel); overflow: hidden; padding: 2.2cqw 2.4cqw 1.2cqw; display: grid; grid-template-rows: auto 1fr auto; }
.rv-pag.izq { border-radius: 6px 0 0 6px; box-shadow: inset -26px 0 30px -18px rgba(0,0,0,.22); }
.rv-pag.der { border-radius: 0 6px 6px 0; box-shadow: inset 26px 0 30px -18px rgba(0,0,0,.22); }
.rv-pag.vacia { background: var(--papel); }
.rv-cab { display: flex; justify-content: space-between; gap: 1cqw; font-size: 1cqw; font-weight: 800; letter-spacing: .15cqw; text-transform: uppercase; color: var(--gris-papel); border-bottom: 1px solid var(--linea-papel); padding-bottom: .7cqw; }
.rv-cab span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1.8cqw 2.2cqw; padding-top: 1.4cqw; min-height: 0; }
.rv-item { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: .4cqw; min-height: 0; color: inherit; }
.rv-item > a.rv-foto { display: block; min-height: 0; }
.rv-item img { width: 100%; height: 100%; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.rv-item.agotado img { opacity: .45; }
.rv-sellos { position: absolute; top: 0; left: 0; display: flex; flex-direction: column; gap: .3cqw; align-items: flex-start; z-index: 1; }
.rv-sello { background: #dc2626; color: #fff; font-size: .95cqw; font-weight: 800; padding: .2cqw .5cqw; border-radius: .3cqw; letter-spacing: .05cqw; text-transform: uppercase; }
.rv-sello.combo { background: #9333ea; max-width: 12cqw; line-height: 1.2; }
.rv-sello.agot { background: #4b5563; }
.rv-cod { font-size: .95cqw; color: var(--gris-papel); font-family: ui-monospace, monospace; }
.rv-nom { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 1.25cqw; font-weight: 600; line-height: 1.3; color: var(--tinta-papel); text-decoration: none; }
.rv-nom:hover { color: #2563eb; }
.rv-linea2 { display: flex; gap: .4cqw; align-items: center; flex-wrap: wrap; margin: .3cqw 0; }
.rv-marca { color: #2563eb; font-size: 1.05cqw; font-weight: 600; }
.rv-dsp { font-size: .9cqw; border-radius: 99px; padding: .05cqw .5cqw; border: 1px solid #bbf7d0; background: #ecfdf3; color: #15803d; white-space: nowrap; }
.rv-dsp.t24 { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.rv-dsp.res { border-color: #fed7aa; background: #fff7ed; color: #c2410c; }
.rv-dsp.otro { border-color: #d1d5db; background: #f9fafb; color: #6b7280; }
.rv-vol { display: inline-block; background: #16a34a; color: #fff; font-size: .85cqw; font-weight: 700; padding: .15cqw .4cqw; border-radius: .3cqw; }
.rv-pie { display: flex; justify-content: space-between; align-items: flex-end; gap: .8cqw; margin-top: .3cqw; }
.rv-precio { font-family: var(--f-revista); color: var(--tinta-papel); font-size: 2.5cqw; line-height: 1; }
.rv-precio.promo { color: #dc2626; }
.rv-precio small { font-family: system-ui, sans-serif; font-size: .9cqw; color: #6b7280; margin-left: .2cqw; }
.rv-precio s { display: block; font-family: system-ui, sans-serif; font-size: .9cqw; color: #9ca3af; }
.rv-precio em { display: block; font-family: system-ui, sans-serif; font-style: normal; font-size: .85cqw; color: #ef4444; margin-top: .2cqw; }
.rv-sesion { font-size: 1cqw; color: #9ca3af; font-style: italic; }
.rv-item .quick-add-btn { border: 0; background: #2563eb; color: #fff; border-radius: .6cqw; padding: .45cqw .9cqw; font-size: 1cqw; font-weight: 600; display: inline-flex; gap: .3cqw; align-items: center; cursor: pointer; white-space: nowrap; }
.rv-item .quick-add-btn:hover { background: #1d4ed8; }
.rv-item .quick-add-btn svg { width: 1.1cqw; height: 1.1cqw; fill: none; stroke: currentColor; stroke-width: 2.2; }
.rv-num { font-family: var(--f-revista); font-style: italic; font-size: 1.2cqw; color: var(--gris-papel); text-align: center; padding-top: .4cqw; }

.rv-portada { background: radial-gradient(120% 90% at 20% 10%, #2f7a4d, var(--portada) 70%); color: #f7f3e8; align-items: center; padding: 3.4cqw; }
.rv-eyebrow { font-weight: 800; letter-spacing: .3cqw; font-size: 1.05cqw; text-transform: uppercase; opacity: .85; }
.rv-portada h2 { font-family: var(--f-revista); font-weight: 400; font-size: 5.6cqw; line-height: .95; margin: 0; overflow-wrap: anywhere; }
.rv-portada h2.largo { font-size: 4cqw; }
.rv-portada h2 i { color: #f2c94c; }
.rv-bajada { font-size: 1.3cqw; font-weight: 500; opacity: .92; max-width: 34ch; line-height: 1.45; margin: 1cqw 0 0; }
.rv-foto-p { justify-self: end; width: 62%; background: #fff; border-radius: .8cqw; padding: 1cqw; transform: rotate(-3deg); box-shadow: 0 18px 30px rgba(0,0,0,.35); }
.rv-foto-p img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; }
.rv-logo-p { height: 3.2cqw; max-width: 18cqw; object-fit: contain; object-position: left; filter: brightness(0) invert(1); opacity: .9; }

.rv-hoja { position: absolute; top: 0; bottom: 0; width: 50%; transform-style: preserve-3d; z-index: 5; }
.rv-hoja.adelante { left: 50%; transform-origin: left center; }
.rv-hoja.atras { left: 0; transform-origin: right center; }
.rv-cara { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.rv-cara > .rv-pag { position: absolute; inset: 0; }
.rv-cara.dorso { transform: rotateY(180deg); }
.rv-cara::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.rv-hoja.adelante .frente::after { background: linear-gradient(90deg, rgba(0,0,0,.25), transparent 40%); }
.rv-hoja.adelante .dorso::after { background: linear-gradient(270deg, rgba(0,0,0,.28), transparent 45%); }
.rv-hoja.atras .frente::after { background: linear-gradient(270deg, rgba(0,0,0,.25), transparent 40%); }
.rv-hoja.atras .dorso::after { background: linear-gradient(90deg, rgba(0,0,0,.28), transparent 45%); }
@keyframes rv-adelante { from { transform: rotateY(0) } to { transform: rotateY(-180deg) } }
@keyframes rv-atras { from { transform: rotateY(0) } to { transform: rotateY(180deg) } }
@keyframes rv-sombra { 0%, 100% { opacity: 0 } 50% { opacity: 1 } }
.rv-hoja.adelante.anim { animation: rv-adelante .85s cubic-bezier(.45,.05,.25,1) forwards; }
.rv-hoja.atras.anim { animation: rv-atras .85s cubic-bezier(.45,.05,.25,1) forwards; }
.rv-hoja.anim .rv-cara::after { animation: rv-sombra .85s ease-in-out; }
.rv-esquina { position: absolute; top: 0; bottom: 0; width: 5%; border: 0; background: none; z-index: 6; cursor: pointer; }
.rv-esquina.sig { right: 0; } .rv-esquina.ant { left: 0; }
.rv-esquina.sig:hover { background: linear-gradient(270deg, rgba(0,0,0,.07), transparent); }
.rv-esquina.ant:hover { background: linear-gradient(90deg, rgba(0,0,0,.07), transparent); }
.rv-esquina[disabled] { pointer-events: none; }
.rv-mando { display: flex; align-items: center; gap: 14px; color: #6b7280; font-size: 13px; font-weight: 600; }
.rv-mando button { border: 1px solid #e5e7eb; background: #fff; border-radius: 99px; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; }
.rv-mando button[disabled] { opacity: .35; cursor: default; }
.rv-mando svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.rv-puntos { display: flex; gap: 6px; }
.rv-puntos i { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; }
.rv-puntos i.on { background: #2563eb; width: 22px; border-radius: 99px; }
.rv-pista { font-size: 12px; color: #6b7280; margin: 0; }

/* Solo en computadora: en pantallas angostas no hay selector y siempre se ve la lista */
@media (min-width: 1024px) {
    .rv-vista { display: inline-flex; }
    body.vista-revista .rv { display: grid; }
    body.vista-revista #resultados [data-rv-cliente] { display: none; }
}
@media (prefers-reduced-motion: reduce) { .rv-hoja.anim { animation-duration: .01s !important; } .rv-hoja.anim .rv-cara::after { animation: none; } }
.rv.sin { display: none !important; }
