/* Match the existing 540px purchase column. Provider iframes keep their own
   responsive heights and payment logic; no payment controls are replaced. */
body.storm-product-payment-layout .summary.entry-summary {
  --storm-purchase-width: 540px;
}

body.storm-product-payment-layout .storm-product-purchase-shell {
  width: 100%;
  margin-top: 28px;
}

body.storm-product-payment-layout .storm-product-purchase {
  display: grid;
  grid-template-columns: minmax(0, var(--storm-purchase-width));
  align-items: start;
  gap: 12px;
}

body.storm-product-payment-layout .storm-product-purchase > form.cart,
body.storm-product-payment-layout .storm-product-purchase > .wcpay-express-checkout-wrapper,
body.storm-product-payment-layout .storm-product-purchase > .ppc-button-wrapper,
body.storm-product-payment-layout .storm-product-purchase > .ppcp-messages,
body.storm-product-payment-layout .storm-product-purchase > .storm-wishlist-button {
  grid-column: 1;
  width: 100%;
  max-width: var(--storm-purchase-width);
  min-width: 0;
  box-sizing: border-box;
}

body.storm-product-payment-layout.woocommerce div.product .summary.entry-summary .storm-product-purchase > form.cart {
  margin: 0;
}

body.storm-product-payment-layout .storm-product-purchase > .wcpay-express-checkout-wrapper {
  margin: 0;
  background: transparent;
}

body.storm-product-payment-layout .storm-product-purchase > .ppc-button-wrapper {
  margin: 0;
  padding: 0;
  background: transparent;
  color-scheme: only light;
}

body.storm-product-payment-layout .summary.entry-summary #ppc-button-ppcp-gateway {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Prevent a light-only embedded PayPal document getting a white backplate
   from the surrounding dark colour scheme. Do not override iframe heights. */
body.storm-product-payment-layout .summary.entry-summary .ppc-button-wrapper iframe,
body.storm-product-payment-layout .summary.entry-summary .ppcp-messages iframe {
  color-scheme: only light;
  background: transparent;
}

body.storm-product-payment-layout .storm-product-purchase > .ppcp-messages {
  margin: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  color-scheme: only light;
  line-height: 1.5;
}

body.storm-product-payment-layout .storm-product-purchase > .ppcp-messages:empty {
  display: none;
}

body.storm-product-payment-layout.woocommerce div.product .summary.entry-summary .storm-product-purchase > .storm-wishlist-button {
  margin: 0;
  min-height: 48px;
  height: auto;
  gap: 12px;
}

/* WooPayments 11.1 reserves 4em even when Stripe's message iframe is empty.
   Let actual provider content set the height, retaining any real message. */
body.storm-product-payment-layout .summary.entry-summary #payment-method-message {
  height: auto;
  min-height: 0;
  margin: 0;
}

body.storm-product-payment-layout .summary.entry-summary #payment-method-message iframe {
  color-scheme: only light;
  background: transparent;
}

body.storm-product-payment-layout.woocommerce div.product .summary.entry-summary > p.price {
  margin-bottom: 8px;
}

@media (max-width: 480px) {
  body.storm-product-payment-layout .storm-product-purchase > form.cart {
    grid-template-columns: 64px minmax(0, 1fr);
  }
}

/* Dealer-only markup: compact typography matching the collection eyebrow. */
body.storm-product-payment-layout .summary.entry-summary .storm-dealer-identifiers {
  display: grid;
  width: 100%;
  max-width: var(--storm-purchase-width);
  box-sizing: border-box;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 7px 12px;
  margin: 24px 0 24px;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #101820;
}

body.storm-product-payment-layout .storm-dealer-identifiers > div {
  display: contents;
}

body.storm-product-payment-layout .storm-dealer-identifiers dt,
body.storm-product-payment-layout .storm-dealer-identifiers dd {
  margin: 0;
  font: inherit;
}

body.storm-product-payment-layout .storm-dealer-identifiers dd {
  color: inherit;
  text-align: right;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

body.storm-product-payment-layout .storm-dealer-identifiers dt {
  color: #0c57bc;
}

html[data-storm-theme="dark"] body.storm-product-payment-layout .summary.entry-summary .storm-dealer-identifiers,
html[data-storm-theme="dark"] body.storm-product-payment-layout .summary.entry-summary .storm-dealer-identifiers dd {
  color: #fff;
}

html[data-storm-theme="dark"] body.storm-product-payment-layout .storm-dealer-identifiers dt {
  color: #7ab8ff;
}

/* The selected wishlist button has a blue background in both themes. */
body.single-product.woocommerce.storm-product-payment-layout div.product div.summary.entry-summary .storm-wishlist-button.is-favorited,
body.single-product.woocommerce.storm-product-payment-layout div.product div.summary.entry-summary .storm-wishlist-button[aria-pressed="true"] {
  background: #075bc4;
  border-color: #075bc4;
  color: #fff;
}
