/* =========================================================
   NAM — bestillingsside (bestil.html)
   ========================================================= */
.order { --line: rgba(23, 38, 28, .12); --muted: rgba(23, 38, 28, .62); --cats-h: 58px;
  padding: clamp(28px, 5vw, 64px) var(--gutter) clamp(60px, 8vw, 110px); }

/* ---------- Top ---------- */
.order__head { display: flex; align-items: end; justify-content: space-between; gap: 12px 30px; flex-wrap: wrap; margin-bottom: clamp(18px, 3vw, 30px); }
.order__title { margin: 0; }
.order__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 0 0 .4em; font-size: .9rem; }
.order__status { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
.order__status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #8B918C; }
.order__status.is-open { color: var(--green); }
.order__status.is-open::before { background: var(--green); box-shadow: 0 0 0 4px rgba(46, 102, 62, .16); }
.order__where { color: var(--muted); }

/* ---------- Kategorilinje (klæber under headeren) ---------- */
.order__cats {
  position: sticky; top: var(--header-h); z-index: 20;
  display: flex; gap: clamp(18px, 2.4vw, 34px); overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  height: var(--cats-h); align-items: center;
  margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter);
  background: var(--paper); border-bottom: 2px solid var(--ink);
}
.order__cats::-webkit-scrollbar { display: none; }
.order__cats a {
  flex: none; position: relative; padding: 6px 0;
  font-weight: 500; text-transform: uppercase; text-decoration: none; white-space: nowrap; font-size: .95rem; letter-spacing: .02em;
  color: rgba(23, 38, 28, .45); transition: color .2s, background-color .2s;
}
.order__cats a:hover, .order__cats a.is-active { color: var(--ink); }
.order__cats a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out); }
.order__cats a.is-active::after { transform: scaleX(1); }

/* ---------- Layout: menu + kurv ---------- */
.order__layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(28px, 4vw, 56px); align-items: start; }

