/* Shared by the shop pages: /shop, /shop/<slug>, /cart and /order/thanks.
   Tokens are copied from index.html, per the repo's copy-don't-import habit. */
:root {
  /* Warmer palette (Oct 26 trial). Add ?theme=classic to any shop page to see the old one; it sticks
     for the tab until ?theme=warm. To make the old palette permanent, copy the classic values here. */
  --bg: #1c1713;
  --bg-header: #0f0d0b; /* the header stays as dark as the home page's */
  --bg-warm: #261f19;
  --panel: #261f19; /* cards, photo panel, thumbnails: one step up so dark leathers read */
  --edge: rgba(196,168,130,0.22); /* the 1px border on cards and panels */
  --tan: #c4a882;
  --tan-light: #d4bc9e;
  --cream: #e8ddd0;
  --white: #f5f0ea;
  --accent: #b8860b;
  --text-muted: #cfc4b6;
  --error: #e0866f;
}
:root[data-theme="classic"] {
  --bg: #0f0d0b;
  --bg-warm: #1a1613;
  --panel: #14110e;
  --edge: rgba(196,168,130,0.08);
  --text-muted: #b5aa9d;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body { font-family: 'Jost', sans-serif; background: var(--bg); color: var(--cream); padding-top: 64px; min-height: 100vh; }
a { color: var(--tan); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--tan-light); outline-offset: 2px; }

/* One header on every page: copied from index.html, per the repo's copy-don't-import habit. */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(1.25rem, env(safe-area-inset-right)) 0 max(1.25rem, env(safe-area-inset-left));
  background: var(--bg-header); border-bottom: 1px solid rgba(196,168,130,0.12);
}
.site-header-logo { display: flex; align-items: center; min-height: 44px; }
.site-header-logo img { height: 44px; width: auto; display: block; }
.site-header-end { display: flex; align-items: center; gap: 0.25rem; }
.site-nav { display: flex; align-items: center; gap: 0.25rem; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.85rem;
  color: var(--cream); text-decoration: none; font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; transition: color 0.3s;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--tan); }
.site-header a:focus-visible, .nav-toggle:focus-visible { outline: 2px solid var(--tan-light); outline-offset: 2px; }
.nav-toggle { display: none; min-width: 44px; min-height: 44px; background: transparent; border: 0; color: var(--tan); cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 22px; height: 2px; background: currentColor; position: relative; margin: 0 auto; content: ''; }
.nav-toggle span::before { position: absolute; top: -7px; left: 0; }
.nav-toggle span::after { position: absolute; top: 7px; left: 0; }
@media (max-width: 899px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem 1.25rem 1rem; background: var(--bg-header); border-bottom: 1px solid rgba(196,168,130,0.12); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0 0.25rem; font-size: 0.85rem; }
}
.cart-btn {
  position: relative; min-width: 44px; min-height: 44px; padding: 0 1rem;
  background: transparent; color: var(--tan); border: 1px solid rgba(196,168,130,0.4);
  font: inherit; font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; cursor: pointer;
}
.cart-btn:hover { border-color: var(--tan); }
.cart-count { margin-left: 0.5rem; color: var(--white); }

main { max-width: 1100px; margin: 0 auto; padding: 3rem 1.25rem 5rem; }
h1, h2 { font-family: 'Playfair Display', serif; color: var(--white); font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 0.5rem; }
.lede { color: var(--text-muted); margin-bottom: 2.5rem; line-height: 1.7; }
.muted { color: var(--text-muted); }
.notice { background: var(--bg-warm); border-left: 3px solid var(--accent); padding: 0.85rem 1rem; margin-bottom: 1.5rem; font-size: 1rem; line-height: 1.6; }
.error { color: var(--error); font-size: 0.9rem; margin-top: 0.75rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 2.25rem;
  background: var(--tan); color: var(--bg); border: 0; text-decoration: none; cursor: pointer;
  font: inherit; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase;
}
.btn:hover { background: var(--tan-light); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--text-muted); font: inherit; font-size: 0.8rem; text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 0.5rem; }

