/*
 * Checkout styles. Served with SRI; no inline style is allowed by the CSP. The appearance of the
 * cashing front (colours, radius, font) comes from `/theme.css` as custom properties; the values
 * below are the defaults (tokens of AUD-GO §16.2).
 */
:root {
  color-scheme: light;
  --text: #3b3933;
  --muted: #6b6860;
  --background: #fffdf5;
  --surface: #ffffff;
  --primary: #ff8329;
  --primary-hover: #ff6b00;
  --field-background: #f2efe3;
  --field-border: #efebdd;
  --danger: #b42318;
  --radius: 16px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --heading-font: var(--font);
  --header-background: var(--background);
  --summary-background: var(--surface);
  --footer-background: var(--background);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--background);
  line-height: 1.5;
}

.site-header,
.site-footer,
.checkout,
.card,
.test-notice {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.test-notice {
  color: var(--danger);
  font-weight: 600;
}

.card {
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  margin-top: 24px;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 16px;
}

h2 {
  font-size: 1.125rem;
  margin: 0 0 12px;
}

h3 {
  font-size: 1rem;
  margin: 0 0 8px;
}

p {
  margin: 0 0 8px;
}

.trust li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust li::before {
  content: '';
  width: 16px;
  height: 16px;
  flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23555'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.back-to-cart {
  margin-bottom: 16px;
}

.back-to-cart a {
  color: inherit;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.875rem;
}

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

@media (min-width: 900px) {
  .columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.summary,
.contact,
.discount-entry,
.member,
.payment,
.option,
.cms-b-thank-you-summary__section,
.cms-b-thank-you-upsell__option {
  background: var(--surface);
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.lines,
.cms-b-thank-you-summary__lines {
  list-style: none;
  margin: 0;
  padding: 0;
}

.line,
.cms-b-thank-you-summary__line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--field-border);
}

/* Thumbnail of the article on the left (Shopify's checkout): title and quantity beside it. */
.line:has(> .line-image) {
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
}

.line-image {
  grid-row: 1 / span 2;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  background: var(--surface);
}

.line:has(> .line-image) > .line-title,
.line:has(> .line-image) > .line-quantity {
  grid-column: 2;
}

.line:has(> .line-image) > .line-total {
  grid-column: 3;
}

.line-title,
.cms-b-thank-you-summary__line-title {
  overflow-wrap: anywhere;
}

.line-quantity,
.cms-b-thank-you-summary__line-quantity {
  color: var(--muted);
  font-size: 0.875rem;
}

.line-total,
.cms-b-thank-you-summary__line-total {
  grid-column: 2;
  grid-row: 1;
  font-weight: 600;
}

.variant,
.cms-b-thank-you-summary__variant {
  color: var(--muted);
}

.totals,
.cms-b-thank-you-summary__totals {
  margin: 12px 0 0;
}

.total-row,
.cms-b-thank-you-summary__total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
}

.total-row dt,
.total-row dd,
.cms-b-thank-you-summary__total dt,
.cms-b-thank-you-summary__total dd {
  margin: 0;
}

.grand-total,
.cms-b-thank-you-summary__total {
  font-weight: 700;
  font-size: 1.125rem;
}

.tax,
.discount {
  color: var(--muted);
  font-size: 0.875rem;
}

