/* spudnote.com/shop (tools/shop.py). Uses blog.css's tokens (--card, --ink, --brand, --sprout ...) so it
   follows the night garden toggle like every other page. */
.paper .read.shop-page { max-width: 1120px; }
.shop-page .index-head { border-bottom: 0; text-align: center; }
.ship-pick { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 18px; }
.ship-label { font: 600 .78rem/1 var(--fred); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.top-countries { justify-content: center; }
.shop-page .lede { margin: 14px auto 0; max-width: 34em; color: var(--ink-dim); font: 500 1.02rem/1.55 var(--sans); }

.grid {
  display: grid; gap: clamp(16px, 2.4vw, 26px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  margin: clamp(8px, 2vh, 18px) 0 0;
}
.item {
  display: flex; flex-direction: column;
  background: var(--card); border-radius: 26px; box-shadow: var(--shadow);
  padding: 14px 14px 18px;
}
.shot { display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--soft); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s ease; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; }
.thumb {
  width: 54px; height: 54px; padding: 0; border-radius: 12px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; background: var(--soft); opacity: .7; transition: opacity .15s, border-color .15s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.on, .thumb:hover { opacity: 1; border-color: var(--soft-edge); }
.thumb.on { border-color: var(--brand); }

.info { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 16px 4px 0; }
.info h2 { font: 600 1.22rem/1.2 var(--fred); color: var(--ink); letter-spacing: -.01em; }
.price { font: 600 1.15rem/1 var(--fred); color: var(--brand); white-space: nowrap; }
.in-app { margin: 6px 4px 0; display: flex; align-items: center; gap: 6px; font: 600 .82rem/1.3 var(--fred); color: var(--brand, #9A5518); }
.in-app::before { content: ""; width: 16px; height: 16px; flex: none; background: url("/assets/icon-spudnote.svg") center / contain no-repeat; border-radius: 4px; }
.in-app + .blurb { margin-top: 4px; }
.blurb { margin: 8px 4px 0; color: var(--body-ink); font: 400 .96rem/1.5 var(--sans); }
.more { margin: 10px 4px 16px; }
.more summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font: 600 .86rem/1 var(--fred); color: var(--ink-dim);
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "+"; font: 500 1rem/1 var(--sans); color: var(--brand); }
.more[open] summary::after { content: "−"; }
.more ul { margin: 10px 0 0; padding-left: 18px; color: var(--body-ink); font: 400 .88rem/1.55 var(--sans); }
.more .care { margin: 8px 0 0; color: var(--ink-dim); font: 500 .86rem/1.5 var(--sans); }
.more + .add { margin-top: auto; }
.add {
  margin: auto 0 0; margin-top: 16px; align-self: stretch;
  font: 600 1rem/1 var(--fred); color: #fff; background: var(--sprout); border: 0; border-radius: 999px;
  padding: 14px 18px; cursor: pointer; transition: transform .12s ease, filter .15s;
}
.add:hover { filter: brightness(1.08); }
.add:active { transform: scale(.97); }
.add.added { background: var(--brand); }
:root[data-theme="dark"] .add { color: #1d2236; }

.fineprint { margin: clamp(28px, 5vh, 44px) auto 0; max-width: 40em; text-align: center; color: var(--ink-faint); font: 500 .88rem/1.6 var(--sans); }
.fineprint a { color: var(--brand); }

/* the basket: a pill pinned to the bottom, opening a sheet */
.basket-bar { position: fixed; left: 0; right: 0; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40; display: flex; justify-content: center; pointer-events: none; }
.basket-bar[hidden] { display: none; }
.basket-open {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 12px;
  font: 600 1rem/1 var(--fred); color: #fff; background: var(--sprout); border: 0; border-radius: 999px;
  padding: 14px 22px; cursor: pointer; box-shadow: 0 14px 30px -12px rgba(46, 112, 24, .55);
}
:root[data-theme="dark"] .basket-open { color: #1d2236; }
.b-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .25); font-size: .9rem; }
.basket-open.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.08); } }