/* Listing */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; list-style: none; }
.card { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--bg-warm); border: 1px solid var(--edge); height: 100%; }
.card:hover { border-color: rgba(196,168,130,0.25); }
.card-img { aspect-ratio: 1/1; overflow: hidden; flex: none; min-height: 0; background: var(--panel); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.8rem; }
.card-img img { width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: 50% 50%; display: block; }
.card-body { padding: 1.25rem 1.5rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card-body .price { margin-top: auto; }
/* Two lines at most, with room for two, so every price lines up across a row. */
.card h2 { font-size: 1.1rem; line-height: 1.3; margin-bottom: 0.3rem; }
.card .leather { font-size: 13px; color: var(--text-muted); margin-bottom: 0.5rem; }
.card { position: relative; }
.badges { position: absolute; top: 0.6rem; left: 0.6rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.badge { background: rgba(15,13,11,0.85); color: var(--tan-light); border: 1px solid rgba(196,168,130,0.35); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 0.3rem 0.5rem; }
/* One row; on a phone it scrolls sideways instead of wrapping, with no visible scrollbar. */
.filters { display: flex; flex-wrap: nowrap; gap: 0.5rem; margin-bottom: 1.75rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.filters a { flex: 0 0 auto; }
.filters a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem; border: 1px solid rgba(196,168,130,0.3); color: var(--cream); text-decoration: none; font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; }
.filters a:hover { border-color: var(--tan); }
.filters a[aria-current="page"] { background: var(--tan); color: var(--bg); border-color: var(--tan); }
.filters .n { margin-left: 0.4rem; opacity: 0.7; }
@media (max-width: 599px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; } .card-body { padding: 0.9rem 0.9rem 1.1rem; } .card h2 { font-size: 15px; } }
.price { color: var(--accent); font-weight: 500; letter-spacing: 0.04em; }

/* Product */
.crumbs { font-size: 0.8rem; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 1.25rem; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--tan); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.product { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 800px) { .product { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: start; } .gallery { position: sticky; top: 80px; } }
/* Whole photos, never cropped, in one 4:5 frame for every album (portrait or landscape), sized so the
   frame and its thumbnails fit the screen height. */
.gallery { width: min(100%, calc((100vh - 160px) * 4 / 5)); margin: 0 auto; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; aspect-ratio: 4/5; max-height: calc(100vh - 160px); background: var(--panel); scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; margin: 0; display: flex; align-items: center; justify-content: center; }
.slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery.landscape { width: 100%; }
.gallery.landscape .slides { aspect-ratio: 3/2; }
.gallery.landscape .slide img { object-fit: cover; }
.slide.empty { color: var(--text-muted); }
.slide[hidden], .thumbs button[hidden], .dots button[hidden] { display: none; }
.gallery-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; }
.gallery-nav button { width: 44px; height: 44px; background: transparent; border: 1px solid rgba(196,168,130,0.3); color: var(--tan); font-size: 1.4rem; cursor: pointer; }
.gallery-nav .count { font-size: 0.8rem; color: var(--text-muted); letter-spacing: 0.1em; }
.thumbs { display: flex; gap: 0.4rem; margin-top: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; }
.thumbs button { flex: 0 0 auto; width: 72px; height: 72px; padding: 0; border: 2px solid transparent; background: var(--panel); cursor: pointer; opacity: 0.65; }
.thumbs button[aria-current="true"] { border-color: var(--accent); opacity: 1; }
/* Dots stand in for the thumbnails on a phone. */
.dots { display: none; }
.dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; background: rgba(196,168,130,0.35); cursor: pointer; }
.dots button[aria-current="true"] { background: var(--tan); }
@media (max-width: 799px) {
  .gallery { width: 100%; }
  .thumbs, .gallery-nav { display: none; }
  .dots { display: flex; justify-content: center; gap: 0.6rem; margin-top: 0.85rem; flex-wrap: wrap; }
  .dots button { position: relative; }
  .dots button::after { content: ''; position: absolute; inset: -10px; } /* a 30px tap target */
}
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product h1 { margin-top: 0.25rem; }
.product .leather { color: var(--text-muted); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; }
.product .price { font-size: 1.3rem; margin: 0.5rem 0 1.25rem; }
.product .desc { color: var(--text-muted); line-height: 1.8; margin-bottom: 1.5rem; white-space: pre-line; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1.25rem; margin: 0 0 1.5rem; font-size: 1rem; line-height: 1.5; }
.specs dt { color: var(--text-muted); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; padding-top: 0.15rem; }
.specs dd { margin: 0; color: var(--cream); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.4rem; }
.field select, .field input { width: 100%; min-height: 46px; padding: 0 0.75rem; background: var(--bg-warm); color: var(--cream); border: 1px solid rgba(196,168,130,0.3); font: inherit; font-size: 1rem; }
.field .hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }
.terms { margin-top: 1.5rem; font-size: 0.9rem; line-height: 1.7; color: var(--text-muted); }

