/* ───────────── Cabecera ───────────── */
.cabecera {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 18px var(--gutter) 0;
}
.marca .sello {
  width: 84px;
  height: 84px;
}
.marca img {
  width: 84px;
  height: 84px;
}
.lema {
  margin: 0;
  color: var(--tinta-suave);
  font-size: var(--t-s);
  line-height: 1.4;
}
.ver-pedido {
  min-height: 44px;
  padding: 0 4px;
  font-weight: 600;
  font-size: var(--t-m);
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
}
.ver-pedido .cuenta {
  color: var(--ciruela);
  font-family: var(--f-libro);
  font-weight: 500;
  display: inline-block;
}
.ver-pedido:hover span:first-child {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.ver-pedido .cuenta.late {
  animation: late 420ms var(--ease);
}
@keyframes late {
  30% {
    transform: scale(1.35);
  }
}
@media (max-width: 640px) {
  .cabecera {
    grid-template-columns: auto 1fr;
    gap: 12px;
  }
  .marca .sello,
  .marca img {
    width: 64px;
    height: 64px;
  }
  .lema {
    display: none;
  }
  .ver-pedido {
    justify-self: end;
  }
}

/* ───────────── Buscador: el paréntesis ───────────── */
.buscador {
  padding: clamp(8px, 3vw, 28px) var(--gutter) 0;
}
.parentesis {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1040px;
  margin: 0 auto;
}
.paren {
  font-family: var(--f-libro);
  font-weight: 300;
  font-size: clamp(110px, 19vw, 236px);
  line-height: 1;
  color: var(--ciruela);
  user-select: none;
  flex: none;
  transform: translateY(-0.06em);
  font-variation-settings: 'opsz' 72;
}
.campo-q {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}
/* Cursor de mentira: titila al principio mientras el buscador está vacío,
   para que se lea como un lugar donde escribir. Al tocar, aparece el cursor real. */
.cursor {
  position: absolute;
  left: 0.36em;
  top: 50%;
  width: max(2px, 0.055em);
  height: 1.05em;
  border-radius: 1px;
  font-size: clamp(22px, 4.2vw, 50px);
  background: var(--ciruela);
  transform: translateY(-50%);
  pointer-events: none;
  animation: titila 1.1s steps(1) infinite;
}
.campo-q:has(input:focus) .cursor,
.campo-q:has(input:not(:placeholder-shown)) .cursor {
  display: none;
}
@keyframes titila {
  50% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }
}
.parentesis input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 1.6em;
  padding: 0 0.3em;
  border: 0;
  background: transparent;
  font-family: var(--f-libro);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(22px, 4.2vw, 50px);
  text-align: left;
  padding-left: 0.5em;
  color: var(--tinta);
  caret-color: var(--ciruela);
  border-radius: 0;
}
.parentesis input::placeholder {
  color: var(--tinta-suave);
  opacity: 0.75;
}
.parentesis input:focus {
  outline: none;
}
.parentesis input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.parentesis:focus-within .paren {
  color: var(--ciruela-hondo);
}
.resumen {
  margin: -0.4em 0 0;
  text-align: center;
  color: var(--tinta-suave);
  font-size: var(--t-s);
  min-height: 1.45em;
}

/* La apertura: los paréntesis se separan una sola vez, al llegar */
.js .parentesis.abriendo .abre {
  animation: abre 900ms var(--ease) both;
}
.js .parentesis.abriendo .cierra {
  animation: cierra 900ms var(--ease) both;
}
.js .parentesis.abriendo input {
  animation: aparece 600ms 380ms ease both;
}
@keyframes abre {
  from {
    transform: translate(min(34vw, 380px), -0.06em);
  }
}
@keyframes cierra {
  from {
    transform: translate(max(-34vw, -380px), -0.06em);
  }
}
@keyframes aparece {
  from {
    opacity: 0;
  }
}

