/* Pickle & Post shop. Colours from the stamp logo. */
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/Fredoka-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --cream: #FBF8F1;
  --paper: #FFFFFF;
  --ink: #1F2A1C;
  --muted: #5E6659;
  --line: #E6E0D2;
  --pickle: #6A9A3A;
  --pickle-dk: #3E6B2A;
  --mustard: #E8B43A;
  --mustard-lt: #FBEFD0;
  --red: #B5121B;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(31 42 28 / 6%), 0 6px 20px rgb(31 42 28 / 7%);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand span, .btn, .ref { font-family: "Fredoka", system-ui, sans-serif; font-weight: 700; letter-spacing: .005em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.08; margin: .2em 0 .4em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15; margin: 0 0 .6em; }
h3 { font-size: 1.3rem; margin: 0 0 .2em; }
a { color: var(--pickle-dk); }
img { max-width: 100%; height: auto; display: block; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 10px clamp(16px, 4vw, 40px); background: rgb(251 248 241 / 92%); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand span { font-size: 1.45rem; }
.brand em { font-style: normal; color: var(--pickle-dk); }
.basket-btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 999px; padding: 6px 12px 6px 10px; font-weight: 600; background: var(--paper);
}
.basket-btn b { background: var(--line); border-radius: 999px; min-width: 24px; text-align: center; padding: 0 6px; font-size: .85rem; }
.basket-btn.has b { background: var(--mustard); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink);
  padding: 8px 18px; font-size: 1.05rem; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--mustard-lt); }
