/* ── ORDER FLOW (preview, 5 Dec 2026) ─────────────────────────
   The four-step ordering modal. It opens only with ?order or #order… in the address (order.js).
   Built on the waiting-list modal (.modal-backdrop, .modal, .modal__close, .modal__input,
   .modal__input-error, .modal__check); every colour, size and radius is a token from shared.css.
   No new token. */

.order-backdrop [hidden] { display: none !important; }

.modal--order {
  --order-pad: clamp(1.25rem, 5vw, 2.5rem);
  width: min(600px, 100%);
  max-height: calc(100dvh - 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  text-align: left;
}

/* ── Header: back, steps, close ── */
.order__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem calc(var(--order-pad) - .75rem);
  background: var(--white);
  box-shadow: 0 1px 0 transparent;   /* a hairline appears under it once the content scrolls */
  transition: box-shadow var(--transition);
}
.order__head.is-scrolled { box-shadow: 0 1px 0 var(--grey-light); }

.order__back,
.modal--order .order__close {
  position: static;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-mid);
  transition: background var(--transition), color var(--transition);
}
.order__back[hidden] { display: flex !important; }   /* hidden on step 1, space kept so nothing moves */
.order__back[hidden] { visibility: hidden; }

@media (hover: hover) {
  .order__back:hover { background: var(--grey-light); color: var(--black); }
}

.order__steps {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1rem;   /* more air between the dots (her word, 5 Dec; was .5rem) */
}
.order__steps[hidden] { display: flex !important; visibility: hidden; }

.order__dot {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--grey-mid);   /* 3:1 or better, so the future step still reads as a step */
  color: var(--grey-mid);
  background: var(--white);
  font-family: var(--ff-ui);
  font-size: var(--fs-menu);
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.order__dot-tick { display: none; width: 16px; height: 16px; }
.order__dot[aria-current="step"] { background: var(--black); border-color: var(--black); color: var(--white); }
.order__dot.is-done { border-color: var(--green); color: var(--green); cursor: pointer; }   /* completed steps green, like the field ticks (her word, 5 Dec) */
.order__dot.is-done .order__dot-num { display: none; }
.order__dot.is-done .order__dot-tick { display: block; }
.order__dot.is-done[aria-current="step"] { border-color: var(--black); color: var(--white); cursor: default; }   /* the current step, filled in: a white tick on black (her word, 6 Dec) */
.order__dot:not(.is-done)[disabled] { opacity: 1; }
.order__dot:not([disabled]) { cursor: pointer; }   /* every step reached so far opens, ticked or not */
@media (hover: hover) {
  .order__dot:not([disabled]):hover { background: var(--grey-light); }
}

/* ── Body ── */
.order__form { padding: .5rem var(--order-pad) var(--order-pad); }

.order-step__title {
  font-family: var(--ff-body);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: .5rem;
  text-align: center;   /* step titles and their lines centred, as in her draft (5 Dec, her word) */
}
.order-step__title:focus { outline: none; }   /* focus is moved here on each step; the heading is not a control */
.order-step__sub { color: var(--grey-mid); margin-bottom: 1.5rem; text-align: center; }
[data-step="thanks"] .order__actions { justify-content: center; }   /* follows the centred thank-you text */
.order-step__sub--tight { margin-bottom: .5rem; }
.order-step__title + .order-plans,
.order-step__title + .order-field,
.order-step__title + .order-group,
.order-step__title + .order-review,
.order-step__title + .order-gift { margin-top: 1.5rem; }   /* space under a title with no line beneath it (1.5rem since 5 Dec, her word) */

/* ── Fields ── */
.order-field { display: flex; flex-direction: column; gap: .375rem; margin-bottom: .75rem; min-width: 0; }   /* 12px between fields (her word, 5 Dec; was 20px) */
/* Contained-label field (her reference): one bordered box, the label small inside at its top-left, the value below it.
   The control fills the whole box, so a click anywhere in it focuses the control; the label sits over it and lets clicks through. */
