/*
 * New design: the checkout window (#checkout), on top of the menu layer (App\Support\NewDesign::menu, body.nd-menu).
 * Look and motion only: js/menu.js keeps every amount, field, check and request; docs: _private/docs/new-design-checkout.md.
 *
 * Rules that must hold when editing this file:
 * - a required field is never display:none: jQuery Validate skips :hidden, and the order would go out without
 *   the terms (#order_accept). Checkboxes are drawn on the input itself, with appearance:none. The one exception is
 *   the panels of the ways not chosen, which the engine hides too (.nd-co-off, see showPanel).
 * - z-index of the window is not touched: #payment_popup, #sms_popup, bootbox and .policy open over it.
 * - the texts of select[name=delivery_hour] change only through CSS: menu.js sends the option text as delivery_range.
 *
 * Weight: body.nd-menu #checkout ... :not(#\9) is two ids, above the Sites' `form#f1 .form-group label`,
 * `div#checkout .modal-body *`, `#f1 select`. The Sites' !important is not fought here, but for the send button's
 * text under a mouse press (see .checkout_send_order:hover:active).
 * The panel variant .order_det_m (menu_checkout_popup = 0, one Site) is not touched: everything is under #checkout.
 */
body.nd-menu #checkout {
  --nd-co-cream: #f5f5f5;
  --nd-co-paper: #fff;
  --nd-co-mut: #6b6b6b;
  --nd-co-field-line: #c9c9c9;
  --nd-co-field-bg: #fafafa;
  --nd-co-error: #b42318; /* the red of the cart's delete; in the prototype the colour follows its palette */
  --nd-co-ring: color-mix(in srgb, var(--primary) 12%, transparent);
  --nd-co-ring-error: color-mix(in srgb, var(--nd-co-error) 12%, transparent);
  --nd-co-outline: rgba(13, 13, 13, .08);
  --nd-co-accent: var(--primary); /* a very light theme: see .nd-co-pale */
  --nd-co-on-primary: var(--nd-on-primary, #fff); /* measured once, in new-design-menu.js */
  --nd-ico-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233d3d3d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --nd-ico-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --nd-ico-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
}

/* ───────────── Shell: backdrop, window, motion ───────────── */
/* Bootstrap makes a backdrop per window: only this window's own one takes the look (js/new-design-checkout.js marks it),
   a window opened over it (the terms) keeps Bootstrap's, so the page is not darkened and blurred twice */
body.nd-menu .modal-backdrop.nd-co-backdrop.show:not(#\9) {
  background: rgba(0, 0, 0, .55);
  opacity: 1;
  -webkit-backdrop-filter: blur(9px) saturate(115%);
  backdrop-filter: blur(9px) saturate(115%);
}

/* Closing, the backdrop fades with the window (its .45s), not after it. An animation, not a transition:
   Bootstrap waits for the backdrop by its first transition's duration */
body.nd-menu .modal-backdrop.nd-co-backdrop.nd-co-leaving:not(#\9) {
  animation: ndCoBackdropOut .45s var(--nd-e-soft) forwards;
}

@keyframes ndCoBackdropOut {
  to { opacity: 0; }
}

/* Bootstrap shows the backdrop before it sets #checkout.show and removes .show first when closing: without a
   transition the blur would switch on in one frame. opacity stands first: Bootstrap times the backdrop by the first duration.
   Only this window's own backdrop: the others (the terms, bootbox, sign-in) keep Bootstrap's motion and its «less motion» */
body.nd-menu .modal-backdrop.nd-co-backdrop:not(#\9) {
  transition: opacity .15s linear, background-color .45s var(--nd-e-soft), -webkit-backdrop-filter .45s var(--nd-e-soft), backdrop-filter .45s var(--nd-e-soft);
}

/* Bootstrap 4.6 takes its fallback timer from the first duration of .modal-dialog, so transform stands first.
   It ignores transitionend from children (bootstrap.js:93-96): a field's hover does not close the window.
   modal-static (a click past the window, data-backdrop=static) is left to Bootstrap's own rules. */
body.nd-menu #checkout.fade:not(#\9) {
  transition: opacity .45s var(--nd-e-soft);
}

body.nd-menu #checkout.fade:not(.modal-static) .modal-dialog:not(#\9) {
  opacity: 0;
  transform: translateY(24px) scale(.97);
  transition: transform .55s var(--nd-e-out), opacity .45s var(--nd-e-soft);
}

body.nd-menu #checkout.show:not(.modal-static) .modal-dialog:not(#\9) {
  opacity: 1;
  transform: none;
}

body.nd-menu #checkout .modal-dialog:not(#\9) {
  max-width: min(1080px, calc(100vw - 40px));
  margin-inline: auto;
}

/* The window's body scrolls, the header and the footer stand. Bootstrap resets the scroll of .modal, not of this:
   js/new-design-checkout.js resets it on every open. */
body.nd-menu #checkout .modal-content:not(#\9) {
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  overflow: hidden;
  background: var(--nd-co-cream);
  border: none;
  border-radius: 24px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .5), 0 8px 24px -12px rgba(0, 0, 0, .2);
  color: var(--nd-ink);
  font-size: 15.2px;
}

body.nd-menu #checkout .modal-header:not(#\9) {
  flex: none;
  align-items: center;
  padding: 22px 26px;
  background: var(--nd-co-paper);
  border-bottom: 1px solid rgba(0, 0, 0, .07);
  border-radius: 0;
}

body.nd-menu #checkout .modal-title:not(#\9) {
  margin: 0;
  color: var(--nd-ink);
  font-size: 22.4px;
  font-weight: 900;
  letter-spacing: -.6px;
}

/* the close button: the × is hidden from the eye only, aria-label stays; data-dismiss runs onBackToMenu */
body.nd-menu #checkout .modal-header .close:not(#\9) {
  flex: none;
  float: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--nd-co-accent);
  opacity: 1;
  text-shadow: none;
  transition: transform .4s var(--nd-e-out), background-color .35s var(--nd-e-soft), color .35s var(--nd-e-soft);
}

body.nd-menu #checkout .modal-header .close > span:not(#\9) {
  display: none;
}