.btn.primary { background: var(--pickle-dk); color: #fff; border-color: #2F5320; box-shadow: 0 3px 0 #2F5320; }
.btn.primary:hover { background: #355D24; }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #2F5320; }
.btn.big { padding: 12px 26px; font-size: 1.2rem; }
.btn[disabled] { opacity: .55; cursor: wait; }
.link { background: none; border: 0; padding: 0; color: var(--pickle-dk); text-decoration: underline; cursor: pointer; font: inherit; }

main > section { padding: clamp(28px, 6vw, 64px) clamp(16px, 4vw, 40px); max-width: 1180px; margin: 0 auto; }

/* hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(20px, 5vw, 56px); align-items: center; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--pickle-dk); margin: 0; }
.lede { font-size: 1.12rem; max-width: 36em; }
.ticks { list-style: none; padding: 0; margin: 18px 0 26px; display: grid; gap: 6px; }
.ticks li { padding-left: 30px; position: relative; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--pickle) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}
.hero-pic { margin: 0; position: relative; }
.hero-pic img { border-radius: 22px; box-shadow: var(--shadow); transform: rotate(1.5deg); border: 6px solid #fff; }
.hero-pic::after {
  content: ""; position: absolute; width: 110px; height: 110px; right: -16px; bottom: -22px;
  background: url("/img/badge.webp") center/contain no-repeat; transform: rotate(-12deg);
}

/* how it works */
.how ol { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.how li { counter-increment: s; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px 16px; display: grid; gap: 4px; }
.how li::before { content: counter(s); font-family: "Fredoka", sans-serif; font-weight: 700; width: 34px; height: 34px; border-radius: 50%; background: var(--mustard); display: grid; place-items: center; margin-bottom: 6px; }
.how b { font-size: 1.05rem; }
.how span { color: var(--muted); font-size: .95rem; }

/* products */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.card-pic { border: 0; padding: 18px; background: radial-gradient(circle at 50% 40%, #fff 0, #F3EEE2 75%); cursor: pointer; aspect-ratio: 1; display: grid; place-items: center; }
.card-pic img { max-height: 100%; width: auto; object-fit: contain; transition: transform .25s; filter: drop-shadow(0 6px 8px rgb(0 0 0 / 14%)); }
.card-pic:hover img { transform: scale(1.04) rotate(-1.5deg); }
.card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-body p { margin: 0; }
.card-body .btn { margin-top: auto; align-self: flex-start; }
.price { margin: 8px 0 12px !important; font-size: 1.25rem; }
.deal { display: inline-block; color: var(--pickle-dk); font-weight: 600; font-size: .9rem; }

/* dialog */
dialog { border: 0; padding: 0; border-radius: 20px; width: min(920px, 96vw); max-height: 94vh; box-shadow: 0 20px 60px rgb(0 0 0 / 30%); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgb(31 42 28 / 55%); }
.maker { display: grid; grid-template-columns: 1fr 1.15fr; position: relative; max-height: 94vh; }
.maker-pic { background: radial-gradient(circle at 50% 40%, #fff 0, #F3EEE2 80%); display: grid; place-items: center; padding: 28px; }
.maker-pic img { max-height: 60vh; width: auto; filter: drop-shadow(0 10px 14px rgb(0 0 0 / 16%)); }
.maker-body { padding: 26px 26px 22px; overflow-y: auto; max-height: 94vh; }
.maker-body h2 { margin-bottom: .2em; padding-right: 32px; }
.x { position: absolute; top: 10px; right: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--cream); font-size: 26px; line-height: 1; cursor: pointer; }
.opt-set { border: 0; padding: 0; margin: 14px 0; }
.opt-set legend { font-weight: 600; margin-bottom: 6px; }
.opt-set legend b { font-weight: 400; color: var(--muted); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.sw { position: relative; border: 2px solid var(--line); border-radius: 10px; padding: 4px; cursor: pointer; background: #FAF7F0; }
.sw span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sw img { width: 100%; height: 62px; object-fit: contain; }
.sw:has(input:checked) { border-color: var(--pickle); background: #EEF5E6; box-shadow: 0 0 0 2px var(--pickle) inset; }
.sw:has(input:focus-visible), .seg:has(input:focus-visible) { outline: 3px solid var(--mustard); outline-offset: 2px; }
.sw input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.segs { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg { position: relative; padding: 7px 18px; cursor: pointer; }
.seg + .seg { border-left: 2px solid var(--ink); }
.seg:has(input:checked) { background: var(--ink); color: #fff; }
.names { margin: 16px 0 8px; }
.f-label { font-weight: 600; margin: 0 0 6px; }
.opt { font-weight: 400; color: var(--muted); font-size: .85rem; }
.name-row { position: relative; margin-bottom: 8px; }
.name-row input { width: 100%; padding-right: 54px; font-size: 1.15rem; }
.count { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .8rem; }
.count.over { color: #A0610B; font-weight: 600; }
.hint { margin: 4px 0 0; }
.preview { margin: 4px 0 0; letter-spacing: .04em; }
.maker-foot { display: flex; align-items: center; gap: 16px; margin: 16px 0 6px; flex-wrap: wrap; }
.howmany { display: flex; align-items: center; gap: 14px; margin: 16px 0 4px; }
.howmany .f-label { margin: 0; }
.each-note { background: var(--mustard-lt); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; font-size: .92rem; }
.item-names.many { display: grid; grid-template-columns: 30px 1fr 30px; gap: 8px; align-items: start; padding: 10px 0; border-top: 1px dashed var(--line); }
.item-names.many:first-of-type { border-top: 0; }
.item-names .preview { margin: 0 0 4px; }
.item-names .link { margin-bottom: 6px; }
.item-no { width: 30px; height: 30px; margin-top: 8px; border-radius: 50%; background: var(--mustard); display: grid; place-items: center; font-family: "Fredoka", sans-serif; font-weight: 700; }
.x-item { width: 30px; height: 30px; margin-top: 8px; border: 0; border-radius: 50%; background: var(--cream); font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }
.x-item:hover { background: var(--mustard-lt); color: var(--ink); }
.was { text-decoration: line-through; }
.maker-price { display: grid; font-size: 1.35rem; line-height: 1.3; }
.maker-price .small { font-size: .85rem; }
#maker-add { width: 100%; margin-top: 10px; }

input, textarea, select {
  font: inherit; color: var(--ink); background: #fff; border: 1.5px solid #CFC8B8; border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus { border-color: var(--pickle); outline: 3px solid rgb(106 154 58 / 25%); outline-offset: 0; }
input[aria-invalid="true"] { border-color: var(--red); }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fff; }
.qty button { border: 0; background: none; width: 40px; height: 40px; font-size: 1.3rem; cursor: pointer; color: var(--ink); }
.qty button:hover { background: var(--mustard-lt); }
.qty output { min-width: 28px; text-align: center; font-weight: 700; }
.qty.sm button { width: 32px; height: 32px; font-size: 1.1rem; }
.errors p { margin: 6px 0 0; color: var(--red); font-size: .92rem; }
.errors p.warn { color: #8A5600; }
.ferr { display: block; color: var(--red); font-size: .85rem; margin-top: 3px; }

/* basket and details */
.basket-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.basket-panel, .details, .done { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.basket-panel { position: sticky; top: 84px; }
.lines { list-style: none; padding: 0; margin: 0; }
.lines li { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lines img { width: 64px; height: 64px; object-fit: contain; background: #F6F2E8; border-radius: 10px; padding: 4px; }
.l-names { margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px; }
.nm { background: var(--mustard-lt); border-radius: 6px; padding: 0 7px; font-weight: 600; font-size: .9rem; }
.l-acts { display: flex; gap: 14px; font-size: .85rem; margin-top: 4px; }
.l-price { text-align: right; display: grid; min-width: 64px; }
.nudge { background: #EEF5E6; border-radius: 10px; padding: 10px 12px; color: var(--pickle-dk); font-weight: 600; font-size: .92rem; }
.totals { margin: 12px 0 8px; display: grid; gap: 4px; }
.totals div { display: flex; justify-content: space-between; }
.totals dt, .totals dd { margin: 0; }
.totals .grand { font-family: "Fredoka", sans-serif; font-size: 1.4rem; border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 4px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin: 14px 0; }
.f { display: block; font-weight: 600; font-size: .95rem; }
.f input, .f textarea { display: block; margin-top: 4px; }
.f.wide { grid-column: 1 / -1; }
.f input, .f textarea { font-weight: 400; }
.pc { text-transform: uppercase; }
.hp { position: absolute; left: -9999px; }
.agree { display: flex; gap: 10px; align-items: flex-start; background: var(--mustard-lt); border-radius: 12px; padding: 12px 14px; margin: 8px 0 14px; cursor: pointer; }
.agree input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--pickle); }
#turnstile:not(:empty) { margin-bottom: 12px; }
#send { width: 100%; }
.done { grid-column: 1 / -1; text-align: center; max-width: 640px; margin: 0 auto; }
.done img { margin: 0 auto 6px; }
.done .ref { font-size: 1.3rem; background: var(--mustard-lt); padding: 2px 10px; border-radius: 8px; }
.lines.plain li { display: flex; justify-content: space-between; text-align: left; gap: 12px; }
.lines.plain li.grand { border-bottom: 0; font-weight: 700; }
.done .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.closed { grid-column: 1 / -1; background: var(--mustard-lt); padding: 14px 18px; border-radius: 12px; font-weight: 600; margin: 0; }

/* paused shop and out-of-stock products: leave an email for when they're back */
.paused { padding-bottom: 0 !important; }
.paused-box { background: var(--mustard-lt); border: 2px solid var(--mustard); border-radius: var(--radius); padding: 20px 22px; }
.paused-box h2 { font-size: 1.35rem; margin: 0 0 12px; }
.notify { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.notify .f { flex: 1 1 260px; }
.notify .f input { width: 100%; }
.notify p { flex-basis: 100%; margin: 0; }
.notify-done { font-weight: 600; color: var(--pickle-dk); }
.soldout { display: inline-block; background: var(--mustard-lt); border-radius: 999px; padding: 2px 10px; font-weight: 600; font-size: .85rem; margin: 0 0 8px; }
.card .notify { margin-top: 6px; }
.card .notify .btn { padding: 8px 14px; font-size: .95rem; }
.btn[disabled].primary { opacity: .55; cursor: not-allowed; }

/* who makes it */
.maker-note { display: flex; gap: 20px; align-items: flex-start; }
.maker-note > div { max-width: 40em; }
.maker-note img { flex: none; margin-top: 4px; }
.maker-note p { font-size: 1.05rem; }
.christmas { display: table; background: var(--mustard-lt); border-radius: 10px; padding: 8px 14px; margin: 0 0 18px; font-weight: 600; }

/* faq and footer */
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; padding: 0 18px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.faq details p { margin: 0 0 16px; color: var(--muted); }
.faq details div p { margin: 0 0 10px; }
.faq details div { padding-bottom: 6px; }
.maker-note div p { margin: 0 0 8px; }

/* a product's own words in the personalise dialog */
.small-ticks { margin: 4px 0 12px; font-size: .95rem; }
.promise { border-left: 4px solid var(--pickle); padding: 2px 0 2px 12px; margin: 0 0 12px; font-size: .95rem; }
.promise p { margin: 2px 0 0; color: var(--muted); }
.about-details { margin: 0 0 14px; font-size: .92rem; }
.about-details summary { cursor: pointer; font-weight: 600; }
.about-details dl { margin: 8px 0 0; display: grid; gap: 6px; }
.about-details dl div { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; }
.about-details dt { font-weight: 600; }
.about-details dd { margin: 0; color: var(--muted); }
.foot { text-align: center; padding: 30px 16px 90px; color: var(--muted); border-top: 1px solid var(--line); }
.foot img { margin: 0 auto 8px; }
.foot p { margin: 4px 0; }

#toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; opacity: 0; transition: .25s; pointer-events: none; z-index: 60; font-weight: 600; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.mbar { display: none; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-pic { max-width: 300px; margin: 0 auto; order: -1; }
  .how ol { grid-template-columns: 1fr 1fr; }
  .basket-wrap { grid-template-columns: 1fr; }
  .basket-panel { position: static; }
  .maker { grid-template-columns: 1fr; overflow-y: auto; }
  .maker-pic { padding: 16px; }
  .maker-pic img { max-height: 30vh; }
  .maker-body { max-height: none; overflow: visible; }
  .mbar:not([hidden]) {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; justify-content: space-between; align-items: center;
    background: var(--ink); color: #fff; text-decoration: none; padding: 12px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgb(0 0 0 / 25%);
  }
  .mbar b { color: var(--mustard); }
  .at-basket .mbar { display: none !important; }
}
@media (max-width: 520px) {
  .how ol { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .lines li { grid-template-columns: 52px 1fr auto; }
  .lines img { width: 52px; height: 52px; }
  .brand span { font-size: 1.2rem; }
  .basket-btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .top, .hero, .how, .shop, .faq, .foot, .mbar, .done .row { display: none !important; }
  .done { box-shadow: none; border: 0; }
}
