/* Propuesta A · Librería: la portada de una librería de regalos. Fondo claro, tarjetas blancas,
   el rojo como la mesa donde se abren en abanico las libretas y los dulces. */
:root {
  --display: "Gabarito", "Onest", system-ui, sans-serif;
  --texto: "Onest", system-ui, sans-serif;
  --m: clamp(16px, 4vw, 48px);
  --ancho: 1280px;
  --radio: 22px;
  /* taste-skill-ignore: profundidad pedida por el usuario; solo en lo que flota y en los objetos */
  --sombra: 0 18px 44px -26px rgb(0 0 0 / 0.4), 0 2px 6px -3px rgb(0 0 0 / 0.12);
  --sombra-libro: 0 34px 50px -26px rgb(0 0 0 / 0.6), 0 8px 16px -10px rgb(0 0 0 / 0.4);
  interpolate-size: allow-keywords;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--fondo); color: var(--tinta);
  font: 400 17px/1.6 var(--texto); -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.025em; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--rojo); outline-offset: 3px; border-radius: 8px; }
.pedir :focus-visible, .pie :focus-visible { outline-color: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.envoltura { width: 100%; max-width: calc(var(--ancho) + 2 * var(--m)); margin-inline: auto; padding-inline: var(--m); }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 15px/1 var(--texto); text-decoration: none; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 180ms ease, color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-chico { min-height: 44px; padding: 0 18px; }
.btn-rojo { background: var(--rojo); color: var(--sobre-rojo); }
.btn-blanco { background: #fff; color: var(--rojo); }
.btn-claro { background: var(--fondo); color: var(--tinta); }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) {
  .btn-rojo:hover { background: var(--rojo-hondo); }
  .btn-blanco:hover { background: #ffeef0; }
  .btn-claro:hover { background: var(--superficie); }
}

/* ---------- héroe ---------- */
.heroe { position: relative; text-align: center; padding-top: clamp(24px, 3vw, 40px); overflow: clip; }
.heroe-texto { padding-inline: var(--m); }
/* el logo original es el titular de la página */
.logo-grande { width: min(100%, clamp(260px, 36vw, 500px)); margin-inline: auto; }
.logo-grande img { width: 100%; }
.entrada { max-width: 54ch; margin: 18px auto 0; font-size: clamp(17px, 1.4vw, 19px); }
.heroe-accion { margin-top: 26px; }
.btn-grande { min-height: 56px; padding: 0 34px; font-size: 16px; }

/* la mesa roja con las libretas en abanico, completas y paradas sobre ella */
.abanico {
  position: relative; height: clamp(320px, 27vw, 390px); margin-top: clamp(24px, 2.5vw, 36px);
  max-width: 1240px; margin-inline: auto;
}
.abanico::before {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 100vw; height: 34%; translate: -50% 0;
  background: var(--rojo);
}
.pieza {
  position: absolute; left: calc(var(--x) + var(--corre, 0%)); bottom: var(--y); z-index: var(--z, 1);
  padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transform: rotate(var(--r, 0deg));
  transition: transform 900ms var(--ease-out) calc(var(--d, 0) * 70ms + 120ms);
}
.pieza .cara { display: block; position: relative; transition: transform 260ms var(--ease-out); }
.pieza:active .cara { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .pieza:hover .cara { transform: translateY(-12px); }
  .pieza:hover:active .cara { transform: translateY(-12px) scale(0.98); }
}
.pieza-nombre { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* cada lugar del abanico tiene un ancho para libreta (--wl) y otro para producto (--wo), y los productos que caen
   en un lugar de atrás suben (--yo) para no hundirse en la mesa: cualquier diseño cabe en cualquier lugar */
.pieza.libreta { width: var(--wl); }
.pieza.objeto { width: var(--wo); bottom: var(--yo, var(--y)); }
/* con cuatro piezas se usan los lugares 1 a 4; se corre el grupo para que quede centrado */
.abanico[data-piezas="4"] { --corre: 10%; }
.libreta .cara { aspect-ratio: var(--proporcion, 400 / 566); }
.libreta .cara img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px 10px 10px 3px; box-shadow: var(--sombra-libro); }
/* espiral de la libreta, en el lomo (taste-skill-ignore: es el material de la libreta, no decoración) */
.libreta .cara::before {
  content: ""; position: absolute; left: -3%; top: 3%; bottom: 3%; width: 7%; z-index: 1;
  background: repeating-linear-gradient(to bottom, transparent 0 7px, #2a2426 7px 10px, transparent 10px 14px);
  border-radius: 4px;
}
.objeto .cara img { width: 100%; filter: drop-shadow(0 26px 22px rgb(0 0 0 / 0.38)) drop-shadow(0 6px 6px rgb(0 0 0 / 0.2)); }
.p1 { --x: 2%;  --y: 7%;  --yo: 16%; --wl: 19%; --wo: 20%; --r: -10deg; --z: 1; --dx: 130%; --d: 1; }
.p2 { --x: 20%; --y: 10%; --yo: 18%; --wl: 20%; --wo: 23%; --r: -5deg;  --z: 2; --dx: 60%;  --d: 2; }
.p3 { --x: 39%; --y: 5%;  --yo: 16%; --wl: 22%; --wo: 24%; --r: 0deg;   --z: 3; --dx: 0%;   --d: 0; }
.p4 { --x: 58%; --y: 10%; --yo: 18%; --wl: 20%; --wo: 23%; --r: 5deg;   --z: 2; --dx: -60%; --d: 2; }
.p5 { --x: 77%; --y: 7%;  --yo: 16%; --wl: 19%; --wo: 20%; --r: 10deg;  --z: 1; --dx: -130%; --d: 1; }
@media (max-width: 700px) {
  .heroe { padding-top: 28px; }
  .entrada { margin-top: 14px; }
  .heroe-accion { margin-top: 22px; }
  .abanico { height: 290px; margin-top: 16px; }
  .p1 { --x: 1%;   --wl: 27%; --wo: 30%; --y: 8%;  --yo: 14%; }
  .p2 { --x: 15%;  --wl: 29%; --wo: 34%; --y: 13%; --yo: 16%; }
  .p3 { --x: 31%;  --wl: 38%; --wo: 40%; --y: 6%;  --yo: 14%; }
  .p4 { --x: 56%;  --wl: 29%; --wo: 34%; --y: 13%; --yo: 16%; }
  .p5 { --x: 72%;  --wl: 27%; --wo: 30%; --y: 8%;  --yo: 14%; }
}

/* ---------- títulos de sección ---------- */
.seccion-cabeza { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.seccion-cabeza h2 { max-width: 14ch; font-size: clamp(34px, 4.4vw, 58px); line-height: 1.02; letter-spacing: -0.03em; }
.seccion-cabeza p { max-width: 52ch; margin-top: 16px; }

/* ---------- catálogo ---------- */
.catalogo { padding-block: clamp(56px, 7vw, 96px) clamp(80px, 10vw, 136px); }
/* dos filas de filtros con su nombre al lado: qué producto y para qué ocasión */
.filtros-barra { display: grid; gap: 12px; margin-top: 36px; }
.filtro-fila { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 12px; }
.filtro-nombre { font-size: 15px; font-weight: 600; color: var(--tenue); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--superficie); outline: 1px solid var(--linea); outline-offset: -1px; font-weight: 600; font-size: 15px;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] { background: var(--rojo); color: var(--sobre-rojo); outline-color: var(--rojo); }
@media (hover: hover) and (pointer: fine) { .chip:not([aria-pressed="true"]):hover { background: var(--acento-2); } }
#conteo { font-size: 15px; color: var(--tenue); padding-left: 104px; }
.rejilla { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 20px; }
.rejilla li[hidden] { display: none; }
.tarjeta-boton {
  display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tarjeta-panel {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--radio);
  background: var(--tint); overflow: hidden; transition: transform 220ms var(--ease-out);
}
.tarjeta-boton:active .tarjeta-panel { transform: scale(0.98); }
.tarjeta-panel .cara { width: 80%; transition: transform 260ms var(--ease-out); }
.tarjeta-panel .cara img { width: 100%; filter: drop-shadow(0 18px 16px rgb(0 0 0 / 0.3)); }
[data-tipo="Libretas"] .tarjeta-panel .cara { width: 54%; }
[data-tipo="Libretas"] .tarjeta-panel .cara img { filter: none; border-radius: 3px 8px 8px 3px; box-shadow: var(--sombra-libro); }
.ver3d {
  position: absolute; top: 12px; right: 12px; padding: 5px 10px; border-radius: 999px;
  background: var(--superficie); font-size: 14px; font-weight: 600; line-height: 1.2;
}
.real {
  display: none; position: absolute; top: 12px; left: 12px; padding: 5px 10px; border-radius: 999px;
  background: var(--rojo); color: var(--sobre-rojo); font-size: 14px; font-weight: 600; line-height: 1.2;
}
[data-real] .real { display: block; }
.tarjeta-titulo { display: block; margin-top: 14px; font: 700 22px/1.2 var(--display); letter-spacing: -0.015em; }
.tarjeta-meta { display: block; margin-top: 4px; font-size: 15px; color: var(--tenue); }
@media (hover: hover) and (pointer: fine) { .tarjeta-boton:hover .tarjeta-panel .cara { transform: translateY(-8px) rotate(-2deg); } }
.vacio { margin-top: 28px; padding: 48px 24px; border-radius: var(--radio); background: var(--superficie); text-align: center; }
.vacio[hidden] { display: none; }
.vacio p { font-size: 18px; }
.vacio-acciones { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
@media (max-width: 1100px) { .rejilla { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .filtro-fila { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #conteo { padding-left: 0; }
  .chip { min-height: 40px; padding: 0 14px; font-size: 14px; }
  .rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .tarjeta-titulo { font-size: 17px; }
  .tarjeta-meta { font-size: 14px; }
  .ver3d { top: 8px; right: 8px; }
  .real { top: 8px; left: 8px; }
  [data-real] .ver3d { display: none; }
}

/* ---------- hecho a mano / cómo pedir ---------- */
.pedir { background: var(--rojo); color: var(--sobre-rojo); padding-block: clamp(72px, 9vw, 128px); overflow: clip; }
.pedir-rejilla { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.pedir h2 { font-size: clamp(34px, 4.4vw, 58px); line-height: 1.02; letter-spacing: -0.03em; max-width: 12ch; }
.pedir-entrada { margin-top: 16px; max-width: 46ch; }
.pasos { list-style: none; margin: 36px 0 40px; padding: 0; display: grid; gap: 24px; counter-reset: paso; }
.pasos li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 18px; counter-increment: paso; max-width: 52ch; }
.pasos li::before {
  content: counter(paso); grid-row: 1 / 3; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; background: #fff; color: var(--rojo); font: 700 18px/1 var(--display);
}
.pasos h3 { font-size: 22px; line-height: 1.2; letter-spacing: -0.015em; padding-top: 8px; }
.pasos p { color: var(--sobre-rojo-tenue); }
.hojas { position: relative; margin: 0; height: clamp(380px, 40vw, 540px); }
.hoja {
  position: absolute; width: 50%; border-radius: 4px;
  box-shadow: 0 40px 60px -30px rgb(0 0 0 / 0.65), 0 10px 20px -12px rgb(0 0 0 / 0.45);
  transition: transform 900ms var(--ease-out);
}
.hoja.h1 { left: 0; top: 8%; transform: rotate(-8deg); }
.hoja.h2 { left: 24%; top: 0; transform: rotate(2deg); z-index: 1; }
.hoja.h3 { left: 47%; top: 10%; transform: rotate(9deg); }
.motion .pedir:not(.in) .hoja { transform: rotate(0deg) translateY(30px); }
.hojas figcaption { position: absolute; left: 0; right: 0; bottom: -8px; font-size: 14px; color: var(--sobre-rojo-tenue); text-align: center; }
@media (max-width: 860px) {
  .pedir-rejilla { grid-template-columns: minmax(0, 1fr); }
  .hojas { height: clamp(300px, 80vw, 420px); margin-bottom: 24px; }
}

/* ---------- preguntas ---------- */
.preguntas { padding-block: clamp(80px, 10vw, 136px); }
.preguntas-rejilla { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(40px, 6vw, 88px); align-items: start; }
.preguntas-lado h2 { font-size: clamp(34px, 4.4vw, 58px); line-height: 1.02; letter-spacing: -0.03em; max-width: 11ch; }
.preguntas-lado > p { margin-top: 16px; max-width: 40ch; }
.tarjeta-ayuda {
  display: flex; gap: 20px; align-items: center; margin-top: 36px; padding: 18px; max-width: 460px;
  background: var(--superficie); border-radius: var(--radio);
}
.tarjeta-ayuda img { width: 92px; flex: none; border-radius: 3px 8px 8px 3px; rotate: -4deg; box-shadow: var(--sombra-libro); }
.tarjeta-ayuda h3 { font-size: 22px; line-height: 1.2; }
.tarjeta-ayuda p { margin: 6px 0 14px; font-size: 15px; color: var(--tenue); }
.acordeon { display: grid; gap: 10px; }
.acordeon details { background: var(--superficie); border-radius: 18px; }
.acordeon summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 24px; cursor: pointer;
  list-style: none; font: 700 19px/1.3 var(--display); letter-spacing: -0.01em; border-radius: 18px;
}
.acordeon summary::-webkit-details-marker { display: none; }
.acordeon summary:active::after { scale: 0.92; }
.acordeon summary::after {
  content: ""; flex: none; width: 32px; height: 32px; border-radius: 50%;
  /* taste-skill-ignore: dos barras planas que dibujan el signo + */
  background:
    linear-gradient(currentColor, currentColor) center / 12px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 12px no-repeat,
    var(--fondo);
  transition: rotate 220ms var(--ease-out), scale 160ms var(--ease-out), background-color 160ms ease;
}
.acordeon details[open] summary::after { rotate: 45deg; color: var(--sobre-rojo); background-color: var(--rojo); }
.acordeon details p { padding: 0 24px 22px; color: var(--tenue); max-width: 62ch; }
.acordeon details::details-content { block-size: 0; overflow: clip; transition: block-size 260ms var(--ease-out), content-visibility 260ms allow-discrete; }
.acordeon details[open]::details-content { block-size: auto; }
@media (max-width: 860px) { .preguntas-rejilla { grid-template-columns: minmax(0, 1fr); } }

/* ---------- pie ---------- */
.pie { background: var(--rojo); color: var(--sobre-rojo); padding: 64px 0 120px; }
.pie-rejilla { display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto auto; gap: 40px 64px; align-items: start; }
.pie-marca img { width: 220px; }
.pie-marca p { margin-top: 10px; color: var(--sobre-rojo-tenue); max-width: 30ch; }
.pie-col h2 { font: 700 15px/1.3 var(--display); letter-spacing: 0; color: var(--sobre-rojo-tenue); }
.pie-col p { margin-top: 10px; line-height: 1.9; }
.pie a:not(.btn) { color: #fff; font-weight: 600; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .pie a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; } }
@media (max-width: 860px) { .pie-rejilla { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pie-marca { grid-column: 1 / -1; } .pie .btn { grid-column: 1 / -1; justify-self: start; } }

@media (max-width: 700px) { .seccion-cabeza { flex-wrap: wrap; } }

/* dos productos flotan arriba, a los lados del logo: el grande a la izquierda, el chico a la derecha */
.vuela {
  position: absolute; z-index: 6; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  width: var(--w); rotate: var(--r);
  animation: flotar var(--t) ease-in-out infinite alternate;
  transition: opacity 700ms var(--ease-out) 600ms, scale 800ms var(--ease-out) 600ms;
}
.v1 { --w: clamp(150px, 17vw, 250px); --r: -14deg; --t: 3.4s; left: max(2%, calc(50% - 600px)); top: clamp(60px, 9vw, 130px); }
.v2 { --w: clamp(96px, 10.5vw, 160px); --r: 12deg; --t: 2.8s; right: max(4%, calc(50% - 560px)); top: clamp(190px, 21vw, 300px); animation-delay: -1.2s; }
.vuela .cara { display: block; transition: transform 260ms var(--ease-out); }
/* sombra larga y suave: el objeto está en el aire, lejos de la mesa */
.vuela .cara img { width: 100%; filter: drop-shadow(0 46px 30px rgb(0 0 0 / 0.22)) drop-shadow(0 8px 10px rgb(0 0 0 / 0.14)); }
.vuela:active .cara { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .vuela:hover .cara { transform: scale(1.05); } .vuela:hover:active .cara { transform: scale(1.01); } }
@keyframes flotar { from { translate: 0 0; } to { translate: 0 -16px; rotate: calc(var(--r) + 3deg); } }
@media (max-width: 860px) {
  .v1 { --w: 128px; left: -6px; top: auto; bottom: 236px; }
  .v2 { --w: 84px; right: 6px; top: auto; bottom: 300px; }
}
@media (prefers-reduced-motion: reduce) { .vuela { animation: none; } }
.motion .heroe:not(.in) .vuela { opacity: 0; scale: 0.9; }

/* ---------- entrada: el abanico se abre una vez; lo demás sube suave ---------- */
.motion .heroe:not(.in) .pieza { transform: translateX(var(--dx)) translateY(40px) rotate(0deg); }
.motion [data-grupo] [data-rise] {
  opacity: 0; translate: 0 14px;
  transition: opacity 420ms var(--ease-out) calc(var(--i, 0) * 60ms), translate 480ms var(--ease-out) calc(var(--i, 0) * 60ms);
}
.motion [data-grupo].in [data-rise] { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  .pieza, .hoja, .acordeon details::details-content { transition: none; }
}
