/*
 * Spireli's checkout at /til-betaling/: the form on Creme to the left, the yellow table
 * ("Bordet") with Simon's promise, the bunches and the order slip to the right.
 * Everything is scoped to body classes (templates/til-betaling.php): .spireli-ramme for the frame
 * shared with "Ordre modtaget" (top, bottom, links, the promise and the bunches), .spireli-kasse
 * for the checkout, .spireli-kvittering for "Ordre modtaget" (the last section).
 * Desktop first: 660 px form + 620 px table on a 1280 px frame; at 900 px and below the
 * table lies under the form.
 */

:root {
  --sp-skov: #2C4A2E;
  --sp-blad: #678849;
  --sp-creme: #F4F6E6;
  --sp-lys: #FBFCF1;
  --sp-gul: #FFC200;
  --sp-bord: #FEDA00;
  --sp-fejl: #C0563A;
  --sp-line: rgb(44 74 46 / .25);
  --sp-faint: rgb(44 74 46 / .12);
  --sp-soft: rgb(44 74 46 / .75);
  --sp-ease-enter: var(--ease-enter, cubic-bezier(.23, 1, .32, 1));
  --sp-sans: "Inter", system-ui, sans-serif;
  --sp-head: "Instrument Sans", "Inter", system-ui, sans-serif;
  /* The frame: 1280 px wide, the form takes 660 of it. */
  --sp-frame: min(1280px, 100%);
  --sp-venstre: calc(var(--sp-frame) * .515625);
  --sp-kant: max(0px, calc((100% - 1280px) / 2));
  /* Height of the "Til betaling" title above the steps (32 + 52 + 28). */
  --sp-titel-plads: 112px;
}

/* ---------- Page and frame ---------- */

body.spireli-ramme {
  margin: 0;
  min-height: 100vh;
  color: var(--sp-skov);
  font: 400 17px/1.5 var(--sp-sans);
  -webkit-font-smoothing: antialiased;
  /* Creme under the form, the yellow table from the top of the page to the right edge. */
  background: linear-gradient(90deg, var(--sp-creme) calc(var(--sp-kant) + var(--sp-venstre)), var(--sp-bord) 0);
}

body.spireli-ramme :is(h1, h2, h3, h4) {
  font-family: var(--sp-head);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--sp-skov);
  text-transform: none;
}

body.spireli-ramme :is(a, button, [role="button"], label, summary, select, input[type="checkbox"], input[type="radio"]) {
  cursor: pointer;
}

