/* The Night Shelf — shop listing, product pages and the bag drawer.
   Loaded after site.css and pages.css on /shop/ pages only.
   --shelf matches the ivory the product photos were composited on (cj/shop_images.py). */
:root { --shelf: #f3eee6; }

.shelf-hero { background: var(--navy); color: var(--on-navy); padding: clamp(3rem, 7vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem); }
.shelf-hero .page-wrap { max-width: 1200px; }
.shelf-hero .eyebrow { color: var(--amber); }
.shelf-hero .breadcrumb, .shelf-hero .breadcrumb a, .shelf-hero .breadcrumb span { color: var(--on-navy-muted); }
.shelf-hero .breadcrumb a:hover { color: var(--on-navy); }
body.cookie-open .bag-btn, .bag-btn[hidden] { display: none; }
.shelf-hero h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.02; margin: .4rem 0 1rem; color: var(--on-navy); }
.shelf-hero h1 em { color: var(--amber); font-style: italic; }
.shelf-hero p { max-width: 38rem; color: var(--on-navy-muted); font-size: 1.1rem; line-height: 1.65; }
.shelf-promises { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin-top: 1.6rem; padding: 0; list-style: none; font-size: .92rem; color: var(--on-navy); }
.shelf-promises li::before { content: "✳"; color: var(--amber); margin-right: .45rem; }

.shelf { max-width: 1200px; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) var(--gutter) clamp(3rem, 6vw, 5rem); }
.shelf-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.shelf-chip { min-height: 44px; padding: 0 1.1rem; border: 1px solid var(--border-strong); border-radius: 999px; background: transparent; color: var(--navy); font: 500 .95rem var(--font-sans); cursor: pointer; }
.shelf-chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--ivory); }

.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: clamp(1.2rem, 2.5vw, 2rem); }
.shelf-card { display: flex; flex-direction: column; color: var(--navy); text-decoration: none; }
.shelf-card-img { position: relative; aspect-ratio: 1; background: var(--shelf); border-radius: 6px; overflow: hidden; }
.shelf-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.shelf-card:hover .shelf-card-img img { transform: scale(1.04); }
.shelf-badge { position: absolute; top: .8rem; left: .8rem; background: var(--navy); color: var(--ivory); font: 500 .74rem var(--font-sans); letter-spacing: .08em; text-transform: uppercase; padding: .35rem .6rem; border-radius: 3px; }
.shelf-card-body { padding: 1rem .1rem 0; }
.shelf-card-cat { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--amber-ink); }
.shelf-card-name { font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.2; margin: .25rem 0 .3rem; }
.shelf-card-tag { color: var(--muted); font-size: .95rem; margin: 0 0 .5rem; }
.shelf-price { font-weight: 500; }
.shelf-price s { color: var(--muted); font-weight: 400; margin-left: .4rem; }
.shelf-soldout { color: var(--danger); font-size: .9rem; }

.shelf-band { background: var(--alt-bg); }
.shelf-band-inner { max-width: 1200px; margin: 0 auto; padding: clamp(2.5rem, 5vw, 4rem) var(--gutter); display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem 2.5rem; }
.shelf-band h2 { font-family: var(--font-serif); font-weight: 400; font-size: 1.4rem; margin: 0 0 .4rem; color: var(--navy); }
.shelf-band p { margin: 0; color: var(--muted); line-height: 1.6; }

