/* Fieldnote Goods, Stillwater bottle.
   The page is the studio the bottle stands in: its background is the backdrop of the chosen render,
   and the one colour on it is the powder coat of the chosen bottle. One typeface, upright. */
:root {
  --ink: #1b1f1d;
  --ink-2: #363c38;
  --muted: #515853;
  --paper: #f8faf6;
  --tone: #dee3db;
  --coat: #566b5b;
  --on-coat: #f4f6f1;
  --on-coat-soft: #e4eae4;
  --coat-text: #415547;
  --line: rgba(27, 31, 29, .16);
  --line-strong: rgba(27, 31, 29, .36);
  --sold: #8a3b2e;
  --sans: "Archivo", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.22, .8, .28, 1);
  --radius: 10px;
  --swap: 0s;
}
body.ready { --swap: .5s var(--ease); }
body[data-tone="glacier"] { --tone: #dce3e6; --coat: #a9bbbe; --on-coat: #142428; --on-coat-soft: #2c4046; --coat-text: #48656d; }
body[data-tone="basalt"] { --tone: #d6d6d3; --coat: #303336; --on-coat: #f1f1ee; --on-coat-soft: #c6c7c3; --coat-text: #2b2d30; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--tone); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; transition: background-color var(--swap); }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
.figure { font-variant-numeric: tabular-nums lining-nums; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 60; top: 12px; left: 12px; padding: 12px 16px; border-radius: 8px; background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.shell { width: min(1320px, 100% - 32px); margin: 0 auto; }

.ribbon { padding: 7px 16px; background: var(--coat); color: var(--on-coat); font-size: 14px; font-weight: 500; text-align: center; transition: background-color var(--swap), color var(--swap); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--tone) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: background-color var(--swap); }
.header-row { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; margin-right: auto; text-decoration: none; }
.main-nav { display: flex; gap: 4px; }
.main-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--ink); font-size: 15.5px; font-weight: 500; text-decoration: none; }
.main-nav a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.bag-button { position: relative; display: inline-grid; place-items: center; width: 46px; height: 46px; margin-left: 8px; border: 0; border-radius: 50%; background: transparent; transition: background-color .15s ease; }
.bag-button:hover { background: rgba(27, 31, 29, .08); }
.bag-button svg { width: 24px; height: 24px; }
.bag-count { position: absolute; top: 3px; right: 0; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bag-count.bump { animation: bump .5s var(--ease); }
@keyframes bump { 30% { transform: scale(1.45); } }

/* Product: options left, the bottle right, views in a strip below it */
.product-layout { display: grid; gap: 22px; padding-top: 12px; padding-bottom: 72px; }
@media (min-width: 980px) {
  .product-layout { grid-template-columns: minmax(380px, .8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; padding-top: 20px; }
  .gallery-column { order: 2; position: sticky; top: 76px; }
  .product-info { order: 1; padding-top: 18px; }
}
.gallery { display: grid; gap: 10px; }
/* No frame. The backdrop of the render fades into the page, which has the same colour. */
.media-stage { position: relative; aspect-ratio: 4 / 5; max-height: calc(100vh - 236px); overflow: hidden; isolation: isolate; }
.media-stage::after, .sizes-figure::after { content: ""; position: absolute; inset: -1px; z-index: 1; pointer-events: none; box-shadow: inset 0 0 56px 30px var(--tone), inset 0 110px 80px -40px var(--tone); transition: box-shadow var(--swap); }
@media (min-width: 980px) { .media-stage { margin: 0 auto; width: 100%; } }
/* Zoomed in, the stage becomes a plain window so nothing fades over the close view */
.media-stage { transition: border-radius .3s ease; }
.media-stage[data-zoom="on"] { border-radius: var(--radius); }
.media-stage[data-zoom="on"]::after { box-shadow: inset 0 0 0 0 var(--tone); transition: box-shadow .3s ease; }
.zoom-frame { position: absolute; inset: 0; transition: transform .45s var(--ease); cursor: zoom-in; touch-action: pan-y; }
.media-stage[data-zoom="on"] .zoom-frame { transform: scale(2.1); cursor: zoom-out; touch-action: none; transition: transform .45s var(--ease), transform-origin .12s linear; }
.product-image, .engrave-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-stage[data-gallery-state="loading"] .product-image { opacity: .55; transition: opacity .2s ease; }
.engrave-layer { pointer-events: none; }
/* The engraving preview copies the lettering stamped on the bottle */
.engrave-layer text { font: 600 21px/1 var(--sans); letter-spacing: 5px; fill: url(#etch); paint-order: stroke; stroke: rgba(0, 0, 0, .28); stroke-width: .8px; }
.stage-tools { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.image-index, .view-name { color: var(--ink-2); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.image-index { color: var(--muted); }
.view-name { margin-right: auto; }
.zoom-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 0 12px; border: 0; border-radius: var(--radius); background: var(--paper); font-size: 15px; font-weight: 600; pointer-events: auto; transition: background-color .15s ease, color .15s ease; }
.zoom-button:hover { background: #fff; }
.zoom-button svg { width: 20px; height: 20px; }
.zoom-button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.stage-arrows { position: absolute; inset: 50% 10px auto; z-index: 2; display: flex; justify-content: space-between; transform: translateY(-50%); pointer-events: none; }
.arrow-button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--paper); opacity: 0; pointer-events: auto; transition: opacity .2s ease, background-color .15s ease; }
.arrow-button svg { width: 22px; height: 22px; }
.arrow-button:hover { background: #fff; }
.media-stage:hover .arrow-button, .arrow-button:focus-visible { opacity: 1; }
@media (hover: none) { .arrow-button { opacity: 1; } }
.media-stage[data-zoom="on"] .stage-arrows { display: none; }
.media-skeleton { position: absolute; inset: 0; display: grid; place-items: center; }
.skeleton-shape { width: 26%; height: 62%; border-radius: 40px 40px 14px 14px; background: linear-gradient(100deg, rgba(255, 255, 255, .2) 30%, rgba(255, 255, 255, .55) 50%, rgba(255, 255, 255, .2) 70%) 0 0 / 300% 100%; animation: sheen 1.2s linear infinite; }
@keyframes sheen { to { background-position: -150% 0; } }
.media-fallback { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; color: var(--ink-2); }
.fallback-icon { width: 54px; height: 54px; color: var(--muted); }
.media-fallback strong { font-size: 20px; font-weight: 700; }
.media-fallback span { max-width: 32ch; color: var(--muted); font-size: 15px; }
.gallery-thumbnails { order: 2; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 3px; }
.gallery-thumbnails::-webkit-scrollbar { display: none; }
.thumb-button { flex: none; width: 68px; padding: 0; border: 0; border-radius: 8px; background: transparent; overflow: hidden; opacity: .7; transition: opacity .2s ease, box-shadow .2s ease, transform .2s var(--ease); }
.thumb-button img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.thumb-button:hover { opacity: 1; }
.thumb-button:active, .arrow-button:active, .zoom-button:active, .qty-button:active, .ghost-button:active, .swap-button:active { transform: scale(.96); }
.thumb-button[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--ink); }

.product-info { min-width: 0; }
.breadcrumbs ol { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 14.5px; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; opacity: .6; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
/* The name is set in the coat of the bottle on screen */
h1 { margin-top: 10px; color: var(--coat-text); font-size: clamp(44px, 4.6vw, 66px); line-height: 1; letter-spacing: -.028em; word-spacing: .04em; transition: color var(--swap); }
.title-main { display: inline; }
.price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-top: 16px; }
.price { font-size: 30px; font-weight: 600; letter-spacing: -.01em; }
.price-meta { color: var(--muted); font-size: 16px; }
.product-description { max-width: 46ch; margin-top: 10px; color: var(--ink-2); font-size: 17px; }
.link-message { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius); background: rgba(138, 59, 46, .1); color: var(--sold); }
.link-message p { margin-top: 2px; font-size: 15px; }

/* Options */
.variant-form { margin-top: 24px; container-type: inline-size; }
.option-fieldset { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.option-fieldset legend { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; padding: 0; font-size: 16px; }
.legend-key { font-weight: 600; }
.current-option { color: var(--muted); }
.color-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.color-choice, .size-choice { border-radius: var(--radius); background: rgba(255, 255, 255, .42); box-shadow: inset 0 0 0 1px var(--line); }
.color-choice { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 10px 6px 6px; cursor: pointer; transition: box-shadow .2s ease, background-color .2s ease; }
.color-choice input, .size-choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
/* Each colour is shown by a crop of its own render, cap and shoulder */
.swatch { flex: none; width: 52px; height: 52px; border-radius: 6px; background: var(--swatch) center 34% / 150% auto no-repeat; }
.choice-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 16px; font-weight: 500; }
/* In a narrow column the three colours still sit side by side */
@container (max-width: 460px) {
  .color-options { display: flex; gap: 8px; }
  .color-choice { flex: 1 1 auto; gap: 8px; padding: 5px 8px 5px 5px; }
  .swatch { width: 38px; height: 38px; }
  .choice-text { font-size: 15.5px; }
}
.color-choice:hover, .size-choice:hover { background: var(--paper); }
.color-choice:has(input:checked), .size-choice:has(input:checked) { background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); }
.color-choice:has(input:checked) .choice-text { font-weight: 600; }
.color-choice:has(input:focus-visible), .size-choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.size-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.size-choice { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: baseline; padding: 12px 16px 13px; cursor: pointer; transition: box-shadow .2s ease, background-color .2s ease; }
.size-label { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.size-price { color: var(--ink-2); font-size: 16px; }
.size-hint { grid-row: 2; grid-column: 1 / -1; color: var(--muted); font-size: 14.5px; }
.option-note { grid-row: 2; grid-column: 1 / -1; color: var(--sold); font-size: 14.5px; font-weight: 600; }
.size-choice[data-available="false"] .size-hint { display: none; }
.size-choice[data-available="false"] .size-label { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--muted); }

.engrave-fieldset { padding: 2px 0 0; }
.engrave-toggle { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; cursor: pointer; }
.engrave-toggle input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.toggle-track { position: relative; width: 44px; height: 26px; margin-top: 1px; border-radius: 13px; background: rgba(27, 31, 29, .26); transition: background-color .2s ease; }
.toggle-track span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); }
.engrave-toggle input:checked + .toggle-track { background: var(--ink); }
.engrave-toggle input:checked + .toggle-track span { transform: translateX(18px); }
.engrave-toggle input:focus-visible + .toggle-track { outline: 2px solid var(--ink); outline-offset: 3px; }
.engrave-copy strong { font-weight: 600; }
.engrave-copy .figure { color: var(--muted); }
.engrave-copy small { display: block; color: var(--muted); font-size: 14.5px; line-height: 1.4; }
.engrave-field { position: relative; margin-top: 14px; }
.engrave-field input { width: 100%; min-height: 50px; padding: 0 64px 0 14px; border: 0; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 18px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.engrave-field input::placeholder { letter-spacing: 0; text-transform: none; font-weight: 400; color: #7d857f; }
.engrave-field input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--ink); }
.engrave-count { position: absolute; top: 14px; right: 14px; color: var(--muted); font-size: 14px; }
.engrave-help { margin-top: 6px; color: var(--muted); font-size: 14px; }