/* Gul paint-hover on links, as on the Astro site: a stroke from the left, wiped off to the right. */
body.spireli-ramme a {
  color: var(--sp-skov);
  text-underline-offset: 3px;
  background-image: linear-gradient(var(--sp-gul), var(--sp-gul));
  background-repeat: no-repeat;
  background-position: 100% 0;
  background-size: 0% 100%;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

body.spireli-ramme a:is(:hover, :focus-visible) {
  color: var(--sp-skov);
  background-position: 0 0;
  background-size: 100% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  body.spireli-ramme a {
    transition: background-size 420ms var(--sp-ease-enter);
  }
}

body.spireli-ramme :focus-visible {
  outline: 2px solid var(--sp-skov);
  outline-offset: 2px;
}

/* Storefront rounds every image by 3 px; the brand has no radius. */
body.spireli-ramme img {
  border-radius: 0;
}

body.spireli-ramme ::selection {
  background: var(--sp-gul);
  color: var(--sp-skov);
}

body.spireli-ramme :is(input, textarea) {
  caret-color: var(--sp-skov);
}

/* Links inside a line of text are underlined, so they read as links without hovering (the paint stroke comes on top). */
body.spireli-ramme :is(.wc-block-checkout__terms, .sp-konto, .sp-bund) a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Storefront leftovers, in case a hook still prints them. */
body.spireli-ramme :is(#masthead, .storefront-breadcrumb, .storefront-handheld-footer-bar, #colophon, .site-search) {
  display: none !important;
}

/* Top: "← Tilbage til kurven" and the logo, over the form column. */
body.spireli-ramme .sp-top {
  box-sizing: border-box;
  width: var(--sp-venstre);
  margin-left: var(--sp-kant);
  height: 80px;
  padding: 0 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

body.spireli-ramme .sp-tilbage {
  font-size: 16px;
  text-decoration: none;
  padding: 3px 6px;
  margin-left: -6px;
}

/* Woo's own "Tilbage til kurven" by the pay button: the top link already says it (and points to
   the drawer, not wc_get_cart_url()). */
body.spireli-kasse .wc-block-components-checkout-return-to-cart-button {
  display: none !important;
}

body.spireli-ramme .sp-logo {
  display: block;
  line-height: 0;
  padding: 0;
  background: none;
}

body.spireli-ramme .sp-logo img {
  height: 30px;
  width: auto;
}

body.spireli-kasse main.sp-kasse {
  box-sizing: border-box;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
}

/* Bottom: the contact to Simon, under the form. */
body.spireli-ramme .sp-bund {
  box-sizing: border-box;
  width: var(--sp-venstre);
  margin-left: var(--sp-kant);
  padding: 0 64px 64px;
  font-size: 16px;
}

body.spireli-ramme .sp-bund p {
  margin: 0;
}

body.spireli-ramme .sp-bund p:first-child {
  border-top: 1px solid var(--sp-line);
  padding-top: 18px;
}

body.spireli-ramme .sp-bund a {
  font-weight: 500;
}

body.spireli-ramme .sp-bund .sp-signatur {
  color: var(--sp-soft);
}

/* ---------- The two columns ---------- */

/* The block carries "alignwide", which Storefront pulls out with negative margins. */
body.spireli-kasse main.sp-kasse .wp-block-woocommerce-checkout {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.spireli-kasse .wc-block-checkout.wc-block-components-sidebar-layout {
  display: grid;
  grid-template-columns: minmax(0, 660fr) minmax(0, 620fr);
  gap: 0;
  align-items: start;
  margin: 0;
  max-width: none;
}

body.spireli-kasse .wc-block-checkout__main {
  box-sizing: border-box;
  width: auto;
  margin: 0;
  padding: 0 64px 64px;
}

body.spireli-kasse .wc-block-checkout__sidebar {
  box-sizing: border-box;
  width: auto;
  margin: 0;
  /* The table sits under the top bar's height, so it lines up with the form. */
  margin-top: -80px;
  padding: 40px 48px 48px;
  position: sticky;
  top: 0;
  align-self: start;
  /* Never taller than the window, so "I alt" can always be reached. */
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--sp-skov) transparent;
  background: var(--sp-bord);
  /* Sticky keeps the margin box inside the grid, which ends above the footer (.sp-bund, ~130 px). Without
     this the table is pushed up at the end of the page, cutting off Simon, just as the customer pays. */
  margin-bottom: -128px;
}

/* With the title above the steps, the table still starts at the top of the page. */
@media (min-width: 901px) {
  body.spireli-kasse main.sp-kasse:has(> .sp-titel) .wc-block-checkout__sidebar {
    margin-top: calc(-80px - var(--sp-titel-plads));
  }
}

/* Woo's own notices above the layout stay in the form column. */
body.spireli-kasse .wp-block-woocommerce-checkout > .wc-block-components-notices {
  box-sizing: border-box;
  width: var(--sp-venstre);
  max-width: 660px;
  padding: 0 64px;
}

/* No quick-pay buttons (Apple Pay, Google Pay, Link, Amazon Pay): removed in PHP (PageSetup, Betaling); this stays as a fallback. */
body.spireli-kasse :is(.wc-block-components-express-payment--checkout, .wc-block-components-express-payment-continue-rule--checkout, .wp-block-woocommerce-checkout-express-payment-block) {
  display: none !important;
}

/* The inline summary Woo puts in the actions block; the table already shows the order. */
body.spireli-kasse .wc-block-checkout__actions .wp-block-woocommerce-checkout-order-summary-block {
  display: none;
}

/* ---------- Steps, fields and controls (Task 6 adds the folding) ---------- */

body.spireli-kasse .wc-block-components-checkout-step {
  margin: 0;
  padding: 24px 0 28px;
  border-top: 1px solid var(--sp-skov);
}

body.spireli-kasse .wc-block-components-checkout-step__heading {
  margin: 0 0 18px;
}

body.spireli-kasse .wc-block-components-checkout-step__title {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

body.spireli-kasse .wc-block-components-checkout-step__description,
body.spireli-kasse .wc-block-checkout__guest-checkout-notice {
  font-size: 15px;
  color: var(--sp-soft);
}

body.spireli-kasse .wc-block-components-checkout-step__container::after,
body.spireli-kasse .wc-block-components-checkout-step::after {
  display: none;
}

/* ---------- The three steps (checkout.js: Kontakt → Levering → Betaling) ---------- */

/* "Til betaling" over the steps (templates/til-betaling.php); fixed height, so the table can line up (see the sidebar). */
body.spireli-ramme .sp-titel {
  box-sizing: border-box;
  width: var(--sp-venstre);
  margin: 0;
  padding: 32px 64px 28px;
  height: var(--sp-titel-plads);
  font: 700 52px/52px var(--sp-head);
  letter-spacing: -.04em;
}

/* The step head: number, title, then the peek (closed) or the summary with "Ret" (filled). */
body.spireli-kasse .sp-trin {
  margin: 28px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--sp-skov);
}

body.spireli-kasse form.wc-block-checkout__form > .sp-trin[data-trin="kontakt"] {
  margin-top: 0;
}

body.spireli-kasse .sp-trin__titel {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  scroll-margin-top: 16px;
}

body.spireli-kasse .sp-trin__titel:focus:not(:focus-visible) {
  outline: none;
}

body.spireli-kasse .sp-trin__nr {
  flex: none;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  border: 1px solid var(--sp-skov);
  font: 700 15px/1 var(--sp-sans);
  letter-spacing: 0;
  transform: translateY(-3px);
}

body.spireli-kasse .sp-trin[data-tilstand="udfyldt"] .sp-trin__nr {
  background: var(--sp-skov);
  color: var(--sp-lys);
}

body.spireli-kasse .sp-trin[data-tilstand="lukket"] .sp-trin__titel {
  color: var(--sp-soft);
}

body.spireli-kasse .sp-trin[data-tilstand="lukket"] .sp-trin__nr {
  border-color: var(--sp-soft);
}

body.spireli-kasse .sp-trin__kig {
  display: none;
  margin: 8px 0 0 40px;
  font-size: 16px;
  color: var(--sp-soft);
}

body.spireli-kasse .sp-trin[data-tilstand="lukket"] .sp-trin__kig {
  display: block;
}

body.spireli-kasse .sp-trin__sum {
  display: none;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin: 6px 0 0 40px;
  font-size: 16px;
  color: var(--sp-soft);
}

body.spireli-kasse .sp-trin[data-tilstand="udfyldt"] .sp-trin__sum {
  display: flex;
}

body.spireli-kasse .sp-trin__sumtekst {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* "Ret" looks like the page's links: underlined, gul paint stroke on hover. */
body.spireli-kasse .sp-trin__ret {
  flex: none;
  margin: 0;
  padding: 2px 4px;
  border: 0;
  border-radius: 0;
  font: 400 16px/1.5 var(--sp-sans);
  color: var(--sp-skov);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background-color: transparent;
  background-image: linear-gradient(var(--sp-gul), var(--sp-gul));
  background-repeat: no-repeat;
  background-position: 100% 0;
  background-size: 0% 100%;
}

body.spireli-kasse .sp-trin__ret:is(:hover, :focus-visible) {
  background-position: 0 0;
  background-size: 100% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  body.spireli-kasse .sp-trin__ret {
    transition: background-size 420ms var(--sp-ease-enter);
  }
}

/* Woo's blocks inside a step (marked by checkout.js) and our "Videre": no own frame, indented under the title.
   Each block folds on its own with grid-template-rows (0fr closed), never display:none, so Stripe's
   iframe and Shipmondo's picker stay mounted. */
body.spireli-kasse form.wc-block-checkout__form > [data-sp-trin] {
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: minmax(0, 1fr);
  margin: 18px 0 0 40px;
  padding: 0;
  border: 0;
  min-width: 0;
}

body.spireli-kasse form.wc-block-checkout__form > [data-sp-trin]:empty {
  margin-top: 0;
}

body.spireli-kasse form.wc-block-checkout__form > [data-sp-trin] > * {
  min-height: 0;
}

body.spireli-kasse form.wc-block-checkout__form > [data-sp-trin]:not([data-sp-tilstand="aaben"]) {
  grid-template-rows: 0fr;
  grid-auto-rows: 0fr;
  margin-top: 0;
  visibility: hidden;
}

body.spireli-kasse form.wc-block-checkout__form > [data-sp-trin]:is(:not([data-sp-tilstand="aaben"]), [data-sp-flytter]) > * {
  overflow: hidden;
  overflow: clip;
}

/* The step's own title replaces Woo's ("Kontaktinformation" …); the fieldset legend still names it for screen readers.
   A login link in the heading (if Woo shows one) stays, after the fields. */
body.spireli-kasse form.wc-block-checkout__form > [data-sp-trin] .wc-block-components-checkout-step__title {
  display: none;
}

body.spireli-kasse form.wc-block-checkout__form > [data-sp-trin] > .wc-block-components-checkout-step__heading-container {
  order: 1;
  margin: 0;
}

body.spireli-kasse form.wc-block-checkout__form > [data-sp-trin] > .wc-block-components-checkout-step__heading-container:not(:has(.wc-block-components-checkout-step__heading-content:not(:empty))) {
  display: none;
}

body.spireli-kasse form.wc-block-checkout__form > [data-sp-trin] .wc-block-components-checkout-step__heading {
  margin: 0;
}

/* One in-flow child per block, so the single 1fr row carries all of it: the empty slot of the
   (hidden) inline summary and empty notice lists step aside. */
body.spireli-kasse form.wc-block-checkout__form > [data-sp-trin] > :has(> .wp-block-woocommerce-checkout-order-summary-block:only-child),
body.spireli-kasse form.wc-block-checkout__form > [data-sp-trin] > .wc-block-components-notices:empty {
  display: none;
}

/* "Videre til levering" / "Videre til betaling": Skov, Gul with Skov text on hover. */
body.spireli-kasse .sp-knap {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 60px;
  margin: 0;
  padding: 0 24px;
  border: 0;
  border-radius: 0;
  background: var(--sp-skov);
  box-shadow: none;
  color: var(--sp-lys);
  font: 600 19px/1.2 var(--sp-head);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

body.spireli-kasse .sp-knap:is(:hover, :focus-visible) {
  background: var(--sp-gul);
  color: var(--sp-skov);
}

/* Shipmondo marks the pickup point red before the customer has typed anything; show it once "Videre" or "Betal" was tried. */
body.spireli-kasse:not([data-sp-proevet~="levering"]) .shipmondo_service_point_selection .wc-block-components-validation-error {
  display: none;
}

/* Read out by screen readers only: the aria-live region and "(udfyldt)" after a filled step's title. */
body.spireli-kasse :is(.sp-besked, .sp-skjult) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Folding: checkout.js (fold) moves each step as one box, open 320 ms var(--sp-ease-enter), close
   220 ms ease-out; only after the first step was chosen (data-sp-klar), never with reduced motion.
   While a block moves, every row keeps its natural height and the block clips them, so a notice,
   a login link and the fields move together. A closing block stays visible until it has folded. */
body.spireli-kasse form.wc-block-checkout__form > [data-sp-trin][data-sp-flytter] {
  grid-template-rows: none;
  grid-auto-rows: max-content;
  align-content: start;
  overflow: hidden;
  overflow: clip;
}

@media (prefers-reduced-motion: no-preference) {
  body.spireli-kasse[data-sp-klar] form.wc-block-checkout__form > [data-sp-trin]:not([data-sp-tilstand="aaben"]) {
    transition: visibility 0s linear 220ms;
  }
}

/* Text fields: Lys, 1 px line, label 14 px over a 17 px value. */
body.spireli-kasse .wc-block-components-text-input :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], input[type="url"]),
body.spireli-kasse .wc-block-components-textarea,
body.spireli-kasse .wc-blocks-components-select .wc-blocks-components-select__select {
  box-sizing: border-box;
  height: 60px;
  min-height: 60px;
  margin: 0;
  padding: 18px 14px 0;
  border: 1px solid var(--sp-line);
  border-radius: 0;
  background: var(--sp-lys);
  box-shadow: none;
  color: var(--sp-skov);
  font: 400 17px/1.2 var(--sp-sans);
}

body.spireli-kasse .wc-block-components-textarea {
  height: auto;
  min-height: 120px;
  padding: 14px;
}

body.spireli-kasse .wc-block-components-text-input.is-active :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], input[type="url"]) {
  padding: 26px 14px 8px;
}