/* ───────────── Estantes y orden ───────────── */
.filtros {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px 28px;
  padding: 10px var(--gutter);
  margin-top: clamp(12px, 3vw, 28px);
  background: var(--papel);
  border-bottom: 1px solid var(--raya);
}
.estantes {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
}
.estantes button {
  min-height: 40px;
  padding: 0 6px;
  font-size: var(--t-s);
  color: var(--tinta-suave);
  white-space: nowrap;
  transition: color 140ms ease;
}
.estantes button:hover {
  color: var(--tinta);
}
.estantes sup {
  font-size: 0.68em;
  margin-left: 2px;
  font-variant-numeric: tabular-nums;
}
.estantes button::before,
.estantes button::after {
  font-family: var(--f-libro);
  font-size: 1.15em;
  color: var(--ciruela);
  opacity: 0;
  display: inline-block;
  transition: opacity 160ms ease, transform 220ms var(--ease);
}
.estantes button::before {
  content: '(';
  transform: translateX(-4px);
  margin-right: 1px;
}
.estantes button::after {
  content: ')';
  transform: translateX(4px);
  margin-left: 1px;
}
.estantes button[aria-pressed='true'] {
  color: var(--tinta);
  font-weight: 600;
}
.estantes button[aria-pressed='true']::before,
.estantes button[aria-pressed='true']::after {
  opacity: 1;
  transform: none;
}
.ajustes {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: none;
  font-size: var(--t-s);
}
.solo-usados {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  cursor: pointer;
  color: var(--tinta-suave);
}
.solo-usados input {
  width: 18px;
  height: 18px;
  accent-color: var(--ciruela);
  margin: 0;
}
.orden {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tinta-suave);
}
.orden select {
  border: 0;
  background: transparent;
  color: var(--tinta);
  font-weight: 600;
  min-height: 40px;
  padding-right: 4px;
  cursor: pointer;
}
/* "Solo usados": casilla propia, no la del navegador */
.solo-usados input {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--estante);
  border-radius: 3px;
  background: var(--papel);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.solo-usados input::after {
  content: '';
  width: 5px;
  height: 10px;
  margin-top: -2px;
  border: solid var(--papel);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 160ms var(--ease);
}
.solo-usados input:checked {
  background: var(--ciruela);
  border-color: var(--ciruela);
}
.solo-usados input:checked::after {
  transform: rotate(45deg) scale(1);
}
.solo-usados:has(input:checked) {
  color: var(--tinta);
  font-weight: 600;
}
.solo-usados:hover input {
  border-color: var(--ciruela);
}

/* "Ordenar": menú propio, no el desplegable del navegador */
.orden {
  position: relative;
}
.orden-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 2px;
  color: var(--tinta);
  font-weight: 600;
  white-space: nowrap;
}
.orden-btn svg {
  width: 16px;
  height: 16px;
  color: var(--ciruela);
  transition: transform 200ms var(--ease);
}
.orden-btn[aria-expanded='true'] svg {
  transform: rotate(180deg);
}
.orden-btn:hover #orden-valor {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.orden-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  min-width: 220px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--papel);
  border: 1px solid var(--raya);
  border-radius: 6px;
  box-shadow: 0 14px 30px -16px rgba(43, 22, 48, 0.5);
  transform-origin: top right;
  animation: menu-abre 160ms var(--ease);
  outline: none;
}
@keyframes menu-abre {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
}
.orden-menu li {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  cursor: pointer;
  font-size: var(--t-s);
  color: var(--tinta-suave);
}
.orden-menu li[aria-selected='true'] {
  color: var(--tinta);
  font-weight: 600;
}
.orden-menu li[aria-selected='true']::before,
.orden-menu li[aria-selected='true']::after {
  font-family: var(--f-libro);
  font-weight: 400;
  color: var(--ciruela);
}
.orden-menu li[aria-selected='true']::before {
  content: '(';
  margin-right: 1px;
}
.orden-menu li[aria-selected='true']::after {
  content: ')';
  margin-left: 1px;
}
.orden-menu li:hover,
.orden-menu li.activo {
  background: var(--pluma-clara);
  color: var(--tinta);
}

.estantes .corto {
  display: none;
}
.tira {
  flex: 1;
  min-width: 0;
}

.tira-flecha {
  display: none;
}

/* Tablet y celular: dos renglones y nada más.
   1) los estantes en una sola línea que se desliza, con flechas que avisan que hay más;
   2) "Solo usados" y el orden. */
