/* Shared shop purchase controls. Enqueued only for the existing journey previews.
   Layout and product data remain in their owning modules; checkout is excluded. */

/* 1. Approved visual values: edit these together. */
:where(#dm-discovery, #dm-bundle-host, body.page-id-111983) {
  --dm-commerce-orange:#e09f3e;
  --dm-commerce-green:#c2d783;
  --dm-commerce-text:#f5f0e6;
  --dm-commerce-ink:#17190f;
  --dm-commerce-price-size:28px;
  --dm-commerce-circle:52px;
  --dm-commerce-button-height:48px;
}
/* The editable home page keeps its layout; bridge its existing tokens to this palette. */
body.page-id-111983 {
  --dm-home-price-color:var(--dm-commerce-green) !important;
  --dm-home-price-size:var(--dm-commerce-price-size) !important;
  --dm-home-button-color:var(--dm-commerce-orange) !important;
  --dm-home-button-height:var(--dm-commerce-button-height) !important;
  --dm-home-button-text-size:15px !important;
}
body.page-id-111983 #syrups .dm-woo-size-widget:has(.dm-size-radio-2:checked) .dm-option-2,
body.page-id-111983 #syrups .dm-woo-size-widget:has(.dm-size-radio-4:checked) .dm-option-4,
body.page-id-111983 #syrups .dm-woo-size-widget:has(.dm-size-radio-8:checked) .dm-option-8 {
  background:var(--dm-commerce-orange) !important;
  border-color:var(--dm-commerce-orange) !important;
}

/* 2. The Divi child theme declares p { font-size:inherit !important }.
   Override only product prices, never paragraphs globally. */
#dm-discovery .dm-collection-price,
#dm-discovery .dm-recipe-feature .dm-bottle-price,
#dm-bundle-host .dm-purchase-controls .dm-mini-price strong,
#dm-bundle-host .dm-confidence > strong,
#dm-bundle-host .dm-starting-price > strong,
#dm-bundle-host .dm-starting-price > strong span {
  color:var(--dm-commerce-green) !important;
  font-family:Outfit, "Avenir Next", Arial, sans-serif !important;
  font-size:var(--dm-commerce-price-size) !important;
  font-weight:700 !important;
  line-height:1.2 !important;
  letter-spacing:0 !important;
  font-variant-numeric:lining-nums tabular-nums;
}
#dm-bundle-host [data-total],
#dm-bundle-host [data-mobile-total],
#dm-bundle-host .dm-visual-review .dm-total strong {
  color:var(--dm-commerce-green); font-weight:700;
  font-variant-numeric:lining-nums tabular-nums;
}

/* 3. Circular bottle-size choices, as on the shop home page. */
#dm-discovery .dm-bottle-sizes,
#dm-bundle-host .dm-builder-sizes { display:flex; flex-wrap:nowrap; gap:8px; margin:0; }
#dm-discovery .dm-bottle-sizes button,
#dm-bundle-host .dm-builder-sizes button {
  display:inline-flex; align-items:center; justify-content:center;
  flex:0 0 var(--dm-commerce-circle); width:var(--dm-commerce-circle);
  height:var(--dm-commerce-circle); min-width:var(--dm-commerce-circle);
  min-height:var(--dm-commerce-circle); padding:0; box-sizing:border-box;
  border:1px solid #8c7950; border-radius:50%; background:transparent;
  color:var(--dm-commerce-text); font:400 16px/1 Outfit, "Avenir Next", Arial, sans-serif;
  cursor:pointer;
}
#dm-discovery .dm-bottle-sizes button[aria-pressed="true"],
#dm-bundle-host .dm-builder-sizes button[aria-pressed="true"] {
  background:var(--dm-commerce-orange); border-color:var(--dm-commerce-orange);
  color:var(--dm-commerce-ink); font-weight:700;
}
#dm-discovery .dm-bottle-sizes button:focus-visible,
#dm-bundle-host .dm-builder-sizes button:focus-visible {
  outline:2px solid var(--dm-commerce-text); outline-offset:3px;
}

/* 4. Purchase actions share a height and type scale; their container owns width. */
#dm-discovery .dm-bottle-add,
#dm-discovery .dm-set-submit,
#dm-bundle-host .dm-card-add,
#dm-bundle-host .dm-primary-button {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:var(--dm-commerce-button-height); box-sizing:border-box;
  padding:10px 18px; border:1px solid var(--dm-commerce-orange); border-radius:4px;
  background:var(--dm-commerce-orange); color:var(--dm-commerce-ink);
  font:700 15px/1.2 Outfit, "Avenir Next", Arial, sans-serif; text-align:center;
}
#dm-discovery .dm-bottle-add:disabled,
#dm-discovery .dm-set-submit:disabled,
#dm-bundle-host .dm-card-add:disabled,
#dm-bundle-host .dm-primary-button:disabled { opacity:.45; cursor:not-allowed; }

/* Match the home page's compact circles on smaller phones. */
@media(max-width:420px) {
  :where(#dm-discovery, #dm-bundle-host) { --dm-commerce-circle:46px; }
}
@media(max-width:360px) {
  :where(#dm-discovery, #dm-bundle-host) { --dm-commerce-circle:44px; }
}