body.spireli-kasse .wc-block-components-text-input :is(input, textarea):focus,
body.spireli-kasse .wc-block-components-textarea:focus,
body.spireli-kasse .wc-blocks-components-select .wc-blocks-components-select__select:focus {
  border-color: var(--sp-skov);
  outline: 1px solid var(--sp-skov);
  outline-offset: -2px;
  box-shadow: none;
}

body.spireli-kasse .wc-block-components-text-input label {
  left: 15px;
  top: 0;
  max-width: calc(100% - 30px);
  font-size: 17px;
  line-height: 1.2;
  color: var(--sp-soft);
  transform: translateY(20px);
  transform-origin: top left;
}

body.spireli-kasse .wc-block-components-text-input.is-active label {
  /* 17 px × 0.8235 = 14 px */
  transform: translateY(9px) scale(.8235);
}

body.spireli-kasse .wc-blocks-components-select .wc-blocks-components-select__label {
  left: 15px;
  top: 9px;
  font-size: 14px;
  line-height: 1.2;
  color: var(--sp-soft);
  transform: none;
}

body.spireli-kasse .wc-blocks-components-select .wc-blocks-components-select__container {
  height: 60px;
  border-radius: 0;
  background: var(--sp-lys);
}

body.spireli-kasse :is(.wc-block-components-text-input, .wc-blocks-components-select).has-error :is(input, select) {
  border-color: var(--sp-fejl);
}

body.spireli-kasse .wc-block-components-validation-error {
  font-size: 14px;
  color: var(--sp-fejl);
}

body.spireli-kasse .wc-block-components-validation-error > p {
  font-size: 14px;
}

body.spireli-kasse :is(.wc-block-components-address-form__address_2-toggle, .wc-block-components-address-card__edit) {
  font-size: 15px;
  color: var(--sp-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Checkboxes: 22 px square, Skov line, no radius. */
body.spireli-kasse .wc-block-components-checkbox {
  font-size: 16px;
}

body.spireli-kasse .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin: 1px 12px 0 0;
  border: 1px solid var(--sp-skov);
  border-radius: 0;
  background: var(--sp-lys);
  box-shadow: none;
}

body.spireli-kasse .wc-block-components-checkbox .wc-block-components-checkbox__mark {
  fill: var(--sp-skov);
}

body.spireli-kasse .wc-block-components-checkbox__label {
  color: var(--sp-skov);
  font-size: 16px;
  line-height: 1.45;
}

/* Choices (shipping, payment): Lys rows, 1 px line, the chosen one framed in Skov. */
body.spireli-kasse :is(.wc-block-components-radio-control--highlight-checked, .wc-block-components-radio-control-accordion-option) {
  border-radius: 0;
  box-shadow: none;
}

body.spireli-kasse .wc-block-components-radio-control--highlight-checked::after,
body.spireli-kasse .wc-block-components-radio-control-accordion-option::after {
  display: none;
}

body.spireli-kasse .wc-block-components-radio-control__option {
  background: var(--sp-lys);
  border: 1px solid var(--sp-line);
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 16px 18px 16px 54px;
  font-size: 16px;
}

body.spireli-kasse .wc-block-components-radio-control__option :is(.wc-block-components-radio-control__label, .wc-block-components-radio-control__secondary-label) {
  font-size: 16px;
}

body.spireli-kasse .wc-block-components-radio-control__label-group {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

body.spireli-kasse .wc-block-components-radio-control__label-group > .wc-block-components-radio-control__label {
  flex: 1 1 auto;
  min-width: 0;
}

body.spireli-kasse .wc-block-components-radio-control__label-group > .wc-block-components-radio-control__secondary-label {
  flex: none;
  margin-left: 0;
}

body.spireli-kasse .wc-block-components-radio-control__option + .wc-block-components-radio-control__option {
  border-top: 0;
}

body.spireli-kasse :is(.wc-block-components-radio-control__option-checked, .wc-block-components-radio-control__option--checked-option-highlighted) {
  outline: 1px solid var(--sp-skov);
  outline-offset: -1px;
  box-shadow: none;
  position: relative;
}

body.spireli-kasse .wc-block-components-radio-control .wc-block-components-radio-control__input {
  left: 18px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border: 1px solid var(--sp-skov);
  border-radius: 50%;
  background: var(--sp-lys);
  box-shadow: none;
}

body.spireli-kasse .wc-block-components-radio-control .wc-block-components-radio-control__input:checked {
  border: 1px solid var(--sp-skov);
}

body.spireli-kasse .wc-block-components-radio-control .wc-block-components-radio-control__input:checked::before {
  width: 10px;
  height: 10px;
  background: var(--sp-skov);
  border-radius: 50%;
}

body.spireli-kasse :is(.wc-block-components-radio-control__label, .wc-block-components-radio-control__secondary-label) {
  font-weight: 500;
  color: var(--sp-skov);
}

body.spireli-kasse :is(.wc-block-components-radio-control__description, .wc-block-components-radio-control__secondary-description) {
  font-size: 15px;
  color: var(--sp-soft);
}

/* Buttons: Skov, Gul with Skov text on hover. */
body.spireli-kasse .wc-block-components-button:not(.is-link):not(.wc-block-components-notice-banner__dismiss) {
  min-height: 60px;
  padding: 0 24px;
  border: 0;
  border-radius: 0;
  background: var(--sp-skov);
  box-shadow: none;
  color: var(--sp-lys);
  font: 600 19px/1.2 var(--sp-head);
  letter-spacing: 0;
  text-transform: none;
}

body.spireli-kasse .wc-block-components-button:not(.is-link):not(.wc-block-components-notice-banner__dismiss):is(:hover, :focus-visible) {
  background: var(--sp-gul);
  color: var(--sp-skov);
}

body.spireli-kasse .wc-block-components-button:not(.is-link):disabled {
  opacity: .6;
  cursor: default;
}

body.spireli-kasse .wc-block-components-button.is-link {
  color: var(--sp-skov);
  font-size: 15px;
  text-underline-offset: 3px;
}

body.spireli-kasse .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button {
  width: 100%;
}

/* Notices: Lys, 1 px line, no radius. */
body.spireli-kasse .wc-block-components-notice-banner {
  border: 1px solid var(--sp-skov);
  border-radius: 0;
  background: var(--sp-lys);
  color: var(--sp-skov);
  font-size: 16px;
  box-shadow: none;
}

body.spireli-kasse .wc-block-components-notice-banner.is-error {
  border-color: var(--sp-fejl);
}

body.spireli-kasse .wc-block-components-notice-banner > svg {
  fill: var(--sp-skov);
  background: transparent;
  border-radius: 0;
}

body.spireli-kasse .wc-block-components-notice-banner.is-error > svg {
  fill: var(--sp-fejl);
}

body.spireli-kasse .wc-block-checkout__terms {
  font-size: 15px;
  color: var(--sp-soft);
  border-top: 0;
  padding-top: 0;
}

/* Under the minimum order (checkout.js part 5): the message first in the form, like the other errors,
   with the way back to the cart. Woo's own banner for the same cart error is hidden, so it is said once. */
body.spireli-kasse .sp-minimum {
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 1px solid var(--sp-fejl);
  background: var(--sp-lys);
  font-size: 17px;
}

body.spireli-kasse .sp-minimum p {
  margin: 0 0 6px;
}

body.spireli-kasse .sp-minimum a {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

body.spireli-kasse .wc-block-components-notice-banner:has(li[data-id="spireli_minimum"]):not(:has(li:not([data-id="spireli_minimum"]))),
body.spireli-kasse .wc-block-components-notice-banner li[data-id="spireli_minimum"] {
  display: none;
}

/* "Betal" while the cart is under the minimum: it still answers a click, with the message above. */
body.spireli-kasse .wc-block-components-button.wc-block-components-checkout-place-order-button[aria-disabled="true"],
body.spireli-kasse .wc-block-components-button.wc-block-components-checkout-place-order-button[aria-disabled="true"]:is(:hover, :focus-visible) {
  opacity: .6;
  background: var(--sp-skov);
  color: var(--sp-lys);
}

/* ---------- Fields and texts (checkout.js part 4, Tekster.php) ---------- */

/* Step 1: e-mail, its help right under it (Woo's guest notice, the field's aria-describedby), then the
   marketing tick box (Spireli\Marketing\Samtykke) and the rest. Woo's DOM order is kept; only the order
   on the screen changes. */
body.spireli-kasse #contact.wc-block-components-address-form {
  display: flex;
  flex-direction: column;
}

body.spireli-kasse #contact > * {
  order: 3;
}

body.spireli-kasse #contact > .wc-block-components-address-form__email {
  order: 1;
}

