@font-face {
  font-family: "Open Sans";
  src: url("../fonts/open-sans-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Raleway";
  src: url("../fonts/raleway-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand: #bf001e;
  --brand-dark: #98001a;
  --ink: #313030;
  --heading: #635551;
  --muted: #6c757d;
  --line: #e9ecef;
  --bg: #f8f9fa;
  --card: #ffffff;
  --yes: #1e8449;
  --yes-bg: #eef8f1;
  --ok: #1f7a4d;
  --ok-bg: #e8f5ee;
  --err: #b3261e;
  --err-bg: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* Header / footer */
.contactbar { background: var(--brand); color: #fff; font-size: .85rem; }
.contactbar .wrap { display: flex; gap: 20px; align-items: center; height: 36px; }
.contactbar a { color: #fff; text-decoration: none; }
.contactbar a:hover { color: #fff; text-decoration: underline; }

.topbar { background: #fff; box-shadow: 0 0 20px rgba(0,0,0,.08); position: relative; z-index: 1; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: block; line-height: 0; }
.brand img { height: 55px; width: auto; }
.site-link { font-family: "Raleway", sans-serif; font-weight: 600; color: var(--heading); text-decoration: none; font-size: .95rem; }
.site-link:hover { color: var(--brand); }

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 32px; padding-bottom: 48px; }

.footer { color: var(--muted); font-size: .85rem; padding: 24px 0 32px; border-top: 1px solid var(--line); }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* Typografi */
h1, h2, h3, .product-name { font-family: "Raleway", sans-serif; color: var(--heading); }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); font-weight: 600; line-height: 1.2; margin: 0 0 .4em; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 .8em; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 1.5em; max-width: 60ch; }
.small { font-size: .85rem; color: var(--muted); }

/* Kort */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card + .card { margin-top: 20px; }
.narrow { max-width: 460px; margin: 0 auto; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* Meldingar */
.alert { border-radius: 10px; padding: 12px 16px; margin: 0 0 20px; }
.alert-error { background: var(--err-bg); color: var(--err); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-info { background: #fff7e0; color: #6b4e00; }
.alert ul { margin: 0; padding-left: 1.2em; }

/* Skjema */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.input, select.input {
  width: 100%;
  font: inherit;
  padding: 11px 13px;
  border: 1px solid #d4d1cc;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(191,0,30,.15); }
.input.is-invalid { border-color: var(--err); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-postal { display: grid; grid-template-columns: 120px 1fr; gap: 0 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700;
  padding: 13px 22px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-block { width: 100%; }
.btn-link { background: none; color: var(--muted); padding: 0; font-weight: 500; text-decoration: underline; border-radius: 0; }
.btn-link:hover { background: none; color: var(--ink); }

/* Bestillingsside */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.portrait { position: sticky; top: 20px; }
.portrait img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); display: block; background: #eee; }
.portrait figcaption { margin-top: 8px; }

.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.product:first-of-type { padding-top: 0; }
.product-name { font-weight: 700; }
.product-desc { color: var(--muted); font-size: .92rem; }
.product-price { font-weight: 600; white-space: nowrap; }

.choice { display: inline-flex; background: #f0eeeb; border-radius: 999px; padding: 4px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  margin: 0; cursor: pointer; font-weight: 700; font-size: .9rem;
  padding: 7px 18px; border-radius: 999px; color: var(--muted);
  transition: background .15s, color .15s;
}
.choice input:focus-visible + label { box-shadow: 0 0 0 3px rgba(191,0,30,.25); }
.choice input[value="1"]:checked + label { background: var(--yes); color: #fff; }
.choice input[value="1"]:checked + label::before { content: "\2713\00a0"; }
.choice input[value="0"]:checked + label { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.product:has(.choice input[value="1"]:checked) { background: var(--yes-bg); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 10px; border-bottom-color: transparent; }
.choice.is-invalid { box-shadow: 0 0 0 2px var(--err); }

.qty { width: 90px; text-align: center; }

.summary {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 18px; font-size: 1.05rem;
}
.summary strong { font-size: 1.3rem; }

.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }

details.terms { margin: 6px 0 18px; font-size: .9rem; color: #444; }
details.terms summary { cursor: pointer; color: var(--brand); font-weight: 600; }
details.terms .terms-body { max-height: 340px; overflow: auto; margin-top: 10px; padding: 14px; background: #faf9f7; border-radius: 10px; }
details.terms h3 { font-size: .95rem; margin: 1em 0 .3em; }
details.terms p { margin: 0 0 .6em; }

.decline { margin-top: 22px; text-align: center; }
.hidden { display: none !important; }

.big-icon {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  margin: 0 auto 16px; font-size: 30px; background: var(--ok-bg); color: var(--ok);
}

.tap-hint { display: none; }

@media (max-width: 760px) {
  .order-layout { grid-template-columns: 1fr; gap: 16px; }

  /* Mobil: lite miniatyrbilete ved sida av teksten, trykk for stort */
  .portrait {
    position: static; order: -1; margin: 0;
    display: flex; align-items: center; gap: 14px;
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px;
  }
  .portrait img { width: 84px; height: auto; flex: none; border-radius: 8px; box-shadow: none; cursor: zoom-in; transition: width .2s; }
  .portrait figcaption { margin: 0; }
  .tap-hint { display: block; margin-top: 4px; color: var(--brand); font-weight: 600; }
  .portrait.expanded { flex-direction: column; align-items: stretch; }
  .portrait.expanded img { width: 100%; cursor: zoom-out; }
  .portrait.expanded .tap-hint { display: none; }

  /* Kompakt: mindre luft og kortare header */
  main.wrap { padding-top: 14px; padding-bottom: 24px; }
  .contactbar .wrap { height: 30px; font-size: .8rem; gap: 14px; }
  .topbar .wrap { height: 56px; }
  .site-link { display: none; }
  h1 { font-size: 1.35rem; margin-bottom: .3em; }
  .lead { font-size: .92rem; line-height: 1.5; margin-bottom: 12px; }
  .card { padding: 14px 16px; }
  .card + .card { margin-top: 12px; }
  .product { padding: 10px 0; gap: 4px 12px; }
  .product-desc { font-size: .85rem; line-height: 1.4; }
  .field { margin-bottom: 12px; }
  .grid-postal { grid-template-columns: 96px 1fr; }
  .footer { padding: 16px 0 20px; font-size: .8rem; }

  /* Summen følgjer med nedst på skjermen medan ein vel produkt */
  .summary {
    position: sticky; bottom: 0; z-index: 2;
    margin: 8px -16px 0; padding: 12px 16px;
    background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -6px 16px rgba(0,0,0,.06);
  }

  /* Større trykkflater */
  .choice label { padding: 9px 20px; }
  .btn { padding: 15px 22px; }
  .input { font-size: 16px; } /* hindrar iOS-zoom ved fokus */
  .card { padding: 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .brand img { height: 44px; }
}