/* Cart (drawer and page share these) */
.cart-lines { list-style: none; }
.cart-line { display: grid; grid-template-columns: 72px 1fr auto; gap: 0.9rem; padding: 1rem 0; border-bottom: 1px solid rgba(196,168,130,0.12); }
.cart-line img, .cart-line .ph { width: 72px; height: 72px; object-fit: cover; background: var(--panel); display: block; }
.cart-line h3 { font-family: 'Playfair Display', serif; font-size: 1rem; color: var(--white); margin-bottom: 0.25rem; }
.cart-line .opts { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.cart-line .qty { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin-top: 0.4rem; }
.qty button { width: 44px; height: 44px; background: transparent; border: 1px solid rgba(196,168,130,0.3); color: var(--tan); font-size: 1.1rem; cursor: pointer; }
.qty button[disabled] { opacity: 0.35; cursor: not-allowed; }
.qty .link-btn { width: auto; border: 0; color: var(--text-muted); font-size: 0.8rem; margin-left: 0.25rem; }
.qty .link-btn:hover { color: var(--tan); }
.qty output { min-width: 2rem; text-align: center; }
.cart-line .line-total { text-align: right; }
.cart-summary { padding-top: 1.25rem; line-height: 1.8; }
.cart-summary .row { display: flex; justify-content: space-between; }
.cart-summary .subtotal { font-size: 1.1rem; color: var(--white); }
.cart-summary .terms { margin: 0.75rem 0 1.25rem; }
.cart-summary .btn { width: 100%; }
.cart-empty { color: var(--text-muted); padding: 2rem 0; }

dialog.drawer {
  position: fixed; top: 0; right: 0; left: auto; margin: 0; height: 100%; max-height: 100%;
  width: min(420px, 100%); background: var(--bg); color: var(--cream);
  border: 0; border-left: 1px solid rgba(196,168,130,0.2); padding: 0;
}
dialog.drawer::backdrop { background: rgba(0,0,0,0.6); }
.drawer-inner { display: flex; flex-direction: column; height: 100%; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1.25rem; border-bottom: 1px solid rgba(196,168,130,0.12); }
.drawer-head h2 { font-size: 1.2rem; }
.drawer-close { min-width: 44px; min-height: 44px; background: none; border: 0; color: var(--tan); font-size: 1.6rem; cursor: pointer; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 1.25rem 1.25rem; }

.thanks dl { margin: 1.5rem 0; line-height: 1.8; }
.thanks li { margin-bottom: 0.5rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Listing sections */
.section-title { font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 2.5rem 0 1.25rem; }
#listing > section:first-child .section-title { margin-top: 0; }

.cart-empty + .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 2.5rem; text-decoration: none; margin-bottom: 2.5rem; }
.cart-tiles { margin-bottom: 3rem; }
.cart-line .leather { font-size: 13px; color: var(--text-muted); margin-bottom: 0.25rem; }
.site-footer { text-align: center; padding: 3rem 1.5rem; border-top: 1px solid rgba(196,168,130,0.12); color: var(--text-muted); font-size: 0.85rem; }
.site-footer img { height: 100px; width: auto; margin-bottom: 1rem; opacity: 0.6; }
.footer-brand { font-family: 'Playfair Display', serif; color: var(--cream, #f0e6d8); font-size: 1.1rem; letter-spacing: 0.1em; text-transform: uppercase; }
.footer-loc { margin: 0.4rem 0 1.2rem; letter-spacing: 0.15em; text-transform: uppercase; font-size: 0.75rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: center; margin-bottom: 1.2rem; }
.footer-links a { color: var(--tan); text-decoration: none; }
.footer-copy { font-size: 0.75rem; }
@media (max-width: 599px) {
  .tiles > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tiles > li:last-child:nth-child(odd) .card-img { aspect-ratio: 2 / 1; }
}

.policy { max-width: 720px; }
.policy h2 { font-size: 1.25rem; margin: 2rem 0 0.6rem; }
.policy p, .policy li { line-height: 1.7; color: var(--cream); }
.policy ul { padding-left: 1.2rem; margin: 0.4rem 0 1rem; }
.policy a { color: var(--tan); }
.placeholder { background: #f3d36b; color: #111; padding: 0 0.25rem; }
.footer-policy { font-size: 0.8rem; }
.cart-policy { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.75rem; }
.cart-policy a { color: var(--tan); }

.leather-note { font-size: 0.9rem; line-height: 1.7; color: var(--text-muted); margin: 0 0 1.5rem; }
.leather-note strong { color: var(--cream); font-weight: 500; }
.product-reviews { margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid rgba(196,168,130,0.15); }
.product-reviews .proof-line { font-size: 0.8rem; letter-spacing: 0.08em; margin-bottom: 1rem; }
.product-reviews .proof-line a, .product-reviews .all-reviews { color: var(--tan); text-decoration: none; }
.product-reviews blockquote { margin: 0 0 1.25rem; }
.product-reviews blockquote p { font-style: italic; line-height: 1.7; color: var(--cream); }
.product-reviews blockquote footer { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; }
.product-reviews .all-reviews { font-size: 0.85rem; }
.order-lines { list-style: none; margin: 0 0 1rem; padding: 0; }
.order-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid rgba(196,168,130,0.12); }
.order-name { color: var(--white); }
.order-choices { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; line-height: 1.5; }
.thanks h2 { font-size: 1.2rem; margin: 2rem 0 0.75rem; }
.thanks #thanks > p { margin-bottom: 0.9rem; line-height: 1.6; }