.basket {
  width: min(440px, calc(100% - 24px)); max-height: min(86vh, 720px); margin: auto auto max(12px, env(safe-area-inset-bottom));
  border: 0; border-radius: 26px; padding: 20px 20px 18px; background: var(--card); color: var(--ink); box-shadow: var(--shadow);
}
@media (min-width: 700px) { .basket { margin: auto; } }
.basket::backdrop { background: rgba(42, 20, 8, .32); }
:root[data-theme="dark"] .basket::backdrop { background: rgba(0, 0, 0, .5); }
.basket-head { display: flex; justify-content: space-between; align-items: center; }
.basket-head h2 { font: 600 1.35rem/1 var(--fred); }
.b-close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--soft); color: var(--ink); font: 500 1.4rem/1 var(--sans); cursor: pointer; }
.b-lines { list-style: none; margin: 14px 0 0; padding: 0; }
.b-line { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.b-line img { width: 52px; height: 52px; border-radius: 12px; background: var(--soft); object-fit: cover; }
.b-name { font: 600 .98rem/1.25 var(--fred); }
.b-each { font: 500 .82rem/1.3 var(--sans); color: var(--ink-faint); }
.b-qty { display: inline-flex; align-items: center; gap: 4px; }
.b-qty button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 1rem/1 var(--fred); cursor: pointer; }
.b-qty span { min-width: 20px; text-align: center; font: 600 .98rem/1 var(--fred); }
.b-ship { margin-top: 16px; }
.b-ship-label { display: block; font: 600 .95rem/1 var(--fred); }
.b-countries { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.b-c {
  font: 600 .9rem/1 var(--fred); color: var(--ink); background: transparent; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 14px; transition: background .15s, border-color .15s;
}
.b-c:hover { border-color: var(--soft-edge); background: var(--soft); }
.b-c.on { background: var(--soft); border-color: var(--brand); color: var(--brand); }
.b-note { margin: 8px 0 0; font: 500 .82rem/1.45 var(--sans); color: var(--ink-faint); }
.b-note:empty { display: none; }
.b-sum { display: flex; justify-content: space-between; margin-top: 14px; font: 600 1.05rem/1 var(--fred); }
.b-small { margin: 6px 0 0; font: 500 .82rem/1.4 var(--sans); color: var(--ink-faint); }
.b-go {
  display: block; width: 100%; margin-top: 16px; text-align: center; text-decoration: none;
  font: 600 1.05rem/1 var(--fred); color: #fff; background: var(--sprout); border: 0; border-radius: 999px; padding: 15px; cursor: pointer;
}
.b-go[disabled] { opacity: .6; cursor: wait; }
:root[data-theme="dark"] .b-go { color: #1d2236; }
.b-go.back { display: inline-block; width: auto; padding: 14px 26px; margin-top: 22px; }
.thanks { text-align: center; }
.b-err { margin: 10px 0 0; font: 500 .85rem/1.4 var(--sans); color: var(--ink-dim); text-align: center; }
.b-err:empty { display: none; }
.b-empty { padding: 18px 0 6px; color: var(--ink-faint); font: 500 .95rem/1.4 var(--sans); }

/* tap a photo: the 1000px copy, with arrows when the product has more than one */
.zoom { width: min(92vw, 86vh, 760px); max-width: none; padding: 0; border: 0; border-radius: 24px; background: var(--card); overflow: visible; }
.zoom::backdrop { background: rgba(42, 20, 8, .55); }
:root[data-theme="dark"] .zoom::backdrop { background: rgba(0, 0, 0, .7); }
.zoom img { display: block; width: 100%; height: auto; border-radius: 24px; background: var(--soft); cursor: zoom-out; }
.z-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--card); color: var(--ink); font: 500 1.6rem/1 var(--sans); box-shadow: var(--shadow);
}
.z-btn[hidden] { display: none; }
.z-prev { left: 10px; } .z-next { right: 10px; }
.z-close { position: absolute; top: 10px; right: 10px; }

@media (prefers-reduced-motion: reduce) { .basket-open.bump { animation: none; } .add, .shot img { transition: none; } }

/* the basket pill steps aside while a photo or the basket is open */
body:has(dialog[open]) .basket-bar { display: none; }

/* phones: the ship-to pills are one swipeable row like the pill row under the header (site.css .subpeeks):
   never wraps, fades at the edge that has more, the picked country scrolled into view */
/* the basket's country row: always one swipeable row */
.basket .b-countries {
  flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px 2px 4px;
}
.basket .b-countries::-webkit-scrollbar { display: none; }
.basket .b-countries .b-c { flex: none; white-space: nowrap; }
.basket .b-countries.scrolls { -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 34px), transparent); }
.basket .b-countries.scrolls.moved { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 34px), transparent); }
.basket .b-countries.scrolls.at-end { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px); mask-image: linear-gradient(to right, transparent 0, #000 16px); }
@media (max-width: 780px) {
  .ship-pick { align-self: stretch; width: 100%; }
  .top-countries {
    flex-wrap: nowrap; justify-content: flex-start; gap: 6px; width: 100%; box-sizing: border-box;
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    padding: 2px 2px 4px;
  }
  .top-countries::-webkit-scrollbar { display: none; }
  .top-countries > :first-child { margin-left: auto; }
  .top-countries > :last-child { margin-right: auto; }
  .top-countries .b-c { flex: none; white-space: nowrap; }
  .top-countries.scrolls {
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 34px), transparent);
            mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 34px), transparent);
  }
  .top-countries.scrolls.moved {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 34px), transparent);
            mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 34px), transparent);
  }
  .top-countries.scrolls.at-end {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px);
            mask-image: linear-gradient(to right, transparent 0, #000 16px);
  }
}

/* while the zoomed photo or the basket is open, the page underneath doesn't scroll (iOS Safari too) */
html:has(dialog[open]) { overflow: hidden; }
body.locked { position: fixed; left: 0; right: 0; overflow: hidden; }

/* /shop/returns/ */
.returns .policy { margin-top: 8px; padding: clamp(20px, 3vw, 32px); background: var(--card); border-radius: 26px; box-shadow: var(--shadow); max-width: 680px; margin-left: auto; margin-right: auto; }
.returns .policy h2 { font: 600 1.12rem/1.3 var(--fred); color: var(--ink); margin: 22px 0 6px; }
.returns .policy h2:first-child { margin-top: 0; }
.returns .policy p { color: var(--body-ink); font: 400 .98rem/1.6 var(--sans); }
.returns .policy a, .fineprint a { color: var(--brand); }
.returns > p:last-child { text-align: center; }