body.spireli-kasse #contact > .wc-block-checkout__guest-checkout-notice {
  order: 2;
  margin: 6px 0 0 2px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--sp-soft);
}

body.spireli-kasse #contact > .wc-block-components-address-form__spireli-marketing {
  margin-top: 18px;
}

/* "Opret en konto" is never offered: fast levering gets its account from Woo (Konto.php), a one-off buyer logs in or buys as a guest. */
body.spireli-kasse .wc-block-checkout__create-account {
  display: none;
}

/* "Har du en konto? Log ind" / the account line for fast levering, over "Videre til levering". */
body.spireli-kasse .sp-konto {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--sp-soft);
}

/* Help under Mobilnummer and the Bornholm/Anholt line under the postcode: a whole row each. */
body.spireli-kasse :is(.sp-felthjaelp, .sp-fjern) {
  flex: 0 0 100%;
  box-sizing: border-box;
  margin: 6px 0 0 2px;
  font-size: 14px;
  line-height: 1.45;
}

body.spireli-kasse .sp-felthjaelp {
  color: var(--sp-soft);
}

body.spireli-kasse .sp-fjern {
  color: var(--sp-fejl);
}

body.spireli-kasse .sp-fjern[hidden] {
  display: none;
}

/* The invoice address is always the delivery address (spec): Woo's "Brug samme adresse til fakturering" stays
   ticked and out of sight. Should Woo start it unticked (a saved, different invoice address), it shows. */
body.spireli-kasse .wc-block-checkout__use-address-for-billing:has(input:checked) {
  display: none;
}

/* Shipmondo's chosen pakkeshop: a Lys row with a 1 px line like the fields, not a grey box. The carrier line
   inside it repeats the chosen shipping right above, so it steps aside. */
body.spireli-kasse .shipmondo_service_point_selection .service_point_title {
  margin: 24px 0 10px;
  font: 700 19px/1.2 var(--sp-head);
  letter-spacing: -.01em;
}

body.spireli-kasse .shipmondo_service_point_selection .selected_service_point {
  box-sizing: border-box;
  margin: 0;
  padding: 16px 44px 16px 18px;
  border: 1px solid var(--sp-line);
  border-radius: 0;
  background-color: var(--sp-lys);
  box-shadow: none;
  color: var(--sp-skov);
  cursor: pointer;
}

body.spireli-kasse .shipmondo_service_point_selection .selected_service_point:hover {
  border-color: var(--sp-skov);
}

body.spireli-kasse .shipmondo_service_point_selection .selected_service_point .rate_name {
  display: none;
}

body.spireli-kasse .shipmondo_service_point_selection .selected_service_point .name {
  font: 500 17px/1.35 var(--sp-sans);
  color: var(--sp-skov);
}

body.spireli-kasse .shipmondo_service_point_selection .selected_service_point .location {
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--sp-soft);
}

body.spireli-kasse .shipmondo_service_point_selection .selected_service_point :is(.address_info, .distance) {
  font-size: 15px;
  color: var(--sp-soft);
}

/* Shipmondo is never named to the customer (Anders): "Pakkeshops via Shipmondo" under the chosen shop and the
   picker's footer with the same line. Only the credit goes; the picker works as before. */
body.spireli-kasse :is(.powered_by_shipmondo, .shipmondo-modal_footer) {
  display: none;
}

/* Betaling: only Kort can be chosen, and Stripe's own head already says "Kort" (Betaling.php gives Stripe
   Spireli's look), so Woo's radio row would say it twice. With a second way to pay the row comes back, and
   so it does when Woo lists saved cards (a logged-in customer): they are radios of their own
   (name radio-control-wc-payment-method-saved-tokens, then "Brug en anden betalingsmetode."), and the
   "Kort" radio is then the only way to a new card. */
body.spireli-kasse .wp-block-woocommerce-checkout-payment-block:not(:has([name="radio-control-wc-payment-method-saved-tokens"], .wc-block-components-checkout-step__description-payments-aligned)) .wc-block-components-radio-control-accordion-option:only-child > .wc-block-components-radio-control__option {
  display: none;
}

body.spireli-kasse .wp-block-woocommerce-checkout-payment-block:not(:has([name="radio-control-wc-payment-method-saved-tokens"], .wc-block-components-checkout-step__description-payments-aligned)) .wc-block-components-radio-control-accordion-option:only-child > .wc-block-components-radio-control-accordion-content {
  padding: 0;
}

