/* Hallmark · scope: app (kiosk) · direction: custom, IBDE blue on warm paper, serif display, covers as hero */
/* critique: all sizes from the 1080 reference via rem; dock holds controls in the lower third; attract covers are script-rendered by design (noscript fallback in index.html) */
/* IBDE kiosk layout. Colours and fonts come from theme.css. */

/* ---------- Scale: the whole interface is sized from the screen width ---------- */
html {
  font-size: 1.48148vw; /* 16px at 1080 wide, 10.7px at 720, 32px at 2160 */
  overflow-x: clip;
}
@media (orientation: landscape) and (min-aspect-ratio: 5/4) {
  /* On a wide monitor (for example a laptop), show a centred portrait frame.
     The aspect-ratio condition stops the Android keyboard from triggering this. */
  html { font-size: 0.83333vh; }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--brand-deeper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.375rem;
  font-weight: var(--weight-body);
  line-height: 1.45;
  overflow: hidden;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }
.display { font-family: var(--font-display); font-weight: var(--weight-heading); letter-spacing: -0.01em; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
.price, .dock-cart-total, .dock-cart-count, .card-price, .spotlight-price, .result-price, .detail-price, .stepper-value, .sheet-total { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 0.25rem solid var(--accent); outline-offset: 0.25rem; transition: none; }

/* ---------- App frame ---------- */
#app {
  position: relative;
  width: 100%;
  height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
}
@media (orientation: landscape) and (min-aspect-ratio: 5/4) {
  #app { width: 56.25vh; box-shadow: 0 0 4rem var(--shadow-strong); }
}