@media (max-width: 900px) {
  .filtros {
    position: static;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 0 0;
  }
  .tira {
    position: relative;
    min-width: 0;
  }
  .estantes {
    flex-wrap: nowrap;
    gap: 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 0 calc(var(--gutter) - 6px);
    scroll-padding-inline: 48px;
  }
  .estantes::-webkit-scrollbar {
    display: none;
  }
  .estantes li {
    flex: none;
    scroll-snap-align: start;
  }
  .estantes button {
    min-height: 46px;
    font-size: var(--t-s);
  }
  .estantes .largo {
    display: none;
  }
  .estantes .corto {
    display: inline;
  }
  /* Flechas: aparecen solo del lado donde hay más estantes */
  .tira-flecha {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    width: 64px;
    color: var(--ciruela);
    transition: opacity 180ms ease;
  }
  .tira-flecha[hidden] {
    display: flex !important;
    opacity: 0;
    pointer-events: none;
  }
  .tira-flecha svg {
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 50%;
    background: var(--papel);
    box-shadow: 0 0 0 1.5px var(--raya);
  }
  .tira-flecha.der {
    right: 0;
    justify-content: flex-end;
    padding-right: max(8px, calc(var(--gutter) - 8px));
    background: linear-gradient(to right, transparent, var(--papel) 55%);
  }
  .tira-flecha.izq {
    left: 0;
    justify-content: flex-start;
    padding-left: max(8px, calc(var(--gutter) - 8px));
    background: linear-gradient(to left, transparent, var(--papel) 55%);
  }
  .tira-flecha:active svg {
    transform: scale(0.92);
  }
  .ajustes {
    justify-content: space-between;
    gap: 12px;
    margin: 0 var(--gutter);
    border-top: 1px solid var(--raya);
  }
}
@media (max-width: 640px) {
  .orden-label {
    color: var(--tinta-suave);
  }
  .orden-menu {
    min-width: 230px;
  }
  /* Cabecera y buscador más compactos: los libros aparecen antes */
  .cabecera {
    padding-top: 10px;
  }
  .buscador {
    padding-top: 0;
  }
  .paren {
    font-size: 92px;
  }
  .resumen {
    margin-top: -6px;
  }
}
@media (max-width: 380px) {
  .orden-label {
    display: none;
  }
}

/* ───────────── La estantería ───────────── */
.estanteria {
  padding: 8px var(--gutter) 80px;
  outline: none;
  min-height: 60vh;
}
.cargando,
.vacio {
  max-width: 34em;
  margin: 72px auto;
  text-align: center;
  font-family: var(--f-libro);
  font-size: var(--t-l);
  font-weight: 300;
  color: var(--tinta-suave);
}
.vacio p {
  margin: 0 0 20px;
}
.vacio em {
  color: var(--tinta);
}

