/* the hidden attribute always wins, whatever display an element's own rule sets */
[hidden] { display: none !important; }

:root {
  --bg: #faf9f7;
  --fg: #1c1b1a;
  --muted: #6b6762;
  --line: #e6e2dc;
  --accent: #8a4b2a;
  --card: #ffffff;
  --radius: 6px;
  --max: 1200px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.site-header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 28px 0 20px; border-bottom: 1px solid var(--line);
}
.site-header .brand { font-size: 26px; letter-spacing: .04em; text-transform: uppercase; }
.site-header nav a { margin-left: 20px; color: var(--muted); font-size: 15px; }
.site-header nav a:hover { color: var(--fg); }
.site-header .shipto { margin-left: 20px; color: var(--muted); font-size: 14px; }
.site-header .shipto select { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--fg); max-width: 190px; }
.details .vat-note { font-size: 13px; margin: 0 0 6px; }
.details .price-ask { font-size: 15px; color: var(--muted); }
.details .price-ask .ship-country { margin-top: 6px; }

.site-footer { color: var(--muted); font-size: 13px; padding: 40px 0; border-top: 1px solid var(--line); margin-top: 60px; }
.site-footer a:hover { color: var(--fg); }

/* imprint, terms and privacy */
.legal { padding: 24px 0 36px; max-width: 720px; font-size: 15px; line-height: 1.6; }
.legal-nav { display: flex; gap: 18px; margin-bottom: 28px; font-size: 14px; }
.legal-nav a { color: var(--muted); }
.legal-nav a:hover { color: var(--fg); }
.legal section { margin-bottom: 44px; }
.legal h1 { font-weight: normal; font-size: 26px; margin: 0 0 12px; }
.legal h2 { font-weight: normal; font-size: 17px; margin: 22px 0 6px; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal a { text-decoration: underline; text-underline-offset: 2px; }
.legal .back { text-decoration: none; }

.muted { color: var(--muted); }
.notice-bar { background: var(--fg); color: #fff; text-align: center; font: 13px/1.4 system-ui, sans-serif;
  letter-spacing: .08em; text-transform: uppercase; padding: 9px 16px; }
.notice-bar:empty { display: none; }
.notice { padding: 40px 0; color: var(--muted); text-align: center; }

/* search + category chips */
.toolbar { display: flex; flex-direction: column; gap: 14px; padding: 24px 0 4px; }
.search { display: flex; gap: 8px; max-width: 520px; }
.search input { flex: 1; font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.search button, .button { font: inherit; font-size: 14px; padding: 9px 16px; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: var(--radius); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 13px/1 system-ui, sans-serif; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); cursor: pointer; }
.chip:hover { color: var(--fg); }
.chip.active { background: var(--fg); color: #fff; border-color: var(--fg); }
.count { margin: 8px 0 0; font-size: 14px; }

/* collection grid */
.grid {
  display: grid; gap: 28px 24px; padding: 24px 0;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card { display: block; }
.card .frame {
  aspect-ratio: 1 / 1; background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.card .frame img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s ease; }
.card:hover .frame img { transform: scale(1.02); }
.card .frame.empty { color: var(--muted); font-size: 13px; }
.card h3 { margin: 12px 0 2px; font-weight: normal; font-size: 16px; line-height: 1.35; }
.card .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); }
.card .meta .price { color: var(--fg); white-space: nowrap; }

.badge { display: inline-block; font: 12px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 3px; background: #efe9e2; color: var(--accent); }
.badge.sold { background: #eee; color: #777; }
.badge.reserved { background: #f4ecd8; color: #8a6a1e; }
.badge.draft { background: #e8e8f4; color: #4a4a8a; }

/* item page */
.crumbs { font-size: 14px; color: var(--muted); padding: 18px 0 0; }
.crumbs a:hover { color: var(--fg); }
/* Two equal halves in two rows: photos | title, price, buy and the contact form (about as tall as the
   photo block); then description | facts. So neither column is left with a tall empty space. */
.item { display: grid; gap: 20px 40px; padding: 20px 0 36px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
/* a grid with minmax(0, 1fr), not a flex column: the thumbnail strip's full width must never widen the
   column (on a phone it made the whole page wider than the screen) */
.item .images { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; min-width: 0; }
.item .details { width: 100%; max-width: 520px; margin: 0 auto; }
.item .details.text { max-width: min(100%, max(280px, calc(100vh - 270px))); }   /* as wide as the photo above it */
.item .details.facts dl { margin-top: 0; }
@media (max-width: 800px) { .item { grid-template-columns: minmax(0, 1fr); gap: 24px; } .item .details.text { max-width: 520px; } }
/* A fixed square stage: photos and videos are fitted inside it and overlap in the
   same box, so the page never reshapes when the picture or the clip changes. */
/* Sized so the square plus the thumbnail row fit in one screen under the header:
   as wide as the column, but never taller than the viewport minus ~270px of chrome. */
.item .main-image { position: relative; width: min(100%, max(280px, calc(100vh - 270px))); aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.item .main-image img, .item .main-image video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.item .main-image img { cursor: zoom-in; }
.item .main-image video { background: #000; z-index: 1; }
.item .main-image [hidden] { display: none; }
/* previous / next, over the photo or the clip (clear of the video controls at the bottom) */
.item .main-image .img-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .78); color: #1c1b1a; cursor: pointer;
  font: 34px/1 system-ui, sans-serif; display: flex; align-items: center; justify-content: center; padding: 0 0 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.item .main-image .img-nav[hidden] { display: none; }
.item .main-image .img-nav:hover { background: #fff; }
.item .main-image .img-prev { left: 10px; }
.item .main-image .img-next { right: 10px; }
/* One row that scrolls sideways, so many photos never push the page down. */
.thumbs { display: flex; gap: 10px; flex-wrap: nowrap; overflow-x: auto; margin-top: 12px; padding-bottom: 6px; max-width: 100%;
  width: min(100%, max(280px, calc(100vh - 270px))); scrollbar-width: thin; }
.thumbs button { padding: 0; border: 2px solid transparent; background: none; cursor: pointer; width: 72px; height: 72px; flex: none; }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button.active { border-color: var(--accent); }
.thumbs button.is-video { position: relative; }
.thumbs button.is-video::after { content: "\25B6"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font: 22px/1 system-ui, sans-serif; text-shadow: 0 0 6px rgba(0,0,0,.8); pointer-events: none; }
.thumbs .novideo { display: block; width: 100%; height: 100%; background: #333; }
.details h1 { font-weight: normal; font-size: 28px; line-height: 1.25; margin: 0 0 4px; }
.details .maker { margin: 0 0 10px; color: var(--muted); font-size: 16px; }
.details .price { font-size: 24px; margin: 14px 0 4px; }
.details .shipping { font-size: 14px; margin: 0 0 16px; }
.details .cta { margin: 0 0 22px; }
.details .cta .button { display: inline-block; }
.details .cta .buy { font-size: 16px; padding: 12px 22px; margin-bottom: 10px; }
.details .cta .buy:disabled { opacity: .5; cursor: default; }
.details .cta .ship-label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.details .cta .ship-country { display: block; width: 100%; max-width: 360px; margin-top: 4px; font: inherit; font-size: 15px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--fg); }
.details .cta .buy + .button { margin-left: 8px; }
.details .cta .error { color: #a3271f; font-size: 14px; margin: 6px 0; }
.details .cta .small { font-size: 13px; margin: 4px 0 0; }
.details .cta a.button { background: transparent; color: var(--accent); }
/* contact form under the price */
.ask { margin: 0 0 24px; padding: 16px; background: var(--card); border: 1px solid var(--line); }
.ask h2 { font-weight: normal; font-size: 17px; margin: 0 0 10px; }
.ask-row { display: flex; gap: 8px; margin-bottom: 8px; }
.ask input, .ask textarea { font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; width: 100%; box-sizing: border-box; }
.ask textarea { resize: vertical; margin-bottom: 8px; }
.ask-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ask-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ask-actions .button { font-size: 14px; padding: 9px 18px; }
@media (max-width: 480px) { .ask-row { flex-direction: column; } }
/* the emailed confirmation code, asked for under a form */
.code-host .small { font-size: 13px; margin: 8px 0 6px; }
.code-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.code-row input { font: inherit; font-size: 16px; letter-spacing: .2em; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; width: 140px; box-sizing: border-box; }
.code-row .button { font-size: 14px; padding: 9px 16px; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; }
button.link:hover { color: var(--fg); }

/* sign-up for news */
.signup { margin: 48px 0 0; padding: 24px; background: var(--card); border: 1px solid var(--line); }
.signup h2 { font-weight: normal; font-size: 20px; margin: 0 0 4px; }
.signup p { margin: 0 0 12px; }
.signup-form { display: flex; gap: 8px; flex-wrap: wrap; }
.signup-form input { font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); flex: 1; min-width: 180px; }
.signup-form button { font: inherit; font-size: 14px; padding: 9px 16px; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: var(--radius); cursor: pointer; }
.signup .small { font-size: 13px; margin: 8px 0 0; }

/* embedded payment form on the product page */
.pay { margin: 8px 0 40px; background: var(--card); border: 1px solid var(--line); padding: 18px 20px 24px; }
.pay-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.pay-head h2 { font-weight: normal; font-size: 20px; margin: 0; }
.pay-head .spacer { flex: 1; }
.pay-head button { font: inherit; font-size: 14px; padding: 6px 12px; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); cursor: pointer; }
.pay .small { font-size: 13px; margin: 0 0 12px; }
#checkout { min-height: 400px; }

/* order / thank-you page */
.order-page { padding: 36px 0; max-width: 680px; }
.order-news { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line); background: var(--card); }
.order-news button { font: inherit; font-size: 14px; padding: 8px 14px; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: var(--radius); cursor: pointer; }
.order-page h1 { font-weight: normal; font-size: 30px; margin: 0 0 6px; }
.order-card { background: var(--card); border: 1px solid var(--line); padding: 20px; margin: 22px 0; }
.order-item { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.order-item img { width: 88px; height: 88px; object-fit: cover; }
.order-item-title { font-size: 18px; }
.order-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 15px; margin: 0; }
.order-card dt { color: var(--muted); }
.order-card dd { margin: 0; }
.details dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 15px; margin: 22px 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.details .description { white-space: pre-line; margin: 0; }
.related { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 28px; }
.related h2 { font-weight: normal; font-size: 20px; margin: 0; }
.related .grid { padding-top: 16px; }
.back { display: inline-block; margin-top: 24px; color: var(--muted); font-size: 15px; }
.back:hover { color: var(--fg); }

.version { font: 12px/1 system-ui, sans-serif; color: var(--muted); }

/* lightbox: full-screen viewer with zoom and pan (see N.lightbox in common.js) */
body.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; background: rgba(20, 18, 16, .96); z-index: 10; }
.lightbox .lb-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none; cursor: zoom-in; }
.lightbox.zoomed .lb-stage { cursor: grab; }
.lightbox.zoomed .lb-stage:active { cursor: grabbing; }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; user-select: none; -webkit-user-drag: none;
  transform-origin: center center; transition: transform .12s ease-out; will-change: transform; }
.lightbox.zoomed img { transition: none; }
.lightbox button { position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
  font: 28px/1 system-ui, sans-serif; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.lightbox button:hover { background: rgba(255, 255, 255, .25); }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-nav { top: 50%; transform: translateY(-50%); font-size: 34px; }
.lightbox .lb-prev { left: 16px; }
.lightbox .lb-next { right: 16px; }
.lightbox .lb-hint, .lightbox .lb-count { position: absolute; bottom: 14px; color: rgba(255, 255, 255, .7);
  font: 13px/1.4 system-ui, sans-serif; pointer-events: none; }
.lightbox .lb-hint { left: 50%; transform: translateX(-50%); }
.lightbox .lb-count { left: 16px; }
.lightbox.zoomed .lb-hint { display: none; }
@media (max-width: 600px) { .lightbox .lb-hint { display: none; } }