.availability { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 16px; }
.availability strong { color: var(--coat-text); font-weight: 700; transition: color var(--swap); }
.availability[data-available="false"] strong { color: var(--sold); }
.availability span { color: var(--muted); }
.swap-button { min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--radius); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 15px; font-weight: 600; }
.swap-button:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.buy-row { display: flex; gap: 10px; margin-top: 14px; }
.quantity { display: flex; align-items: center; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line-strong); }
.qty-button { display: grid; place-items: center; width: 46px; height: 58px; border: 0; background: transparent; }
.qty-button svg { width: 16px; height: 16px; }
.qty-button:disabled { opacity: .3; }
.qty-value { min-width: 24px; text-align: center; font-size: 18px; font-weight: 600; }
/* The button is the coat too */
.add-button { flex: 1; min-height: 58px; padding: 0 22px; border: 0; border-radius: var(--radius); background: var(--coat); color: var(--on-coat); font-size: 18px; font-weight: 700; transition: transform .12s ease, background-color var(--swap), color var(--swap), filter .15s ease; }
.add-button:hover:not(:disabled) { filter: brightness(.9); }
.add-button:active { transform: scale(.985); }
.add-button:disabled { background: #9aa09b; color: #fff; }
.promise-list { display: flex; flex-wrap: wrap; gap: 4px 26px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 15.5px; }
.promise-list b { color: var(--ink); font-weight: 700; }

/* Details: a band in the coat of the chosen bottle */
.story { padding: 76px 0; background: var(--coat); color: var(--on-coat); transition: background-color var(--swap), color var(--swap); }
.story-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .story-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 72px; } }
.story-figure { margin: 0; border-radius: 6px; overflow: hidden; }
.story-figure img { width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; }
.story-copy h2, .sizes-copy h2, .care h2 { font-size: clamp(32px, 3.2vw, 44px); letter-spacing: -.03em; }
.story-copy > p { max-width: 44ch; margin-top: 14px; font-size: 19px; line-height: 1.4; }
.sizes-copy > p:not(.day-answer) { max-width: 50ch; margin-top: 14px; color: var(--ink-2); font-size: 17px; }
.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; margin: 30px 0 0; }
.spec-list div { padding: 13px 0; border-top: 1px solid color-mix(in srgb, var(--on-coat) 30%, transparent); }
.spec-list dt { color: var(--on-coat-soft); font-size: 15px; }
.spec-list dd { margin: 1px 0 0; font-size: 17px; font-weight: 600; }