body.nd-menu #checkout .modal-header .close::before {
  content: "";
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask: var(--nd-ico-x) center / contain no-repeat;
  mask: var(--nd-ico-x) center / contain no-repeat;
}

@media (hover: hover) {
  /* the theme's fill, as in the prototype */
  body.nd-menu #checkout .modal-header .close:is(:hover, :hover:active):not(#\9) {
    background: var(--primary);
    color: var(--nd-co-on-primary);
    transform: rotate(90deg);
  }

  body.nd-menu #checkout .modal-header .close:hover:active:not(#\9) {
    transform: rotate(90deg) scale(.92);
  }
}

/* on touch, no turn */
body.nd-menu #checkout .modal-header .close:active:not(#\9) {
  background: #0d0d0d;
  color: #fff;
  transform: scale(.92);
}

body.nd-menu #checkout .modal-header .close:focus-visible:not(#\9) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

body.nd-menu #checkout .modal-body:not(#\9) {
  flex: 1 1 auto;
  min-height: 0;
  padding: 24px 26px 28px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, .15) transparent;
}

body.nd-menu #checkout .modal-footer:not(#\9) {
  flex: none;
  padding: 14px 26px;
  background: var(--nd-co-cream);
  border-top: 1px solid rgba(0, 0, 0, .07);
  border-radius: 0;
}

/* Until the sections are built (js/new-design-checkout.js), and when the script could not run: one white sheet per form */
body.nd-menu #checkout :is(form#f1, form#f2):not(#\9) {
  padding: 20px;
  background: var(--nd-co-paper);
  border: 1px solid var(--nd-co-outline);
  border-radius: 18px;
}

body.nd-menu #checkout form#f2:not(#\9) {
  margin-top: 18px;
}

/* A very light theme colour (the script measures it): white on it cannot be read, and icons and links on white get lost.
   The fill stays the theme's; the text on it turns dark and the small accents darken. */
body.nd-menu.nd-on-dark #checkout:not(.nd-co-pale) {
  --nd-ico-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d0d0d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

body.nd-menu #checkout.nd-co-pale {
  --nd-co-accent: color-mix(in srgb, var(--primary) 38%, #000);
}

/* iOS before 16.2 has no color-mix: the value would be invalid and a ticked box transparent */
@supports not (color: color-mix(in srgb, red, red)) {
  body.nd-menu #checkout.nd-co-pale {
    --nd-co-accent: #3d3d3d;
  }
}

/* ───────────── Form text ───────────── */
body.nd-menu #checkout .order h3:not(#\9) {
  margin: 0 0 16px;
  color: var(--nd-ink);
  font-size: 16.3px;
  font-weight: 800;
  line-height: 1.3;
  text-align: start;
}

body.nd-menu #checkout .order :is(.addr_wrapper_del, .delayed_delivery):not(#\9) {
  margin-top: 18px;
}

body.nd-menu #checkout .order :is(p.notes, div.notes):not(#\9) {
  margin: 0 0 14px;
  padding: 0;
  color: var(--nd-co-mut); /* 5.3:1 on the white card; a lighter grey falls under 4.5:1 at this size */
  font-size: 12.48px;
  line-height: 1.55;
}

body.nd-menu #checkout .order div.notes:empty:not(#\9) {
  display: none;
}

/* ───────────── Field grid: the engine's columns on the prototype's two ─────────────
   col-6 col-lg-3 is half, col-12 is the whole row. The card number is already col-12, the other PayMe fields col-6. */
body.nd-menu #checkout .order .row:not(#\9) {
  row-gap: 14px;
  margin-inline: -7px;
}

/* the gift's columns carry Bootstrap's .mb-3, !important */
body.nd-menu #checkout .order .row > .mb-3:not(#\9) {
  margin-bottom: 0 !important;
}

/* the space between rows is the row's gap: a margin here would stay under the last row of every card */
body.nd-menu #checkout .order .row > :is(.form-group, [class*="col-"]):not(#\9) {
  flex: 0 0 100%;
  max-width: 100%;
  margin-bottom: 0;
  padding-inline: 7px;
}

body.nd-menu #checkout .order .row + :is(.row, p.notes):not(#\9) {
  margin-top: 14px;
}

body.nd-menu #checkout .order .row > :is(.col-6, .col-3, .col-md-3):not(#\9) {
  flex-basis: 50%;
  max-width: 50%;
}

/* e-mail is the whole row in the prototype, col-6 in the engine */
body.nd-menu #checkout .order .row > .form-group:has(> #order_mail):not(#\9) {
  flex-basis: 100%;
  max-width: 100%;
}

/* time: the radios and the select one above the other; the engine shows and hides the select itself (menu.js:11733) */
body.nd-menu #checkout .order .delayed_delivery .row > [class*="col-"]:not(#\9) {
  flex-basis: 100%;
  max-width: 100%;
}

/* «now»: the engine hides the select itself, its empty column would still keep a row's gap under the radios */
body.nd-menu #checkout .order .delayed_delivery .row > [class*="col-"]:has(> select[name="delivery_hour"][style*="display: none"]):not(#\9) {
  display: none;
}

/* ───────────── Fields ───────────── */
/* .sr-only stays: with checkout_placeholders the label is for screen readers only (12 Sites) */
body.nd-menu #checkout .order :is(.form-group, .row:not(.payment_types) > [class*="col-"]) > label:not(.sr-only):not(.error):not(#\9) {
  display: block;
  margin: 0 0 6px;
  color: var(--nd-co-mut);
  font-size: 12.48px;
  font-weight: 700;
  line-height: 1.3;
  height: auto;
}

body.nd-menu #checkout .order :is(.form-control, select):not([type="checkbox"]):not(#\9) {
  box-sizing: border-box;
  width: 100%;
  height: 43px; /* one height with the hosted fields' containers, at either font size */
  padding: 0 14px;
  background-color: var(--nd-co-field-bg);
  border: 1.5px solid var(--nd-co-field-line);
  border-radius: 12px;
  box-shadow: none;
  color: var(--nd-ink);
  font-size: 15.2px;
  line-height: 1.3;
  transition: border-color .3s var(--nd-e-soft), background-color .3s var(--nd-e-soft), box-shadow .3s var(--nd-e-soft);
}

