/* Follow the OS directly, including changes while a checkout is open. */
html:has(#checkout-page) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  html:has(#checkout-page) {
    color-scheme: dark;
    background-color: #151716;
  }

  body:has(#checkout-page) {
    background-color: #151716;
    color: #f4f4f0;
  }

  #checkout-page .checkout-section {
    background-color: #151716;
  }

  #checkout-page .checkout-section.details {
    background-color: #1b1e1c;
  }

  #checkout-page h1,
  #checkout-page h2 {
    color: #f4f4f0;
  }

  #checkout-page #checkout-payment-type,
  #checkout-page #checkout-loader-container > div {
    color: #bdc5be;
  }

  #checkout-page #quantity {
    color-scheme: dark;
    background-color: #2c332e;
    color: #f4f4f0;
    border-color: #69776c;
  }

  #checkout-page #quantity:focus-visible,
  #checkout-page a:focus-visible {
    outline: 2px solid #d3c4ea;
    outline-offset: 3px;
  }

  /* This seller's Classic iframe keeps its light branding even with the dark
     option. Give its transparent background a light surface, without changing
     the iframe, payment state, provider settings, or layout dimensions. */
  #checkout-page .checkout-container:has(iframe) {
    color-scheme: light;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 0 20px #fff;
  }
}