/* ---------- Menu ---------- */
.ocat { padding-top: clamp(30px, 4vw, 46px); scroll-margin-top: calc(var(--header-h) + var(--cats-h)); }
.ocat__head { margin-bottom: 18px; }
.ocat__head h2 { margin: 0 0 6px; font-weight: 700; text-transform: uppercase; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.05; color: var(--green); }
.ocat__head p { margin: 0; max-width: 62ch; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.ocat__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.oitem {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 108px; gap: 16px; align-items: start;
  min-height: 140px; padding: 16px; background: var(--white); border: 1.5px solid var(--line);
  transition: border-color .2s, transform .25s var(--ease-bounce), box-shadow .25s;
}
/* hele kortet er en knap (usynlig, ligger ovenpå) — "+" ligger ovenover den igen */
.oitem__open { position: absolute; inset: 0; z-index: 1; width: 100%; padding: 0; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.oitem__open:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.oitem:hover:not(.is-off) { border-color: var(--ink); transform: translate(-3px, -3px); box-shadow: 5px 5px 0 0 var(--green); }
.oitem:has(.oitem__open:active) { transform: none; box-shadow: none; }
.oitem.is-off { opacity: .55; }
.oitem.is-off .oitem__open { cursor: default; }
.oitem.is-in-cart { border-color: var(--ink); }
.oitem__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 100%; }
.oitem__name { margin: 0; font-weight: 600; font-size: 1.02rem; line-height: 1.3; }
.oitem__n { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; margin-right: 8px; padding: 0 .3em; background: var(--red); color: var(--sage); font-size: .72rem; font-weight: 700; vertical-align: .12em; }
.oitem__note { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.oitem__price { margin: auto 0 0; padding-top: 10px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.oitem__hit { padding: 3px 7px 2px; background: var(--sage); color: var(--green); font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.oitem__img { position: relative; display: block; width: 108px; height: 108px; background: var(--sage); }
.oitem__img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.oitem__img .oitem__mand { padding: 18px; opacity: .55; }
.oitem__add {
  position: absolute; z-index: 2; right: 8px; bottom: 8px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  background: var(--red); color: var(--sage); border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 12px rgba(212, 64, 25, .3); transition: transform .2s var(--ease-bounce), background-color .2s;
}
.oitem__add:hover { background: var(--red-dark); transform: scale(1.06); }
.oitem__add:active { transform: scale(.92); }
.oitem__add:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.oitem__qty { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; background: var(--green); color: var(--sage); font-size: .8rem; font-weight: 700; }
.oitem__qty[hidden] { display: none; }

/* ---------- Kurv ---------- */
.cart {
  position: sticky; top: calc(var(--header-h) + var(--cats-h) + 24px); margin-top: clamp(30px, 4vw, 46px);
  display: flex; flex-direction: column; max-height: calc(100svh - var(--header-h) - var(--cats-h) - 48px);
  background: var(--white); border: 2px solid var(--ink); outline: none;
}
.cart.is-bump { animation: cart-bump .45s var(--ease-bounce); }
@keyframes cart-bump { 40% { transform: translateY(-4px); box-shadow: 6px 6px 0 0 var(--red); } }
.cart__head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px 14px; }
.cart__head h2 { margin: 0; font-weight: 700; text-transform: uppercase; font-size: 1.15rem; letter-spacing: .02em; }
.cart__grip { display: none; }
.cart__close { display: none; width: 40px; height: 40px; place-items: center; margin: -8px -10px -8px 0; background: none; border: 0; color: var(--ink); cursor: pointer; }
.cart__body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 22px 18px; }
.cart__foot { display: grid; gap: 10px; padding: 14px 22px 18px; border-top: 1.5px solid var(--line); background: var(--white); }
.cart__muted { color: var(--muted); font-size: .85rem; line-height: 1.5; margin: 0; }
.cart__empty { display: grid; justify-items: center; gap: 4px; padding: 14px 0 6px; text-align: center; }
.cart__empty img { width: 72px; height: auto; margin-bottom: 10px; opacity: .9; }
.cart__empty p { margin: 0; }

.cart__lines { list-style: none; margin: 0; padding: 0; }
.cline { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text price" "qty qty"; gap: 8px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cline:first-child { padding-top: 2px; }
.cline__text { grid-area: text; display: grid; gap: 2px; }
.cline__name { font-weight: 600; font-size: .98rem; line-height: 1.3; }
.cline__sub { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.cline__price { grid-area: price; font-weight: 600; font-size: .98rem; white-space: nowrap; }
.cline__qty { grid-area: qty; justify-self: start; }
.cart__sum { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 8px; font-size: 1.05rem; }
.cart__sum strong { font-size: 1.35rem; }
.cart__pay { display: flex; align-items: center; gap: 6px; }
.cart__pay svg { flex: none; }
.cart__cta { width: 100%; justify-content: space-between; min-height: 54px; padding: 0 1.2em; font-size: .95rem; }
.cart__cta--center { justify-content: center; }
.cart__cta[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.cart__fine { text-align: center; font-size: .78rem; }

/* antal-knapper (dialog og kurv) */
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--ink); background: var(--white); }
.qty button { display: grid; place-items: center; width: 44px; height: 48px; padding: 0; background: none; border: 0; color: var(--ink); font: inherit; font-size: 1.3rem; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.qty button:hover:not(:disabled) { background: var(--sage); }
.qty button:disabled { opacity: .3; cursor: default; }
.qty output { min-width: 28px; text-align: center; font-weight: 600; }
.qty--sm button { width: 38px; height: 36px; font-size: 1.1rem; }
.qty--sm output { min-width: 22px; font-size: .95rem; }

/* afhentningsformular */
.checkout { display: grid; gap: 14px; }
.cart__back { justify-self: start; padding: 4px 0; margin: -4px 0 0; background: none; border: 0; font: inherit; font-size: .88rem; font-weight: 500; color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.checkout__summary { display: flex; justify-content: space-between; padding: 12px 14px; background: var(--sage); color: var(--green); font-size: .95rem; }
.field { display: grid; gap: 6px; }
.field > span { font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.field em { font-style: normal; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: 4px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; font: inherit; font-size: 16px; /* 16px: iOS zoomer ikke ind */ color: var(--ink);
  background: var(--paper); border: 1.5px solid rgba(23, 38, 28, .35); border-radius: 0; outline: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2317261C' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 4px 4px 0 var(--green); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.checkout__status { margin: 0; font-size: .88rem; font-weight: 500; color: var(--green); }
.checkout__status:empty { display: none; }
.checkout__status.is-error { color: var(--red); }
.checkout__status a { color: inherit; }

/* bekræftelse */
.cart__done { display: grid; gap: 10px; padding: 4px 0 2px; }
.cart__done p { margin: 0; line-height: 1.55; }
.cart__check { display: grid; place-items: center; width: 54px; height: 54px; background: var(--green); color: var(--sage); }
.cart__done-title { font-weight: 700; font-size: 1.4rem; text-transform: uppercase; color: var(--green); margin-top: 6px !important; }
.cart__facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 6px 0 0; padding: 14px; background: var(--sage); font-size: .92rem; }
.cart__facts dt { font-weight: 600; }
.cart__facts dd { margin: 0; }

/* lille besked "lagt i kurven" */
.otoast {
  position: fixed; z-index: 95; left: 50%; bottom: 28px; display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(calc(100vw - 32px), 440px);
  padding: 12px 18px; background: var(--ink); color: var(--paper); font-size: .9rem; font-weight: 500;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease-out);
}
.otoast svg { flex: none; color: #9BD3A4; }
.otoast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Vare-dialog ---------- */
.item-dlg { width: min(560px, calc(100vw - 32px)); max-width: none; max-height: min(92svh, 880px); padding: 0; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); overflow: hidden; }
.item-dlg[open] { display: flex; animation: dlg-in .3s var(--ease-out); }
.item-dlg::backdrop { background: rgba(23, 38, 28, .55); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(16px); } }
.idlg { position: relative; display: flex; flex-direction: column; width: 100%; max-height: inherit; margin: 0; }
.idlg__scroll { overflow: auto; flex: 1; overscroll-behavior: contain; }
.idlg__close { position: absolute; top: 12px; right: 12px; z-index: 2; display: grid; place-items: center; width: 42px; height: 42px; background: var(--white); border: 1.5px solid var(--ink); color: var(--ink); cursor: pointer; }
.idlg__close:hover { background: var(--red); border-color: var(--red); color: var(--sage); }
.idlg__media { position: relative; height: clamp(200px, 34svh, 320px); background: var(--sage); }
.idlg__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.idlg__media .oitem__mand { padding: 18% 30%; opacity: .55; }
.idlg__body { padding: 22px 24px 10px; }
.idlg__cat { margin: 0 0 6px; color: var(--red); font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.idlg__title { margin: 0 0 8px; font-weight: 700; text-transform: uppercase; font-size: clamp(1.4rem, 3vw, 1.8rem); line-height: 1.08; color: var(--green); }
.idlg__note { margin: 0 0 8px; font-weight: 500; }
.idlg__info { margin: 0 0 10px; color: var(--muted); line-height: 1.6; font-size: .95rem; }
.idlg__small { margin: 0 0 10px; color: var(--muted); font-size: .8rem; font-style: italic; }
.idlg__opt { margin: 18px 0 6px; padding: 0; border: 0; }
.idlg__opt legend { display: flex; justify-content: space-between; width: 100%; padding: 0 0 10px; font-weight: 700; text-transform: uppercase; font-size: .85rem; letter-spacing: .06em; }
.idlg__opt legend span { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 16px; border: 1.5px solid var(--line); background: var(--white); font-size: .95rem; font-weight: 500; cursor: pointer; transition: border-color .15s, background-color .15s, color .15s; -webkit-tap-highlight-color: transparent; }
.chip span em { font-style: normal; font-size: .8rem; color: var(--muted); }
.chip:hover span { border-color: var(--ink); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip input:checked + span em { color: rgba(250, 248, 241, .7); }
.chip input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }
.idlg__foot { display: flex; gap: 12px; padding: 14px 24px 18px; border-top: 1.5px solid var(--line); background: var(--paper); }
.idlg__add { flex: 1; justify-content: space-between; padding: 0 1.3em; min-height: 52px; font-size: .95rem; }

/* ---------- Mobil: liste, bjælke nederst og kurv som skuffe ---------- */
.cart-bar, .cart-dim { display: none; }
@media (max-width: 960px) {
  .order__layout { grid-template-columns: minmax(0, 1fr); }
  .cart {
    position: fixed; inset: auto 0 0 0; z-index: 90; margin: 0; top: auto;
    height: auto; max-height: min(92svh, 820px);
    border: 0; border-top: 2px solid var(--ink); box-shadow: 0 -12px 40px rgba(23, 38, 28, .18);
    transform: translateY(105%); visibility: hidden; transition: transform .32s var(--ease-out), visibility 0s linear .32s;
  }
  .cart.is-open { transform: none; visibility: visible; transition: transform .32s var(--ease-out), visibility 0s; }
  .cart.is-bump { animation: none; }
  .cart__head { padding: 22px var(--gutter) 12px; border-bottom: 1px solid var(--line); }
  .cart__grip { display: block; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; background: rgba(23, 38, 28, .2); }
  .cart__close { display: grid; }
  .cart__body { padding: 16px var(--gutter) 18px; }
  .cart__foot { padding: 12px var(--gutter) calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 20px rgba(23, 38, 28, .06); }
  .cart-dim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 85; background: rgba(23, 38, 28, .5); animation: fade-in .25s; }
  @keyframes fade-in { from { opacity: 0; } }

  /* bjælken "Se kurv" */
  .cart-bar:not([hidden]) {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
    position: fixed; z-index: 80; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    min-height: 58px; padding: 0 18px 0 12px; border: 0; background: var(--red); color: var(--sage); font: inherit; text-align: left; cursor: pointer;
    box-shadow: 0 10px 28px rgba(23, 38, 28, .3); -webkit-tap-highlight-color: transparent;
    animation: bar-in .35s var(--ease-out);
  }
  .cart-bar:active { transform: scale(.985); }
  .cart-bar.is-bump { animation: bar-bump .45s var(--ease-bounce); }
  @keyframes bar-in { from { transform: translateY(30px); opacity: 0; } }
  @keyframes bar-bump { 40% { transform: translateY(-5px); } }
  .cart-bar__count { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; background: var(--sage); color: var(--red); font-weight: 700; font-size: .95rem; }
  .cart-bar__label { font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .95rem; }
  .cart-bar__total { font-weight: 700; font-size: 1.1rem; }
  body.has-cart-bar .site-footer { padding-bottom: 96px; }
  body.has-cart-bar .otoast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width: 700px) {
  .order { --cats-h: 54px; padding-top: 22px; }
  .order__head { margin-bottom: 14px; }
  .order__title { font-size: 2.5rem; }
  .order__meta { flex-direction: column; align-items: flex-start; gap: 4px; font-size: .85rem; }

  /* kategorier som små faner */
  .order__cats { gap: 8px; border-bottom: 1px solid var(--line); }
  .order__cats a { padding: 9px 14px; font-size: .82rem; font-weight: 600; letter-spacing: .04em; color: var(--ink); background: var(--white); border: 1.5px solid var(--line); }
  .order__cats a.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
  .order__cats a::after { content: none; }

  /* retter som en ren liste med streger imellem */
  .ocat { padding-top: 26px; }
  .ocat__head { margin-bottom: 4px; }
  .ocat__head h2 { font-size: 1.5rem; }
  .ocat__head p { font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ocat__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .oitem { grid-template-columns: minmax(0, 1fr) 104px; gap: 14px; min-height: 0; padding: 16px 0; background: none; border: 0; border-bottom: 1px solid var(--line); }
  .oitem:hover:not(.is-off) { transform: none; box-shadow: none; }
  .oitem.is-in-cart { border-color: var(--line); }
  .oitem:active:not(.is-off) { background: rgba(231, 239, 212, .45); }
  .oitem__name { font-size: 1rem; }
  .oitem__note { font-size: .85rem; }
  .oitem__img { width: 104px; height: 104px; }
  .oitem__add { right: -4px; bottom: 10px; width: 38px; height: 38px; }
  .oitem__qty { top: 6px; right: -4px; }

  .item-dlg { width: 100vw; max-height: 94svh; margin: auto 0 0; border-width: 2px 0 0; }
  .item-dlg[open] { animation: sheet-in .32s var(--ease-out); }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
  .idlg__media { height: min(52vw, 230px); }
  .idlg__body { padding: 18px 18px 8px; }
  .idlg__foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .item-dlg[open], .cart.is-bump, .cart-bar.is-bump, .cart-bar:not([hidden]), .cart-dim:not([hidden]) { animation: none; }
  .cart, .cart.is-open, .otoast { transition: none; }
}