.view {
  position: absolute;
  left: 0; right: 0; top: 0;
  bottom: var(--dock-height);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.view::-webkit-scrollbar { display: none; }
.view-inner { padding-bottom: 4rem; }
.pad { padding-left: var(--gutter); padding-right: var(--gutter); }

.ribbon {
  position: absolute; left: 0; right: 0; top: 0; z-index: 60;
  background: var(--accent); color: var(--ink);
  font-size: 1.125rem; text-align: center; padding: 0.4rem 1rem;
  pointer-events: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem;
  min-height: var(--tap);
  padding: 0 2.25rem;
  border-radius: var(--radius-pill);
  font-size: 1.5rem; font-weight: var(--weight-strong);
  transition: transform 120ms ease-out, opacity 120ms ease-out;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-light { background: var(--on-brand); color: var(--brand-deep); }
.btn-ghost { background: var(--paper-raised); color: var(--brand); box-shadow: inset 0 0 0 0.125rem var(--line); }
.btn-block { display: flex; width: 100%; }
.btn-xl { min-height: 6.5rem; font-size: 2rem; }
.btn[disabled] { background: var(--paper-sunk); color: var(--ink-faint); cursor: default; }
.btn svg, .dock-btn svg, .search-bar svg { width: 2rem; height: 2rem; flex: none; }

/* ---------- Bottom dock: always within reach ---------- */
.dock {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--dock-height); z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: 0 var(--gutter);
  background: var(--paper-raised);
  box-shadow: 0 -0.125rem 0 var(--line), 0 -1rem 2.5rem var(--shadow);
}
.dock-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem;
  width: 8.5rem; height: 6.5rem; border-radius: var(--radius);
  font-size: 1.25rem; font-weight: var(--weight-label); color: var(--ink-soft);
  transition: transform 120ms ease-out, opacity 120ms ease-out;
}
.dock-btn:active { transform: scale(0.95); }
.dock-btn.is-current { color: var(--brand); background: var(--brand-soft); }
.dock-btn[disabled] { color: var(--line); cursor: default; }
.dock-cart {
  margin-left: auto;
  display: flex; align-items: center; gap: 1.25rem;
  height: 6.5rem; padding: 0 2.25rem 0 1.75rem;
  border-radius: var(--radius-pill);
  background: var(--brand); color: var(--on-brand);
  transition: transform 120ms ease-out;
}
.dock-cart:active { transform: scale(0.97); }
.dock-cart svg { width: 2.5rem; height: 2.5rem; }
.dock-cart-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.dock-cart-label { font-size: 1.25rem; color: var(--on-brand-soft); }
.dock-cart-total { font-size: 1.75rem; font-weight: var(--weight-heading); }
.dock-cart-count {
  min-width: 3rem; height: 3rem; padding: 0 0.75rem; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--on-brand); color: var(--brand); font-weight: var(--weight-heading); font-size: 1.5rem;
}
.dock-cart.is-bumped { animation: bump 360ms ease-out; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ---------- Covers ---------- */
.cover {
  position: relative; width: 100%;
  padding-top: var(--cover-ratio);
  border-radius: var(--cover-radius);
  background: var(--paper-sunk);
  overflow: hidden;
  box-shadow: 0 0.5rem 1.25rem var(--shadow);
}
.cover > * { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.cover img { object-fit: var(--cover-fit); background: var(--paper-raised); }
.cover-art {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 9% 9% 7%;
  color: var(--cover-ink);
}
.cover-art::before {
  content: ''; position: absolute; left: 5%; right: 5%; top: 3.5%; bottom: 3.5%;
  border: 0.125rem solid var(--cover-rule); border-radius: 0.2rem; pointer-events: none;
}
.cover-art::after { /* spine shading */
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6%;
  background: linear-gradient(90deg, var(--spine), var(--spine-end));
}
.c1 { background: var(--cover-1); } .c2 { background: var(--cover-2); }
.c3 { background: var(--cover-3); } .c4 { background: var(--cover-4); }
.c5 { background: var(--cover-5); } .c6 { background: var(--cover-6); }
.c7 { background: var(--cover-7); } .c8 { background: var(--cover-8); }
.cover-mark { font-family: var(--font-display); font-weight: var(--weight-heading); opacity: 0.85; }
.cover-orn { width: 22%; padding-top: 22%; height: 0; margin: 9% 0 7%; border: 0.125rem solid var(--cover-rule); transform: rotate(45deg); flex: none; }
.cover-title { font-family: var(--font-display); font-weight: var(--weight-strong); line-height: 1.15; overflow-wrap: break-word; max-width: 100%; }
.cover-rule { width: 30%; height: 0.125rem; background: var(--cover-rule); margin: 8% 0; flex: none; }
.cover-author { margin-top: auto; opacity: 0.9; }

/* Text sizes for the cover sizes in use */
.cover-s .cover-mark { font-size: 0.95rem; }
.cover-s .cover-title { font-size: 1.6rem; }
.cover-s .cover-author { font-size: 0.95rem; }
.cover-l .cover-mark { font-size: 1.6rem; }
.cover-l .cover-title { font-size: 2.5rem; }
.cover-l .cover-author { font-size: 1.6rem; }
.cover-xs .cover-art { padding: 10%; justify-content: center; }
.cover-xs .cover-mark, .cover-xs .cover-title, .cover-xs .cover-rule, .cover-xs .cover-author { display: none; }
.cover-xs .cover-orn { margin: 0; width: 30%; padding-top: 30%; }

.is-sold .cover { filter: grayscale(1); opacity: 0.55; }
.badge-sold {
  position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%);
  white-space: nowrap; padding: 0.5rem 1.25rem; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--on-brand); font-size: 1.25rem; font-weight: var(--weight-strong);
}
.cover-wrap { position: relative; }

/* ---------- Book card (grids and rows) ---------- */
.card { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; text-align: left; width: 100%; transition: transform 120ms ease-out; }
.card:active { transform: scale(0.97); }
/* Card text: title (up to 3 lines), author (up to 2), then the price pinned to
   the bottom, so prices line up across a row even when titles differ in length. */
