/* Local refinements preserve the published composition and original illustrations. */
:root{--paper:#f6f4ee;--burgundy:#643740;--line:#d6d3cb}
[hidden]{display:none!important}
body{background:#f0ece4}
header>*{min-width:0}
nav{flex-wrap:wrap}
header{background:rgba(246,244,238,.94)}
.nocta-collage{background:#c9c0b5}
.nocta-collage:after{background:rgba(240,233,220,.65)}
.collage-art{filter:blur(3px) saturate(.5);opacity:.6}
.hero{background:#ded7cc}
.hero-image{filter:blur(2px) saturate(.55)}
.hero:after{background:linear-gradient(90deg,rgba(246,242,232,.98),rgba(246,242,232,.92) 33%,rgba(233,219,205,.45) 68%,rgba(233,219,205,.2))}

.hero-image::after{width:42%;background-position:65% 40%;mask-image:linear-gradient(90deg,transparent,#000 24%);opacity:.72}
.catalogue{background:rgba(246,244,238,.56)}
.book-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:24px;align-items:stretch}
.book-card{background:rgba(246,244,238,.92);min-width:0;padding:15px}
.book-open>img{background:#e9e3d8;object-fit:contain}
.book-card>.add-cart,.book-card>.book-buy{margin-top:auto}
.book-author{overflow-wrap:anywhere}
footer{background:rgba(246,244,238,.94)}
.button:hover,.add-cart:hover,.book-buy:hover{background:var(--burgundy);border-color:var(--burgundy);color:var(--paper)}
.categories a[aria-current]{outline:2px solid var(--burgundy);outline-offset:3px}
a:focus-visible,button:focus-visible,input:focus-visible,img:focus-visible{outline:2px solid var(--burgundy);outline-offset:3px}
dialog:is(#product,#product-two,#product-three,#product-four){max-width:960px;width:calc(100% - 24px);max-height:calc(100dvh - 24px);padding:52px 28px 28px;overflow:auto}
dialog .close{position:sticky;display:block;margin:-44px -8px 8px auto;top:0;right:auto;width:44px;height:44px;background:var(--paper);z-index:3;line-height:1;border-radius:50%;color:var(--ink)}
.product-layout>*{min-width:0}
.product-gallery>img,.product-gallery>#product-image,.product-gallery>#four-image{display:block;width:100%;height:min(52vh,480px);max-height:480px;object-fit:contain;background:#e5e1d7;touch-action:pan-y}
.product-copy{overflow-wrap:break-word}
.product-gallery .thumbnails{position:relative;display:flex;gap:9px;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;padding:10px 3px 8px;margin-top:10px}
.gallery-thumb{flex:0 0 64px;width:64px;height:82px;padding:0;border:1px solid transparent;background:none;scroll-snap-align:center}
.gallery-thumb.active{border-color:var(--burgundy);box-shadow:0 0 0 1px var(--burgundy)}
.gallery-thumb img{display:block;width:100%;height:100%;object-fit:cover}
@media(max-width:1050px){.book-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){
 nav{gap:14px}
 h1{font-size:clamp(38px,12vw,51px)}
 .hero:after{background:linear-gradient(180deg,rgba(246,242,232,.98),rgba(246,242,232,.94) 36%,rgba(233,219,205,.5) 59%,rgba(233,219,205,.2))}
 
 .hero-image::after{top:38%;width:62%;bottom:-8px;background-position:65% 40%;mask-image:linear-gradient(90deg,transparent,#000 24%)}
 .book-grid{gap:14px}
 .book-card{padding:10px}
 .book-title{font-size:20px}
 .book-card>.add-cart,.book-card>.book-buy{width:100%;font-size:9px;padding:10px 6px}
 .product-layout{display:block}
 dialog:is(#product,#product-two,#product-three,#product-four){padding:52px 18px 24px}
 .product-copy{padding-top:24px}
 .product-copy h2{font-size:clamp(26px,8vw,34px)}
 .product-copy .button{max-width:100%}
 .product-gallery>img{height:42dvh;max-height:390px}
 .gallery-thumb{flex-basis:58px;width:58px;height:74px}
 .quote h2{overflow-wrap:break-word}
 .subscribe{border-left:0}
}
@media(max-width:360px){.book-grid{grid-template-columns:minmax(0,1fr)}}

/* Consulta editorial: carrito persistente, sin pagos ni cálculo de envíos. */
#cart{max-width:720px;padding:52px 28px 28px}
.cart-panel{max-width:640px;margin:0 auto}
.cart-panel h2{font:clamp(28px,4vw,38px)/1.08 'Libre Caslon Display',Georgia,serif;letter-spacing:-.02em;text-transform:none;margin:0 0 25px}
#cart-items{border-top:1px solid var(--line)}
.cart-item{display:grid;grid-template-columns:78px minmax(0,1fr) auto;gap:16px;align-items:center;padding:16px 0;border-bottom:1px solid var(--line)}
.cart-item>img{width:78px;height:96px;object-fit:contain;background:#e9e3d8}
.cart-item-copy h3{font:20px/1.15 'Libre Caslon Display',Georgia,serif;margin:0 0 6px}
.cart-item-copy p{font-size:12px;color:#777269;margin:0 0 6px}.cart-item-copy strong{font-size:14px;font-weight:400}
.cart-item-actions{display:grid;grid-template-columns:32px 32px 32px;justify-items:center;gap:2px;align-items:center}
.cart-item-actions button{width:30px;height:30px;border:1px solid var(--line);background:transparent;font-size:18px;line-height:1;color:var(--ink)}
.cart-item-actions output{font-size:14px;text-align:center}.cart-item-actions .remove-item{grid-column:1/-1;width:auto;height:auto;border:0;text-decoration:underline;text-underline-offset:4px;text-transform:uppercase;letter-spacing:.08em;font-size:9px;padding:6px 0}
#cart-empty{padding:18px 0;margin:0;border-top:1px solid var(--line);color:#777269}.cart-summary{display:flex;justify-content:space-between;gap:20px;border-top:1px solid var(--ink);margin-top:18px;padding:16px 0;font-size:14px}.cart-summary strong{font-size:20px;font-weight:400}
.availability-note{font-size:13px;line-height:1.6;color:#625c54;margin:0 0 20px;padding:14px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.cart-actions{display:flex;gap:10px;flex-wrap:wrap}.cart-actions .button{flex:1;min-width:210px}.button-quiet{background:transparent!important;color:var(--ink)!important}.is-disabled{opacity:.45;cursor:not-allowed}
@media(max-width:650px){#cart{width:calc(100% - 20px);padding:50px 18px 22px}.cart-item{grid-template-columns:58px minmax(0,1fr) auto;gap:11px}.cart-item>img{width:58px;height:74px}.cart-item-copy h3{font-size:17px}.cart-item-actions{grid-template-columns:27px 27px 27px}.cart-item-actions button{width:26px;height:26px}.cart-actions .button{min-width:100%;width:100%}}

/* Ficha dinámica conectada al catálogo administrable. */
dialog#product-live{max-width:960px;width:calc(100% - 24px);max-height:calc(100dvh - 24px);padding:52px 28px 28px;overflow:auto}
#product-live .close{position:sticky;display:block;margin:-44px -8px 8px auto;top:0;right:auto;width:44px;height:44px;background:var(--paper);z-index:3;line-height:1;border-radius:50%;color:var(--ink)}
#product-live .product-main{display:block;width:100%;height:min(52vh,480px);max-height:480px;object-fit:contain;background:#e5e1d7;touch-action:pan-y}
@media(max-width:650px){dialog#product-live{padding:52px 18px 24px}#product-live .product-main{height:42dvh;max-height:390px}}

