/* Order form: shared additions on top of the brand stylesheet (brand/<store>/tilaus.css).
   Server-rendered controls that work without JavaScript; the colours come from --tl-* set per brand. */

/* size/variant options with a quantity input (replaces the wireframe's JS size panel and +/- buttons) */
.opts { grid-column: 1 / -1; display: flex; flex-direction: column; margin-top: -4px; }
.card .opts { grid-column: auto; margin-top: 0; }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px;
  border-top: 1px solid var(--tl-line); font-size: 16px; font-weight: 700; color: var(--tl-ink); }
.opt-var { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 12px; margin-top: 6px;
  border-radius: 10px; background: var(--tl-soft); font-size: 14px; }
.opt-var b { font-weight: 900; color: var(--tl-head); }
.qty { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.qty input { width: 4.2em; min-height: 44px; padding: 0 8px; border: 2px solid var(--tl-line); border-radius: 10px;
  font: 700 17px var(--sans); color: var(--tl-ink); background: #fff; text-align: center; }
.qty input:focus { outline: 2px solid var(--tl-accent); outline-offset: 1px; border-color: var(--tl-accent); }
.qty input.has { border-color: var(--tl-accent); background: var(--tl-soft); }
.qty.invalid input { border-color: #c0392b; }
.desc { margin: 0; font-size: 14px; line-height: 1.4; }

/* category chips are plain links */
a.pill { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }

/* notices */
.notice { border-radius: 14px; padding: 18px 20px; background: var(--tl-soft); color: var(--tl-ink); font-size: 16px; line-height: 1.5; }
.notice h2 { margin-bottom: 6px; }
.notice.error { background: #fdecea; color: #7a1d14; }

/* consent banner (same choice and cookie as the current form) */
.consent { position: fixed; left: 12px; right: 12px; bottom: 96px; z-index: 18; /* above the page and the dimming (15), below the bar (20) and the size panel (30) */ max-width: 560px; margin: 0 auto; background: #fff;
  color: var(--tl-ink); border: 2px solid var(--tl-line); border-radius: 14px; padding: 14px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.18);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 15px; }
.consent a { color: var(--tl-accent); }
.consent button { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--tl-accent); background: #fff;
  color: var(--tl-accent); font: 700 15px var(--sans); cursor: pointer; }
.consent button.yes { background: var(--tl-accent); color: #fff; }

/* footer */
.foot { padding: 18px 0 110px; font-size: 13px; color: var(--tl-ink); opacity: .8; }
.foot a { color: inherit; }

/* ---- C3: pickup, contact and review steps (server-rendered, no JavaScript needed) ---- */
/* the form's default (Enter) button is the forward one; kept in the DOM but out of sight */
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bar-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.only-at { margin: 4px 0 0; font-size: 13px; font-weight: 700; color: var(--tl-accent); }

/* pickup: one box per place, its dates as radio tiles */
fieldset.pickplace { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pickplace legend { float: left; width: 100%; padding: 0; font-size: 19px; }
.pickplace legend + * { clear: left; }
.pickplace.blocked { opacity: .75; }
.date { position: relative; cursor: pointer; padding: 8px 4px; text-align: center; }
.date input { margin: 0 0 2px; width: 18px; height: 18px; accent-color: var(--tl-accent); }
.date:has(input:checked) { border-color: var(--tl-accent); box-shadow: inset 0 0 0 2px var(--tl-accent); background: var(--tl-soft); }
.date:focus-within { outline: 2px solid var(--tl-accent); outline-offset: 2px; }
.date.off { cursor: not-allowed; opacity: .5; }
.date .full-tag { font-size: 11px; letter-spacing: .1em; }

/* review */
.rv-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.line.rv-head { margin: 0; padding-top: 10px; padding-bottom: 10px; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.summary .box { line-height: 1.5; }
.summary .note { margin-top: 6px; }
.rv-note { white-space: pre-line; overflow-wrap: anywhere; }
.linkbtn { background: none; border: 0; padding: 4px 0; font: 700 14px var(--sans); color: var(--tl-accent); text-decoration: underline; cursor: pointer; }
.field textarea { min-height: 96px; resize: vertical; }

/* ---- C4: JavaScript enhancements (wwwroot/js/tilaus.js). html.js is set only after the script started
   without errors; elements the script adds carry .jsonly and never show without it. ---- */
html:not(.js) .jsonly { display: none !important; }
html.js .nojs { display: none !important; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* products: the plain quantity lists give way to the wireframe controls */
html.js .item .opts, html.js .card .opts { display: none; }
html.js .item.opens-sheet h3, html.js .item.opens-sheet .item-media img { cursor: pointer; }
.card-js { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.catnav .pill[aria-current="true"] { border-color: var(--tl-accent); box-shadow: inset 0 0 0 1px var(--tl-accent); }
.catnav .pill .count { margin-left: 2px; }
.bar .cart-toggle strong.bar-warn { color: #ffd3dc; }
.stepper button:disabled, .mini-step button:disabled { opacity: .35; cursor: not-allowed; }

/* pickup: choose the place first when there is more than one */
.place-btn { all: unset; cursor: pointer; font-weight: 900; font-size: 19px; border-radius: 6px; }
.place-btn:focus-visible { outline: 2px solid var(--tl-accent); outline-offset: 3px; }
html.js .pickplace.choosable { cursor: pointer; }
html.js .pickplace.choosable:not(.chosen) .dates { display: none; }
html.js .pickplace.chosen { border-color: var(--tl-accent); box-shadow: inset 0 0 0 2px var(--tl-accent); }
.place-hint { margin: 0; }

/* the order so far on the pickup and contact steps (native <details>, works without JavaScript) */
.order-sum { background: #fff; border: 2px solid var(--tl-line); border-radius: 14px; padding: 12px 16px; }
.order-sum summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-height: 28px; }
.order-sum summary::after { content: "Näytä"; margin-left: auto; font-size: 14px; font-weight: 700; color: var(--tl-accent); text-decoration: underline; }
.order-sum[open] summary::after { content: "Piilota"; }
.sum-lines { list-style: none; margin: 10px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.sum-lines small { display: block; font-size: 13px; opacity: .85; }
.sum-lines .fee { padding-top: 6px; border-top: 1px solid var(--tl-line); }

/* one post at a time */
button.sending { opacity: .6; cursor: progress; }

/* footer text inside the main content on the order steps (nothing may follow the sticky order bar) */
.foot.in-main { padding: 40px 0 8px; }
/* while the cookie banner is open it floats above the bar: keep the end of the page clear of it */
body.has-consent main.main { padding-bottom: 120px; }

/* ---- C6: order page ---- */
.order-page .done { word-break: break-word; }
@media print {
  .consent, .no-print, .foot, .steps { display: none !important; }
  body, .hero { background: #fff !important; color: #000 !important; }
  .box, .lines { break-inside: avoid; }
}

/* ---- C7: images from the pipeline (<picture> with WebP + JPEG) ---- */
.item-media picture, .card-img picture { display: block; width: 100%; height: 100%; }
.cline picture { display: block; }
.sheet-inner picture { display: block; flex: none; }
/* no photo (yet): a neutral block of the same shape; never a stand-in picture (D3) */
.img-none { display: block; width: 100%; height: 100%; background: var(--tl-soft); border-radius: inherit; }
.item-media .img-none { border-radius: 12px; }
.cline .img-none { width: 64px; height: 48px; border-radius: 8px; }
.sheet-inner .img-none.sh-img { height: auto; }
