/* KOPI — fiks begge (pxd.no ↔ flyskjermen.no) */
/* Felles bestillingsskall (godkjent design): innhold til venstre, fast oppsummering til høyre. Alt skopes under .order / .order-bar. Hvert nettsted overstyrer --o-* i sin egen CSS. Ingen tekst under 14 px. */
:root {
  --o-bg: #F7F3ED; --o-surface: #FFFFFF; --o-surface-sel: #FFFDFA; --o-surface-2: #EEE6DA;
  --o-line: #DDD3C4; --o-line-strong: #958672;
  --o-ink: #241C15; --o-ink-2: #5C5347; --o-ink-3: #6E6252;
  --o-select: #241C15; --o-accent: #E07A2C; --o-accent-ink: #241C15; --o-accent-text: #A24F18;
  --o-focus: #3E8F86; --o-ok: #23704D; --o-ok-soft: #E6F1EA; --o-err: #A93624; --o-err-soft: #F8E6E1;
  --o-font-head: "Space Grotesk", system-ui, sans-serif; --o-font-body: "Geist", system-ui, sans-serif; --o-font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --o-radius: 12px;
}

.order { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; font-family: var(--o-font-body); font-size: 16px; line-height: 1.5; color: var(--o-ink-2); }
.order *, .order *::before, .order *::after { box-sizing: border-box; }
.order__main, .order__aside { min-width: 0; }
.order__aside { position: sticky; top: calc(var(--header-height, 0px) + 16px); }
.order__lead { margin: 8px 0 0; max-width: 56ch; }
@media (max-width: 860px) {
  .order { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .order__aside { position: static; }
  .order__aside--hide-m { display: none; }
}

/* Seksjoner */
.order-section { border: 0; margin: 32px 0 0; padding: 0; min-width: 0; }
.order__main > .order-section:first-child { margin-top: 0; }
.order-section__title { font: 700 18px/1.15 var(--o-font-head); letter-spacing: -0.01em; color: var(--o-ink); margin: 0 0 12px; padding: 0; }
.order-section__title span { font: 500 15px var(--o-font-body); letter-spacing: 0; color: var(--o-ink-2); margin-left: 6px; }
legend.order-section__title { float: left; width: 100%; }
legend.order-section__title + * { clear: both; }
.order-section__help { font-size: 14px; line-height: 1.5; color: var(--o-ink-3); margin: 8px 0 0; }
.order a { color: var(--o-accent-text); text-underline-offset: 3px; }

/* Valgkort: den native radioen ligger usynlig over hele kortet (klikkflate, tastatur og piltaster gratis). */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; border: 0; margin: 0; padding: 0; min-width: 0; }
.choices--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .choices--3, .choices--2.choices--stack { grid-template-columns: minmax(0, 1fr); } }
.choice { position: relative; display: block; min-width: 0; min-height: 44px; padding: 14px 16px; background: var(--o-surface); border: 1px solid var(--o-line); border-radius: var(--o-radius); cursor: pointer; transition: border-color 120ms ease-out, background-color 120ms ease-out; }
.choice__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.choice__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.choice__title { font-weight: 600; color: var(--o-ink); }
.choice__price { font: 500 14px var(--o-font-mono); color: var(--o-ink); white-space: nowrap; }
.choice__desc { display: block; font-size: 14px; line-height: 1.5; color: var(--o-ink-2); margin-top: 2px; }
.choice__specs { display: flex; flex-wrap: wrap; column-gap: 16px; margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--o-ink-3); }
.choice__specs > span { white-space: nowrap; }
.choice__specs b { font-weight: 500; color: var(--o-ink-2); }
.choice__sub { display: block; font: 14px var(--o-font-mono); color: var(--o-ink-3); margin-top: 6px; }
@media (hover: hover) { .choice:hover { border-color: var(--o-line-strong); } }
.choice:has(:checked) { border-color: var(--o-select); box-shadow: inset 0 0 0 1px var(--o-select); background: var(--o-surface-sel); }
.choice:has(:checked)::after { content: ""; position: absolute; top: -1px; left: 16px; right: 16px; height: 3px; background: var(--o-accent); border-radius: 0 0 3px 3px; }
.choice:has(:focus-visible), .swatch:has(:focus-visible) { outline: 2px solid var(--o-focus); outline-offset: 2px; }
.choice:has(:disabled) { opacity: 0.55; cursor: not-allowed; }