/* not on a field with an error: its red stays while the client corrects it */
body.nd-menu #checkout .order :is(.form-control, select):not([type="checkbox"]):not(.error):is(:focus, :focus-within):not(#\9) {
  background-color: #fff;
  border-color: var(--nd-co-accent);
  box-shadow: 0 0 0 4px var(--nd-co-ring);
  outline: none;
}

/* values locked by the engine: the city and address from the session, a read-only profile */
body.nd-menu #checkout .order :is(.form-control, select):is([disabled], [readonly]):not([type="checkbox"]):not(#\9) {
  background-color: #f0f0f0;
  color: rgba(13, 13, 13, .55);
}

/* The containers of hosted fields, PayMe and Prime (div), PayPlus (span): only the frame. They stay empty, with the same
   ids: the provider's script puts its iframe inside. The weight is lifted by :is(div, span) and [type], otherwise the
   general field rule wins and the padding stays 11px. The height is explicit, as in Bootstrap.
   Prime keeps an inline min-height:50px, which is stronger. */
body.nd-menu #checkout .order :is(div, span).form-control:not([type="checkbox"]):not(#\9) {
  display: flex;
  align-items: center;
  height: 43px;
  padding: 0 14px;
  overflow: hidden;
}

/* an error: Validate sets the class. The red line under the field is its own label, see below */
body.nd-menu #checkout .order :is(.form-control, select).error:not(label):not(#\9) {
  border-color: var(--nd-co-error);
  box-shadow: 0 0 0 4px var(--nd-co-ring-error);
}

/* The line under a field: Validate's own label, placed by js/new-design-checkout.js. jQuery hides it with an inline
   display:none, which would make everything below jump up: the display stays block and the state is read from that
   inline value, so the field's row opens and closes in one motion. */
body.nd-menu #checkout .order label.error:not(#\9) {
  display: block !important;
  width: 100%;
  max-height: 200px; /* the keyframes open over the message's measured height; here only a limit */
  margin: 6px 0 0;
  pointer-events: none; /* it carries for="…": a press on the line must not tick the consent */
  overflow: hidden;
  color: var(--nd-co-error);
  font-size: 12.48px;
  font-weight: 600;
  line-height: 1.35;
  animation: ndCoErrorIn .3s cubic-bezier(.33, 1, .68, 1);
  transition: max-height .25s var(--nd-e-soft), margin .25s var(--nd-e-soft), opacity .2s var(--nd-e-soft), visibility 0s linear .25s;
}

body.nd-menu #checkout .order label.error[style*="display: none"]:not(#\9) {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  visibility: hidden;
  animation: none;
}

/* A field that became valid: Validate empties the same label (with a `success` setting it never hides it). The script keeps
   the text in data-text, so the line can close in the same motion as it opened; a label that never held a message takes no room. */
body.nd-menu #checkout .order label.error:empty:not(#\9) {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  visibility: hidden;
  animation: none;
  transition: none;
}

body.nd-menu #checkout .order label.error:empty[data-text]:not(#\9) {
  animation: ndCoErrorOut .25s cubic-bezier(.33, 1, .68, 1);
}

body.nd-menu #checkout .order label.error:empty[data-text]::before {
  content: attr(data-text);
}

@keyframes ndCoErrorIn {
  from { max-height: 0; margin-top: 0; opacity: 0; }
  to { max-height: var(--nd-co-err-h, 60px); margin-top: 6px; opacity: 1; }
}

@keyframes ndCoErrorOut {
  from { max-height: var(--nd-co-err-h, 60px); margin-top: 6px; opacity: 1; visibility: visible; }
}

/* select: its own arrow, on the end side */
body.nd-menu #checkout .order select:not(#\9) {
  -webkit-appearance: none;
  appearance: none;
  background-image: var(--nd-ico-chevron);
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 16px;
}

/* a rule of its own, heavier than the general one: its padding would put the text on the arrow */
body.nd-menu #checkout .order select:is(.form-control, select):not([type="checkbox"]):not(#\9) {
  padding-inline-end: 36px;
}

body.nd-menu.ltr #checkout .order select:not(#\9) {
  background-position: right 12px center;
}

/* an hours range must not read backwards in RTL. The option's text may not change (delivery_range): only bidi */
body.nd-menu #checkout .order select[name="delivery_hour"]:not(#\9) {
  unicode-bidi: plaintext;
  text-align: start;
}

/* select2 of the street (#order_addr_street, dropdownParent #checkout) */
body.nd-menu #checkout .order .select2-container--default .select2-selection--single:not(#\9) {
  height: 43px;
  background-color: var(--nd-co-field-bg);
  border: 1.5px solid var(--nd-co-field-line);
  border-radius: 12px;
}

body.nd-menu #checkout .order .select2-container--default .select2-selection--single .select2-selection__rendered:not(#\9) {
  line-height: 40px;
  padding-inline: 14px 32px;
}

body.nd-menu #checkout .order .select2-container--default .select2-selection--single .select2-selection__arrow:not(#\9) {
  height: 40px;
}

body.nd-menu #checkout .order .select2-container--default.select2-container--open .select2-selection--single:not(#\9) {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--nd-co-ring);
}

/* an error on select2: the class is on the hidden select, the client sees the container next to it */
body.nd-menu #checkout .order select.error + .select2-container--default .select2-selection--single:not(#\9) {
  border-color: var(--nd-co-error);
  box-shadow: 0 0 0 4px var(--nd-co-ring-error);
}

/* ───────────── Checkboxes and radios: the input itself, never display:none ───────────── */
body.nd-menu #checkout .order input[type="checkbox"]:not(#\9) {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: #fff center / 13px no-repeat;
  border: 1.5px solid var(--nd-co-field-line);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color .25s var(--nd-e-out), border-color .25s var(--nd-e-out), transform .25s var(--nd-e-out), box-shadow .25s var(--nd-e-out);
}

body.nd-menu #checkout .order input[type="checkbox"]:checked:not(#\9) {
  background-color: var(--nd-co-accent);
  background-image: var(--nd-ico-check);
  border-color: var(--nd-co-accent);
  transform: scale(1.05);
}

body.nd-menu #checkout .order input[type="checkbox"].error:not(#\9) {
  border-color: var(--nd-co-error);
  box-shadow: 0 0 0 4px var(--nd-co-ring-error);
}

