/* Checkout and the order confirmation. Loaded after main.css and shop.css on checkout.php and order-confirmation.php
   only; tokens, buttons, notices and the header come from those files. */

/* Where the customer is in the journey */
.checkout__head { align-items: flex-end; }
.steps { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 0 0 10px; padding: 0; list-style: none; font-size: 14.5px; color: var(--muted); }
.steps li { display: flex; align-items: center; }
.steps li + li::before { content: ""; width: 7px; height: 7px; margin: 0 12px 0 10px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; rotate: 45deg; opacity: 0.55; }
.steps a { color: var(--blue); font-weight: 700; text-underline-offset: 3px; }
.steps [aria-current] { color: var(--navy); font-weight: 800; }
.steps .is-done { color: var(--navy); }

/* Page layout: the form, with the order beside it on wide screens and above it on narrow ones */
.checkout__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: clamp(22px, 3.4vw, 52px); align-items: start; }
.checkout__form { display: grid; gap: 16px; min-width: 0; }
.co-card { padding: clamp(20px, 2.6vw, 30px); background: var(--white); box-shadow: 0 16px 44px -34px rgba(6, 42, 92, 0.6); }
.co-card h2 { display: flex; align-items: center; gap: 14px; font-size: clamp(23px, 2.4vw, 28px); }
.co-card__lead { margin: 8px 0 20px; color: var(--muted); font-size: 15.5px; }
.co-step {
  position: relative; isolation: isolate; flex: none;
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  color: var(--white); font: italic 800 18px/1 var(--display);
}
.co-step::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--navy); transform: skewX(calc(var(--slant) * -1)); }
.co-free { color: #1a7a3b; font-weight: 800; }

/* Fields */
.fields { display: grid; gap: 18px; max-width: 620px; transition: opacity 0.2s; }
.fields__pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 190px); gap: 16px; align-items: start; }
.field label, .field__label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 15px; color: var(--ink); }
.field__optional { margin-left: 4px; font-weight: 500; font-size: 13px; color: var(--muted); }
.field input, .field textarea {
  display: block; width: 100%; min-height: 50px; padding: 11px 14px;
  border: 2px solid rgba(6, 42, 92, 0.24); border-radius: 0; background: var(--white);
  font: inherit; font-size: 16px; color: var(--text, var(--ink));
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
.field input:hover, .field textarea:hover { border-color: rgba(6, 42, 92, 0.42); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--sky); }
.field__hint { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.field__error { margin-top: 6px; padding-left: 22px; font-size: 14px; font-weight: 700; color: #a32417; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23a32417'/%3E%3Cpath d='M8 4v5' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11.7' r='1.1' fill='%23fff'/%3E%3C/svg%3E") left 2px / 15px no-repeat; }
.field__error[hidden] { display: none; }
.field.has-error input, .field.has-error textarea { border-color: #c0392b; background: #fff8f7; }
.field--fixed p { padding: 11px 0 0; font-weight: 600; }
.field--fixed .field__label { margin-bottom: 0; }
/* Once a payment form is open the details are part of that order: they are shown but not editable until it closes. */
.checkout__form.is-paying .fields { opacity: 0.55; pointer-events: none; }

/* Payment */
.pay__total {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 16px;
  margin: 18px 0 18px; padding: 16px 20px; background: var(--navy); color: var(--white);
}
.pay__total span { font-weight: 700; font-size: 16px; }
.pay__total b { grid-row: span 2; align-self: center; font: italic 800 clamp(30px, 3.6vw, 40px)/1 var(--display); color: var(--sun); }
.pay__total small { font-size: 13.5px; color: #cfddf2; }
.pay__lead { margin: 0 0 16px; max-width: 60ch; color: var(--muted); font-size: 15px; }
.pay__options { display: grid; gap: 12px; max-width: 440px; }
.pay__options[hidden], .pay__lead[hidden], .pay__wait[hidden], .pay__resolve[hidden], .pay__message[hidden], .pay__loading[hidden] { display: none; }
/* PayPal's own controls: the card button's box is given the full width; its form opens inside it, under the button. */
.pay__options paypal-button, .pay__options paypal-basic-card-container, .pay__options paypal-basic-card-button { display: block; width: 100%; }
.pay__options paypal-button[hidden], .pay__options paypal-basic-card-container[hidden] { display: none; }
.pay__options paypal-button { --paypal-button-border-radius: 0; min-height: 48px; }
.pay__loading, .pay__wait { display: flex; align-items: center; gap: 12px; padding: 14px 0; font-weight: 700; color: var(--navy); }
.pay__message { margin: 0 0 16px; padding: 14px 18px; background: #ffd7d1; color: #7a1d14; font-weight: 600; }
.pay__message--info { background: var(--sky); color: var(--navy); }
.pay__message:focus { outline: none; }
.pay__resolve { padding: 18px 20px; background: var(--sky); color: var(--navy); }
.pay__resolve p { margin: 0 0 14px; font-weight: 700; max-width: 56ch; }
.pay__resolve-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.pay__resolve-actions [hidden] { display: none; }
.pay button.btn { border: 0; cursor: pointer; }
.spinner { flex: none; width: 22px; height: 22px; border: 3px solid rgba(10, 95, 196, 0.22); border-top-color: var(--blue); border-radius: 50%; animation: co-spin 0.8s linear infinite; }
@keyframes co-spin { to { rotate: 360deg; } }

/* The order beside the form */
.osum { position: sticky; top: calc(var(--head) + 16px); min-width: 0; }
.osum__box { padding: 22px 24px; background: var(--white); box-shadow: 0 16px 44px -34px rgba(6, 42, 92, 0.6); }
.osum__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.osum__title { font: italic 800 26px/1.1 var(--display); color: var(--navy); }
/* The fold's button exists on narrow screens only; beside the form the order is always shown. */
.osum__toggle { display: none; align-items: center; gap: 10px; padding: 8px 0 8px 8px; border: 0; background: none; font: inherit; font-size: 15px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.osum__toggle b { color: var(--navy); font-size: 17px; }
.osum__toggle::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2.5px solid var(--navy); border-bottom: 2.5px solid var(--navy); rotate: 45deg; translate: 0 -3px; transition: rotate 0.2s, translate 0.2s; }
.osum__box.is-open .osum__toggle::after { rotate: -135deg; translate: 0 3px; }
.osum__lines { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.osum__lines li { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.osum__lines img, .osum__noimg { width: 72px; height: 54px; object-fit: cover; background: var(--sky); }
.osum__name { font-weight: 700; line-height: 1.25; color: var(--navy); }
.osum__meta, .osum__qty { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.osum__price { font-weight: 700; white-space: nowrap; }
.osum__totals { display: grid; gap: 10px; margin: 18px 0 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.osum__totals div { display: flex; justify-content: space-between; gap: 12px; font-size: 15.5px; }
.osum__totals dd { margin: 0; font-weight: 600; }
.osum__free, .osum__saved dd { color: #1a7a3b; }
.osum__total { padding-top: 12px; border-top: 1px solid var(--line); font-size: 20px; font-weight: 800; }
.osum__total dd { font: italic 800 28px/1 var(--display); color: var(--blue); }

@media (max-width: 899px) {
  .checkout__grid { grid-template-columns: minmax(0, 1fr); }
  .osum { position: static; order: -1; }
  .osum__box { padding: 12px 18px; }
  .osum__box.is-open { padding-bottom: 18px; }
  .osum__toggle { display: inline-flex; }
  .osum__box:not(.is-open) .osum__body { display: none; }
  .osum__title { font-size: 21px; }
  .osum__lines { margin-top: 12px; }
  .steps { margin-bottom: 0; }
}
@media (max-width: 520px) {
  .fields__pair { grid-template-columns: minmax(0, 1fr); }
  .co-card h2 { gap: 11px; }
  .pay__options { max-width: none; }
}

/* Order confirmation */
.receipt__hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 22px; align-items: center; padding: clamp(22px, 3vw, 34px); background: var(--navy); color: var(--white); }
.receipt__tick { grid-row: span 2; width: clamp(54px, 6vw, 72px); height: clamp(54px, 6vw, 72px); }
.receipt__hero h1 { color: var(--white); font-size: clamp(30px, 4.4vw, 56px); }
.receipt__hero p { color: #cfddf2; font-size: 17px; max-width: 62ch; }
.receipt__ref { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 0; padding: 18px clamp(22px, 3vw, 34px); background: var(--sun); color: var(--ink); }
.receipt__ref div { display: grid; gap: 2px; }
.receipt__ref dt { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.receipt__ref dd { margin: 0; font: italic 800 24px/1.1 var(--display); }
.receipt__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.receipt__side { display: grid; gap: 16px; }
.receipt .co-card h2 { font-size: 23px; margin-bottom: 14px; }
.receipt__lines { margin: 0; padding: 0; list-style: none; }
.receipt__lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.receipt__lines li:first-child { padding-top: 0; }
.receipt__lines b { color: var(--navy); }
.receipt__lines small { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.receipt__lines span { font-weight: 700; white-space: nowrap; }
.receipt .osum__totals { margin: 0; padding-top: 14px; border-top: 0; }
.receipt address { font-style: normal; line-height: 1.5; }
.receipt__facts { display: grid; gap: 12px; margin: 0; }
.receipt__facts dt { font-size: 13px; font-weight: 700; color: var(--muted); }
.receipt__facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.receipt__next { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 24px; }
.receipt__next button.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; cursor: pointer; }
.receipt__keep { margin-top: 16px; font-size: 15px; color: var(--muted); max-width: 70ch; }
@media (max-width: 860px) {
  .receipt__grid { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .top, .menu, .foot, .skip, .receipt__next, .toast { display: none !important; }
  body { background: #fff; }
  .co-card { box-shadow: none; border: 1px solid #ccd; }
  .receipt__hero, .receipt__ref { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