/* Stripe keeps 4 px inside its frame for focus rings; pull it out so its box lines up with the fields. */
body.spireli-kasse .wp-block-woocommerce-checkout-payment-block .wcstripe-payment-element {
  margin: 0 -4px;
}

/* Stripe's test-card hint (test mode only). */
body.spireli-kasse .wc-stripe-payment-method-instruction {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--sp-soft);
}

/* Betaling: the MobilePay line, the saved-card line over "Betal", and the two lines under it. */
body.spireli-kasse .sp-ekstra p {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--sp-soft);
}

body.spireli-kasse .sp-ekstra--tillid > div {
  display: grid;
  gap: 6px;
}

body.spireli-kasse .sp-ekstra--tillid p::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 10px 2px 2px;
  background: var(--sp-blad);
}

/* ---------- The table (Bordet) ---------- */

/* Simon's promise: photo, the promise in first person and the stamp with the delivery day. */
body.spireli-ramme .sp-loefte {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  align-items: center;
  margin: 0 0 22px;
}

body.spireli-ramme .sp-loefte[hidden] {
  display: none;
}

body.spireli-ramme .sp-loefte img {
  display: block;
  width: 92px;
  height: 112px;
  object-fit: cover;
  object-position: center 22%;
  border: 1px solid var(--sp-skov);
  transform: rotate(-2deg);
}

body.spireli-ramme .sp-loefte p {
  margin: 0;
  font: 600 22px/1.25 var(--sp-head);
  letter-spacing: -.01em;
}

body.spireli-ramme .sp-stempel {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  border: 1.5px solid var(--sp-skov);
  background: var(--sp-lys);
  font: 700 16px/1.3 var(--sp-head);
  transform: rotate(-3deg);
}

/* Up to four cut-out bunches from the cart's sorts, only for the mood. */
body.spireli-ramme .sp-bundter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 6px;
  height: 150px;
  margin: 0 -8px 4px;
  align-items: end;
}

body.spireli-ramme .sp-bundter:empty {
  display: none;
}

body.spireli-ramme .sp-bundter img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgb(80 60 0 / .18));
}

body.spireli-ramme .sp-bundter img:nth-child(odd) {
  transform: rotate(-6deg);
}

body.spireli-ramme .sp-bundter img:nth-child(even) {
  transform: rotate(5deg) translateY(-8px);
}

/* ---------- The order slip (Woo's order summary, restyled) ---------- */