/* ---- product page ---- */
.pdp { max-width: 1200px; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) clamp(3rem, 6vw, 5rem); }
.pdp-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.pdp-gallery { position: sticky; top: calc(var(--header-h) + 1rem); }
.pdp-main { aspect-ratio: 1; background: var(--shelf); border-radius: 8px; overflow: hidden; }
.pdp-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-thumbs { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }
.pdp-thumb { width: 76px; height: 76px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: var(--shelf); cursor: pointer; }
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-thumb[aria-current="true"] { border-color: var(--navy); }
.pdp-info .shelf-card-cat { display: block; margin-bottom: .4rem; }
.pdp-info h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; margin: 0 0 .5rem; color: var(--navy); }
.pdp-tagline { font-size: 1.15rem; color: var(--amber-ink); font-style: italic; font-family: var(--font-serif); margin: 0 0 1rem; }
.pdp-price { font-size: 1.6rem; font-weight: 500; margin: 0 0 1rem; color: var(--navy); }
.pdp-price s { font-size: 1.1rem; color: var(--muted); font-weight: 400; margin-left: .5rem; }
.pdp-summary { font-size: 1.05rem; line-height: 1.65; margin: 0 0 1.4rem; }
.pdp-label { display: block; font-weight: 500; margin-bottom: .5rem; }
.pdp-variants { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; border: 0; padding: 0; }
.pdp-variant { min-height: 44px; padding: 0 1rem; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--white); color: var(--navy); font: 500 .95rem var(--font-sans); cursor: pointer; }
.pdp-variant[aria-pressed="true"] { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: var(--ivory); }
.pdp-variant[data-out="true"] { color: var(--muted); text-decoration: line-through; }
.pdp-buy { display: flex; gap: .7rem; align-items: stretch; margin-bottom: .8rem; }
.pdp-qty { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--white); }
.pdp-qty button { width: 44px; border: 0; background: transparent; font-size: 1.2rem; color: var(--navy); cursor: pointer; }
.pdp-qty output { min-width: 2.2rem; display: grid; place-items: center; font-weight: 500; }
.pdp-buy .btn { flex: 1; justify-content: center; }
.pdp-msg { min-height: 1.4em; font-size: .95rem; }
.pdp-trust { list-style: none; padding: 1rem 0 0; margin: 1rem 0 0; border-top: 1px solid var(--border); display: grid; gap: .45rem; font-size: .95rem; color: var(--muted); }
.pdp-trust li::before { content: "✳"; color: var(--amber-ink); margin-right: .5rem; }
.pdp-section { margin-top: 1.8rem; }
.pdp-section h2 { font-family: var(--font-serif); font-weight: 400; font-size: 1.45rem; margin: 0 0 .7rem; color: var(--navy); }
.pdp-section p { line-height: 1.7; margin: 0 0 .9rem; }
.pdp-features { padding: 0; list-style: none; margin: 0; display: grid; gap: .55rem; }
.pdp-features li { padding-left: 1.6rem; position: relative; line-height: 1.55; }
.pdp-features li::before { content: ""; position: absolute; left: 0; top: .55em; width: .7rem; height: .7rem; border-radius: 50%; background: var(--amber); }
.pdp-details { width: 100%; border-collapse: collapse; font-size: .95rem; }
.pdp-details th, .pdp-details td { text-align: left; padding: .55rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.pdp-details th { width: 36%; font-weight: 500; color: var(--muted); }
.pdp-pair { margin-top: 2.5rem; display: grid; grid-template-columns: 110px 1fr; gap: 1.2rem; align-items: center; background: var(--navy); color: var(--on-navy); border-radius: 8px; padding: 1.2rem 1.4rem; text-decoration: none; }
.pdp-pair img { width: 110px; height: 110px; object-fit: contain; }
.pdp-pair b { display: block; font-family: var(--font-serif); font-weight: 400; font-size: 1.3rem; }
.pdp-pair span { color: var(--on-navy-muted); }
.pdp-related { margin-top: clamp(3rem, 6vw, 5rem); }
.pdp-related h2 { font-family: var(--font-serif); font-weight: 400; font-size: 1.8rem; margin: 0 0 1.4rem; color: var(--navy); }

/* ---- bag ---- */
.bag-btn { position: fixed; left: 22px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 140; display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1rem; border: 1px solid var(--navy); border-radius: 999px; background: var(--ivory); color: var(--navy); font: 500 .95rem var(--font-sans); cursor: pointer; box-shadow: var(--shadow-soft); }
.bag-btn [data-count] { min-width: 1.4rem; height: 1.4rem; border-radius: 999px; background: var(--navy); color: var(--ivory); display: inline-grid; place-items: center; font-size: .78rem; }
.bag { position: fixed; inset: 0; z-index: 320; display: flex; justify-content: flex-end; background: rgba(10, 18, 40, .55); }
.bag[hidden] { display: none; }
.bag-panel { width: min(26rem, 100%); height: 100%; background: var(--ivory); display: flex; flex-direction: column; box-shadow: var(--shadow-soft); }
.bag-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--border); }
.bag-head h2 { font-family: var(--font-serif); font-weight: 400; font-size: 1.5rem; margin: 0; color: var(--navy); }
.bag-x { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.6rem; color: var(--navy); cursor: pointer; }
.bag-lines { flex: 1; overflow-y: auto; padding: .6rem 1.3rem; }
.bag-line { display: grid; grid-template-columns: 72px 1fr auto; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--border); align-items: center; }
.bag-line img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--shelf); }
.bag-line b { font-weight: 500; display: block; }
.bag-line small { color: var(--muted); display: block; }
.bag-line .pdp-qty { margin-top: .4rem; transform: scale(.9); transform-origin: left; }
.bag-remove { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: .85rem; }
.bag-empty { color: var(--muted); padding: 2rem 0; text-align: center; }
.bag-foot { padding: 1.1rem 1.3rem 1.4rem; border-top: 1px solid var(--border); }
.bag-total { display: flex; justify-content: space-between; font-size: 1.1rem; margin-bottom: .3rem; }
.bag-note { font-size: .88rem; color: var(--muted); margin: 0 0 .9rem; }
.bag-foot .btn { width: 100%; justify-content: center; }
.bag-msg { font-size: .9rem; margin-top: .6rem; min-height: 1.2em; }
.shelf-flash { max-width: 1200px; margin: 1.5rem auto 0; padding: 1rem 1.3rem; border-radius: 6px; background: var(--alt-bg); color: var(--navy); }

@media (max-width: 860px) {
    .pdp-grid { grid-template-columns: 1fr; }
    .pdp-gallery { position: static; }
    .bag-btn { left: 16px; }
}
@media (prefers-reduced-motion: reduce) { .shelf-card-img img { transition: none; } }
