@font-face {
  font-family: Mali;
  src: url(../assets/fonts/mali-600.ttf) format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Sarabun;
  src: url(../assets/fonts/sarabun-400.ttf) format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Sarabun;
  src: url(../assets/fonts/sarabun-600.ttf) format("truetype");
  font-weight: 600;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #fff;
  --line: #e4d8c9;
  --blush: #f8daca;
  --butter: #fae8a9;
  --heading: Mali, Thonburi, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font:
    16px/1.55 Sarabun,
    Thonburi,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-underline-offset: 0.2em;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}
button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}
[hidden] {
  display: none !important;
}
.wrap {
  width: min(1120px, calc(100% - 80px));
  margin: auto;
}
.row,
.byline,
.purchase,
.dialog-top,
.zoom-nav {
  display: flex;
  align-items: center;
}
.bar {
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.bar .row {
  height: 66px;
  justify-content: space-between;
}
.brand {
  font: 600 21px var(--heading);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.shelf-icon {
  display: inline-flex;
  align-items: end;
  gap: 3px;
  border-bottom: 2px solid var(--brand);
  padding: 0 3px 2px 1px;
  height: 23px;
}
.shelf-icon i {
  width: 3px;
  height: 13px;
  background: #b85c49;
}
.shelf-icon i:nth-child(2) {
  height: 17px;
  background: var(--brand);
}
.shelf-icon i:last-child {
  height: 15px;
  background: #c08936;
  transform: rotate(-14deg);
}
.close,
.zoom-nav button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 13px;
  background: #fff;
}
.crumb {
  display: flex;
  gap: 10px;
  padding: 21px 0;
  color: var(--muted);
  font-size: 13px;
}
.crumb a { flex-shrink: 0; }
.crumb span, .intro { overflow-wrap: anywhere; }
#missing-book { padding: 30px 0 70px; }
.crumb a:hover,
.byline a:hover {
  color: var(--brand);
}
.product {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "gallery intro" "gallery buy";
  column-gap: clamp(28px, 4.5vw, 70px);
  align-items: start;
}
.intro {
  grid-area: intro;
  padding-top: 5px;
}
.category {
  display: inline-block;
  color: var(--ink);
  background: var(--tint, #fbe5da);
  border-radius: 22px;
  padding: 3px 11px;
  font: 600 13px/1.5 var(--heading);
}
.product[data-theme="nature"] { --tint: #e5efda; }
.product[data-theme="fantasy"] { --tint: #ede5f6; }
.product[data-theme="animals"] { --tint: #dfedf7; }
.product[data-theme="patterns"] { --tint: #f7e2ea; }
.product[data-theme="kids"] { --tint: #fff0c8; }
.product[data-theme="mindful"] { --tint: #ddf1e7; }
.long-title { font-size: clamp(28px, 3.2vw, 44px); }
h1 {
  font: 600 clamp(38px, 4vw, 58px) / 1.18 var(--heading);
  letter-spacing: -0.045em;
  margin: 12px 0;
}
.byline {
  flex-wrap: wrap;
  color: var(--muted);
  gap: 6px 12px;
  font-size: 15px;
}
.byline b {
  color: var(--ink);
}
.byline i {
  height: 15px;
  border-left: 1px solid #d3c6ba;
}
.byline a {
  text-decoration: none;
}
.star {
  color: #996100;
}
.soft {
  color: var(--muted);
}
.gallery {
  grid-area: gallery;
  min-width: 0;
}
.stage {
  position: relative;
  display: grid;
  place-items: center;
  background-color: var(--tint, #fae8dd);
  border: 1px solid #ebd6c4;
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
  height: clamp(316px, 29vw, 402px);
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 12px, #bc7d5a0c 12px 24px),
    repeating-linear-gradient(90deg, transparent 0 12px, #bc7d5a0c 12px 24px);
  pointer-events: none;
  z-index: -1;
}
.open-image {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 18px;
  background: transparent;
  border: 0;
  cursor: zoom-in;
}
.open-image img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
}
.stage[data-cover="true"] .open-image {
  padding: 24px 24px 28px;
}
.stage[data-cover="true"] img {
  height: 100%;
  width: auto;
  transform: rotate(-3deg);
  box-shadow:
    2px 3px 0 #e8ddc7,
    4px 5px 0 #b8a589,
    8px 11px 18px #5b3f2f30;
}
.stage[data-cover="false"] img {
  box-shadow: 1px 5px 14px #74594120;
  border-radius: 4px;
}
.image-count,
.expand {
  position: absolute;
  bottom: 12px;
  background: #fffffff2;
  border: 1px solid #e4d3c3;
}
.image-count {
  left: 14px;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.expand {
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--brand);
}
.expand svg {
  width: 21px;
}
.thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}
.thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 5px 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}
.thumb img {
  height: 39px;
  max-width: 100%;
  object-fit: contain;
}
.thumb[aria-pressed="true"] {
  border: 2px solid var(--brand);
  padding: 4px 3px;
  background: var(--brand-tint);
  color: var(--brand-deep);
  font-weight: 600;
}
.thumb:hover {
  border-color: var(--brand);
}
.stage[data-plane="true"] { background: #f5ede0; }
.stage[data-plane="true"]::before { display: none; }
.stage[data-plane="true"] .open-image {
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  cursor: pointer;
}
.stage[data-plane="true"] .open-image img {
  grid-area: 1 / 1; background: white; border-radius: 0;
  width: auto; height: 94%; max-width: 88%;
  border: 6px solid white; transform: rotate(-3deg);
  box-shadow: 0 3px 9px #51413235;
}
#plane-fade { pointer-events: none; }
.plane-palette {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.plane-actions { margin-right: auto; }
.cycle-plane {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 44px; padding: 4px 10px; border: 1px solid var(--brand-border); border-radius: 12px;
  color: var(--brand-deep); background: var(--brand-tint); font: 600 14px/1.4 Mali, sans-serif;
}
#plane-status { display: block; color: var(--muted); font: 400 13px/1.5 Sarabun, sans-serif; }
#plane-status:not(:empty) { margin-top: 3px; }
.paint-swatch {
  position: relative; display: grid; place-items: center; align-content: center; gap: 4px;
  min-width: 44px; min-height: 52px; padding: 3px; border: 0; background: none;
  color: var(--ink); font: 600 13px/1.3 Sarabun, sans-serif;
}
.paint-swatch::before {
  content: ""; box-sizing: border-box; width: 28px; height: 28px; border-radius: 50%;
  background: var(--swatch); border: 1px solid #30394920;
}
.paint-swatch[aria-pressed="true"]::before { outline: 2px solid var(--brand); outline-offset: 2px; }
.paint-swatch[aria-pressed="true"]::after {
  content: ""; position: absolute; top: 12px; left: 50%; width: 10px; height: 5px;
  border: solid var(--brand-deep); border-width: 0 0 2px 2px; transform: translateX(-50%) rotate(-45deg);
}
.thumbs:has(.plane-thumb) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.plane-thumb {
  width: 32px; height: 32px;
  background: white url("media/inside-day.jpg") 95.18% 79.26% / 434.98% 267.86% no-repeat;
}
.buy {
  grid-area: buy;
}
.summary {
  margin: 19px 0 18px;
  color: var(--muted);
  line-height: 1.65;
}
.highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.highlights div {
  border-radius: 12px;
  padding: 10px 9px;
  text-align: center;
  background: #fff1c9;
}
.highlights div:nth-child(2) {
  background: #e9f1dd;
}
.highlights div:nth-child(3) {
  background: #eee7f5;
}
.highlights dt {
  font-size: 12px;
  color: var(--muted);
}
.highlights dd {
  font: 600 clamp(13px, 1.3vw, 17px) / 1.65 var(--heading);
}
.offer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 19px;
}
.price {
  font:
    600 32px/1.2 Sarabun,
    sans-serif;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.format {
  font-size: 14px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 12px;
}
.price-date {
  color: var(--muted);
  font-size: 12px;
}
.price-date {
  margin-top: 3px;
}
.delivery {
  margin-top: 12px;
  padding: 10px 15px;
  color: var(--ink);
  background: #f2f8f3;
  border: 1px solid #cddfd4;
  border-radius: 14px;
}
.delivery-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.stock {
  color: #285d46;
  font: 600 15px/1.5 var(--heading);
}
.stock::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: #3b795f;
}
.sample-label, .destination, .delivery-facts dt {
  color: #52675c;
  font-size: 12px;
}
.delivery-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 6px 0 2px;
}
.delivery-facts dd {
  font-weight: 600;
  font-size: 16px;
}
.purchase {
  gap: 8px;
  margin: 15px 0 5px;
}
.stepper {
  display: flex;
  align-items: center;
  border: 1px solid #cbbeb1;
  border-radius: 12px;
  height: 45px;
}
.stepper button {
  width: 31px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 20px;
}
.stepper output {
  min-width: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.primary {
  background: var(--brand);
  color: white;
  font-weight: 600;
  border: 1px solid var(--brand);
  border-radius: 12px;
  min-height: 45px;
  padding: 8px 15px;
}
.primary:hover {
  background: var(--brand-deep);
}
.purchase .primary {
  flex: 1;
}
.bookmark {
  height: 45px;
  width: 45px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--brand-border);
  color: var(--brand);
  border-radius: 12px;
}
.bookmark:has(#save-label:not([hidden])) {
  display: inline-flex;
  align-items: center;
  width: auto;
  gap: 8px;
  padding: 0 14px;
}
.bookmark[aria-pressed="true"] {
  background: var(--brand-tint-hover);
}
.bookmark[aria-pressed="true"] svg {
  fill: currentColor;
}
.feedback {
  font-size: 13px;
  color: var(--brand-deep);
  min-height: 20px;
}
.details {
  margin: 33px 0 55px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  gap: 32px;
}
h2 {
  font: 600 27px/1.45 var(--heading);
}
.details > div > p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 3px;
}
details {
  border-bottom: 1px solid var(--line);
  padding: 0 0 9px;
  margin: 0 0 9px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 1px;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: "+";
  font-size: 20px;
  color: var(--brand);
  font-weight: 400;
}
details[open] > summary::after {
  content: "−";
}
details p,
.specs {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  margin-top: 5px;
}
.specs div {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) 1.7fr;
  gap: 15px;
  padding: 3px 0;
}
.specs dd {
  color: var(--ink);
}
.text-button {
  padding: 3px 0;
  color: var(--brand);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  font: inherit;
}
dialog {
  background: white;
  color: var(--ink);
  border: 0;
  border-radius: 18px;
  padding: 20px;
  width: min(900px, calc(100% - 32px));
  max-height: 92dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #302521a8;
}
.dialog-top,
.zoom-nav {
  justify-content: space-between;
  gap: 10px;
}
.dialog-top {
  margin-bottom: 12px;
}
.dialog-top h2 {
  font-size: 22px;
}
#large-image {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 66dvh;
  margin: auto;
  object-fit: contain;
}
.zoom-nav {
  margin-top: 14px;
}
.zoom-nav span {
  font-size: 14px;
  text-align: center;
}
@media (max-width: 800px) and (min-width: 701px) {
  .wrap {
    width: calc(100% - 40px);
  }
  .product {
    column-gap: 20px;
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 700px) {
  .wrap {
    width: calc(100% - 32px);
  }
  .bar .row {
    height: 51px;
  }
  .brand {
    font-size: 16px;
  }
  .crumb {
    padding: 11px 0 10px;
    font-size: 12px;
  }
  .product {
    grid-template-areas: "intro" "gallery" "buy";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 0;
  }
  .intro {
    padding: 0;
    margin-bottom: 12px;
  }
  .category {
    font-size: 12px;
  }
  h1 {
    font-size: 36px;
    margin: 5px 0 4px;
  }
  .byline {
    font-size: 13px;
  }
  .stage {
    height: clamp(215px, 62vw, 300px);
    border-radius: 15px;
  }
  .stage[data-cover="true"] .open-image {
    padding: 18px 28px;
  }
  .thumbs {
    gap: 5px;
    margin-top: 6px;
  }
  .thumb {
    font-size: 11px;
  }
  .thumb img {
    height: 28px;
  }
  .stage[data-plane="true"] { height: clamp(230px, 71vw, 300px); }
  .stage[data-plane="true"] .open-image { padding: 10px; }
  .plane-thumb { width: 28px; height: 28px; }
  .summary {
    font-size: 14px;
    margin: 12px 0;
  }
  .highlights {
    gap: 5px;
  }
  .highlights div {
    padding: 6px 3px;
  }
  .highlights dt {
    font-size: 11px;
  }
  .highlights dd {
    font-size: 14px;
  }
  .offer {
    margin-top: 12px;
  }
  .price {
    font-size: 27px;
  }
  .purchase {
    margin-top: 9px;
  }
  .stepper button {
    width: 28px;
  }
  .details {
    margin: 10px 0 30px;
    padding-top: 16px;
    display: block;
  }
  .details > div:first-child {
    margin-bottom: 12px;
  }
  h2 {
    font-size: 23px;
  }
  dialog {
    padding: 14px;
  }
  .zoom-nav button {
    font-size: 13px;
    padding: 6px 9px;
  }
  .zoom-nav span {
    font-size: 12px;
  }
  .specs div {
    grid-template-columns: 110px 1fr;
  }
}