.order-box {
  position: relative;
  background: var(--white);
  border: 1.5px solid var(--grey-light);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
/* the finger over every field box (her word, 5 Dec); a focused text field shows the text cursor while typing */
.order-box, .order-box .modal__input { cursor: pointer; }
.order-box input.modal__input:focus, .order-box textarea.modal__input:focus { cursor: text; }
.order-box:focus-within { border-color: var(--blue-focus); box-shadow: 0 0 0 3px rgba(74,144,217,.25); }
.order-box.is-error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(226,29,46,.12); }
.order-box.is-error:focus-within { border-color: var(--red); }
.order-field__label {
  position: absolute;
  z-index: 1;
  top: .5rem;
  left: 1rem;
  right: 2.75rem;
  font-family: var(--ff-ui);   /* sans-serif form labels (her word, 5 Dec) */
  font-size: .6875rem;   /* 11px, as the hints (her word, 5 Dec) */
  font-weight: 500;
  line-height: 1.2;
  color: var(--grey-mid);
  pointer-events: none;
  background: transparent;   /* so a browser-autofilled (tinted) input shows no white strip behind its label */
}
.order-field__label > span { color: var(--red); margin-left: .125rem; }
.order-box .modal__input,
.order-box .modal__input:focus,
.order-box .modal__input--error {
  height: 56px;   /* 56px since the text went to 17px (her word, 5 Dec; was 64px) */
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: none;
  padding: 1.5rem 2.75rem .5rem 1rem;
  font-size: 1.0625rem;   /* 17px typed and chosen text (her word, 5 Dec; was 19px) */
  line-height: 1.3;
}
.order-box select.modal__input {   /* our own arrow, as far from the border as the ticks (her word, 5 Dec: the native one sat too close) */
  -webkit-appearance: none;
  appearance: none;
  padding-left: 1rem;
  padding-right: 2.75rem;
  background: url(images/icon-chevron-down.svg) no-repeat right 1rem center / 18px 18px;
}
/* dropdown text at the typed fields' size (her word, 5 Dec, after a 16px try); the Mac draws the open list at that size too */
.order-box select:invalid { color: var(--grey-mid); }
.order-box select option { color: var(--black); }
.order-box textarea.modal__input { height: auto; min-height: 7rem; padding-top: 1.75rem; field-sizing: content; }   /* grows with the note where supported, so it rarely scrolls */
.order-box:has(> textarea) > .order-field__label { background: var(--white); top: 0; padding: .5rem 0 .4rem; }   /* a white strip down to the text's first line: scrolled text slides cleanly under the label */
.order-field__control { position: static; }
/* Labels, hints, counter, notes, terms line and errors: Noto Sans Medium 12px, labels and hints grey (her word, 5 Dec: same size, greyish, smaller); Noto Sans is self-hosted at 500 and 600 only */
.order-field__hint, .order-field__count, .order__note, .order__terms, .modal--order .modal__input-error { font-family: var(--ff-ui); font-size: .6875rem; font-weight: 500; line-height: 1.4; }   /* 11px since 5 Dec, her word */
.order-field__hint, .order-field__count { color: var(--grey-mid); }
.order-field .modal__input-error { margin-top: 0; }
.order-field__tick {
  position: absolute;
  z-index: 1;
  right: 1rem;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  color: var(--green);   /* green ticks (her word, 5 Dec) */
  display: none;
  pointer-events: none;
}
.order-field.is-valid .order-field__tick { display: block; }
.order-field__textarea { resize: vertical; min-height: 7rem; line-height: 1.4; }
.order-field__meta { display: flex; justify-content: flex-end; gap: 1rem; align-items: flex-start; }
.order-field__count { flex: none; font-variant-numeric: tabular-nums; }

.order-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }   /* 12px between side-by-side fields too */

.order-group { border: 0; margin: 0; padding: 0; min-width: 0; }   /* its last field's own 12px margin is the gap after it, like any field (5 Dec) */
.order-group__legend { font-weight: 500; padding: 0; margin-bottom: .75rem; float: left; width: 100%; }
.order-group__legend + * { clear: both; }
.order-group + .order-group { margin-top: 1.25rem; }   /* a section heading sits 32px under the section before it (Posting date, Contact; 5 Dec) */

select.modal__input { appearance: auto; }
.modal--order .modal__input { width: 100%; }


/* hint text leaves as soon as a field is clicked (her word, 5 Dec, for the gift note sample; every field alike) */
.order-box .modal__input:focus::placeholder { color: transparent; }