/* Sizes */
.sizes { display: grid; gap: 32px; align-items: center; padding-top: 72px; padding-bottom: 24px; }
@media (min-width: 900px) { .sizes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; } }
.sizes-figure { position: relative; margin: 0; overflow: hidden; }
.sizes-figure img { width: 100%; aspect-ratio: 1 / 1.1; object-fit: cover; object-position: 50% 80%; }
.day-slider { max-width: 460px; margin-top: 26px; }
.day-slider label { display: flex; justify-content: space-between; font-weight: 600; }
.day-slider output { font-variant-numeric: tabular-nums; }
.day-slider input { width: 100%; height: 44px; margin: 4px 0 0; accent-color: var(--coat-text); cursor: pointer; }
.day-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; }
.day-answer { max-width: 46ch; min-height: 3em; margin-top: 14px; color: var(--ink-2); font-size: 17px; }
.ghost-button { min-height: 50px; margin-top: 14px; padding: 0 20px; border: 0; border-radius: var(--radius); background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); font-size: 16px; font-weight: 600; transition: background-color .15s ease, color .15s ease; }
.ghost-button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.ghost-button:disabled { box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--muted); }

/* Care */
.care { display: grid; gap: 20px; padding-top: 56px; padding-bottom: 88px; }
@media (min-width: 900px) { .care { grid-template-columns: minmax(0, .8fr) minmax(0, 2fr); gap: 72px; align-items: baseline; } }
.care-list { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 700px) { .care-list { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.care-list li { color: var(--ink-2); font-size: 17px; }
.care-list strong { display: block; color: var(--ink); font-size: 19px; font-weight: 700; }

/* Bug demo */
.study-panel { padding: 64px 0 72px; background: var(--ink); color: #dfe3df; }
.study-grid { display: grid; gap: 28px; }
@media (min-width: 900px) { .study-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 72px; align-items: start; } }
.study-copy h2 { font-size: clamp(28px, 2.8vw, 38px); letter-spacing: -.03em; color: #fff; }
.study-copy p:last-child { max-width: 54ch; margin-top: 14px; color: #bcc3be; font-size: 17px; }
.study-control label { display: block; margin-bottom: 8px; font-weight: 600; color: #fff; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 1.6px solid #fff; border-bottom: 1.6px solid #fff; transform: rotate(45deg); pointer-events: none; }
.study-control select { width: 100%; min-height: 54px; padding: 0 44px 0 16px; border: 0; border-radius: var(--radius); background: #2c322e; color: #fff; font-size: 16px; appearance: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.study-control select:focus-visible { outline: 2px solid #fff; }
.defect-note { margin-top: 14px; padding: 14px 16px; border-radius: var(--radius); background: rgba(255, 255, 255, .09); }
.defect-note strong { color: #fff; }
.defect-note p { margin-top: 2px; color: #c9cfcb; font-size: 15px; }

/* Buy bar */
.buy-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px 0 max(10px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--tone) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 -1px 0 var(--line); transform: translateY(110%); transition: transform .35s var(--ease), background-color var(--swap); }
.buy-bar.show, .buy-bar.pre { transform: none; }
.buy-bar-row { display: flex; align-items: center; gap: 12px; }
.buy-bar-swatch { flex: none; width: 30px; height: 30px; border-radius: 8px; }
.buy-bar-text { min-width: 0; margin-right: auto; overflow: hidden; font-size: 16px; white-space: nowrap; text-overflow: ellipsis; }
.buy-bar-text strong { font-weight: 700; }
.buy-bar-text span { color: var(--muted); }
.add-small { flex: none; min-height: 46px; padding: 0 18px; font-size: 16px; }

/* Footer */
.site-footer { padding: 28px 0 96px; border-top: 1px solid var(--line); }
.footer-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 32px; align-items: center; color: var(--muted); font-size: 15px; }
.footer-brand { color: var(--ink); }
.footer-row a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.footer-row a:hover { color: var(--coat-text); }
.footer-row .footer-contact { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0 22px; }
.footer-contact span { color: var(--muted); }
.footer-row .footer-contact a { font-weight: 500; }

/* Bag drawer */
.bag-dialog { width: min(440px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; background: var(--paper); color: var(--ink); }
.bag-dialog[open] { display: flex; flex-direction: column; animation: drawer .35s var(--ease); }
@keyframes drawer { from { transform: translateX(40px); opacity: 0; } }
.bag-dialog::backdrop { background: rgba(20, 24, 22, .45); }
.bag-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.bag-head h2 { font-size: 24px; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; }
.icon-button:hover { background: rgba(27, 31, 29, .08); }
.icon-button svg { width: 18px; height: 18px; }
.bag-body { flex: 1; overflow-y: auto; padding: 4px 20px; }
.bag-empty-wrap { display: grid; justify-items: start; gap: 4px; padding: 28px 0; }
.bag-empty { color: var(--muted); }
.bag-line { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 4px 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.bag-thumb { grid-row: span 2; width: 56px; height: 70px; border-radius: 6px; object-fit: cover; }
.bag-text { display: grid; }
.bag-text strong { font-weight: 700; }
.bag-text span { color: var(--muted); font-size: 15px; }
.bag-text .bag-engrave { color: var(--ink-2); font-weight: 500; }
.bag-price { font-weight: 600; }
.line-actions { grid-column: 2 / -1; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.line-qty { display: inline-flex; align-items: center; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.line-qty button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 18px; }
.line-qty button:disabled { opacity: .3; }
.line-qty output { min-width: 22px; text-align: center; font-weight: 600; }
.text-button { min-height: 40px; padding: 0 4px; border: 0; background: transparent; color: var(--muted); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--ink); }
.bag-foot { padding: 18px 20px 22px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--tone) 55%, var(--paper)); }
.ship-meter p { font-size: 15px; color: var(--ink-2); }
.ship-track { display: block; height: 6px; margin-top: 8px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ship-fill { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--coat-text); transition: width .5s var(--ease); }
.bag-total { display: flex; justify-content: space-between; margin-top: 16px; font-size: 19px; }
.bag-total strong { font-weight: 700; }
.bag-note { margin-top: 6px; color: var(--muted); font-size: 15px; }

.toast { position: fixed; left: 50%; bottom: 84px; z-index: 50; max-width: min(460px, calc(100vw - 32px)); padding: 12px 18px; border-radius: var(--radius); background: var(--ink); color: var(--paper); font-size: 15.5px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .3s var(--ease); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 979px) { .site-footer { padding-bottom: 96px; } }
/* Tablets: the photo keeps its shape and leaves the name on the first screen */
@media (min-width: 721px) and (max-width: 979px) {
  .media-stage { width: min(100%, calc((100svh - 420px) * .8)); max-height: none; margin: 0 auto; }
  .gallery-thumbnails { justify-content: center; }
}
@media (max-width: 720px) {
  .main-nav { display: none; }
  .product-layout { padding-top: 0; gap: 14px; }
  .media-stage { aspect-ratio: 1 / 1; max-height: none; margin: 0 -16px; }
  .media-stage::after { box-shadow: inset 0 0 30px 14px var(--tone); }
  .thumb-button { width: 58px; }
  h1 { margin-top: 6px; font-size: 44px; }
  .story { padding: 52px 0; }
  .spec-list { grid-template-columns: 1fr; }
  .buy-row { position: relative; }
  .footer-row { grid-template-columns: 1fr; font-size: 16px; }
  .breadcrumbs ol { font-size: 16px; }
  .sizes { padding-top: 56px; }
  .promise-list { gap: 4px 18px; font-size: 15px; }
}
/* Unfolded foldables: the photo keeps its shape and leaves its buttons on the first screen */
@media (min-width: 560px) and (max-width: 720px) {
  .media-stage { width: min(100%, calc((100svh - 190px) * .8)); margin: 0 auto; }
}
@media (max-width: 360px) {
  .size-options { grid-template-columns: 1fr; }
  .color-choice { flex-direction: column; align-items: flex-start; padding: 5px; }
}
@media (pointer: coarse) {
  .breadcrumbs a { display: inline-block; padding-block: 12px; margin-block: -12px; }
  .line-qty button, .text-button { min-width: 44px; min-height: 44px; }
  .line-qty button { height: 44px; }
}
/* Sideways phones: photo and options side by side, a compact header */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 979px) {
  html { scroll-padding-top: 64px; }
  .ribbon { padding: 4px 16px; }
  .header-row { min-height: 52px; }
  .main-nav { display: none; }
  .product-layout { grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 24px; align-items: start; padding-top: 12px; }
  .gallery-column { position: sticky; top: 60px; }
  .media-stage { width: min(100%, calc((100svh - 76px) * .8)); max-height: none; margin: 0 auto; }
  .thumb-button { width: 52px; }
  h1 { margin-top: 8px; font-size: clamp(34px, 10vh, 44px); }
  .price-row { margin-top: 10px; }
  .variant-form { margin-top: 18px; }
}
/* Large screens are zoomed. Viewport units inside a zoomed page are zoomed too,
   so full-height parts divide by the factor. */
@media (min-width: 1900px) {
  html { zoom: 1.2; }
  .media-stage { max-height: calc(100vh / 1.2 - 236px); }
  .bag-dialog { height: calc(100dvh / 1.2); max-height: calc(100dvh / 1.2); }
}
@media (min-width: 2400px) {
  html { zoom: 1.4; }
  .media-stage { max-height: calc(100vh / 1.4 - 236px); }
  .bag-dialog { height: calc(100dvh / 1.4); max-height: calc(100dvh / 1.4); }
}
@media (min-width: 3200px) {
  html { zoom: 1.8; }
  .media-stage { max-height: calc(100vh / 1.8 - 236px); }
  .bag-dialog { height: calc(100dvh / 1.8); max-height: calc(100dvh / 1.8); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