body.spireli-kasse .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
  position: relative;
  margin: 0;
  padding: 24px 26px;
  border: 1px solid var(--sp-skov);
  border-radius: 0;
  background: var(--sp-lys);
  transform: rotate(-.5deg);
  font-size: 16px;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__title {
  display: block;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  cursor: default;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__title-text {
  margin: 0;
  font: 700 22px/1.2 var(--sp-head);
  letter-spacing: -.02em;
  color: var(--sp-skov);
}

body.spireli-kasse .wc-block-checkout__sidebar :is(.wc-block-components-checkout-order-summary__title-price, .wc-block-components-checkout-order-summary__title-icon) {
  display: none;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__content {
  display: block;
}

/* Items, then Varer and Levering, then the coupon link right above "I alt". */
body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__content-container {
  display: flex;
  flex-direction: column;
}

body.spireli-kasse .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-cart-items-block {
  order: 0;
}

body.spireli-kasse .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-totals-block {
  order: 1;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--sp-skov);
}

body.spireli-kasse .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-coupon-form-block {
  order: 2;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__content-container > .wc-block-components-totals-wrapper:last-child {
  order: 3;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-wrapper {
  margin: 0;
  padding: 0;
  border: 0;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-wrapper::after {
  display: none;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-order-summary,
body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-order-summary__content {
  margin: 0;
  padding: 0;
}

/* One line per item: name left, price right; no image. */
body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-order-summary-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 12px;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--sp-faint);
  font-size: 16px;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-order-summary-item:first-child {
  border-top: 0;
  padding-top: 0;
}

body.spireli-kasse .wc-block-checkout__sidebar :is(.wc-block-components-order-summary-item__image, .wc-block-cart-item__prices, .wc-block-components-product-metadata__description) {
  display: none;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-order-summary-item__description {
  padding: 0;
  margin: 0;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-product-name {
  margin: 0;
  font: 500 16px/1.4 var(--sp-sans);
  letter-spacing: 0;
  color: var(--sp-skov);
}

/* "2 × " before a single sort bought twice (checkout.js visAntal); the empty alt text keeps it out of the
   screen-reader name, since Woo's screen-reader line already says the quantity. */
body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-product-name[data-sp-antal]:not([data-sp-antal=""])::before {
  content: attr(data-sp-antal);
  content: attr(data-sp-antal) / "";
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-order-summary-item__total-price {
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 400;
  color: var(--sp-skov);
}

/* The name already says the size and the interval; only a box note stays. */
body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-product-details > :not(.wc-block-components-product-details__note) {
  display: none;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-product-metadata {
  margin: 0;
  font-size: 15px;
  color: var(--sp-soft);
}

/* A box's sorts: grouped under the box as "100 g …" and "50 g …" (sp-sorter, from checkout.js).
   Without the script the sorts stay as indented lines without a price. */
body.spireli-kasse .wc-block-components-order-summary-item.spireli-sort {
  padding-left: 1.5rem;
}

body.spireli-kasse .wc-block-components-order-summary__content:has(.sp-sorter) .wc-block-components-order-summary-item.spireli-sort {
  display: none;
}

body.spireli-kasse .sp-sorter {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--sp-soft);
}

body.spireli-kasse .sp-sorter em {
  font-style: normal;
  font-weight: 500;
  color: var(--sp-skov);
}

/* Varer, Levering. */
body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  margin: 0;
  padding: 3px 0;
  font-size: 16px;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-item__label,
body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-item__value {
  font-size: 16px;
  font-weight: 400;
  color: var(--sp-skov);
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-item__description {
  flex-basis: 100%;
  margin: 0;
  font-size: 14px;
  color: var(--sp-soft);
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-shipping__via {
  margin: 0;
  font-size: 14px;
  color: var(--sp-soft);
}

/* "Har du en rabatkode?" as a quiet link. */
body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-coupon {
  margin: 8px 0 2px;
  padding: 0;
  border: 0;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-panel__button {
  display: inline-block;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--sp-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-panel__button {
  background-image: linear-gradient(var(--sp-gul), var(--sp-gul));
  background-repeat: no-repeat;
  background-position: 100% 0;
  background-size: 0% 100%;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-panel__button:is(:hover, :focus-visible) {
  color: var(--sp-skov);
  background-position: 0 0;
  background-size: 100% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-panel__button {
    transition: background-size 420ms var(--sp-ease-enter);
  }
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-panel__button-icon {
  display: none;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-panel__content {
  padding: 10px 0 4px;
}

/* I alt and the VAT line. */
body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-footer-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  padding: 12px 0 0;
  border-top: 1px solid var(--sp-skov);
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
  font: 700 22px/1.2 var(--sp-head);
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-footer-item .wc-block-components-totals-item__value .wc-block-components-formatted-money-amount {
  font: 700 36px/1.1 var(--sp-head);
  letter-spacing: -.03em;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-footer-item .wc-block-components-totals-item__description {
  flex-basis: 100%;
  text-align: right;
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-footer-item-tax {
  margin: 0;
  text-align: right;
  font-size: 14px;
  color: var(--sp-soft);
}

body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-footer-item-tax .wc-block-components-formatted-money-amount {
  font: inherit;
}

/* ---------- Narrow screens: one column (refined in "Touch and narrow screens" at the end) ---------- */

@media (max-width: 900px) {
  body.spireli-ramme {
    background: var(--sp-creme);
  }

  body.spireli-ramme :is(.sp-top, .sp-bund) {
    width: auto;
    margin-left: 0;
    padding-left: 20px;
    padding-right: 20px;
  }

  body.spireli-kasse .wc-block-checkout.wc-block-components-sidebar-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body.spireli-kasse .wc-block-checkout__main {
    padding: 0 20px 40px;
  }

  body.spireli-kasse .wc-block-checkout__main {
    order: 0;
  }

  /* The table comes first (see "Touch and narrow screens" below). */
  body.spireli-kasse .wc-block-checkout__sidebar {
    order: -1;
    position: static;
    max-height: none;
    overflow: visible;
    margin-top: 0;
    margin-bottom: 0;
    padding: 32px 20px 40px;
  }

  /* Woo folds the summary on small screens; keep its price and arrow so it can be opened. */
  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__title {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
  }

  body.spireli-kasse .wc-block-checkout__sidebar :is(.wc-block-components-checkout-order-summary__title-price, .wc-block-components-checkout-order-summary__title-icon) {
    display: revert;
  }

  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__title-price {
    margin-left: auto;
  }

  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__content {
    display: revert;
  }

  body.spireli-kasse .wp-block-woocommerce-checkout > .wc-block-components-notices {
    width: auto;
    padding: 0 20px;
  }

  body.spireli-ramme .sp-bundter {
    height: 120px;
  }

  body.spireli-ramme .sp-titel {
    width: auto;
    height: auto;
    padding: 20px 20px 24px;
    font-size: 40px;
    line-height: 1.05;
  }
}

/* Phones: the steps use the full width (mobile gets its own round). */
@media (max-width: 600px) {
  body.spireli-kasse form.wc-block-checkout__form > [data-sp-trin],
  body.spireli-kasse :is(.sp-trin__kig, .sp-trin__sum) {
    margin-left: 0;
  }
}

/* Windows up to ~940 px high (1440×900): a little tighter, so a cart of five lines keeps "I alt" in view.
   Placed last so these win over the rules above. */
@media (min-width: 901px) and (max-height: 940px) {
  body.spireli-kasse .wc-block-checkout__sidebar {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  body.spireli-ramme .sp-loefte {
    margin-bottom: 14px;
  }

  body.spireli-ramme .sp-bundter {
    height: 110px;
  }

  body.spireli-ramme .sp-bundter img {
    max-height: 110px;
  }

  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-order-summary-item {
    padding: 9px 0;
  }
}

/* Low windows (laptops at 768 px, placed last so it wins): a tighter table, so the slip and "I alt" fit without scrolling. */
@media (min-width: 901px) and (max-height: 860px) {
  body.spireli-kasse .wc-block-checkout__sidebar {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  body.spireli-ramme .sp-loefte {
    grid-template-columns: 64px 1fr;
    margin-bottom: 10px;
  }

  body.spireli-ramme .sp-loefte img {
    width: 64px;
    height: 78px;
  }

  body.spireli-ramme .sp-loefte p {
    font-size: 19px;
  }

  body.spireli-ramme .sp-stempel {
    margin-top: 6px;
    font-size: 15px;
  }

  body.spireli-ramme .sp-bundter {
    height: 84px;
    margin-bottom: 0;
  }

  body.spireli-ramme .sp-bundter img {
    max-height: 84px;
  }

  body.spireli-kasse .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
    padding: 16px 22px;
  }

  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-order-summary-item {
    padding: 8px 0;
  }

  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-totals-footer-item .wc-block-components-totals-item__value .wc-block-components-formatted-money-amount {
    font-size: 30px;
  }
}

/* ---------- "Ordre modtaget" (body.spireli-kvittering, Checkout\Kvittering) ----------
   Woo's classic order-received output in the same two columns: the facts on Creme to the left,
   the table to the right with Simon's line, the bunches and the slip (Woo's order table, wrapped in
   .sp-seddel). Woo's wrappers step aside (display: contents), so the parts are placed directly. */

body.spireli-kvittering main.sp-kvittering {
  box-sizing: border-box;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 0 48px;
  display: grid;
  grid-template-columns: minmax(0, 660fr) minmax(0, 620fr);
  /* The slip spans every row; the last row takes what it needs beyond the facts, so they keep their own rhythm. */
  grid-template-rows: repeat(5, auto) 1fr;
  align-items: start;
}

body.spireli-kvittering main.sp-kvittering :is(.woocommerce, .woocommerce-order) {
  display: contents;
}

body.spireli-kvittering main.sp-kvittering > .sp-titel,
body.spireli-kvittering main.sp-kvittering :is(.woocommerce, .woocommerce-order) > * {
  grid-column: 1;
  box-sizing: border-box;
  width: auto;
  margin: 0;
}

body.spireli-kvittering main.sp-kvittering :is(.woocommerce, .woocommerce-order) > * {
  padding: 0 64px;
}

/* The title already thanks her; Woo's "Tak. Din bestilling er modtaget." would say it again. */
body.spireli-kvittering .woocommerce-thankyou-order-received {
  display: none;
}

body.spireli-kvittering :is(h2, h3) {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.2;
}

/* Ordrenr., Dato, Betaling: a row of facts. The total stands on the slip. */
body.spireli-kvittering main.sp-kvittering ul.woocommerce-order-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  margin: 0;
  padding: 0 64px 28px;
  border: 0;
  background: none;
  list-style: none;
}

body.spireli-kvittering ul.woocommerce-order-overview::before,
body.spireli-kvittering ul.woocommerce-order-overview::after {
  display: none;
}

body.spireli-kvittering ul.woocommerce-order-overview li {
  float: none;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 15px;
  line-height: 1.4;
  text-transform: none;
  color: var(--sp-soft);
}

body.spireli-kvittering ul.woocommerce-order-overview li strong {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  font-weight: 500;
  color: var(--sp-skov);
}

body.spireli-kvittering ul.woocommerce-order-overview .woocommerce-order-overview__total {
  display: none;
}

/* Levering til, and any extra fields: under a 1 px line, like the steps in the checkout. */
body.spireli-kvittering .woocommerce-customer-details {
  font-size: 17px;
}

body.spireli-kvittering .woocommerce-customer-details > section {
  margin: 0;
  padding: 24px 0 28px;
  border-top: 1px solid var(--sp-skov);
}

body.spireli-kvittering .woocommerce-customer-details .col2-set {
  display: block;
  width: auto;
  float: none;
}

body.spireli-kvittering .woocommerce-customer-details .col2-set::before,
body.spireli-kvittering .woocommerce-customer-details .col2-set::after {
  display: none;
}

body.spireli-kvittering .woocommerce-customer-details .woocommerce-column {
  float: none;
  width: auto;
  margin: 0;
}

/* The invoice address is always the delivery address (spec); with both shown, only "Levering til" stays. */
body.spireli-kvittering .col2-set .woocommerce-column--billing-address {
  display: none;
}

body.spireli-kvittering .woocommerce-customer-details address {
  margin: 0;
  padding: 0;
  border: 0;
  font-style: normal;
  line-height: 1.5;
}

body.spireli-kvittering .woocommerce-customer-details address p {
  margin: 6px 0 0;
  padding: 0;
}

body.spireli-kvittering .woocommerce-customer-details address p::before {
  display: none;
}

/* Woo's "Yderligere information" (the marketing tick box, "Ja"/"Nej") is for the shop, not the receipt;
   it stays in the order in admin and in the mails. */
body.spireli-kvittering .wc-block-order-confirmation-additional-fields-wrapper {
  display: none;
}

/* A failed payment: the title already says it did not go through, so Woo's sentence under it steps aside;
   its "Betal" button (pay again) stays. */
body.spireli-kvittering .woocommerce-thankyou-order-failed {
  display: none;
}

/* Woo's own notices (the pay-again button) and the e-mail check for an old order. */
body.spireli-kvittering .woocommerce-notice:not(.woocommerce-thankyou-order-received),
body.spireli-kvittering .woocommerce-verify-email p {
  margin: 0 0 16px;
  font-size: 17px;
}

body.spireli-kvittering .woocommerce-verify-email label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

body.spireli-kvittering .woocommerce-verify-email input[type="email"] {
  box-sizing: border-box;
  width: 100%;
  height: 56px;
  padding: 0 14px;
  border: 1px solid var(--sp-line);
  border-radius: 0;
  background: var(--sp-lys);
  font: 400 17px var(--sp-sans);
  color: var(--sp-skov);
  box-shadow: none;
}

body.spireli-kvittering :is(.woocommerce-verify-email button, .woocommerce-notice a.button) {
  display: inline-block;
  min-height: 56px;
  padding: 16px 28px;
  border: 0;
  border-radius: 0;
  background: var(--sp-skov);
  background-image: none;
  color: var(--sp-lys);
  font: 700 18px/1.3 var(--sp-head);
  text-decoration: none;
  box-shadow: none;
}

body.spireli-kvittering :is(.woocommerce-verify-email button, .woocommerce-notice a.button):is(:hover, :focus-visible) {
  background: var(--sp-gul);
  color: var(--sp-skov);
}

/* The right column: the table, Simon, the bunches and the slip. */
body.spireli-kvittering main.sp-kvittering section.woocommerce-order-details {
  grid-column: 2;
  grid-row: 1 / -1;
  margin-top: -80px;
  padding: 40px 48px 48px;
}

body.spireli-kvittering .sp-bord {
  margin: 0 0 4px;
}

body.spireli-kvittering .sp-loefte .sp-loefte__mere {
  margin-top: 8px;
  font: 400 16px/1.45 var(--sp-sans);
  letter-spacing: 0;
}

body.spireli-kvittering .sp-seddel {
  padding: 24px 26px;
  border: 1px solid var(--sp-skov);
  background: var(--sp-lys);
  transform: rotate(-.5deg);
  font-size: 16px;
}

/* Woo's table as lines of the slip: each row a line, name left and price right, like the checkout's. */
body.spireli-kvittering .sp-seddel table.order_details,
body.spireli-kvittering .sp-seddel table.order_details :is(tbody, tfoot) {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  background: none;
}

body.spireli-kvittering .sp-seddel table.order_details thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

body.spireli-kvittering .sp-seddel table.order_details tr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 12px;
  padding: 3px 0;
}

body.spireli-kvittering .sp-seddel table.order_details :is(th, td) {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--sp-skov);
  text-align: left;
}

body.spireli-kvittering .sp-seddel table.order_details tr > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

body.spireli-kvittering .sp-seddel table.order_details tr > :last-child:not(:first-child) {
  flex: 0 1 auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

body.spireli-kvittering .sp-seddel tbody tr {
  padding: 12px 0;
}

body.spireli-kvittering .sp-seddel tbody tr + tr {
  border-top: 1px solid var(--sp-faint);
}

body.spireli-kvittering .sp-seddel tbody tr:first-child {
  padding-top: 0;
}

body.spireli-kvittering .sp-seddel tbody .product-name {
  font-weight: 500;
}

body.spireli-kvittering .sp-seddel .product-quantity {
  font-weight: 400;
}

/* A box's sorts: quiet lines tucked under the box, no line between them. */
body.spireli-kvittering .sp-seddel tbody tr.spireli-sort {
  padding: 0 0 4px;
  border-top: 0;
}

body.spireli-kvittering .sp-seddel table.order_details tbody tr.spireli-sort td {
  font-size: 15px;
  font-weight: 400;
  color: var(--sp-soft);
}

body.spireli-kvittering .sp-seddel .wc-item-meta {
  margin: 2px 0 6px;
  padding: 0;
  list-style: none;
  font-size: 15px;
  font-weight: 400;
  color: var(--sp-soft);
}

body.spireli-kvittering .sp-seddel .wc-item-meta :is(li, p, strong) {
  display: inline;
  margin: 0;
  font-weight: 400;
}

/* Varer, Levering, then I alt with the VAT under it. The short label keeps its width; the value wraps. */
body.spireli-kvittering .sp-seddel table.order_details tfoot tr > th:first-child {
  flex: 0 0 auto;
}

body.spireli-kvittering .sp-seddel table.order_details tfoot tr > td:last-child {
  flex: 1 1 0;
  min-width: 0;
}

body.spireli-kvittering .sp-seddel tfoot tr:first-child {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--sp-skov);
}

body.spireli-kvittering .sp-seddel tfoot small {
  display: block;
  font-size: 14px;
  color: var(--sp-soft);
}

/* I alt (marked .sp-i-alt by Kvittering::totaler) closes the slip, also when Woo prints a customer note after it. */
body.spireli-kvittering .sp-seddel table.order_details tfoot {
  display: flex;
  flex-direction: column;
}

body.spireli-kvittering .sp-seddel tfoot tr:has(.sp-i-alt) {
  order: 1;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--sp-skov);
}

body.spireli-kvittering .sp-seddel table.order_details tfoot tr:has(.sp-i-alt) th {
  font: 700 22px/1.2 var(--sp-head);
  letter-spacing: -.02em;
}

body.spireli-kvittering .sp-seddel table.order_details tfoot tr:has(.sp-i-alt) td {
  font: 700 36px/1.1 var(--sp-head);
  letter-spacing: -.03em;
}

body.spireli-kvittering .sp-seddel tfoot tr:has(.sp-i-alt) td small {
  margin-top: 4px;
  font: 400 14px/1.4 var(--sp-sans);
  letter-spacing: 0;
}

@media (max-width: 900px) {
  body.spireli-kvittering main.sp-kvittering {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  body.spireli-kvittering main.sp-kvittering :is(.woocommerce, .woocommerce-order) > *,
  body.spireli-kvittering main.sp-kvittering ul.woocommerce-order-overview {
    padding-left: 20px;
    padding-right: 20px;
  }

  body.spireli-kvittering main.sp-kvittering section.woocommerce-order-details {
    grid-column: 1;
    grid-row: auto;
    margin: 0 0 28px;
    padding: 32px 20px 40px;
    background: var(--sp-bord);
  }
}

/* ---------- Touch and narrow screens (phones 360–430, tablets 768) ----------
   One column. In the checkout the table comes first, compact: Simon's promise with the day, then Woo's
   folded slip "Din ordre 286,00 kr." that opens in place. So the buyer sees what she pays and when it
   comes before typing anything, and the steps stay one at a time below it, ending in "Betal". The bunches
   are only mood and would push the form a screen down on a phone, so they stay out there (not on the
   receipt, where nothing is to be filled in). Running text is 16 px, help lines 15 px, everything tappable
   44 px high, and hover never sticks after a tap. Nothing here reaches 901 px and up. */
@media (max-width: 900px) {
  body.spireli-ramme {
    min-height: 100dvh;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
  }

  body.spireli-ramme .sp-tilbage {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  body.spireli-ramme .sp-logo {
    padding: 7px 0;
  }

  body.spireli-ramme .sp-titel {
    padding-bottom: 20px;
  }

  /* The compact table on top. */
  body.spireli-kasse .wc-block-checkout__sidebar {
    padding: 20px 20px 24px;
  }

  body.spireli-ramme .sp-loefte {
    grid-template-columns: 64px 1fr;
    gap: 16px;
    margin-bottom: 18px;
  }

  body.spireli-ramme .sp-loefte img {
    width: 64px;
    height: 78px;
  }

  body.spireli-ramme .sp-loefte p {
    font-size: 19px;
  }

  body.spireli-ramme .sp-stempel {
    margin-top: 8px;
  }

  body.spireli-kasse .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
    padding: 4px 18px;
  }

  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__title {
    min-height: 56px;
    margin: 0;
  }

  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__content:not(:empty) {
    padding-bottom: 18px;
  }

  /* Air between the yellow table and the first step's line. */
  body.spireli-kasse .wc-block-checkout__main {
    padding-top: 28px;
  }

  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__title-price {
    font-size: 17px;
    font-weight: 500;
  }

  /* Open, the slip ends in "I alt"; the price in its head would say it twice. */
  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__title.is-open .wc-block-components-checkout-order-summary__title-price {
    visibility: hidden;
  }

  /* Running text 16 px. */
  body.spireli-kasse :is(.wc-block-components-checkout-step__description, .wc-block-checkout__terms, .sp-konto, .sp-ekstra p, .wc-block-components-radio-control__description, .wc-block-components-radio-control__secondary-description),
  body.spireli-kasse .shipmondo_service_point_selection .selected_service_point :is(.location, .address_info, .distance),
  body.spireli-kasse .wc-block-checkout__sidebar :is(.wc-block-components-product-metadata, .sp-sorter),
  body.spireli-kasse .wc-block-components-button.is-link,
  body.spireli-kasse :is(.wc-block-components-address-form__address_2-toggle, .wc-block-components-address-card__edit) {
    font-size: 16px;
  }

  /* Help lines and field errors 15 px. */
  body.spireli-kasse #contact > .wc-block-checkout__guest-checkout-notice,
  body.spireli-kasse :is(.sp-felthjaelp, .sp-fjern, .wc-stripe-payment-method-instruction),
  body.spireli-kasse :is(.wc-block-components-validation-error, .wc-block-components-validation-error > p) {
    font-size: 15px;
  }

  /* 44 px to tap. */
  body.spireli-kasse .sp-trin__ret {
    min-height: 44px;
    margin: -10px -8px -10px 0;
    padding: 0 8px;
  }

  body.spireli-kasse .wc-block-components-address-form__address_2-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-panel__button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 16px;
  }

  /* The receipt: the facts, the table, "Levering til", in the page's order. */
  body.spireli-kvittering ul.woocommerce-order-overview li {
    font-size: 16px;
  }

  body.spireli-kvittering main.sp-kvittering section.woocommerce-order-details {
    padding: 24px 20px 32px;
  }

  body.spireli-kvittering .sp-bundter {
    height: 96px;
  }

  body.spireli-kvittering .sp-bundter img {
    max-height: 96px;
  }

  body.spireli-kvittering .sp-seddel {
    padding: 20px 18px;
  }

  body.spireli-kvittering .sp-seddel table.order_details tbody tr.spireli-sort td,
  body.spireli-kvittering .sp-seddel .wc-item-meta {
    font-size: 16px;
  }

  body.spireli-kvittering .sp-seddel tfoot small {
    font-size: 15px;
  }

  body.spireli-kvittering .woocommerce-notice a.button {
    margin: 0 8px 8px 0;
  }

  /* Shipmondo's "Vælg pakkeshop" fills a phone: Lys sheet with square corners and 1 px lines like the rest,
     a heading the size of the step titles, rows split by a line, the chosen one Creme, and × as a 44 px target. Shipmondo nests its own rules four classes deep, hence the long selectors. */
  body.spireli-kasse .shipmondo_service_point_selection .service_points_modal .shipmondo-modal_wrapper .shipmondo-modal_content {
    border: 1px solid var(--sp-skov);
    border-radius: 0;
    background: var(--sp-lys);
    color: var(--sp-skov);
  }

  body.spireli-kasse .shipmondo_service_point_selection .service_points_modal .shipmondo-modal_wrapper .shipmondo-modal_content .shipmondo-modal_header {
    padding: 20px 56px 16px 20px;
  }

  body.spireli-kasse .shipmondo_service_point_selection .service_points_modal .shipmondo-modal_wrapper .shipmondo-modal_content .shipmondo-modal_header :is(h1, h2, h3, h4) {
    margin: 0;
    font: 700 24px/1.15 var(--sp-head);
    letter-spacing: -.01em;
    color: var(--sp-skov);
  }

  body.spireli-kasse .shipmondo_service_point_selection .service_points_modal .shipmondo-modal_wrapper .shipmondo-modal_content .shipmondo-modal_close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
  }

  body.spireli-kasse .shipmondo_service_point_selection .service_points_modal .shipmondo-modal_wrapper .shipmondo-modal_content .service_points_list .service_point {
    padding: 14px 20px;
    border-bottom: 1px solid var(--sp-line);
    background: transparent;
    cursor: pointer;
  }

  body.spireli-kasse .shipmondo_service_point_selection .service_points_modal .shipmondo-modal_wrapper .shipmondo-modal_content .service_points_list .service_point.selected {
    background: var(--sp-creme);
  }

  body.spireli-kasse .shipmondo_service_point_selection .service_points_modal .shipmondo-modal_wrapper .shipmondo-modal_content .service_points_list .service_point .name {
    font: 500 17px/1.35 var(--sp-sans);
    color: var(--sp-skov);
  }

  body.spireli-kasse .shipmondo_service_point_selection .service_points_modal .shipmondo-modal_wrapper .shipmondo-modal_content .service_points_list .service_point .location {
    font-size: 16px;
    color: var(--sp-soft);
  }
}

/* Phones: the bunches stay out of the checkout (see above). */
@media (max-width: 600px) {
  body.spireli-kasse .sp-bundter {
    display: none;
  }
}

/* Touch: a tap leaves no hover behind (paint stroke, Gul button); focus still shows. */
@media (max-width: 900px) and (hover: none) {
  body.spireli-ramme a:hover:not(:focus-visible),
  body.spireli-kasse .sp-trin__ret:hover:not(:focus-visible),
  body.spireli-kasse .wc-block-checkout__sidebar .wc-block-components-panel__button:hover:not(:focus-visible) {
    background-position: 100% 0;
    background-size: 0% 100%;
  }

  body.spireli-kasse .sp-knap:hover:not(:focus-visible),
  body.spireli-kasse .wc-block-components-button:not(.is-link):not(.wc-block-components-notice-banner__dismiss):hover:not(:focus-visible),
  body.spireli-kvittering :is(.woocommerce-verify-email button, .woocommerce-notice a.button):hover:not(:focus-visible) {
    background: var(--sp-skov);
    color: var(--sp-lys);
  }

  body.spireli-kasse .shipmondo_service_point_selection .selected_service_point:hover {
    border-color: var(--sp-line);
  }

  body.spireli-kasse .shipmondo_service_point_selection .service_points_modal .shipmondo-modal_wrapper .shipmondo-modal_content .service_points_list .service_point:not(.selected):hover {
    background: transparent;
  }
}