.field {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.field-row {
  display: grid;
  gap: 12px;
}

@media (min-width: 480px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

label {
  font-size: 0.875rem;
  font-weight: 600;
}

input,
select {
  font: inherit;
  color: inherit;
  padding: 10px 12px;
  border: 1px solid var(--field-border);
  border-radius: calc(var(--radius) / 2);
  background: var(--field-background);
  width: 100%;
}

/* Logos of the card brands the payment session accepts (shapes of the brands, never a text). */
.card-brands {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.card-brands img {
  display: block;
}

.card-fields {
  min-height: 220px;
  margin-bottom: 12px;
}

/* Apple Pay and Google Pay: the frame of the orchestrator, unusable until the terms are accepted. */
.wallets {
  margin-bottom: 16px;
}

.wallet-frame[inert] {
  opacity: 0.5;
}

.wallets-hint,
.wallets-or {
  margin: 8px 0 0;
  font-size: 0.875rem;
  text-align: center;
}

/* Billing address apart from the delivery address (lot Q6): the same by default. */
.billing {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0 0 12px;
  min-width: 0;
}

.billing legend {
  padding: 0;
  margin-bottom: 4px;
  font-size: 0.875rem;
  font-weight: 600;
}

.billing-choice {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 400;
}

.billing-choice input {
  width: auto;
}

.terms {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.terms input {
  width: auto;
  margin-top: 4px;
}

button,
.button {
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius);
  padding: 12px 20px;
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-block;
}

.primary,
.cms-b-thank-you-upsell__accept {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.primary:hover:not(:disabled),
.cms-b-thank-you-upsell__accept:hover:not(:disabled) {
  background: var(--primary-hover);
}

.secondary,
.button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--field-border);
}

.link,
.cms-b-thank-you-upsell__decline {
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  padding: 8px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.notice,
.cms-b-thank-you-upsell__notice {
  color: var(--danger);
  font-weight: 600;
}

.form-message,
.cms-b-thank-you-upsell__message {
  color: var(--muted);
}

/* Thank-you design: the « continue shopping » link drawn as the main button. */
.cms-b-thank-you-continue-button .button {
  background: var(--primary);
  color: #ffffff;
  border-color: transparent;
  font-weight: 700;
}

.option-actions,
.cms-b-thank-you-upsell__actions {
  display: grid;
  gap: 8px;
}

.order-number strong,
.cms-b-thank-you-order-number__number strong {
  font-size: 1.25rem;
  letter-spacing: 0.05em;
}

.beacon {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.site-footer {
  color: var(--muted);
  font-size: 0.875rem;
}

.legal ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.legal a,
.support a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* Details typed at the cart (R56): a summary, the fields behind « Modifier ». */
.contact-recap {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.contact-recap div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 8px;
}

.contact-recap dt {
  color: var(--muted, inherit);
}

.contact-recap dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.contact-edit > summary {
  display: inline-block;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  text-decoration: underline;
}

.contact-edit > summary::-webkit-details-marker {
  display: none;
}

.contact-edit[open] > summary {
  margin-bottom: 12px;
}

/* Discount codes (K9): field and button on one row, codes applied as tags (like Shopify). */
.discount-entry__row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.discount-entry__row > .field {
  flex: 1;
  margin-bottom: 0;
}

.discount-codes {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.discount-code {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: var(--field-border);
  border-radius: var(--radius);
  padding: 4px 8px;
  font-size: 0.875rem;
}

.discount-code__tag {
  font-weight: 600;
}

.discount-code__remove {
  background: none;
  border: 0;
  padding: 0 2px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: inherit;
}

.discount-code__note {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
}

/*
 * Settings of the checkout editor (Shopify's « Personnaliser › Checkout »): the header and the
 * footer take the whole width with their own background, their content stays in the column;
 * position and size of the logo, alignment of the footer, font of the titles.
 */
.site-header,
.site-footer {
  max-width: none;
  padding-left: max(16px, calc((100% - 1040px) / 2 + 16px));
  padding-right: max(16px, calc((100% - 1040px) / 2 + 16px));
}

.site-header {
  background: var(--header-background);
}

.site-header--center {
  justify-content: center;
}

.site-header--right {
  justify-content: flex-end;
}

.brand-logo {
  display: block;
  width: auto;
  max-width: 240px;
  height: auto;
  max-height: 40px;
}

.brand-logo--small {
  max-height: 28px;
}

.brand-logo--large {
  max-height: 64px;
}

.site-footer {
  background: var(--footer-background);
}

.site-footer--center {
  text-align: center;
}

.site-footer--right {
  text-align: right;
}

.site-footer--center .legal ul {
  justify-content: center;
}

.site-footer--right .legal ul {
  justify-content: flex-end;
}

.summary {
  background: var(--summary-background);
}

h1,
h2,
.brand {
  font-family: var(--heading-font);
}

/* Canvas of the checkout editor: the place of the card fields of the payment platform. */
.card-fields--preview {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 16px;
  color: var(--muted);
  text-align: center;
  background: var(--field-background);
  border: 1px dashed var(--field-border);
  border-radius: var(--radius);
}