.seccion {
  margin-top: 40px;
}
.seccion > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.seccion h2 {
  margin: 0;
  font-family: var(--f-libro);
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.seccion h2 .cant {
  font-size: 0.5em;
  color: var(--tinta-suave);
  font-weight: 400;
  vertical-align: super;
  margin-left: 4px;
}
.seccion > header button {
  font-size: var(--t-s);
  color: var(--ciruela);
  min-height: 40px;
  white-space: nowrap;
}
.seccion > header button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fila {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  column-gap: 0;
  row-gap: 44px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.libro {
  display: flex;
  flex-direction: column;
  padding: 0 14px;
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 360px;
}
.libro .tapa {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 244px;
  margin: 0 -14px;
  padding: 18px 20px 0;
  border-bottom: 3px solid var(--estante);
  cursor: pointer;
}
.libro .tapa img,
.libro .tapa .sin-foto {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: 1px 2px 2px 1px;
  box-shadow: 0 7px 10px -7px var(--sombra-libro), inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  transform-origin: 50% 100%;
  transition: transform 260ms var(--ease);
  background: var(--papel-2);
}
@media (hover: hover) and (pointer: fine) {
  .libro .tapa:hover img,
  .libro .tapa:hover .sin-foto {
    transform: translateY(-6px);
  }
}
.libro .tapa:active img {
  transform: translateY(-3px) scale(0.99);
}
.libro h3 {
  margin: 14px 0 3px;
  font-family: var(--f-libro);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.libro h3 a {
  text-decoration: none;
}
.libro h3 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.libro .autor {
  margin: 0;
  color: var(--tinta-suave);
  font-size: var(--t-s);
  line-height: 1.3;
}
.libro .linea {
  margin: 8px 0 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--t-s);
}
.libro .precio {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.libro .usado {
  font-family: var(--f-libro);
  font-style: italic;
  color: var(--tinta-suave);
}
.libro .en-pedido {
  color: var(--ciruela);
  font-weight: 600;
}
.libro.reservado .tapa img,
.libro.reservado .tapa .sin-foto {
  filter: grayscale(0.9);
  opacity: 0.55;
}
.libro.reservado .precio {
  font-weight: 400;
  font-family: var(--f-libro);
  font-style: italic;
  color: var(--tinta-suave);
}

/* Tapa tipográfica para libros sin foto */
.sin-foto {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 2 / 3;
  height: 100% !important;
  padding: 14px 12px;
  background: var(--ciruela) !important;
  color: #fbf3f8;
  font-family: var(--f-libro);
  text-align: left;
  overflow: hidden;
}
.sin-foto b {
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.2;
}
.sin-foto i {
  font-size: 0.78rem;
  opacity: 0.85;
}
.sin-foto::after {
  content: '( )';
  font-size: 1.2rem;
  opacity: 0.6;
  align-self: flex-end;
}

@media (max-width: 640px) {
  .seccion {
    margin-top: 32px;
  }
  .fila {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    row-gap: 32px;
  }
  .libro {
    padding: 0 10px;
  }
  .libro .tapa {
    height: 208px;
    margin: 0 -10px;
    padding: 14px 14px 0;
  }
}

/* ───────────── Ficha ───────────── */
.ficha-nav {
  display: flex;
  gap: 4px;
  margin-left: -10px;
}
.paso {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-family: var(--f-libro);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--tinta-suave);
}
.paso:hover {
  background: var(--pluma-clara);
  color: var(--tinta);
}
.paso[disabled] {
  opacity: 0.3;
  pointer-events: none;
}
.ficha .panel-cuerpo {
  padding-top: 0;
}
.ficha-tapa {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: min(46dvh, 380px);
  margin: 0 calc(-1 * var(--gutter-panel, 28px));
  padding: 28px 0 0;
  background: var(--papel-2);
  border-bottom: 3px solid var(--estante);
}
.ficha-tapa img,
.ficha-tapa .sin-foto {
  max-height: 100%;
  width: auto;
  box-shadow: 0 10px 16px -10px var(--sombra-libro);
  border-radius: 1px 3px 3px 1px;
}
.ficha-tapa .sin-foto b {
  font-size: 1.4rem;
}
.ficha h2 {
  margin: 26px 0 6px;
  font-family: var(--f-libro);
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.ficha .ficha-autor {
  margin: 0;
  font-size: var(--t-l);
  color: var(--tinta-suave);
  font-family: var(--f-libro);
  font-style: italic;
  font-weight: 300;
}
.ficha .ficha-autor button {
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--raya);
}
.ficha .ficha-autor button:hover {
  color: var(--ciruela);
  text-decoration-color: currentColor;
}
.ficha .sinopsis {
  margin: 22px 0 0;
  font-family: var(--f-libro);
  font-size: 1.0625rem;
  line-height: 1.68;
  max-width: 36em;
  text-wrap: pretty;
}
.ficha dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--raya);
  font-size: var(--t-s);
}
.ficha dt {
  color: var(--tinta-suave);
}
.ficha dd {
  margin: 0;
}
.ficha .compartir {
  margin-top: 22px;
  font-size: var(--t-s);
}
.ficha-pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ficha-pie .precio-grande {
  font-family: var(--f-libro);
  font-size: var(--t-xl);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ficha-pie .precio-grande small {
  display: block;
  font-family: var(--f-ui);
  font-size: var(--t-xs);
  color: var(--tinta-suave);
}
.ficha-pie .boton {
  flex: 1;
  max-width: 280px;
}

/* ───────────── Pedido ───────────── */
.items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 4px 14px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--raya);
}
.item img,
.item .sin-foto {
  width: 44px;
  height: auto;
  aspect-ratio: 2/3;
  object-fit: cover;
  grid-row: span 2;
  box-shadow: 0 4px 6px -4px var(--sombra-libro);
}
.item .sin-foto {
  height: 66px !important;
  padding: 0;
}
.item .sin-foto::after,
.item .sin-foto b,
.item .sin-foto i {
  display: none;
}
.item .t {
  font-family: var(--f-libro);
  font-weight: 500;
  line-height: 1.25;
}
.item .a {
  grid-column: 2;
  color: var(--tinta-suave);
  font-size: var(--t-s);
}
.item .p {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.item .quitar {
  grid-column: 3;
  font-size: var(--t-xs);
  color: var(--tinta-suave);
  text-decoration: underline;
  text-underline-offset: 3px;
  justify-self: end;
  min-height: 32px;
}
.item .quitar:hover {
  color: var(--error);
}
.item.no-disponible .t,
.item.no-disponible .p {
  text-decoration: line-through;
  color: var(--tinta-suave);
}
.item .aviso-item {
  grid-column: 2 / -1;
  color: var(--error);
  font-size: var(--t-xs);
  font-weight: 500;
}
.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0 4px;
  font-size: var(--t-l);
  font-family: var(--f-libro);
}
.total b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.nota-total {
  margin: 0;
  color: var(--tinta-suave);
  font-size: var(--t-xs);
}
.form-pedido {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}
.form-pedido h3 {
  margin: 0 0 -4px;
  font-family: var(--f-libro);
  font-weight: 500;
  font-size: var(--t-l);
}
.opciones {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}
.opciones legend {
  font-size: var(--t-s);
  font-weight: 600;
  margin-bottom: 6px;
  padding: 0;
}
.opcion {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 2px 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--raya);
  border-radius: var(--radio);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.opcion:hover {
  border-color: var(--estante);
}
.opcion:has(input:checked) {
  border-color: var(--ciruela);
  background: var(--pluma-clara);
}
.opcion input {
  margin: 3px 0 0;
  width: 18px;
  height: 18px;
  accent-color: var(--ciruela);
}
.opcion b {
  font-weight: 600;
}
.opcion small {
  grid-column: 2;
  color: var(--tinta-suave);
  font-size: var(--t-xs);
}
.pedido-vacio {
  padding: 40px 0;
  font-family: var(--f-libro);
  font-size: var(--t-l);
  font-weight: 300;
  color: var(--tinta-suave);
}
.pedido-vacio p {
  margin: 0 0 22px;
}
.pedido-pie {
  display: grid;
  gap: 8px;
}
.pedido-pie .boton {
  width: 100%;
}
.pedido-pie .legal {
  margin: 0;
  text-align: center;
  color: var(--tinta-suave);
  font-size: var(--t-xs);
}
.error-general {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--error);
  background: var(--pluma-clara);
  font-size: var(--t-s);
}

/* Pedido enviado */
.listo {
  padding: 18px 0;
}
.listo .gran-paren {
  font-family: var(--f-libro);
  font-weight: 300;
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  line-height: 1.1;
  margin: 0 0 18px;
  color: var(--ciruela);
}
.listo .gran-paren span {
  color: var(--tinta);
}
.listo p {
  font-family: var(--f-libro);
  font-size: 1.0625rem;
  line-height: 1.6;
  margin: 0 0 14px;
  max-width: 32em;
}
.listo .acciones {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

/* ───────────── Pie ───────────── */
.pie {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  padding: 40px var(--gutter) calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--raya);
  color: var(--tinta-suave);
  font-size: var(--t-s);
}
.pie-marca {
  display: flex;
  align-items: center;
  gap: 16px;
}
.pie-marca .sello,
.pie-marca img {
  width: 64px;
  height: 64px;
}
.pie-marca p {
  margin: 0;
  font-family: var(--f-libro);
  font-style: italic;
}
.pie-contacto {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.pie-contacto a {
  color: var(--tinta);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.pie-contacto a:hover {
  color: var(--ciruela);
}

/* ───────────── Barra de pedido (celular) ───────────── */
.barra-pedido {
  display: none;
}
@media (max-width: 640px) {
  .barra-pedido:not([hidden]) {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 0 18px;
    border-radius: 10px;
    background: var(--ciruela);
    color: var(--papel);
    font-weight: 600;
    box-shadow: 0 10px 24px -12px rgba(43, 22, 48, 0.6);
    animation: barra-sube 360ms var(--ease);
  }
  .barra-pedido:active {
    transform: scale(0.98);
  }
  .bp-n {
    font-family: var(--f-libro);
    font-weight: 500;
  }
  .bp-total {
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
    font-weight: 500;
  }
  .bp-ver {
    margin-left: auto;
  }
  body.con-barra .pie {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
  body.con-barra .aviso {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
}
@keyframes barra-sube {
  from {
    transform: translateY(120%);
  }
}

/* ─────────── paginado ─────────── */
.ver-estante {
  margin: 28px 0 0;
  text-align: center;
}

/* ─────────── tapa con distintivos ─────────── */
.libro .tapa .cubierta {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  transform-origin: 50% 100%;
  transition: transform 260ms var(--ease);
}
.libro .tapa .cubierta img {
  max-height: 226px;
}
.libro .tapa .cubierta .sin-foto {
  height: 226px !important;
  line-height: 1.2;
}
@media (hover: hover) and (pointer: fine) {
  .libro .tapa:hover .cubierta img,
  .libro .tapa:hover .cubierta .sin-foto {
    transform: none;
  }
  .libro .tapa:hover .cubierta {
    transform: translateY(-6px);
  }
}
.libro .tapa:active .cubierta img {
  transform: none;
}
.cubierta .cinta {
  position: absolute;
  top: -3px;
  left: 9px;
}
.cubierta .sellos {
  position: absolute;
  top: -12px;
  right: -14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
}
.libro.reservado .cubierta .cinta,
.libro.reservado .cubierta .sellos {
  opacity: 0.5;
}

/* ficha: tapa más grande, todos los sellos */
.ficha-tapa .cubierta {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.ficha-tapa .cubierta img {
  max-height: calc(min(46dvh, 380px) - 28px);
}
.ficha-tapa .cubierta .sin-foto {
  height: calc(min(46dvh, 380px) - 28px) !important;
  line-height: 1.2;
}
.ficha-tapa .cinta {
  width: 26px;
  height: 44px;
  padding-top: 7px;
  font-size: 14px;
  left: 14px;
}
.ficha-tapa .sellos {
  top: -14px;
  right: -40px;
}
.ficha-tapa .sellos .sello-redondo + .sello-redondo {
  margin-top: -14px;
  margin-right: 18px;
}

/* leyenda chica junto a "Solo usados" */
.leyenda-cinta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--tinta-suave);
  font-size: var(--t-xs);
}
.leyenda-cinta .cinta {
  width: 13px;
  height: 20px;
  padding-top: 3px;
  font-size: 8px;
}
.leyenda-cinta .cinta + * {
  margin-right: 6px;
}

/* Filtro por sello: al principio de la tira, con una mini roseta del color de cada sello */
.estantes .filtro-sello {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 4px;
  color: var(--tinta);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.estantes .filtro-sello::before,
.estantes .filtro-sello::after {
  content: none;
}
.mini-sello {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fondo);
  color: var(--tinta-mini);
  box-shadow: 0 0 0 2px var(--papel), 0 0 0 3px var(--fondo);
  font-style: normal;
  font-size: 10px;
  line-height: 1;
  transform: rotate(-12deg);
  transition: transform 200ms var(--ease);
}
.estantes .filtro-sello:hover .mini-sello {
  transform: rotate(0deg) scale(1.08);
}
.estantes .filtro-sello[aria-pressed='true'] {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--fondo);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}
.estantes .li-sello:last-of-type {
  margin-right: 10px;
  padding-right: 12px;
  border-right: 1px solid var(--raya);
}
.resumen-fila {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 20px;
}
.resumen-fila .leyenda-cinta {
  margin-top: -0.4em;
  align-self: center;
}
/* el sello no puede salirse de la tarjeta: content-visibility recorta lo que sobresale */
@media (max-width: 640px) {
  .libro .sello-redondo {
    --d: 64px;
  }
  .cubierta .sellos {
    top: -8px;
    right: -10px;
  }
}