/* the time's and cutlery's radios. Saved cards (.cards) and tips live by their own rules */
body.nd-menu #checkout .order .form-group > label > input[type="radio"]:not(#\9),
body.nd-menu #checkout .order .delayed_delivery label > input[type="radio"]:not(#\9) {
  vertical-align: middle;
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  background: #fff;
  border: 1.5px solid var(--nd-co-field-line);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color .25s var(--nd-e-out), box-shadow .25s var(--nd-e-out);
}

body.nd-menu #checkout .order .form-group > label > input[type="radio"]:checked:not(#\9),
body.nd-menu #checkout .order .delayed_delivery label > input[type="radio"]:checked:not(#\9) {
  border-color: var(--nd-co-accent);
  box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 10px var(--nd-co-accent);
}

body.nd-menu #checkout .order input:is([type="checkbox"], [type="radio"]):focus-visible:not(#\9) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

body.nd-menu #checkout .order .delayed_delivery label:not(#\9),
body.nd-menu #checkout .order .form-group > label:has(> input:is([type="checkbox"], [type="radio"])):not(#\9) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--nd-ink);
  font-size: 13.76px;
  font-weight: 400;
  cursor: pointer;
}

/* A consent's text and its link are one sentence that wraps as one: the box hangs at the start of the first line.
   A flex label would make the text and the link two columns */
body.nd-menu #checkout .order .first label:not(.error):not(#\9) {
  position: relative;
  display: block;
  margin: 0;
  padding-inline-start: 30px;
  color: var(--nd-ink);
  font-size: 13.76px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
}

body.nd-menu #checkout .order .first label > input[type="checkbox"]:not(#\9) {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
}

/* the consents in a column; the engine's <br> between them is no longer needed */
body.nd-menu #checkout .order .first:not(#\9) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 14px;
  padding: 0;
}

/* margin, not gap: an emptied error label also counts as a flex item */
body.nd-menu #checkout .order .first label:not(.error) + label:not(.error):not(#\9),
body.nd-menu #checkout .order .first label.error + label:not(.error):not(#\9) {
  margin-top: 10px;
}

body.nd-menu #checkout .order .first > br:not(#\9) {
  display: none;
}

/* a darker tone of the theme: small text on white keeps 4.5:1 on any theme colour the pale check lets through
   (worst, cyan #0fffff: 4.79:1; at 60% it was 3.48:1). Without color-mix the ink of the text stays: 19:1 on white */
body.nd-menu #checkout .order .first a:not(#\9) {
  color: var(--nd-ink);
  color: color-mix(in srgb, var(--nd-co-accent) 50%, #000);
  font-weight: 700;
  text-decoration: underline;
}

/* ───────────── Tips (not in the prototype: the same language as the tiles) ───────────── */
body.nd-menu #checkout .order .tip fieldset:not(#\9) {
  position: relative; /* the hidden radios inside: without it a keyboard focus would scroll the window to the wrong place */
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  border: none;
}

body.nd-menu #checkout .order .tip legend:not(#\9) {
  width: 100%;
  margin: 0 0 8px;
  color: var(--nd-co-mut);
  font-size: 12.48px;
  font-weight: 700;
}

body.nd-menu #checkout .order .tip input[type="radio"]:not(#\9) {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* !important: the label has Bootstrap's .mr-3, itself !important */
body.nd-menu #checkout .order .tip input[type="radio"] + label:not(#\9) {
  margin: 0 !important;
  padding: 8px 16px;
  background: #fff;
  border: 1.5px solid var(--nd-co-field-line);
  border-radius: 999px;
  color: var(--nd-ink);
  font-size: 13.44px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .3s var(--nd-e-soft), box-shadow .3s var(--nd-e-soft);
}

@media (hover: hover) {
  body.nd-menu #checkout .order .tip input[type="radio"]:not(:disabled) + label:hover:not(#\9) {
    border-color: #9c9c9c;
  }
}

/* the radio itself is hidden: the ring is the only sign of the choice, in the tone that stays dark on a light theme */
body.nd-menu #checkout .order .tip input[type="radio"]:checked + label:not(#\9) {
  border-color: var(--nd-co-accent);
  box-shadow: inset 0 0 0 1px var(--nd-co-accent);
}

body.nd-menu #checkout .order .tip input[type="radio"]:focus-visible + label:not(#\9) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* when every payment is cash the engine switches tips off (menu.js:8164) */
body.nd-menu #checkout .order .tip input[type="radio"]:disabled + label:not(#\9) {
  opacity: .45;
  cursor: not-allowed;
}

/* ───────────── Payment ───────────── */
body.nd-menu #checkout .order .payments:not(#\9) {
  margin: 0;
}

body.nd-menu #checkout .order .payments .payment:first-child:not(#\9) {
  padding-top: 0;
  border-top: none;
}

body.nd-menu #checkout .order .payments .payment + .payment:not(#\9) {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, .07);
}

/* The payment's amount, while there is one payment and it is readonly, equals the total: the client does not need it.
   The node and its value stay (computeTotal writes, createOrder3 reads .val()); hidden is safe for Validate, the field
   is not required. After «פיצול חשבון» readonly goes (menu.js:8079) and the field shows again. */
body.nd-menu #checkout .order .payment > .row > .form-group:has(> input[id^="payment_amount_"][readonly]):not(#\9) {
  display: none;
}

/* the engine's caption above the tiles: the section's title says the same once the sections are built */
body.nd-menu #checkout .order .payment > .row > .form-group:has(> .payment_types) > label:not(#\9) {
  margin-bottom: 8px;
}

/* the tiles; minmax(0, …): a long unbroken name wraps in its tile instead of widening the column */
body.nd-menu #checkout .order .payment_types:not(#\9) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

/* Two ways to pay share the row instead of leaving an empty third cell. The engine hides the Apple Pay tile outside
   Safari with an inline display:none on its column (menu.js:13626): three columns with one hidden are two ways */
body.nd-menu #checkout .order .payment_types:is(:has(> :nth-child(2):last-child), :has(> :nth-child(3):last-child):has(> [style*="display: none"])):not(#\9) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.nd-menu #checkout .order .form-group:has(> .payment_types) > br:not(#\9) {
  display: none;
}

/* grid instead of col-*. A hidden tile (Apple Pay without support: jQuery's inline display:none) just falls out of the grid */
body.nd-menu #checkout .order .payment_types > [class*="col-"]:not(#\9) {
  position: relative;
  width: auto;
  max-width: none;
  margin: 0 !important; /* the first payment has Bootstrap's .mb-3, !important, the split template has not: the grid's gaps would differ */
  padding: 0;
}

/* front.css hides the radio with display:none, which takes it away from the keyboard. The radio is not required: Validate is not affected */
body.nd-menu #checkout .order .payment_types input:not(#\9) {
  position: absolute;
  display: block;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body.nd-menu #checkout .order .payment_types input + label:not(#\9) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 99px;
  margin: 0;
  padding: 16px 10px;
  background: #fff;
  border: 1.5px solid var(--nd-co-field-line);
  border-radius: 16px;
  box-shadow: none;
  color: var(--nd-ink);
  font-size: 13.44px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: transform .3s var(--nd-e-out), box-shadow .35s var(--nd-e-soft), border-color .3s var(--nd-e-soft);
}

body.nd-menu #checkout .order .payment_types input + label > br:not(#\9) {
  display: none;
}

/* the Site's icon font; a tile with a design picture draws it instead, see below */
body.nd-menu #checkout .order .payment_types input + label > i:not(#\9) {
  color: var(--primary);
  font-size: 34px;
  line-height: 1;
}

/* The design's three pictures, by the way's code, where it has one; every other code keeps the Site's icon font.
   The picture's own colours: they do not follow the theme, as in the design. A picture takes the icon's place once it has
   loaded (js/new-design-checkout.js marks the window .nd-co-pic-<name>): until then, or if it never comes, the icon stays. */
body.nd-menu #checkout {
  --nd-co-pic-cash: url("/images/new-design/icons/payment/cash.png");
  --nd-co-pic-tenbis: url("/images/new-design/icons/payment/tenbis.png");
  --nd-co-pic-card: url("/images/new-design/icons/payment/card.png");
}

body.nd-menu #checkout .order .payment_types :is(.nd-co-pic-cash [data-code="cash"], .nd-co-pic-tenbis :is([data-code="tenbis"], [data-code="tenbis_real"], [data-code="cibus"], [data-code="cibus_real"]), .nd-co-pic-card [data-code="payme"]) + label > i:not(#\9) {
  display: none;
}

body.nd-menu #checkout .order .payment_types :is(.nd-co-pic-cash [data-code="cash"], .nd-co-pic-tenbis :is([data-code="tenbis"], [data-code="tenbis_real"], [data-code="cibus"], [data-code="cibus_real"]), .nd-co-pic-card [data-code="payme"]) + label::before {
  content: "";
  flex: none;
  width: 67px;
  height: 38px;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

body.nd-menu #checkout .order .payment_types input[data-code="cash"] + label::before { background-image: var(--nd-co-pic-cash); }
body.nd-menu #checkout .order .payment_types input:is([data-code="tenbis"], [data-code="tenbis_real"], [data-code="cibus"], [data-code="cibus_real"]) + label::before { background-image: var(--nd-co-pic-tenbis); }
body.nd-menu #checkout .order .payment_types input[data-code="payme"] + label::before { background-image: var(--nd-co-pic-card); }

/* the front.css hover paints the tile and its icon: the tile keeps its colours here */
@media (hover: hover) {
  body.nd-menu #checkout .order .payment_types input + label:hover:not(#\9) {
    background: #fff;
    color: var(--nd-ink);
    box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .18);
    transform: translateY(-2px);
  }
}

/* The selected one: 2px as in the prototype. A wider border would move the content: the extra pixel is an inner shadow.
   No pop: Rest's and Delicates' `.payment_types input:checked + label` scale it .94 → 1.04 (rs-pop, sd-pop) */
body.nd-menu #checkout .order .payment_types input:checked + label:not(#\9) {
  animation: none;
  background: #fff;
  border-color: var(--nd-co-accent);
  box-shadow: inset 0 0 0 1px var(--nd-co-accent), 0 12px 26px -12px color-mix(in srgb, var(--primary) 45%, transparent);
  color: var(--nd-ink);
}

body.nd-menu #checkout .order .payment_types input:focus-visible + label:not(#\9) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* The fields of the chosen way: the script decides which panel shows (see showPanel). jQuery's slide of the engine
   (menu.js:15777) keeps its timing and classes; its inline height, margins and paddings are switched off here. */
body.nd-menu #checkout.nd-co-built .order .payment_settings:not(#\9) {
  height: auto !important;
  margin-top: 18px !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: visible !important;
  scroll-margin-block: 24px; /* brought into view after a choice (js): the last field clear of the window's edge */
}

body.nd-menu #checkout.nd-co-built .order .payment_settings.nd-co-off:not(#\9) {
  display: none !important;
}

body.nd-menu #checkout.nd-co-built .order .payment_settings.nd-co-on:not(#\9) {
  display: block !important;
  animation: ndCoFadeIn .32s var(--nd-e-soft);
}

body.nd-menu #checkout.nd-co-built .order .payment_settings.row.nd-co-on:not(#\9) {
  display: flex !important;
}

@keyframes ndCoFadeIn {
  from { opacity: 0; }
}

/* the × of an added payment: the same round button as the window's, smaller */
body.nd-menu #checkout .order .payment .close:not(#\9) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0 0 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--nd-co-accent);
  font-size: 18px;
  line-height: 1;
  opacity: 1;
  text-shadow: none;
  transition: background-color .3s var(--nd-e-soft), color .3s var(--nd-e-soft);
}

@media (hover: hover) {
  body.nd-menu #checkout .order .payment .close:hover:not(#\9) {
    background: #0d0d0d;
    color: #fff;
  }
}

/* The × stands absolute in the row's top corner (front.css .payments .payment .close). The caption of the amount takes its
   line, with room at the end: the × stays off the field, the field keeps the whole width */
body.nd-menu #checkout .order .payment > .row:has(> .close) > .form-group > label[for^="payment_amount_"]:not(#\9) {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding-inline-end: 36px;
}

/* «split the bill» */
body.nd-menu #checkout .order .split_payment:not(#\9) {
  margin-top: 16px;
  padding: 8px 18px;
  background: transparent;
  border: 1.5px solid #bdbdbd;
  border-radius: 999px;
  color: var(--nd-ink);
  font-size: 13.76px;
  font-weight: 700;
  transition: background-color .35s var(--nd-e-soft), border-color .35s var(--nd-e-soft);
}

body.nd-menu #checkout .order .split_payment::after {
  display: none;
}

@media (hover: hover) {
  body.nd-menu #checkout .order .split_payment:hover:not(#\9) {
    background: #f0f0f0;
    border-color: #9c9c9c;
  }
}

/* ───────────── Sections: cards built by the script, inside the same forms ───────────── */
body.nd-menu #checkout.nd-co-built :is(form#f1, form#f2):not(#\9) {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}

body.nd-menu #checkout.nd-co-built form#f2:not(#\9) {
  margin-top: 18px;
}

/* At rest a thin outline, no shadow: the cart's line cards were approved this way. Only with a mouse, the card lifts and takes
   the prototype's shadow; a card being typed in stays put, so the field under the cursor does not run away. */
body.nd-menu #checkout .nd-co-section:not(#\9) {
  position: relative;
  padding: 20px;
  background: var(--nd-co-paper);
  border: 1px solid var(--nd-co-outline);
  border-radius: 18px;
  transition: transform .4s var(--nd-e-soft), box-shadow .4s var(--nd-e-soft);
}

/* no margin under a card's last thing: the card's own padding is the space */
body.nd-menu #checkout .order .nd-co-section > :is(:last-child, p.notes:last-child, div.notes:last-child):not(#\9) {
  margin-bottom: 0;
}

/* a section without a visible field, e.g. an empty row of extras */
body.nd-menu #checkout .nd-co-section--extra:not(:has(.form-group:not(.d-none), [class*="col-"]:not(.d-none))):not(#\9) {
  display: none;
}

@media (hover: hover) {
  /* the invisible strip under the card keeps the pointer on it when the card rises: no flicker at the bottom edge */
  body.nd-menu #checkout .nd-co-section:hover::after {
    content: "";
    position: absolute;
    inset: 100% 0 auto;
    height: 4px;
  }

  body.nd-menu #checkout .nd-co-section:hover:not(:focus-within):not(#\9) {
    box-shadow: 0 6px 16px rgba(0, 0, 0, .07), 0 26px 54px -28px rgba(0, 0, 0, .38);
    transform: translateY(-3px);
  }
}

body.nd-menu #checkout .nd-co-section h3:not(#\9) {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.nd-menu #checkout .order :is(.nd-co-section.addr_wrapper_del, .nd-co-section .delayed_delivery):not(#\9) {
  margin-top: 0;
}

/* the engine's notes under the time's select */
body.nd-menu #checkout .order .nd-co-section--time > div.notes:not(#\9) {
  margin-top: 14px;
}

/* section title icons: the design's line icons, a mask so they take the theme colour */
body.nd-menu #checkout .nd-co-section--personal h3:first-child::before,
body.nd-menu #checkout .nd-co-section--address h3:first-child::before,
body.nd-menu #checkout .nd-co-section--time h3:first-child::before,
body.nd-menu #checkout .nd-co-section--payment h3:first-child::before,
body.nd-menu #checkout .nd-co-summary h3:first-child::before {
  content: "";
  flex: none;
  width: 19px;
  height: 19px;
  background: var(--nd-co-accent);
  -webkit-mask: var(--nd-co-ico) center / contain no-repeat;
  mask: var(--nd-co-ico) center / contain no-repeat;
}

body.nd-menu #checkout .nd-co-section--personal { --nd-co-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21a8 8 0 0 0-16 0'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }
body.nd-menu #checkout .nd-co-section--address { --nd-co-ico: url("/images/front/map_pin.svg"); }
body.nd-menu #checkout .nd-co-section--time { --nd-co-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
body.nd-menu #checkout .nd-co-section--payment { --nd-co-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2.5'/%3E%3Cpath d='M2 10h20'/%3E%3C/svg%3E"); }

/* the section's title says what the engine's caption above the tiles says */
body.nd-menu #checkout.nd-co-built .order .payment > .row > .form-group:has(> .payment_types) > label:not(#\9) {
  display: none;
}

/* ───────────── Summary column and the buttons ───────────── */
body.nd-menu #checkout.nd-co-built .modal-body:not(#\9) {
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

/* .order stays the forms' parent: the engine reads `.order [name=…]` */
body.nd-menu #checkout.nd-co-built .modal-body > .order:not(#\9) {
  flex: 1 1 0;
  min-width: 0;
}

/* min-width: a long caption of a fee wraps inside the column instead of widening it over the form */
body.nd-menu #checkout .nd-co-aside:not(#\9) {
  flex: 0 0 360px;
  min-width: 0;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(var(--nd-co-room, 100vh) - 52px); /* the body's room (js) less its paddings, 24 + 28 */
}

/* a summary taller than the room scrolls in its card: the buttons under it are never cut */
body.nd-menu #checkout .nd-co-aside > .nd-co-summary:not(#\9) {
  min-height: 0;
  overflow-y: auto;
}

/* there the total stays at the card's foot, the lines above it scroll; its shadow fills the card's bottom padding (20px),
   where the scrolled lines showed under it */
body.nd-menu #checkout .nd-co-aside .nd-co-sum-total:not(#\9) {
  position: sticky;
  bottom: 0;
  background: var(--nd-co-paper);
  box-shadow: 0 20px 0 var(--nd-co-paper);
}

body.nd-menu #checkout .nd-co-actions:not(#\9) {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.nd-menu #checkout.nd-co-built .modal-footer:not(#\9) {
  display: none;
}

/* the prototype's resting shadow; the other cards stay flat at rest (approved with the cart's cards) */
body.nd-menu #checkout .nd-co-summary:not(#\9) {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05), 0 18px 40px -26px rgba(0, 0, 0, .28);
}

body.nd-menu #checkout .nd-co-summary h3:not(#\9) {
  margin: 0 0 16px;
  color: var(--nd-ink);
  font-size: 16.3px;
  font-weight: 800;
  line-height: 1.3;
  --nd-co-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h2l2.2 12.5a1.5 1.5 0 0 0 1.5 1.2h8.3a1.5 1.5 0 0 0 1.5-1.2L21.5 7H6'/%3E%3Ccircle cx='9' cy='20' r='1.4'/%3E%3Ccircle cx='18' cy='20' r='1.4'/%3E%3C/svg%3E");
}

body.nd-menu #checkout .nd-co-sum:not(#\9) {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.nd-menu #checkout .nd-co-sum-row:not(#\9) {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: rgba(13, 13, 13, .68);
  font-size: 14.4px;
}

body.nd-menu #checkout .nd-co-sum-label:not(#\9) {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.nd-menu #checkout .nd-co-sum-amount:not(#\9) {
  color: var(--nd-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* black, not the theme colour: as in the prototype, a coloured total reads as a discount */
body.nd-menu #checkout .nd-co-sum-total:not(#\9) {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px dashed rgba(0, 0, 0, .12);
  color: var(--nd-ink);
  font-size: 17.6px;
  font-weight: 900;
}

body.nd-menu #checkout .nd-co-sum-total .nd-co-sum-amount:not(#\9) {
  font-size: 24.8px;
  font-weight: 900;
  letter-spacing: -.5px;
}

/* The send button: the engine's node and handler. menu.js sets .disabled and disabled while it sends (menu.js:2697) */
body.nd-menu #checkout .checkout_send_order:not(#\9) {
  position: relative;
  isolation: isolate;
  flex: none;
  width: 100%;
  margin: 0;
  padding: 12px 18px;
  overflow: hidden;
  background: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  box-shadow: none;
  color: var(--nd-co-on-primary);
  font-size: 15.36px;
  font-weight: 800;
  line-height: 1.3;
  transition: transform .45s var(--nd-e-soft), box-shadow .45s var(--nd-e-soft), border-color .45s var(--nd-e-soft);
}

body.nd-menu #checkout .checkout_send_order::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--nd-primary-hover);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .42s var(--nd-e-fill);
}

body.nd-menu.ltr #checkout .checkout_send_order::before {
  transform-origin: left;
}

@media (hover: hover) {
  body.nd-menu #checkout .checkout_send_order:hover:not(#\9) {
    border-color: var(--nd-primary-hover);
    box-shadow: 0 16px 32px -14px rgba(0, 0, 0, .35);
    transform: translateY(-2px);
  }

  body.nd-menu #checkout .checkout_send_order:hover::before {
    transform: scaleX(1);
  }

  /* Rest's and Delicates' press inverts the button with !important: a light plate and text in the theme colour. Under the
     mouse the layer's fill covers that plate, so the text keeps the colour that reads on the fill. Touch has no fill: the Site's press stays.
     The one !important against a Site's: their `color` is !important, which no weight of a normal declaration outweighs */
  body.nd-menu #checkout .checkout_send_order:hover:active:not(#\9) {
    color: var(--nd-co-on-primary) !important;
  }
}

body.nd-menu #checkout .checkout_send_order:active:not(#\9) {
  transform: translateY(0) scale(.99);
}

body.nd-menu #checkout .checkout_send_order:focus:not(:focus-visible):not(#\9) {
  box-shadow: none;
  outline: none;
}

body.nd-menu #checkout :is(.checkout_send_order, .nd-co-back):focus-visible:not(#\9) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: none;
}

body.nd-menu #checkout .checkout_send_order:is(:disabled, .disabled):not(#\9) {
  box-shadow: none;
  opacity: .6;
  pointer-events: none;
  transform: none;
}

body.nd-menu #checkout .nd-co-back:not(#\9) {
  flex: none;
  width: 100%;
  padding: 12px 18px;
  background: transparent;
  border: 1.5px solid #bdbdbd;
  border-radius: 999px;
  color: var(--nd-ink);
  font-size: 14.72px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color .35s var(--nd-e-soft), border-color .35s var(--nd-e-soft), transform .35s var(--nd-e-soft);
}

@media (hover: hover) {
  body.nd-menu #checkout .nd-co-back:hover:not(#\9) {
    background: #f0f0f0;
    border-color: #9c9c9c;
  }
}

body.nd-menu #checkout .nd-co-back:active:not(#\9) {
  transform: scale(.97);
}

/* ───────────── Where the column drops under the form: the buttons go to the footer ───────────── */
@media (max-width: 900px), (max-height: 500px) {
  body.nd-menu #checkout.nd-co-built .modal-body:not(#\9) {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }

  body.nd-menu #checkout.nd-co-built .modal-body > .order:not(#\9) {
    flex: none;
    width: 100%;
  }

  body.nd-menu #checkout .nd-co-aside:not(#\9) {
    position: static;
    flex: none;
    width: 100%;
    max-height: none;
  }

  body.nd-menu #checkout .nd-co-actions:not(#\9) {
    display: none;
  }

  /* one row, as in the cart's sheet: the round «back» and the send button; the sum stays in the summary, as in the prototype */
  body.nd-menu #checkout.nd-co-built .modal-footer:not(#\9) {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    justify-content: stretch;
  }

  body.nd-menu #checkout.nd-co-built .modal-footer > *:not(#\9) {
    margin: 0;
  }

  body.nd-menu #checkout .checkout_send_order:not(#\9) {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    white-space: nowrap;
  }

  body.nd-menu #checkout .nd-co-back:not(#\9) {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-color: var(--nd-co-field-line);
    border-radius: 50%;
  }

  /* the same back arrow as the cart's sheet: points to the reading start */
  body.nd-menu #checkout .nd-co-back-text:not(#\9) {
    display: none;
  }

  body.nd-menu #checkout .nd-co-back::before {
    content: "";
    width: 19px;
    height: 19px;
    background: var(--nd-ink);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  body.nd-menu.ltr #checkout .nd-co-back::before {
    transform: scaleX(-1);
  }
}

/* A phone held upright: two rows as in the prototype, the send button above, «back to the cart» as text below
   (js places them in this order) */