/* Fargeprikker: navnet står synlig under hver prikk (14 px), valgt navn også ved overskriften. */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.swatch { position: relative; min-width: 56px; min-height: 44px; padding: 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 10px; cursor: pointer; }
.swatch__chip { width: 30px; height: 30px; border-radius: 50%; background: var(--c, var(--o-surface-2)); box-shadow: inset 0 0 0 1px rgba(36, 28, 21, 0.18); transition: box-shadow 120ms ease-out; }
.swatch--unknown .swatch__chip { background: repeating-linear-gradient(45deg, var(--o-surface-2) 0 4px, var(--o-line) 4px 8px); }
.swatch__name { font-size: 14px; line-height: 1.2; color: var(--o-ink-2); text-align: center; overflow-wrap: anywhere; max-width: 80px; }
.swatch:has(:checked) .swatch__chip { box-shadow: 0 0 0 2px var(--o-bg), 0 0 0 4px var(--o-ink); }

/* Oppsummering (fast i høyre kolonne på desktop). */
.summary { background: var(--o-surface); border: 1px solid var(--o-line); border-radius: var(--o-radius); padding: 24px; }
.summary__file { display: flex; gap: 10px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--o-line); }
.summary__file div { min-width: 0; }
.summary__file b { display: block; color: var(--o-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary__file small { display: block; font-size: 14px; color: var(--o-ink-3); }
.fileico { flex: none; width: 40px; height: 44px; border-radius: 4px; background: var(--o-surface-2); display: grid; place-items: center; font: 600 14px var(--o-font-mono); color: var(--o-ink-2); }
.summary__rows { margin: 16px 0 0; display: grid; gap: 8px; }
.summary__rows--flush { margin-top: 0; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.summary__row > :first-child { color: var(--o-ink-2); }
.summary__row > :last-child { color: var(--o-ink); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.summary__row .mono, .summary__total b { font-family: var(--o-font-mono); font-variant-numeric: tabular-nums; }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--o-line); margin-top: 16px; padding-top: 16px; }
.summary__total > span { font-size: 14px; color: var(--o-ink); font-weight: 600; }
.summary__total b { font-size: 30px; line-height: 1; font-weight: 600; color: var(--o-ink); letter-spacing: -0.02em; }
.summary__note { font-size: 14px; line-height: 1.5; color: var(--o-ink-3); margin: 12px 0 0; }
.summary .dot, .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--o-accent)); box-shadow: inset 0 0 0 1px rgba(36, 28, 21, 0.18); margin-right: 6px; }
.order-mobsum { display: none; }
@media (max-width: 860px) { .order-mobsum { display: block; margin-top: 32px; background: var(--o-surface); border: 1px solid var(--o-line); border-radius: var(--o-radius); padding: 16px; } .order-mobsum .summary__total { margin-top: 12px; padding-top: 12px; } }