/* ── Gift note preview: her card with the ribbon (assets/giftnote-bg.png, 5 Dec), filled as the buyer types ── */
.order-gift {
  position: relative;
  width: min(100%, max(61%, 16.25rem));   /* the envelope's width on step 1 */
  margin: 0 auto 2.5rem;
}
.order-gift__bg { display: block; width: 100%; height: auto; }
.order-gift__text {
  position: absolute;
  left: 10.9%;   /* where her mock-up puts the words */
  right: 8.2%;
  top: 23%;   /* a little lower than her mock-up (her word, 5 Dec) */
  bottom: 8%;
  display: flex;
  flex-direction: column;
}
.order-gift__note {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  font-style: italic;
  font-size: .9375rem;   /* shrinks in order.js when a long note would not fit the card */
  line-height: 1.6;
  color: var(--black);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.order-gift__note.is-sample { color: var(--grey-mid); }   /* her sample, greyed (her word, 5 Dec); the field itself stays empty */
.order-gift__from { font-size: .8125rem; line-height: 1.3; color: var(--grey-mid); text-align: right; overflow-wrap: anywhere; }
.order-gift__from:empty { display: none; }

/* ── Envelope preview: her envelope with its stamp (assets/envelope-bg.png, 5 Dec) ── */
.order-env {
  position: relative;
  width: min(100%, max(61%, 16.25rem));   /* her mock-up: 61% of the step's width, centred; never under 260px */
  margin: 0 auto 1.75rem;
}
.order-env__bg { display: block; width: 100%; height: auto; }
.order-env__text {
  position: absolute;
  left: 10.8%;   /* where her mock-up puts "To:", under the stamp */
  right: 8%;
  top: 41%;
}
.order-env__to { font-size: var(--fs-small); line-height: 1.4; color: var(--grey-mid); }
.order-env__name {
  min-height: 1.3em;    /* the blank line stays when no name is typed */
  font-size: var(--fs-body);
  line-height: 1.3;
  color: var(--black);
  overflow-wrap: anywhere;
  display: -webkit-box;           /* a very long name stops at two lines inside the envelope */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ── Plan cards ── */
.order-plans { border: 0; padding: 0; margin: 0 0 .5rem; min-width: 0; }
.order-plan { position: relative; margin-bottom: .5rem; }
.order-plan__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.order-plan__card {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 72px;
  padding: .875rem 1rem;
  border: 1.5px solid var(--grey-light);
  border-radius: var(--radius-sm);
  background: var(--white);   /* no grey fill (her word, 5 Dec) */
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.order-plan__dot {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--grey-mid);
  background: var(--white);
}
.order-plan__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .125rem; }
.order-plan__name { font-weight: 700; line-height: 1.3; }
.order-plan__sub { font-size: var(--fs-small); color: var(--grey-mid); line-height: 1.3; }
.order-plan__badge {
  display: inline-block;
  margin-left: .25rem;
  padding: .125rem .625rem;
  border-radius: 100px;
  background: var(--yellow);   /* "Save 25%" (5 Dec, her word: yellow and green) */
  color: var(--black);
  font-family: var(--ff-body);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .03em;
  white-space: nowrap;
  vertical-align: .1em;
}
.order-plan__badge--shipping { background: var(--green-pale); }   /* black text on both badges, no edge (her word, 5 Dec) */
.order-plan__price { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.order-plan__amount { font-size: 1.375rem; font-variant-numeric: lining-nums; }

@media (hover: hover) {
  .order-plan__input:not(:disabled) + .order-plan__card:hover { border-color: var(--grey-mid); }
}
.order-plan__input:checked + .order-plan__card { border-color: var(--black); }
.order-plan__input:checked + .order-plan__card .order-plan__dot { background: radial-gradient(var(--black) 0 45%, var(--white) 50%); border-color: var(--black); }
.order-plan__input:focus-visible + .order-plan__card { outline: 2px solid var(--blue-focus); outline-offset: 3px; }

.order__note { color: var(--grey-mid); margin-top: 1rem; }

/* ── Review (her mock-up, 5 Dec): product image left, "Label: value" lines right, one Edit link at the top right ── */
.order-review {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  grid-template-areas: ". edit" "pic details";
  column-gap: 3.35rem;
}
.order-review__edit { grid-area: edit; justify-self: end; display: inline-flex; align-items: center; min-height: 1.5rem; margin-bottom: .75rem; font-size: var(--fs-small); color: var(--grey-mid); }   /* Edit stays 16px (measured against her mock-up); clear of the first line at every width (her word, 6 Dec: the overlap read as too close) */
.order-review__pic { grid-area: pic; align-self: start; margin-top: .375rem; }
.order-review__pic img { display: block; width: 100%; height: auto; }
.order-review__details { grid-area: details; min-width: 0; overflow-wrap: anywhere; }
.order-sum__group + .order-sum__group { margin-top: 1.5rem; }
.order-sum__line { --sum-size: .955rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: var(--sum-size); line-height: 1.63; }   /* 15.3px, measured from her mock-up (line text is 4% narrower than 16px; Edit matches 16px) */
.order-sum__label { flex: none; white-space: nowrap; color: var(--grey-mid); }   /* labels grey, values regular black (her word, 6 Dec) */
.order-sum__value { min-width: 0; text-align: right; overflow-wrap: anywhere; }   /* flush right, under Edit */
.order-sum__value span { display: block; }
.order-sum__group--money { font-variant-numeric: lining-nums; }   /* the amounts share one figure style */
/* Prices as her mock-up (6 Dec): the replaced price struck through in grey, Total price bold, Total savings green */
.order-sum__group--money .order-sum__value { font-weight: 700; }   /* the amounts bold, bar the struck-through ones (her word, 6 Dec) */
.order-sum__was { color: var(--grey-mid); font-weight: 400; text-decoration-thickness: 1px; }   /* 1px strike (her word, 6 Dec: the default read as bold, .5px too thin) */
.order-sum__line--total { margin-top: 1rem; font-weight: 700; }
.order-sum__line--total .order-sum__label { color: var(--black); }
.order-sum__line--savings { margin-top: .75rem; color: var(--green-dark); }
.order-sum__line--savings .order-sum__label { color: inherit; font-weight: 700; }   /* bold, as its amount (her word, 6 Dec) */
/* Delivery tooltip (her word, 6 Dec): a dashed underline marks the term; the bubble sits above it on hover, keyboard focus or tap */
.order-tip { position: relative; }
.order-tip__term { font: inherit; color: inherit; line-height: inherit; background: none; border: 0; padding: 0; cursor: help; text-decoration: underline dashed 1px; text-underline-offset: .2em; }
.order-tip__bubble { display: none; position: absolute; left: 0; bottom: calc(100% + .5rem); z-index: 2; width: max-content; max-width: 16rem; padding: .5rem .75rem; border-radius: 6px; background: var(--black); color: var(--white); white-space: normal; text-align: left; font-family: var(--ff-ui); font-size: .6875rem; font-weight: 500; line-height: 1.5; text-wrap: pretty; }   /* 11px Noto Sans, as the modal's hints; no lone amount on the last line */
.order-tip__bubble::before { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: .5rem; }   /* bridges the gap, so the pointer can move onto the bubble */
.order-tip__bubble::after { content: ''; position: absolute; left: 1rem; top: 100%; border: 6px solid transparent; border-top-color: var(--black); }
.order-tip:hover .order-tip__bubble, .order-tip__term:focus-visible + .order-tip__bubble, .order-tip.is-open .order-tip__bubble { display: block; }
.order-tip.is-dismissed .order-tip__bubble { display: none; }   /* Escape hides it until the pointer or focus leaves */
.order-sum__line--total .order-sum__value { font-size: 1.375rem; line-height: 1.2; }   /* the Total as big as the plan cards' amounts (22px, her word, 6 Dec), label on its baseline */
.order-sum__line--total .order-sum__small { display: inline; font-size: var(--sum-size); }   /* its cents and "/ month" as small as the other lines (her word, 6 Dec) */
@media (max-width: 520px) {   /* below this the text column gets under ~200px */
  .order-review { grid-template-columns: minmax(0, 1fr); grid-template-areas: "pic" "edit" "details"; }
  .order-review__pic { justify-self: center; width: 12rem; margin-bottom: .75rem; }
}

/* Terms line, centred under the review step's button (her yes, 6 Dec) */
.order__terms { color: var(--grey-mid); text-align: center; margin-top: .75rem; }

/* Cancel order: a text link centred under the button, swapped in place for its confirm */
.order-cancel { margin-top: 1rem; text-align: center; }
.order-cancel__link { min-height: 1.5rem; font-size: var(--fs-small); color: var(--grey-mid); }   /* Edit and the cancel links grey, as the labels; red on hover still (her word, 6 Dec) */

/* Cancel order's toast (her word, 6 Dec): asks over the review step, bottom centre of the screen; black as the Delivery tooltip; stays until answered */
.order-toast { position: fixed; z-index: 10; left: 50%; bottom: 1.5rem; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 1.5rem; row-gap: .25rem; width: max-content; max-width: calc(100% - 2rem); padding: .625rem .75rem .625rem 1.25rem; border-radius: 6px; background: var(--black); color: var(--white); box-shadow: 0 4px 20px rgba(0,0,0,.25); font-family: var(--ff-ui); font-size: var(--fs-menu); font-weight: 500; line-height: 1.4; text-align: left; }
.order-toast__text { margin: 0; }
.order-toast__buttons { display: flex; gap: .5rem; margin-left: auto; }
.order-toast__btn { font: inherit; font-weight: 600; color: inherit; background: none; border: 0; min-height: 2rem; padding: .25rem .5rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.order-toast__btn:focus-visible { outline-color: var(--blue-focus-pale); }   /* the ring for dark grounds */
@media (hover: hover) { .order-toast__btn:hover { text-decoration-thickness: 2px; } }
@media (prefers-reduced-motion: no-preference) {
  .order-toast { animation: order-toast-in .2s ease-out; }
  @keyframes order-toast-in { from { opacity: 0; transform: translate(-50%, .5rem); } }
}

/* ── Buttons ── */
.order__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.order__next { width: 100%; justify-content: center; }
.order-step[data-step="thanks"] .order__actions { margin-top: 0; }
.order-backdrop .btn:hover { transform: none; }   /* the order flow keeps its buttons still on hover */

/* ── Printed gift card ── */
.order-print { display: none; }

/* ── Phones: a full-screen sheet ── */
@media (max-width: 640px) {
  .order-backdrop { padding: 0; align-items: stretch; }
  .modal--order {
    width: 100%;
    max-height: none;
    height: 100dvh;
    border-radius: 0;
  }
}
@media (max-width: 480px) {
  .order-row { grid-template-columns: 1fr; }
  .order-step__title { font-size: 1.5rem; }
}
@media (max-width: 359px) {
  .order__steps { gap: .25rem; }
  .order__dot { width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .order-backdrop, .modal--order, .order-plan__card, .order__dot { transition: none; }
}

@media print {
  body > *:not(#orderBackdrop) { display: none !important; }
  .order-backdrop { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; opacity: 1; visibility: visible; display: block; }
  .modal--order { box-shadow: none; transform: none; max-height: none; overflow: visible; width: auto; background: none; }
  .order__head, .order__form { display: none !important; }
  .order-print {
    display: block;
    width: 14cm;
    margin: 2cm auto 0;
    padding: 1.5cm;
    border: 1px solid var(--black);
    text-align: center;
    color: var(--black);
    background: var(--white);
  }
  .order-print__line { font-size: 20pt; line-height: 1.4; }
  .order-print__from { font-size: 14pt; margin-top: 1cm; }
  .order-print__from:empty { display: none; }
}

/* ── Country type-ahead (combobox + listbox), her yes 5 Dec ── */
.order-combo__list {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: -1.5px;
  right: -1.5px;
  list-style: none;
  background: var(--white);
  border: 1.5px solid var(--grey-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: .25rem 0;
  cursor: default;
}
.order-combo__option,
.order-combo__empty {
  position: relative;
  min-height: 40px;
  padding: .5rem 2.75rem .5rem 1rem;
  display: flex;
  align-items: center;
  font-size: 1.0625rem;
  line-height: 1.3;
  cursor: pointer;
}
.order-combo__option[aria-selected="true"] { background: var(--cream); }
.order-combo__empty { color: var(--grey-mid); cursor: default; }
.order-combo__option.is-chosen::after {   /* a small green tick on the chosen country */
  content: "";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  width: 5px;
  height: 10px;
  margin-top: -7px;
  border: solid var(--green);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