@media (max-width: 767px) and (orientation: portrait) {
  body.nd-menu #checkout.nd-co-built .modal-footer:not(#\9) {
    flex-direction: column;
    align-items: stretch;
  }

  body.nd-menu #checkout .checkout_send_order:not(#\9) {
    flex: none;
    width: 100%;
  }

  body.nd-menu #checkout .nd-co-back:not(#\9) {
    width: 100%;
    height: 44px;
    padding: 0 18px;
    background: transparent;
    border-color: #bdbdbd;
    border-radius: 999px;
  }

  body.nd-menu #checkout .nd-co-back-text:not(#\9) {
    display: inline;
  }

  body.nd-menu #checkout .nd-co-back::before {
    content: none;
  }
}

/* The platform's accessibility button sits over the window where its edge reaches it; the phone's rule of the cart layer stops at 767px */
@media (max-width: 1132px), (max-height: 500px) {
  body.nd-menu:has(#checkout.show) .a11y_floating_button:not(#\9) {
    z-index: 1040;
  }
}

/* ───────────── Phone, and a landscape phone: the whole screen ───────────── */
@media (max-width: 767px), (max-height: 500px) {
  /* Height from .modal (position:fixed, height:100%), not 100dvh: as in the cart's sheet, it follows the real window
     together with the browser's bar. Not checked on a real iPhone. */
  body.nd-menu #checkout .modal-dialog:not(#\9) {
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 100%;
    margin: 0;
  }

  body.nd-menu #checkout.fade:not(.modal-static) .modal-dialog:not(#\9) {
    transform: translateY(2%);
  }

  body.nd-menu #checkout.show:not(.modal-static) .modal-dialog:not(#\9) {
    transform: none;
  }

  body.nd-menu #checkout .modal-content:not(#\9) {
    height: 100%;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }

  /* left and right are physical, as the cutout of a turned phone is: in either direction of the text */
  body.nd-menu #checkout .modal-header:not(#\9) {
    padding: calc(14px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 14px calc(14px + env(safe-area-inset-left));
  }

  body.nd-menu #checkout .modal-title:not(#\9) {
    font-size: 18.4px;
  }

  /* the prototype's phone close: 40px, white, a soft shadow */
  body.nd-menu #checkout .modal-header .close:not(#\9) {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, .35);
    color: var(--nd-ink);
  }

  body.nd-menu #checkout .modal-header .close::before {
    width: 18px;
    height: 18px;
  }

  body.nd-menu #checkout .modal-body:not(#\9) {
    padding: 16px calc(14px + env(safe-area-inset-right)) 20px calc(14px + env(safe-area-inset-left));
  }

  /* env(safe-area-inset-bottom) changes on iOS as its bar shows and hides (proved on the cart): not checked on a real iPhone */
  body.nd-menu #checkout .modal-footer:not(#\9) {
    padding: 12px calc(14px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
    border-top: none;
    box-shadow: 0 -8px 20px -12px rgba(0, 0, 0, .25);
  }
}

/* As in the prototype: two tiles a row up to 900px, three ways of paying are 2+1 */
@media (max-width: 900px) {
  body.nd-menu #checkout .order .payment_types:not(#\9) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The phone's label is the long one and takes two lines on a narrow phone: the row keeps its fields on one line */
@media (max-width: 389px) {
  body.nd-menu #checkout .order .row:has(#order_phone) > .form-group > label:not(.sr-only):not(.error):not(#\9) {
    display: flex;
    align-items: flex-end;
    min-height: 2.6em;
  }
}

/* the prototype's 99px tile also on a phone; only the padding is narrower */
@media (max-width: 767px) {
  body.nd-menu #checkout .order .payment_types input + label:not(#\9) {
    padding: 12px 6px;
  }
}

/* Under 16px iOS Safari zooms the page on focus (the viewport has no maximum-scale, masterNew:25).
   The prototype's 15.2px is not carried over here. pointer:coarse: an iPhone in landscape is wider than 767px */
@media (max-width: 767px), (pointer: coarse) {
  body.nd-menu #checkout .order :is(.form-control, select):not([type="checkbox"]):not(#\9) {
    font-size: 16px;
  }
}

/* A landscape phone: the header and the footer give the form what they can */
@media (max-height: 500px) {
  body.nd-menu #checkout .modal-header:not(#\9) {
    padding-block: calc(6px + env(safe-area-inset-top)) 6px;
  }

  body.nd-menu #checkout.nd-co-built .modal-footer:not(#\9) {
    padding-block: 6px calc(6px + env(safe-area-inset-bottom));
  }

  /* not on a phone held upright: there «back to the cart» is a full-width text button, 44px high */
  @media (min-width: 768px), (orientation: landscape) {
    body.nd-menu #checkout :is(.checkout_send_order, .nd-co-back):not(#\9) {
      height: 42px;
    }

    body.nd-menu #checkout .nd-co-back:not(#\9) {
      width: 42px;
    }
  }
}

/* ───────────── Less motion ───────────── */
/* !important: the main rules weigh more (:not(.modal-static), [type], .error), without it this would not apply */
@media (prefers-reduced-motion: reduce) {
  body.nd-menu .modal-backdrop.nd-co-backdrop, /* only this window's own: the terms and bootbox keep Bootstrap's motion */
  body.nd-menu #checkout.fade,
  body.nd-menu #checkout.fade .modal-dialog,
  body.nd-menu #checkout .modal-header .close,
  body.nd-menu #checkout .order :is(.form-control, select, input, label.error, .payment_settings, .split_payment, .payment .close),
  body.nd-menu #checkout .order .payment_types input + label,
  body.nd-menu #checkout .nd-co-section,
  body.nd-menu #checkout .checkout_send_order,
  body.nd-menu #checkout .checkout_send_order::before,
  body.nd-menu #checkout .nd-co-back {
    animation: none !important;
    transition: none !important;
  }

  body.nd-menu #checkout .modal-header .close:not(#\9) {
    transform: none !important;
  }

  body.nd-menu #checkout.fade:not(.modal-static) .modal-dialog:not(#\9) {
    transform: none !important;
  }

  body.nd-menu #checkout .order .payment_types input + label:not(#\9),
  body.nd-menu #checkout .nd-co-section:hover:not(#\9) {
    transform: none !important;
  }
}