/* Skjema */
.order .field { display: grid; gap: 6px; margin: 16px 0 0; }
.order .field > label, .order .field > .lbl { font: 500 14px/1.4 var(--o-font-body); color: var(--o-ink); margin: 0; }
.order .field .optional { color: var(--o-ink-3); font-weight: 400; }
.order .field input:not([type="checkbox"]):not([type="radio"]), .order .field textarea { width: 100%; min-height: 48px; padding: 0 14px; font: 16px var(--o-font-body); color: var(--o-ink); background: var(--o-surface); border: 1px solid var(--o-line-strong); border-radius: 10px; box-shadow: none; }
.order .field textarea { padding: 12px 14px; min-height: 96px; }
.order .field input::placeholder, .order .field textarea::placeholder { color: #7A6D5C; }
.order .field input:focus, .order .field textarea:focus { outline: 2px solid var(--o-focus); outline-offset: -1px; border-color: var(--o-focus); box-shadow: none; }
.order .field.has-error input { border-color: var(--o-err); box-shadow: inset 0 0 0 1px var(--o-err); }
.order .field__error { font-size: 14px; font-weight: 400; color: var(--o-err); margin: 0; min-height: 0; }
.order .field__error:empty { display: none; }
.order-cols { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; margin-top: 16px; }
.order-cols .field { margin-top: 0; }
@media (max-width: 860px) { .order-cols { grid-template-columns: 110px minmax(0, 1fr); } }
.order .upload-help { font-size: 14px; line-height: 1.5; color: var(--o-ink-3); margin: 8px 0 0; }
.order-declare { margin-top: 32px; padding: 16px; border: 1px solid var(--o-line); border-radius: var(--o-radius); background: var(--o-surface); }
.order-declare .field { margin: 0; }
.order .checkbox-row { display: flex; gap: 12px; align-items: flex-start; font: 14px/1.5 var(--o-font-body); color: var(--o-ink); margin: 0; cursor: pointer; }
.order .checkbox-row input[type="checkbox"] { flex: none; width: 22px; height: 22px; min-height: 0; margin: 0; padding: 0; accent-color: var(--o-ink); }
details.order-fold { margin-top: 24px; border-top: 1px solid var(--o-line); padding-top: 16px; }
details.order-fold summary { display: flex; justify-content: space-between; align-items: center; min-height: 32px; cursor: pointer; color: var(--o-ink); font-weight: 500; font-size: 15px; list-style: none; }
details.order-fold summary::-webkit-details-marker { display: none; }
details.order-fold summary::after { content: "+"; font: 500 20px var(--o-font-mono); color: var(--o-ink-2); }
details.order-fold[open] summary::after { content: "\2212"; }
details.order-fold summary:focus-visible { outline: 2px solid var(--o-focus); outline-offset: 2px; border-radius: 6px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--o-radius); font-size: 14px; line-height: 1.5; color: var(--o-ink-2); background: var(--o-surface-2); }
.notice b { display: block; color: var(--o-ink); }
.notice--err { background: var(--o-err-soft); }
.notice--ok { background: var(--o-ok-soft); }
/* Klassenes display (grid/flex) overstyrte [hidden]: filkontroll-felt og samtykkerad sto synlige uten å være valgt. */
.order [hidden], .notice[hidden] { display: none !important; } /* begrenset: ikke global, så hidden="until-found" osv. virker utenfor bestillingen */
.order .notice { margin: 14px 0 0; }
.notice::before { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 14px/1 var(--o-font-body); }
.notice--info { border: 1px solid var(--o-line); }
.notice--info::before { content: "i"; background: var(--o-ink-2); color: #fff; }
.notice--legal { border: 1px solid var(--o-line-strong); border-left-width: 4px; background: var(--o-surface-sel); color: var(--o-ink); }
.notice--legal::before { content: "§"; background: var(--o-accent); color: var(--o-accent-ink); }
.skel { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--o-surface-2) 0%, #F6F0E7 50%, var(--o-surface-2) 100%); background-size: 200% 100%; animation: o-shimmer 1.4s linear infinite; }
@keyframes o-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* Fast bunnlinje (mobil/nettbrett, kun steg 2). Knappen har INGEN egen logikk: order-bar.js videresender .click() til sidens egen knapp. */
.order-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--o-surface); border-top: 1px solid var(--o-line); box-shadow: 0 -6px 20px rgba(36, 28, 21, 0.06); font-family: var(--o-font-body); box-sizing: border-box; }
.order-bar[hidden], .order-bar.is-kbd { display: none; }
.order-bar__sum { min-width: 0; line-height: 1.2; }
.order-bar__total { display: block; font: 600 22px/1.1 var(--o-font-mono); font-variant-numeric: tabular-nums; color: var(--o-ink); white-space: nowrap; }
.order-bar__label { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; color: var(--o-ink-2); overflow: hidden; }
.order-bar__btn { flex: none; min-width: 132px; min-height: 48px; padding: 0 22px; border: 0; border-radius: 10px; background: var(--o-accent); color: var(--o-accent-ink); font: 600 16px/1 var(--o-font-body); cursor: pointer; }
.order-bar__btn:disabled { background: var(--o-surface-2); color: var(--o-ink-3); cursor: not-allowed; }
.order-bar__btn:focus-visible { outline: 2px solid var(--o-focus); outline-offset: 2px; }
@media (min-width: 861px) { .order-bar { display: none; } }
@media (max-width: 860px) { html { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom)); } body.has-order-bar { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } }
