/* ── ARMARIUM v2 (maqueta del usuario): estantes / cuadrícula / lista, marco de categorías, buscador de pergamino ── */

/* ── 1) Panel de categorías con marco dorado, que se expande y contrae (ya no queda fijo al bajar) ── */
aside:has(> .arm-marco) { position: static !important; max-height: none !important; overflow: visible !important; }
/* marco de madera del usuario (img/arm-marco.webp) en 9 partes: esquinas y remate intactos, los lados se estiran */
.sidebar-card.arm-marco { position: relative; border-radius: 0 !important; padding: 8px 6px 6px !important; background: none !important;
    box-shadow: none !important; backdrop-filter: none !important; border-style: solid !important; border-color: transparent !important;
    border-width: 28px 22px 22px 23px !important;
    border-image: url('/images/portada/arm-marco.webp') 56 43 44 46 fill / 28px 22px 22px 23px stretch; }
.arm-cat-titulo { display: flex; align-items: center; gap: 8px; padding: 0 2px 12px; margin: 0 !important;
    font-family: 'Cinzel', serif; font-size: .9rem; letter-spacing: .15em; text-transform: uppercase; color: #f5e6c8; }
.arm-estrella { color: #e9c97a; }
/* la lista de categorías se desplaza dentro del marco (alto fijado por armarium-v2.js = hasta donde terminan los libros) */
.arm-marco #categories-container { overflow-y: auto; overscroll-behavior: contain; padding-right: 6px;
    scrollbar-width: thin; scrollbar-color: #b8955a rgba(0,0,0,.35); }
.arm-marco #categories-container::-webkit-scrollbar { width: 7px; }
.arm-marco #categories-container::-webkit-scrollbar-track { background: rgba(0,0,0,.35); border-radius: 6px; }
.arm-marco #categories-container::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #e9c97a, #8a6a38); border-radius: 6px; }
.arm-marco .category-item.active { background: linear-gradient(135deg, rgba(109,40,217,.35), rgba(60,20,110,.35)) !important;
    border: 1px solid rgba(214,178,106,.7) !important; border-radius: 4px; color: #f5e6c8; }
.arm-marco .category-item .cat-count { background: #0b0806 !important; color: #e9c97a !important; border: 1px solid rgba(200,169,107,.55); }

/* ── 2) Buscador: pergamino con marco de hierro y lupa del usuario (img/arm-buscador.webp, sin el texto pintado):
      border-image de 3 partes → los extremos quedan intactos y el pergamino del medio se estira ── */
.search-bar.arm-perg { position: relative; height: 64px; min-height: 64px; background: none !important; box-shadow: none !important;
    border-radius: 0 !important; border-style: solid !important; border-color: transparent !important; border-width: 0 27px 0 54px !important;
    border-image: url('/images/portada/arm-buscador.webp?v=2') 0 60 0 118 fill / 0 27px 0 54px stretch; padding: 0 10px !important; }
.search-bar.arm-perg input { color: #33230f !important; font-family: 'Cormorant Garamond', serif; font-size: 1.3rem !important; font-weight: 500; padding: 8px 6px !important; }
.search-bar.arm-perg input::placeholder { color: #3b2a16; opacity: .85; }
.search-bar.arm-perg:focus-within { filter: drop-shadow(0 0 8px rgba(233,201,122,.5)); }
.arm-lupa { display: none; }

/* ── 3-5) Botones de vista: imágenes del usuario (img/arm-btn-*.webp) ── */
.arm-vistas { gap: 10px !important; }
.arm-vista.view-toggle-btn { width: 52px; height: 52px; border: 0 !important; border-radius: 4px; padding: 0;
    background: center / 100% 100% no-repeat !important; box-shadow: none !important; filter: brightness(.82); transition: filter .25s, transform .25s; }
.arm-vista[data-vista="estante"] { background-image: url('/images/portada/arm-btn-estante.webp') !important; }
.arm-vista[data-vista="cuadricula"] { background-image: url('/images/portada/arm-btn-cuadricula.webp') !important; }
.arm-vista[data-vista="lista"] { background-image: url('/images/portada/arm-btn-lista.webp') !important; }
.arm-vista svg { display: none; }
.arm-vista:hover { filter: brightness(1.05); transform: translateY(-1px); }
.arm-vista.active { filter: brightness(1.18) drop-shadow(0 0 8px rgba(233,201,122,.65)); }

/* ── Vista ESTANTES: los libros en la librería de madera (piezas en libreria-v2.css) ── */
#books-container.arm-libreria { display: flex !important; grid-template-columns: none !important; gap: 0 !important; }
.arm-tapa { position: relative; display: inline-flex; align-items: flex-end; justify-content: center; height: auto !important;
    padding: 0 !important; background: none !important; overflow: visible !important; cursor: pointer; }
.arm-tapa::before { display: none !important; }
.arm-tapa .book-cover { width: calc(var(--col) * .64) !important; height: calc(var(--col) * .9) !important; object-fit: cover;
    border-radius: 3px 6px 6px 3px; box-shadow: 0 10px 22px rgba(0,0,0,.75), -3px 0 0 rgba(0,0,0,.35) inset; transition: transform .35s ease; }
.arm-tapa:hover .book-cover, .arm-tapa:focus-visible .book-cover { transform: translateY(-6px); }
.arm-tapa:focus-visible { outline: 2px solid #e9c97a; outline-offset: 3px; border-radius: 4px; }
.arm-tapa > .absolute { border-radius: 3px 6px 6px 3px; }          /* candado de libros de suscripción */
.lib-libro { padding-bottom: calc(var(--col) * .02); }
.arm-bloqueado .arm-tapa { opacity: .85; }
.arm-tapa .resumen-hover { border-radius: 3px 6px 6px 3px; padding: 0 6px 10px; }
.arm-tapa .resumen-btn { font-size: 9px !important; padding: 5px 6px !important; letter-spacing: .08em; }
.arm-info .book-info { padding: 0 2px !important; text-align: center; }
.arm-info .book-info > div:first-child { justify-content: center !important; flex-wrap: wrap; }
.arm-info h3 { font-weight: 700; font-size: clamp(10.5px, calc(var(--col) * .062), 14px) !important; color: #f0dcae !important; }
.arm-info .book-info p { margin-bottom: 2px !important; }
.arm-info .book-info p + p { margin-bottom: 6px !important; }
.arm-info .book-info a, .arm-info .book-info button { padding: 6px 4px !important; font-size: 9.5px !important; border-color: rgba(214,178,106,.55) !important;
    color: #e8d4a8; background: rgba(12,9,6,.6) !important; border-radius: 6px !important; }
.arm-info .book-info a:hover, .arm-info .book-info button:hover { border-color: #e9c97a !important; color: #fff3d0 !important; }

/* ── Vista LISTA: portada pequeña + datos en una fila ── */
#books-container.arm-lista { display: flex !important; flex-direction: column; gap: 10px !important; }
.arm-fila { display: flex; align-items: center; gap: 16px; padding: 10px 14px; border-radius: 4px; cursor: default;
    background: linear-gradient(90deg, rgba(21,16,12,.92), rgba(11,8,6,.85)); border: 1px solid rgba(200,169,107,.35); }
.arm-fila:hover { border-color: rgba(233,201,122,.7); }
.arm-fila .arm-tapa-lista { flex: none; width: 64px; height: 88px !important; padding: 0 !important; background: none !important; cursor: pointer; overflow: hidden; border-radius: 3px; }
.arm-fila .arm-tapa-lista::before { display: none !important; }
.arm-fila .arm-tapa-lista .book-cover { width: 64px !important; height: 88px !important; object-fit: cover; border-radius: 3px; }
.arm-fila .arm-tapa-lista .resumen-hover { display: none !important; }
.arm-fila .arm-tapa-lista > .absolute svg { width: 18px; height: 18px; margin: 0; }
.arm-fila .arm-tapa-lista > .absolute span { display: none; }
.arm-fila .book-info { flex: 1; min-width: 0; padding: 0 !important; display: grid; grid-template-columns: 1fr auto; column-gap: 14px; align-items: center; }
.arm-fila .book-info > div:first-child { grid-column: 1; margin-bottom: 2px !important; }
.arm-fila .book-info > p { grid-column: 1; margin: 0 !important; }
.arm-fila .book-info > a, .arm-fila .book-info > button { grid-column: 2; grid-row: 1 / span 2; width: auto !important; padding: 8px 14px !important;
    border-color: rgba(214,178,106,.55) !important; color: #e8d4a8; background: rgba(12,9,6,.6) !important; }
.arm-fila .book-info > a.espejo-btn-movil { grid-row: 3; display: none; }
.arm-bloqueado.arm-fila { opacity: .85; }
@media (max-width: 640px) {
    .arm-fila .book-info { grid-template-columns: 1fr; }
    .arm-fila .book-info > a, .arm-fila .book-info > button { grid-column: 1; grid-row: auto; margin-top: 6px; }
}
html.oc-liviano .arm-tapa .book-cover { transition: none; }
/* teléfono: el buscador a todo el ancho y los 3 botones debajo, a la derecha */
@media (max-width: 560px) {
    div:has(> .search-bar.arm-perg) { flex-wrap: wrap; gap: 12px !important; }
    .search-bar.arm-perg { flex: 1 1 100% !important; }
    .arm-vistas { margin-left: auto; }
}

/* ── Paginación como la maqueta del usuario (imágenes img/pag-*.webp): "Mostrando…" entre lunas, flechas
      labradas, la página actual en un medallón con vela, las demás en números dorados y "✦ … ✦" ── */
#results-info { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 2.5rem !important;
    font-family: 'Cormorant Garamond', serif !important; font-style: italic; font-size: clamp(1.15rem, 2.2vw, 1.6rem) !important;
    color: #e2cd9f !important; opacity: 1 !important; text-align: center; }
#results-info:not(:empty)::before, #results-info:not(:empty)::after { content: ''; flex: 0 1 clamp(80px, 14vw, 160px); height: 24px;
    background: url('/images/portada/pag-lunas.webp') center / contain no-repeat; opacity: .85; }
#results-info:not(:empty)::after { transform: scaleX(-1); }
#pagination { gap: clamp(10px, 2.4vw, 34px) !important; margin-top: 1.4rem !important; align-items: center; }
#pagination .page-btn { width: auto; min-width: 44px; height: auto; padding: 4px 6px; border: 0 !important; border-radius: 0;
    background: none !important; box-shadow: none !important; font-family: 'Cinzel', serif; font-weight: 600;
    font-size: clamp(1.5rem, 2.6vw, 2.2rem); color: #c9a86a; transition: color .2s, transform .2s, filter .2s; }
#pagination .page-btn:hover:not([disabled]) { color: #f3dca4; transform: translateY(-2px); }
/* página actual: medallón con runas y vela, número encima */
#pagination .page-btn.active { width: clamp(78px, 9vw, 108px); height: clamp(78px, 9vw, 108px); padding: 0 0 6px; color: #f6e6c2 !important;
    background: url('/images/portada/pag-medallon.webp') center / contain no-repeat !important; text-shadow: 0 2px 6px rgba(0,0,0,.85);
    filter: drop-shadow(0 0 14px rgba(240,190,90,.45)); }
/* flechas: la primera y la última del paginador son "anterior" y "siguiente" */
#pagination .page-btn:first-child, #pagination .page-btn:last-child { width: clamp(84px, 10vw, 130px); height: 60px; font-size: 0 !important;
    background: url('/images/portada/pag-flecha-izq.webp') center / contain no-repeat !important; }
#pagination .page-btn:last-child { background-image: url('/images/portada/pag-flecha-der.webp') !important; }
#pagination .page-btn:first-child:hover:not([disabled]) { transform: translateX(-4px); filter: brightness(1.2); }
#pagination .page-btn:last-child:hover:not([disabled]) { transform: translateX(4px); filter: brightness(1.2); }
/* "…" = estrella + tres rombos + estrella */
#pagination .page-ellipsis { min-width: 120px; height: 30px; font-size: 0; color: transparent; gap: 10px;
    background: url('/images/portada/pag-puntos.webp') center / auto 15px no-repeat; }
#pagination .page-ellipsis::before, #pagination .page-ellipsis::after { content: ''; width: 18px; height: 18px;
    background: url('/images/portada/pag-estrella.webp') center / contain no-repeat; }
#pagination .page-ellipsis::before { margin-right: auto; } #pagination .page-ellipsis::after { margin-left: auto; }
@media (max-width: 560px) {
    #pagination { gap: 6px !important; }
    #pagination .page-ellipsis { min-width: 70px; background-size: auto 11px; }
    #pagination .page-ellipsis::before, #pagination .page-ellipsis::after { width: 12px; height: 12px; }
    #pagination .page-btn:first-child, #pagination .page-btn:last-child { width: 58px; height: 40px; }
    #results-info:not(:empty)::before, #results-info:not(:empty)::after { flex-basis: 40px; }
}
/* resplandor dorado alrededor del buscador (tapa cualquier resto del borde blanco de la imagen original) */
.search-bar.arm-perg { filter: drop-shadow(0 0 3px rgba(233,201,122,.75)) drop-shadow(0 0 10px rgba(214,170,80,.35)); }
.search-bar.arm-perg:focus-within { filter: drop-shadow(0 0 4px rgba(240,210,130,.95)) drop-shadow(0 0 14px rgba(214,170,80,.5)); }
/* paginación más chica y proporcionada (el usuario: "se ve muy grande, desproporcionado") */
#results-info { font-size: clamp(1rem, 1.5vw, 1.2rem) !important; gap: 10px; margin-top: 2rem !important; }
#results-info:not(:empty)::before, #results-info:not(:empty)::after { flex-basis: clamp(60px, 8vw, 110px); height: 16px; }
#pagination { gap: clamp(8px, 1.4vw, 20px) !important; margin-top: .9rem !important; }
#pagination .page-btn { min-width: 30px; font-size: clamp(1.05rem, 1.6vw, 1.4rem); }
#pagination .page-btn.active { width: clamp(54px, 5.5vw, 68px); height: clamp(54px, 5.5vw, 68px); padding-bottom: 4px; }
#pagination .page-btn:first-child, #pagination .page-btn:last-child { width: clamp(60px, 6.5vw, 86px); height: 40px; }
#pagination .page-ellipsis { min-width: 80px; height: 22px; background-size: auto 11px; }
#pagination .page-ellipsis::before, #pagination .page-ellipsis::after { width: 13px; height: 13px; }
/* un poco más chica todavía, para que entren ~7 números */
#results-info { font-size: clamp(.95rem, 1.3vw, 1.08rem) !important; }
#results-info:not(:empty)::before, #results-info:not(:empty)::after { flex-basis: clamp(50px, 6vw, 90px); height: 13px; }
#pagination { gap: clamp(6px, 1vw, 14px) !important; }
#pagination .page-btn { min-width: 24px; font-size: clamp(.95rem, 1.3vw, 1.15rem); }
#pagination .page-btn.active { width: clamp(46px, 4.4vw, 56px); height: clamp(46px, 4.4vw, 56px); padding-bottom: 3px; }
#pagination .page-btn:first-child, #pagination .page-btn:last-child { width: clamp(50px, 5vw, 70px); height: 32px; }
#pagination .page-ellipsis { min-width: 60px; height: 18px; background-size: auto 9px; }
#pagination .page-ellipsis::before, #pagination .page-ellipsis::after { width: 10px; height: 10px; }
@media (max-width: 560px) { #pagination { gap: 4px !important; } #pagination .page-ellipsis { min-width: 34px; } #pagination .page-ellipsis::before, #pagination .page-ellipsis::after { display: none; } }

/* ── paginación 15 % más chica (pedido del usuario) ── */
#results-info { font-size: clamp(.85rem, 1.1vw, .95rem) !important; }
#results-info:not(:empty)::before, #results-info:not(:empty)::after { flex-basis: clamp(42px, 5vw, 76px); height: 11px; }
#pagination .page-btn { font-size: clamp(.82rem, 1.1vw, .98rem); }
#pagination .page-btn.active { width: clamp(40px, 3.8vw, 48px); height: clamp(40px, 3.8vw, 48px); }
#pagination .page-btn:first-child, #pagination .page-btn:last-child { width: clamp(42px, 4.3vw, 60px); height: 28px; }
#pagination .page-ellipsis { min-width: 50px; height: 15px; background-size: auto 8px; }
#pagination .page-ellipsis::before, #pagination .page-ellipsis::after { width: 9px; height: 9px; }

/* ── Vistas CUADRÍCULA y LISTA con el mismo estilo de madera y oro que el marco de categorías ── */
.arm-cuadricula .book-card.arm-hecho, .arm-fila {
    background: linear-gradient(180deg, #1c140d 0%, #110c08 55%, #0b0806 100%) !important; border: 1px solid #a8864e !important;
    border-radius: 4px !important; box-shadow: inset 0 0 0 3px #0e0a06, inset 0 0 0 4px rgba(200,169,107,.35), 0 10px 24px rgba(0,0,0,.55) !important; }
/* cuadrícula */
#books-container.arm-cuadricula { gap: 22px !important; }
.arm-cuadricula .book-card.arm-hecho:hover { transform: translateY(-6px); border-color: #e9c97a !important;
    box-shadow: inset 0 0 0 3px #0e0a06, inset 0 0 0 4px rgba(233,201,122,.7), 0 0 22px rgba(233,201,122,.25), 0 14px 30px rgba(0,0,0,.6) !important; }
.arm-cuadricula .book-card.arm-hecho::after { background: radial-gradient(circle at 50% 35%, rgba(233,201,122,.14), transparent 60%) !important; }
.arm-cuadricula .book-cover-wrap { background: radial-gradient(ellipse at 50% 70%, rgba(214,170,80,.16), transparent 65%) !important; height: 210px !important; }
.arm-cuadricula .book-cover-wrap::before { display: none !important; }
.arm-cuadricula .book-cover { border-radius: 3px 6px 6px 3px !important; box-shadow: 0 10px 22px rgba(0,0,0,.75) !important; }
.arm-cuadricula .book-info { text-align: center; border-top: 1px solid rgba(200,169,107,.28); position: relative; padding-top: 16px !important; }
.arm-cuadricula .book-info::before { content: '✦'; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 11px;
    color: #e9c97a; background: #130d09; padding: 0 6px; line-height: 16px; }
.arm-cuadricula .book-info > div:first-child { justify-content: center !important; }
.arm-cuadricula .book-info h3, .arm-fila .book-info h3 { color: #f0dcae !important; font-weight: 700; letter-spacing: .05em; }
.arm-cuadricula .book-info p:first-of-type, .arm-fila .book-info p:first-of-type { color: #c9a86a !important; font-family: 'Cormorant Garamond', serif !important;
    font-style: italic; text-transform: none !important; font-size: .9rem !important; letter-spacing: .02em !important; }
.arm-cuadricula .book-info p + p, .arm-fila .book-info p + p { color: #9d8a6a !important; }
.arm-cuadricula .book-info a, .arm-cuadricula .book-info button, .arm-fila .book-info > a, .arm-fila .book-info > button {
    background: linear-gradient(180deg, #3b2a1a, #1d140c) !important; border: 1px solid #b8955a !important; border-radius: 4px !important;
    color: #f0dcae !important; box-shadow: inset 0 0 0 2px #1d140c, inset 0 0 0 3px rgba(200,169,107,.35); }
.arm-cuadricula .book-info a:hover, .arm-cuadricula .book-info button:hover, .arm-fila .book-info > a:hover, .arm-fila .book-info > button:hover {
    color: #fff3d0 !important; box-shadow: inset 0 0 0 2px #1d140c, inset 0 0 0 3px rgba(233,201,122,.75), 0 0 10px rgba(233,201,122,.3); }
/* lista */
#books-container.arm-lista { gap: 12px !important; }
.arm-fila { padding: 12px 22px 12px 14px !important; position: relative; }
.arm-fila::before { content: ''; position: absolute; left: 96px; top: 16px; bottom: 16px; width: 1px;
    background: linear-gradient(180deg, transparent, rgba(200,169,107,.55), transparent); }
.arm-fila:hover { border-color: #e9c97a !important; box-shadow: inset 0 0 0 3px #0e0a06, inset 0 0 0 4px rgba(233,201,122,.7), 0 0 18px rgba(233,201,122,.2) !important; }
.arm-fila .arm-tapa-lista { width: 62px !important; height: 86px !important; margin-right: 18px; box-shadow: 0 6px 14px rgba(0,0,0,.7); }
.arm-fila .book-info h3 { font-size: 1rem !important; }
@media (max-width: 640px) { .arm-fila::before { display: none; } }

/* ══ ESTANTE GÓTICO del usuario (img/est-*.webp, tramos que se repiten; armarium-v2.js arma las filas) ══
   Cada tramo: el libro parado en la tabla (73 % del alto), el título en una placa y la categoría/autor en un
   pergamino sobre el tablón, y "Leer pergamino" colgando de las cadenas debajo. --e = escala de la imagen. */
#books-container.arm-estante { display: flex !important; flex-direction: column; align-items: center; gap: 0 !important; grid-template-columns: none !important; }
.est-fila { display: flex; justify-content: center; margin-bottom: calc(var(--e) * 150px + 26px); filter: drop-shadow(0 14px 22px rgba(0,0,0,.6)); }
.est-bahia { position: relative; flex: none; background: center / 100% 100% no-repeat; }
.est-ini { background-image: url('/images/portada/est-ini.webp'); } .est-mid1 { background-image: url('/images/portada/est-mid1.webp'); }
.est-mid2 { background-image: url('/images/portada/est-mid2.webp'); } .est-fin { background-image: url('/images/portada/est-fin.webp'); }
.est-sola { background-image: url('/images/portada/est-sola.webp'); }
/* el libro, parado sobre la tabla */
.est-libro { position: absolute; left: var(--l); right: var(--r); top: 37.5%; bottom: 26.6%; display: flex; align-items: flex-end; justify-content: center; }
.est-tapa { position: relative; display: inline-flex; height: 100% !important; padding: 0 !important; background: none !important; overflow: visible !important; cursor: pointer; align-items: flex-end; }
.est-tapa::before { display: none !important; }
.est-tapa .book-cover { height: 96% !important; width: auto !important; aspect-ratio: 13 / 18; object-fit: cover; border-radius: 2px 5px 5px 2px;
    box-shadow: 0 8px 16px rgba(0,0,0,.8), -3px 0 0 rgba(0,0,0,.35) inset; transition: transform .35s ease; }
.est-tapa:hover .book-cover, .est-tapa:focus-visible .book-cover { transform: translateY(-5px); }
.est-tapa:focus-visible { outline: 2px solid #e9c97a; outline-offset: 3px; }
.est-tapa > .absolute { border-radius: 2px 5px 5px 2px; }
.est-tapa .resumen-hover { opacity: 1 !important; background: none !important; padding: 0 0 6% !important; justify-content: flex-end; }
.est-tapa .resumen-btn { font-size: max(8px, calc(var(--e) * 17px)) !important; padding: .35em .9em !important; white-space: nowrap; letter-spacing: .06em;
    background: rgba(12,8,5,.88) !important; border: 1px solid rgba(214,178,106,.75) !important; border-radius: 999px !important; color: #f0dcae !important; }
.est-libro.arm-bloqueado .est-tapa { opacity: .9; }
/* rótulo sobre el tablón: placa con el título + pergamino con categoría y autor */
.est-info { position: absolute; left: calc(var(--l) + 4px); right: calc(var(--r) + 4px); top: 75.5%; bottom: 0; }
.est-info .book-info { position: static; padding: 0 !important; text-align: center; }
.est-info .book-info > div:first-child { justify-content: center !important; flex-wrap: wrap; gap: 4px !important; margin: 0 auto !important; width: fit-content; max-width: 100%;
    padding: .25em .9em; background: linear-gradient(180deg, #3a2817, #1f150c); border: 1px solid #8f7140; border-radius: 2px;
    box-shadow: inset 0 0 0 2px #1f150c, inset 0 0 0 3px rgba(200,169,107,.35), 0 3px 6px rgba(0,0,0,.6); }
.est-info .book-info h3 { font-size: max(9px, calc(var(--e) * 26px)) !important; font-weight: 700; color: #f0d79e !important; letter-spacing: .05em; line-height: 1.2 !important;
    text-shadow: 0 1px 2px #000; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.est-info .book-info > p { margin: 0 auto !important; width: 92%; padding: .1em .4em; color: #2c1d0e !important; text-transform: none !important;
    background: url('/images/portada/fila-perg.webp') 50% 50% / 420% 900% no-repeat, #d8c39a; box-shadow: 0 2px 4px rgba(0,0,0,.45); }
.est-info .book-info > p:first-of-type { margin-top: 5px !important; padding-top: .3em; font-family: 'Cormorant Garamond', serif !important; font-weight: 600;
    font-size: max(10px, calc(var(--e) * 28px)) !important; letter-spacing: .01em !important; border-radius: 2px 2px 0 0; }
.est-info .book-info > p + p { font-size: max(9px, calc(var(--e) * 24px)) !important; color: #4a3218 !important; padding-bottom: .3em; border-radius: 0 0 2px 2px; }
.est-info .espejo-btn-movil { display: none !important; }
/* "Leer pergamino" colgando del tablón con dos cadenas */
.est-info .book-info > a:not(.espejo-btn-movil), .est-info .book-info > button { position: absolute; left: 50%; transform: translateX(-50%);
    top: calc(100% + var(--e) * 52px + 8px); width: min(92%, calc(var(--e) * 380px + 40px)) !important; margin: 0 !important; }
.est-info::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: min(70%, calc(var(--e) * 290px + 20px));
    height: calc(var(--e) * 52px + 12px);
    background: repeating-linear-gradient(180deg, #5a4a3a 0 4px, #2a2018 4px 6px) left / 3px 100% no-repeat,
                repeating-linear-gradient(180deg, #5a4a3a 0 4px, #2a2018 4px 6px) right / 3px 100% no-repeat; }
.est-vacia .est-info::after { display: none; }

/* ══ Botón "Leer pergamino" / "Iniciar sesión" / "Suscribirme": placa de hierro y madera del usuario (img/btn-placa.webp) ══ */
#books-container .book-info > a:not(.espejo-btn-movil), #books-container .book-info > button {
    display: flex !important; align-items: center; justify-content: center; min-height: 38px; padding: 0 6px !important;
    background: none !important; box-shadow: none !important; border-radius: 0 !important; border-style: solid !important; border-color: transparent !important;
    border-width: 0 26px !important; border-image: url('/images/portada/btn-placa.webp') 0 82 0 82 fill / 0 26px stretch !important;
    font-family: 'Cinzel', serif !important; font-weight: 700; font-size: .78rem !important; letter-spacing: .12em; color: #e9c98a !important;
    text-shadow: 0 1px 0 #000, 0 0 6px rgba(0,0,0,.8); white-space: nowrap; transition: filter .2s; }
#books-container .book-info > a:not(.espejo-btn-movil):hover, #books-container .book-info > button:hover { filter: brightness(1.2) drop-shadow(0 0 6px rgba(233,201,122,.45)); color: #fff0c8 !important; }

/* ══ LISTA como la segunda maqueta: pergamino enmarcado (img/fila-perg.webp), libro inclinado, botón placa ══ */
#books-container.arm-lista { gap: 16px !important; }
.arm-fila { min-height: 112px; padding: 6px 4px !important; background: none !important; box-shadow: none !important; border-radius: 0 !important;
    border-style: solid !important; border-color: transparent !important; border-width: 0 46px !important;
    border-image: url('/images/portada/fila-perg.webp') 0 200 0 200 fill / 0 46px stretch !important; filter: drop-shadow(0 8px 14px rgba(0,0,0,.55)); }
.arm-fila:hover { box-shadow: none !important; filter: drop-shadow(0 0 10px rgba(233,201,122,.35)) drop-shadow(0 8px 14px rgba(0,0,0,.55)); }
.arm-fila::before { left: 96px !important; top: 22px !important; bottom: 22px !important; background: linear-gradient(180deg, transparent, rgba(60,38,16,.55), transparent) !important; }
.arm-fila .arm-tapa-lista { width: 70px !important; height: 98px !important; margin: -14px 26px -14px -20px !important; overflow: visible !important;
    transform: rotate(-9deg); box-shadow: none !important; filter: drop-shadow(4px 8px 8px rgba(0,0,0,.65)); }
.arm-fila .arm-tapa-lista .book-cover { width: 70px !important; height: 98px !important; border-radius: 2px 5px 5px 2px !important; }
.arm-fila .book-info h3 { color: #2a1a0b !important; font-size: 1.05rem !important; text-shadow: none !important; }
.arm-fila .book-info p:first-of-type { color: #3d2914 !important; font-size: .98rem !important; font-weight: 600; }
.arm-fila .book-info p + p { color: #5a4024 !important; }
.arm-fila .book-info > a, .arm-fila .book-info > button { margin-right: 6px; }
@media (max-width: 640px) {
    .arm-fila { border-width: 0 24px !important; border-image-width: 0 24px !important; }
    .arm-fila .arm-tapa-lista { width: 54px !important; height: 76px !important; margin-right: 14px !important; }
    .arm-fila .arm-tapa-lista .book-cover { width: 54px !important; height: 76px !important; }
}
.arm-fila .book-info p + p { color: #4a3016 !important; font-size: .85rem !important; }
.arm-fila .arm-tapa-lista { position: relative; z-index: 2; }
/* en el estante el texto del botón se escala con el estante (en teléfono no se sale de la placa) */
#books-container .est-info .book-info > a:not(.espejo-btn-movil), #books-container .est-info .book-info > button { font-size: max(8.5px, calc(var(--e) * 24px)) !important; letter-spacing: .06em; min-height: max(28px, calc(var(--e) * 72px)); border-width: 0 max(14px, calc(var(--e) * 50px)) !important; border-image-width: 0 max(14px, calc(var(--e) * 50px)) !important; padding: 0 2px !important; }

/* ══ CUADRÍCULA: 6 libros por fila en PC (12 por página), tarjetas más compactas ══ */
#books-container.arm-cuadricula { display: grid !important; grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 14px !important; }
@media (max-width: 1400px) { #books-container.arm-cuadricula { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; } }
@media (max-width: 1150px) { #books-container.arm-cuadricula { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } }
@media (max-width: 820px)  { #books-container.arm-cuadricula { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 560px)  { #books-container.arm-cuadricula { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; } }
.arm-cuadricula .book-card.arm-hecho .book-cover-wrap { height: 172px !important; padding: 14px 10px !important; }
.arm-cuadricula .book-card.arm-hecho .book-cover { width: 104px !important; height: 144px !important; }
.arm-cuadricula .book-card.arm-hecho .book-info { padding: 12px 10px 12px !important; }
.arm-cuadricula .book-card.arm-hecho .book-info h3 { font-size: .74rem !important; line-height: 1.25 !important; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.arm-cuadricula .book-card.arm-hecho .book-info p:first-of-type { font-size: .82rem !important; }
.arm-cuadricula .book-card.arm-hecho .book-info p + p { font-size: .7rem !important; margin-bottom: 8px !important; }
.arm-cuadricula .book-card.arm-hecho .resumen-btn { font-size: 8.5px !important; padding: 4px 8px !important; }
#books-container.arm-cuadricula .book-info > a:not(.espejo-btn-movil), #books-container.arm-cuadricula .book-info > button {
    min-height: 32px; font-size: .64rem !important; letter-spacing: .08em; border-width: 0 18px !important; border-image-width: 0 18px !important; padding: 0 2px !important; }
@media (max-width: 560px) { .arm-cuadricula .book-card.arm-hecho .book-cover { width: 92px !important; height: 128px !important; } .arm-cuadricula .book-card.arm-hecho .book-cover-wrap { height: 150px !important; } }

/* ══ Estante: objetos en la repisa de arriba de cada arco y libros debajo de esa repisa (maqueta del usuario) ══ */
.est-s1 { background-image: url('/images/portada/est6-1.webp'); } .est-s2 { background-image: url('/images/portada/est6-2.webp'); }
.est-s3 { background-image: url('/images/portada/est6-3.webp'); } .est-s4 { background-image: url('/images/portada/est6-4.webp'); }
.est-s5 { background-image: url('/images/portada/est6-5.webp'); } .est-s6 { background-image: url('/images/portada/est6-6.webp'); }
.est-objeto { position: absolute; left: var(--l); right: var(--r); bottom: 64.9%; height: 15%; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.est-objeto img { max-height: 100%; max-width: 78%; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(0,0,0,.7)); }
.est-libro, .libreria-gotica .est-libro { top: 40% !important; }
/* teléfono: el texto del pergamino un poco más grande y oscuro (se veía pálido) */
.est-info .book-info > p:first-of-type { font-size: max(12px, calc(var(--e) * 28px)) !important; color: #1e1408 !important; font-weight: 700 !important; }
.est-info .book-info > p + p { font-size: max(10.5px, calc(var(--e) * 24px)) !important; color: #3a2610 !important; }