.card-body { flex: 1; display: flex; flex-direction: column; padding-top: 1.25rem; }
.card-title {
  font-family: var(--font-display); font-weight: var(--weight-strong);
  font-size: 1.75rem; line-height: 1.25;
  overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-author {
  color: var(--ink-soft); margin-top: 0.4rem; font-size: 1.5rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.price { font-weight: var(--weight-heading); color: var(--brand); }
.card-price { margin-top: auto; padding-top: 0.75rem; font-size: 1.75rem; line-height: 1.3; }
.price-was { color: var(--ink-faint); text-decoration: line-through; font-weight: var(--weight-body); margin-left: 0.6rem; font-size: 1.375rem; }
.is-sold .card-title, .is-sold .price { color: var(--sold); }
.sold-text { color: var(--sold); font-weight: var(--weight-strong); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4rem 2rem;
}

.strip {
  display: flex; gap: 2rem;
  overflow-x: auto; overflow-y: hidden;
  padding: 0.5rem var(--gutter) 1.5rem;
  scroll-snap-type: x proximity;
  scroll-padding-left: var(--gutter);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip > .card { flex: 0 0 18.5rem; scroll-snap-align: start; }

/* Sideways rows: the right edge fades and a round "next" button shows there is
   more to see. Both disappear when the row reaches its end. */
.hscroll { position: relative; }
.hscroll:not(.is-end) > .strip,
.hscroll:not(.is-end) > .chips {
  -webkit-mask-image: linear-gradient(to right, var(--mask) calc(100% - 9rem), transparent);
  mask-image: linear-gradient(to right, var(--mask) calc(100% - 9rem), transparent);
}
.hscroll-next {
  position: absolute; right: 2rem; top: 11rem; z-index: 2;
  width: 6rem; height: 6rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-raised); color: var(--brand);
  box-shadow: 0 0.75rem 2rem var(--shadow), inset 0 0 0 0.125rem var(--line);
  transition: transform 120ms ease-out, opacity 200ms ease-out;
}
.hscroll-next:active { transform: scale(0.92); }
.hscroll-next svg { width: 2.5rem; height: 2.5rem; }
.hscroll.is-end .hscroll-next { opacity: 0; pointer-events: none; }

/* ---------- Section headings ---------- */
.section { margin-top: 4.5rem; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem;
  margin-bottom: 2rem;
}
.section-title { font-size: 2.5rem; line-height: 1.15; }
.link-btn {
  min-height: var(--tap); padding: 0 1.5rem; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--brand); font-weight: var(--weight-strong); background: var(--brand-soft);
  transition: transform 120ms ease-out;
}
.link-btn:active { transform: scale(0.96); }
.link-btn svg { width: 1.5rem; height: 1.5rem; }

/* ---------- Attract screen ---------- */
.attract {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center;
  padding: 7rem var(--gutter) 8rem;
  background: radial-gradient(ellipse at 50% 38%, var(--brand) 0%, var(--brand-deep) 55%, var(--brand-deeper) 100%);
  color: var(--on-brand);
  text-align: center;
  transition: opacity 300ms ease-out;
}
.attract.is-leaving { opacity: 0; }
.brand-lockup { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.wordmark { font-family: var(--font-display); font-weight: var(--weight-heading); line-height: 1; letter-spacing: 0.02em; }

/* Logo slots (files are named in js/brand.js). Images keep their proportions. */
img.logo { width: auto; max-width: 100%; object-fit: contain; }
img.logo-xl { height: 8rem; }
img.logo-l { height: 4.5rem; }
img.logo-m { height: 3.25rem; }
.logo-text.logo-xl { font-size: 6.5rem; }
.logo-text.logo-l { font-size: 3.75rem; }
.logo-text.logo-m { font-size: 2.5rem; }
.logo-sibf.logo-text {
  display: inline-flex; align-items: center; min-height: 3.25rem; padding: 0 1.1rem;
  border-radius: 0.5rem; box-shadow: inset 0 0 0 0.125rem var(--on-brand-soft);
  font-size: 1.375rem; font-weight: var(--weight-strong); color: var(--on-brand);
}
.tagline { font-size: 1.75rem; color: var(--on-brand-soft); }
.attract-stage { position: relative; width: 34rem; height: 51rem; margin: 5rem 0 4rem; flex: none; }
.attract-cover {
  position: absolute; left: 0; top: 0; width: 100%;
  opacity: 0; transform: scale(0.96);
  transition: opacity 900ms ease-out, transform 900ms ease-out;
}
.attract-cover.is-on { opacity: 1; transform: scale(1); }
.attract-cover .cover { box-shadow: 0 2.5rem 5rem var(--shadow-strong); }
.attract-side { position: absolute; top: 4rem; width: 70%; opacity: 0.35; }
.attract-side.left { left: -15rem; transform: rotate(-6deg); }
.attract-side.right { right: -15rem; transform: rotate(6deg); }
.attract-side .cover { box-shadow: 0 1.5rem 3rem var(--shadow-strong); }
.attract-headline { font-size: 4rem; line-height: 1.12; max-width: 22ch; }
.attract-sub { margin-top: 1.5rem; font-size: 1.75rem; color: var(--on-brand-soft); max-width: 30ch; }
.attract-cta { margin-top: auto; min-height: 7.5rem; padding: 0 4.5rem; font-size: 2.25rem; box-shadow: 0 1.5rem 3rem var(--shadow-strong); }
.attract-event { margin-top: 2.5rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; font-size: 1.375rem; color: var(--on-brand-soft); }
.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

/* ---------- Home ---------- */
.masthead {
  position: relative;
  background: linear-gradient(170deg, var(--brand) 0%, var(--brand-deep) 70%);
  color: var(--on-brand);
  padding: 3.5rem var(--gutter) 7.5rem;
}
.masthead-top { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.masthead-brand { display: flex; align-items: baseline; gap: 1.25rem; min-height: var(--tap); }
.masthead .tagline { font-size: 1.5rem; }
.spotlight {
  display: grid; grid-template-columns: minmax(0, 1fr) 23rem; gap: 3rem; align-items: center;
  margin-top: 3.5rem; min-height: 34.5rem;
  transition: opacity 400ms ease-out;
}
.spotlight.is-fading { opacity: 0; }
.spotlight-label { font-size: 1.5rem; color: var(--accent); font-weight: var(--weight-strong); }
.spotlight-title { font-size: 3.75rem; line-height: 1.1; margin-top: 1rem; }
.spotlight-author { font-size: 1.75rem; color: var(--on-brand-soft); margin-top: 1rem; }
.spotlight-price { font-size: 2.25rem; font-weight: var(--weight-heading); margin-top: 1.75rem; }
.spotlight .btn { margin-top: 2.5rem; min-height: 6.5rem; padding: 0 3.25rem; font-size: 2rem; box-shadow: 0 1rem 2.5rem var(--shadow-strong); }
.spotlight .btn svg { width: 2.25rem; height: 2.25rem; }
.spotlight-cover { display: block; width: 100%; transition: transform 120ms ease-out; }
.spotlight-cover:active { transform: scale(0.98); }
.spotlight-cover .cover { box-shadow: 0 2rem 4rem var(--shadow-strong); }
.dots { display: flex; gap: 0.75rem; margin-top: 2.5rem; }
.dot { width: 1rem; height: 1rem; border-radius: 50%; background: var(--on-brand-soft); opacity: 0.35; }
.dot.is-on { opacity: 1; background: var(--on-brand); }

.search-bar {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 1.25rem; width: calc(100% - 2 * var(--gutter));
  margin: -4rem var(--gutter) 0;
  height: 7.5rem; padding: 0 2.5rem;
  border-radius: var(--radius-pill);
  background: var(--paper-raised); color: var(--ink-faint);
  font-size: 1.75rem; text-align: left;
  box-shadow: 0 1.25rem 3rem var(--shadow);
  transition: transform 120ms ease-out;
}
.search-bar:active { transform: scale(0.99); }
.search-bar svg { color: var(--brand); width: 2.5rem; height: 2.5rem; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 18rem; padding: 2.25rem 2.25rem 2rem; overflow: hidden; text-align: left;
  border-radius: var(--radius); background: var(--paper-raised);
  transition: transform 120ms ease-out;
}
.t1 { background: var(--tint-1); } .t2 { background: var(--tint-2); } .t3 { background: var(--tint-3); }
.t4 { background: var(--tint-4); } .t5 { background: var(--tint-5); } .t6 { background: var(--tint-6); }
.tile:active { transform: scale(0.97); }
.tile-name { position: relative; z-index: 3; font-size: 2rem; line-height: 1.2; max-width: 56%; }
.tile-count {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 0.5rem;
  align-self: flex-start; min-height: 3.5rem; padding: 0 1.25rem; border-radius: var(--radius-pill);
  background: var(--paper-raised); color: var(--brand); font-weight: var(--weight-strong);
}
.tile-count svg { width: 1.5rem; height: 1.5rem; }
.tile-fan { position: absolute; right: 0.5rem; bottom: -3rem; width: 14rem; height: 14rem; }
.tile-fan .cover-wrap { position: absolute; bottom: 0; width: 7.25rem; }
.tile-fan .cover-wrap:nth-child(1) { right: 5.5rem; transform: rotate(-14deg); bottom: -0.5rem; }
.tile-fan .cover-wrap:nth-child(2) { right: 3.25rem; transform: rotate(-3deg); bottom: 0.75rem; z-index: 1; }
.tile-fan .cover-wrap:nth-child(3) { right: 0.25rem; transform: rotate(10deg); z-index: 2; }
.tile-fan .cover { box-shadow: 0 0.75rem 1.5rem var(--shadow); }

.home-note { margin-top: 5rem; text-align: center; color: var(--ink-soft); }

/* ---------- Page header (category, search) ---------- */
.page-head { padding-top: 5rem; }
.page-title { font-size: 4rem; line-height: 1.08; }
.page-sub { margin-top: 0.75rem; color: var(--ink-soft); font-size: 1.5rem; }
.chips { display: flex; gap: 1rem; overflow-x: auto; padding: 2.5rem var(--gutter) 0.5rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: var(--tap); padding: 0 1.75rem; border-radius: var(--radius-pill);
  background: var(--paper-raised); box-shadow: inset 0 0 0 0.125rem var(--line);
  font-weight: var(--weight-label); white-space: nowrap;
  transition: transform 120ms ease-out;
}
.chip:active { transform: scale(0.96); }
.chip.is-current { background: var(--ink); color: var(--on-brand); box-shadow: none; }

/* ---------- Search ---------- */
.search-field {
  display: flex; align-items: center; gap: 1rem;
  height: 7.5rem; padding: 0 1rem 0 2.5rem; margin-top: 2.5rem;
  border-radius: var(--radius-pill); background: var(--paper-raised);
  box-shadow: inset 0 0 0 0.1875rem var(--brand);
}
.search-field svg { width: 2.5rem; height: 2.5rem; color: var(--brand); flex: none; }
.search-input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font-size: 2rem; color: var(--ink);
  -webkit-user-select: text; user-select: text;
}
.search-input::placeholder { color: var(--ink-faint); }
/* While the on-screen keyboard is up, the dock steps aside so results get the room. */
.kb-open .dock { display: none; }
.kb-open .view { bottom: 0; }
.kb-open .page-head { padding-top: 2.5rem; }
.kb-open .search-field { margin-top: 1.5rem; }
.search-input::-webkit-search-cancel-button, .search-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.search-clear { min-height: 6rem; padding: 0 2rem; font-size: 1.5rem; }
.result-meta { margin-top: 2.5rem; color: var(--ink-soft); }
.results { margin-top: 1.25rem; }
.result {
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 3rem; gap: 2rem; align-items: center;
  width: 100%; padding: 1.5rem 0; text-align: left;
  border-bottom: 0.125rem solid var(--line);
  transition: opacity 120ms ease-out;
}
.result:active { opacity: 0.6; }
.result-title { font-family: var(--font-display); font-weight: var(--weight-strong); font-size: 2rem; line-height: 1.25; overflow-wrap: break-word; }
.result-author { color: var(--ink-soft); margin-top: 0.35rem; font-size: 1.5rem; }
.result-price { margin-top: 0.75rem; font-size: 1.75rem; }
.result-go { color: var(--ink-faint); }
.result-go svg { width: 2.25rem; height: 2.25rem; }
.result mark { background: var(--brand-soft); color: inherit; border-radius: 0.2rem; }
.empty { margin-top: 4rem; text-align: center; }
.empty-title { font-size: 2.25rem; }
.empty-sub { margin-top: 1rem; color: var(--ink-soft); }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 1rem; }

/* ---------- Book detail ---------- */
.detail-stage {
  display: flex; justify-content: center;
  padding: 4.5rem var(--gutter) 4rem;
  background: linear-gradient(180deg, var(--paper-sunk) 0%, var(--paper) 100%);
}
.detail-cover { width: 27rem; }
.detail-cover .cover { box-shadow: 0 2rem 4rem var(--shadow); }
.detail-cats { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.detail-cats .chip { min-height: var(--tap); padding: 0 1.5rem; font-size: 1.375rem; }
.detail-title { font-size: 3.5rem; line-height: 1.1; margin-top: 1.5rem; }
.detail-author { font-size: 1.875rem; color: var(--ink-soft); margin-top: 0.75rem; }
.detail-price { font-size: 3rem; margin-top: 1.75rem; }
.field-label { font-size: 1.5rem; font-weight: var(--weight-strong); margin: 3rem 0 1.25rem; }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.option {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.2rem;
  min-height: 7rem; padding: 1rem 1.75rem; border-radius: var(--radius); text-align: left;
  background: var(--paper-raised); box-shadow: inset 0 0 0 0.1875rem var(--line);
  transition: transform 120ms ease-out;
}
.option:active { transform: scale(0.98); }
.option-name { font-size: 1.75rem; font-weight: var(--weight-strong); }
.option-price { color: var(--ink-soft); font-size: 1.5rem; }
.option.is-selected { box-shadow: inset 0 0 0 0.3125rem var(--brand); background: var(--brand-soft); }
.option.is-selected .option-name { color: var(--brand); }
.option[disabled] { background: var(--paper-sunk); color: var(--sold); box-shadow: none; cursor: default; }
.buy-row { display: flex; gap: 1.5rem; align-items: stretch; margin-top: 3rem; }
.stepper {
  display: flex; align-items: center; flex: none;
  height: 6.5rem; border-radius: var(--radius-pill);
  background: var(--paper-raised); box-shadow: inset 0 0 0 0.1875rem var(--line);
}
.stepper button {
  width: 6.5rem; height: 6.5rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--brand);
  transition: transform 120ms ease-out;
}
.stepper button:active { transform: scale(0.9); }
.stepper button[disabled] { color: var(--line); cursor: default; }
.stepper svg { width: 2.25rem; height: 2.25rem; }
.stepper-value { min-width: 4rem; text-align: center; font-size: 2.25rem; font-weight: var(--weight-heading); }
.buy-row .btn { flex: 1; }
.description { margin-top: 4.5rem; padding-top: 3rem; border-top: 0.125rem solid var(--line); }
.description h2 { font-size: 2.25rem; margin-bottom: 1.25rem; }
.prose { font-size: 1.5rem; line-height: 1.6; color: var(--ink-soft); max-width: 46ch; }
.prose p + p, .prose ul, .prose ol { margin-top: 1rem; }

/* ---------- Toast and sheet ---------- */
.toast {
  position: absolute; left: 50%; bottom: calc(var(--dock-height) + 2rem); z-index: 25;
  display: flex; align-items: center; gap: 1rem;
  padding: 1.5rem 2.5rem; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--on-brand); font-size: 1.625rem; font-weight: var(--weight-strong);
  box-shadow: 0 1rem 2.5rem var(--shadow-strong);
  opacity: 0; transform: translate(-50%, 1rem); pointer-events: none;
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.no-dock .toast { bottom: 21rem; }
.toast svg { width: 2rem; height: 2rem; color: var(--accent); }

/* ---------- Checkout flow screens (cart, QR): no dock, own action bar ---------- */
.no-dock .dock { display: none; }
.no-dock .view { bottom: 0; }
.screen { min-height: 100%; display: flex; flex-direction: column; }
.screen > .view-inner { flex: 1; }
.view-inner.flow { display: flex; flex-direction: column; padding-bottom: 0; }

.actionbar {
  position: sticky; bottom: 0; z-index: 5; margin-top: auto;
  padding: 2rem var(--gutter) 2.75rem;
  background: var(--paper-raised);
  box-shadow: 0 -0.125rem 0 var(--line), 0 -1rem 2.5rem var(--shadow);
}
.pad > .actionbar, .flow.pad > .actionbar { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
.actionbar-buttons { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1.5rem; margin-top: 1.75rem; }
.actionbar .btn-xl { min-height: 7.5rem; }

.sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 2rem; padding: 0.6rem 0; font-size: 1.5rem; }
.sum-row > span:last-child { flex: none; font-variant-numeric: tabular-nums; }
.sum-sub { margin-top: 0.75rem; padding-top: 1.25rem; border-top: 0.125rem solid var(--line); }
.sum-main { font-size: 2.25rem; font-weight: var(--weight-heading); padding: 0.5rem 0; }
.sum-main .price { font-size: 2.75rem; }
.sum-note { color: var(--ink-soft); font-size: 1.375rem; }

.notice {
  margin: 2.5rem var(--gutter) 0; padding: 1.5rem 2rem; border-radius: var(--radius);
  background: var(--notice-bg); color: var(--danger); font-weight: var(--weight-strong); font-size: 1.5rem;
}

/* Cart lines */
.cart-lines { margin-top: 2.5rem; padding-bottom: 3rem; }
.cart-line {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: 1.5rem 2rem; align-items: start;
  padding: 2.25rem 0; border-bottom: 0.125rem solid var(--line);
}
.cart-line-cover { display: block; width: 100%; }
.cart-line-title { font-size: 1.875rem; font-weight: var(--weight-strong); line-height: 1.25; overflow-wrap: break-word; }
.cart-line-variant { margin-top: 0.4rem; font-size: 1.5rem; color: var(--ink-soft); }
.cart-line-unit { margin-top: 0.4rem; font-size: 1.375rem; color: var(--ink-faint); }
.cart-line-flag { margin-top: 0.4rem; font-size: 1.5rem; color: var(--danger); font-weight: var(--weight-strong); }
.cart-line-total { font-size: 2rem; text-align: right; white-space: nowrap; }
.cart-line-controls { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.cart-line-controls .stepper { height: 5.5rem; }
.cart-line-controls .stepper button { width: 5.5rem; height: 5.5rem; }
.cart-remove { min-height: 5.5rem; color: var(--ink-soft); }
.cart-remove svg { width: 1.75rem; height: 1.75rem; }
.cart-line.is-gone .cover { filter: grayscale(1); opacity: 0.55; }
.cart-line.is-gone .cart-line-title { color: var(--sold); }
.cart-empty { margin: auto 0; padding: 4rem 0; }

/* QR screen: fits the screen exactly, never scrolls */
.screen-fit { height: 100%; min-height: 0; overflow: hidden; }
.qrx { height: 100%; }
.qrx-top {
  flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  padding: 5rem var(--gutter) 3rem;
  background: linear-gradient(170deg, var(--brand) 0%, var(--brand-deep) 80%);
  color: var(--on-brand);
}
.qrx-head { text-align: center; }
.qr-title { font-size: 4.5rem; line-height: 1.1; }
.qr-sub { margin-top: 0.75rem; font-size: 1.625rem; color: var(--on-brand-soft); }
.qrx-grid {
  flex: 1; min-height: 0; margin-top: 3.5rem;
  display: grid; grid-template-columns: 27rem minmax(0, 1fr); gap: 2.5rem; align-items: start;
}
.qrx-left { display: flex; flex-direction: column; min-width: 0; }
.qr-card {
  width: 27rem; height: 27rem; padding: 1rem;
  border-radius: var(--radius); background: var(--qr-light);
  box-shadow: 0 1.5rem 3rem var(--shadow-strong);
}
.qr { display: block; width: 100%; height: 100%; }
.qr-bg { fill: var(--qr-light); }
.qr-fg { fill: var(--qr-dark); }
.qr-demo { margin-top: 1.25rem; padding: 0.75rem 1.25rem; border-radius: var(--radius); background: var(--accent); color: var(--ink); font-size: 1.25rem; line-height: 1.3; font-weight: var(--weight-strong); text-align: center; }
.steps { list-style: none; margin: 2.5rem 0 0; padding: 0; }
.step { display: flex; align-items: flex-start; gap: 1.25rem; padding: 1.1rem 0; font-size: 1.75rem; font-weight: var(--weight-label); line-height: 1.3; }
.step-num {
  flex: none; width: 3.5rem; height: 3.5rem; margin-top: -0.4rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-raised); color: var(--brand); font-size: 1.875rem; font-weight: var(--weight-heading);
}

/* Order summary panel */
.qs {
  min-width: 0; padding: 2.25rem 2.25rem 2rem; border-radius: var(--radius);
  background: var(--paper-raised); color: var(--ink);
  box-shadow: 0 1.5rem 3rem var(--shadow-strong);
}
.qs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 0.125rem solid var(--line); }
.qs-heading { font-size: 2rem; }
.qs-count { flex: none; font-size: 1.5rem; color: var(--ink-soft); }
.qs-list.is-paged.per-5 { min-height: 53.75rem; }
.qs-list.is-paged.per-4 { min-height: 43rem; }
.qs-row {
  height: 10.75rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; align-items: center;
  border-bottom: 0.125rem solid var(--line);
}
.qs-what { min-width: 0; }
.qs-title {
  font-size: 1.5rem; font-weight: var(--weight-strong); line-height: 1.25; overflow-wrap: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.qs-variant { margin-top: 0.3rem; font-size: 1.375rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-cost { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qs-line { font-size: 1.625rem; }
.qs-unit { margin-top: 0.3rem; font-size: 1.375rem; color: var(--ink-soft); }
.qs-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.25rem; }
.qs-range { white-space: nowrap; font-size: 1.5rem; font-weight: var(--weight-strong); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.qs-nav {
  width: 5.5rem; height: 5.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand);
  transition: transform 120ms ease-out;
}
.qs-nav:active { transform: scale(0.92); }
.qs-nav[disabled] { background: var(--paper-sunk); color: var(--line); cursor: default; }
.qs-nav:focus-visible { outline: 0.25rem solid var(--brand); outline-offset: 0.25rem; }
.qs-nav svg { width: 2.25rem; height: 2.25rem; }
.qs-foot { padding-top: 1.25rem; }
.qs-foot .sum-row { font-size: 1.375rem; color: var(--ink-soft); padding: 0.3rem 0; }
.qs-total { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-top: 0.5rem; font-size: 2.25rem; font-weight: var(--weight-heading); }
.qs-total .price { font-size: 3.25rem; color: var(--brand); font-variant-numeric: tabular-nums; }
.qr-timer { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 5rem; margin-bottom: 0.75rem; }
.qr-timer-text { font-size: 1.625rem; color: var(--ink-soft); }
.qr-timer-text strong { display: inline-block; min-width: 3.25rem; color: var(--ink); font-weight: var(--weight-heading); font-variant-numeric: tabular-nums; }
.qr-timer-text.is-low strong { color: var(--danger); }
.qr-timer .btn { min-height: 5rem; padding: 0 2rem; font-size: 1.5rem; }

/* ---------- "Masih di sini?" ---------- */
.idle {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; align-items: center; justify-content: center; padding: var(--gutter);
  background: var(--scrim);
}
.idle-card {
  width: 100%; max-width: 52rem; padding: 4rem 3.5rem 3.5rem; border-radius: var(--radius);
  background: var(--paper-raised); text-align: center;
  box-shadow: 0 2rem 5rem var(--shadow-strong);
}
.idle-title { font-size: 4rem; line-height: 1.1; }
.idle-body { margin-top: 1.5rem; font-size: 1.75rem; line-height: 1.4; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.idle-buttons { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1.5rem; margin-top: 3rem; }
.idle-buttons .btn-xl { min-height: 7.5rem; }

/* ---------- Loading and error ---------- */
.message {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem;
  padding: var(--gutter); text-align: center;
  background: var(--brand-deep); color: var(--on-brand);
}
.message-title { font-size: 3rem; line-height: 1.2; max-width: 20ch; }
.message-body { font-size: 1.75rem; color: var(--on-brand-soft); }
.message .btn { margin-top: 2rem; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
}
