/* Cart/checkout presentation only. No payment, order or consent behaviour. */
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-header-context { display: none !important; }
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-header .bacb-purchase-help { margin-left: auto; position: relative; flex-shrink: 1; min-width: 0; }
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-header .bacb-purchase-help > summary {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  min-height: 44px; padding: 8px 0; font-size: 17px; font-weight: 600;
  line-height: 1.35; cursor: pointer; list-style: none; text-align: right;
}
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-help > summary::-webkit-details-marker { display: none; }
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-help > summary::after {
  content: '' !important; display: block; flex: 0 0 7px; width: 7px; height: 7px;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin: -4px 3px 0 0;
}
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-help[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-help-content { z-index: 110; }

body.woocommerce-checkout .bacb-checkout-progress {
  position: sticky; top: var(--wp-admin--admin-bar--height,0px); z-index: 85;
  width: 100%; box-sizing: border-box; background: #fff; color: #293b40;
  border-block: 1px solid #dce0d7; font: 400 16px/1.4 'Source Sans 3',sans-serif;
}
body.woocommerce-checkout .bacb-checkout-progress ol {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px;
  max-width: 1240px; margin: 0 auto; padding: 12px clamp(20px,4vw,48px); list-style: none;
}
body.woocommerce-checkout .bacb-checkout-progress li { min-width: 0; margin: 0; padding: 0; list-style: none; }
body.woocommerce-checkout .bacb-checkout-progress-link {
  display: flex; align-items: center; gap: 10px; min-height: 48px;
  padding: 6px 10px; border: 1px solid #dce0d7; border-radius: 7px;
  color: #293b40; background: #fff; text-decoration: none;
}
body.woocommerce-checkout .bacb-checkout-progress-number {
  display: flex; justify-content: center; align-items: center; flex: 0 0 28px;
  width: 28px; height: 28px; border: 1px solid currentColor; border-radius: 50%; font-weight: 600;
}
body.woocommerce-checkout .bacb-checkout-progress-copy { min-width: 0; }
body.woocommerce-checkout .bacb-checkout-progress-label { display: block; font-weight: 600; }
body.woocommerce-checkout .bacb-checkout-progress-state { display: block; font-size: 12px; line-height: 1.4; }
body.woocommerce-checkout .bacb-checkout-progress-link[data-state=complete] { color: #2e603a; background: #f0f6ef; border-color: #88aa8b; }
body.woocommerce-checkout .bacb-checkout-progress-link[data-state=error] { color: #92342e; background: #fff4f2; border-color: #c9958e; }
body.woocommerce-checkout .bacb-checkout-progress-link:focus-visible { outline: 3px solid #9baf76; outline-offset: 3px; }
body.woocommerce-checkout :is(#bacb-checkout-contact-heading,#bacb-checkout-delivery-heading,#bacb-purchase-payment-heading) {
  scroll-margin-top: calc(120px + var(--wp-admin--admin-bar--height,0px));
}

/* Full table width for shipping: the native inputs, labels and amounts remain. */
body.woocommerce-cart.page-id-16 .bacb-purchase-page .cart_totals table.shop_table > :is(tbody,tfoot) { display: block; width: 100%; }
body.woocommerce-cart.page-id-16 .bacb-purchase-page .cart_totals table.shop_table tr {
  display: grid; grid-template-columns: minmax(0,1fr) auto; width: 100%;
}
body.woocommerce-cart.page-id-16 .bacb-purchase-page .cart_totals table.shop_table tr > :is(th,td) { width: auto !important; min-width: 0; }
body.woocommerce-cart.page-id-16 .bacb-purchase-page .cart_totals table.shop_table tr:has(>td[colspan="2"]) > td { grid-column: 1 / -1; }
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page table.shop_table tr.woocommerce-shipping-totals {
  display: block !important; width: 100%; padding: 12px 0; border-bottom: 1px solid #dce0d7;
}
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page table.shop_table tr.woocommerce-shipping-totals > :is(th,td) {
  display: block !important; width: 100% !important; padding: 0 !important; border: 0; text-align: left;
}
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page table.shop_table tr.woocommerce-shipping-totals > th { margin-bottom: 4px; }
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page table.shop_table .woocommerce-shipping-methods li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; width: 100%; padding: 2px 0;
}
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page table.shop_table .woocommerce-shipping-methods input[type=radio] {
  flex: 0 0 17px; width: 17px; height: 17px; margin: 0; accent-color: #677348;
}
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page table.shop_table #shipping_method label,
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page table.shop_table tr.woocommerce-shipping-totals .woocommerce-shipping-methods li > label {
  display: flex !important; flex: 1 1 0%; align-items: baseline; justify-content: space-between;
  gap: 6px 12px; min-width: 0; min-height: 44px; padding-block: 10px; box-sizing: border-box;
  font-size: 14px; line-height: 1.4; white-space: normal !important; text-align: left;
}
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page .bacb-shipping-service { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page .bacb-shipping-price { flex: 0 0 auto; text-align: right; }
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page .bacb-shipping-price .woocommerce-Price-amount { white-space: nowrap; }
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page .bacb-shipping-price .tax_label { display: block; font-size: 11px; }

/* A grid tbody keeps the item name and metadata out of the price column. */
body.woocommerce-checkout .bacb-purchase-page .bacb-purchase-checkout-grid--numbered table.woocommerce-checkout-review-order-table > :is(tbody,tfoot) {
  display: block; width: 100%;
}
body.woocommerce-checkout .bacb-purchase-page .bacb-purchase-checkout-grid--numbered table.woocommerce-checkout-review-order-table tr {
  display: grid; grid-template-columns: minmax(0,1fr) auto; width: 100%;
}
body.woocommerce-checkout .bacb-purchase-page .bacb-purchase-checkout-grid--numbered table.woocommerce-checkout-review-order-table tr.cart_item {
  display: flex; flex-direction: column; padding-block: 14px; border-bottom: 1px solid #dce0d7;
}
body.woocommerce-checkout .bacb-purchase-page .bacb-purchase-checkout-grid--numbered table.woocommerce-checkout-review-order-table tr.cart_item > td {
  display: block; width: 100% !important; max-width: none; min-width: 0; padding: 0; border: 0; box-sizing: border-box;
}
body.woocommerce-checkout .bacb-purchase-page .bacb-purchase-checkout-grid--numbered table.woocommerce-checkout-review-order-table tr.cart_item > td.product-total { padding-top: 6px; text-align: right; }
body.woocommerce-checkout .bacb-purchase-page .bacb-purchase-checkout-grid--numbered table.woocommerce-checkout-review-order-table .bacb-purchase-review-item {
  display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 12px; width: 100%;
}
body.woocommerce-checkout .bacb-purchase-page .bacb-purchase-review-details { min-width: 0; overflow-wrap: break-word; }
body.woocommerce-checkout .bacb-purchase-page .bacb-purchase-review-details dl.variation { display: block; }
body.woocommerce-checkout .bacb-purchase-page .bacb-purchase-review-details dl.variation :is(dt,dd,dd p) { margin-left: 0; }
body.woocommerce-checkout .bacb-purchase-page td.product-name > dl.variation { display: block; width: 100%; white-space: normal; }
body.woocommerce-checkout .bacb-purchase-page td.product-name > dl.variation :is(dt,dd,dd p) { display: inline; float: none; margin: 0; font-weight: 400; }
body.woocommerce-checkout .bacb-purchase-page .bacb-purchase-checkout-grid--numbered table.woocommerce-checkout-review-order-table tr:has(>td[colspan="2"]) > td { grid-column: 1 / -1; }

/* Reduce row gaps only inside address forms; leave section introductions alone. */
body.woocommerce-checkout .bacb-purchase-page :is(.woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper) p.form-row { margin-bottom: 9px; }
body.woocommerce-checkout .bacb-purchase-page .bacb-purchase-optional-field { margin-bottom: 7px; }

/* Hide basket promotional messages, never the gateway payment controls. */
body.woocommerce-cart .bacb-purchase-page :is(#payment-method-message,.ppcp-messages) { display: none !important; }
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page .bacb-code-explanation {
  display: block; color: #53656b; font-size: 13px; font-weight: 400; line-height: 1.45; text-align: left;
}
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page details.bacb-purchase-coupon > summary {
  position: relative; display: block !important; padding-right: 24px;
}
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page details.bacb-purchase-coupon > summary::after { position: absolute; top: 8px; right: 0; }
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-page details.bacb-purchase-coupon > summary .bacb-code-explanation { margin-top: 6px; }
body.woocommerce-checkout .bacb-purchase-page .woocommerce-form-coupon-toggle > .bacb-code-explanation { margin: -10px 0 16px; }

@media (max-width: 767px) {
  body.woocommerce-checkout .bacb-checkout-progress ol { gap: 6px; padding: 8px 12px; }
  body.woocommerce-checkout .bacb-checkout-progress-link { gap: 6px; align-items: flex-start; padding: 7px; min-height: 74px; }
  body.woocommerce-checkout .bacb-checkout-progress-number { flex-basis: 22px; width: 22px; height: 22px; font-size: 12px; }
  body.woocommerce-checkout .bacb-checkout-progress-label { font-size: 13px; line-height: 1.3; }
  body.woocommerce-checkout .bacb-checkout-progress-state { margin-top: 3px; font-size: 11px; }
  body.woocommerce-checkout .bacb-purchase-page .bacb-purchase-checkout-grid--numbered:has(#bacb-purchase-show-items:not(:checked)) table.woocommerce-checkout-review-order-table tr.cart_item { display: none; }
}
@media (max-width: 479px) {
  body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-header { gap: 14px; }
  body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-header .bacb-purchase-help > summary { font-size: 15px; max-width: 205px; }
  body.woocommerce-checkout .bacb-checkout-progress-link { flex-direction: column; gap: 5px; min-height: 104px; }
  body.woocommerce-checkout :is(#bacb-checkout-contact-heading,#bacb-checkout-delivery-heading,#bacb-purchase-payment-heading) { scroll-margin-top: calc(154px + var(--wp-admin--admin-bar--height,0px)); }
}


/* Match the shop's green interaction colour in either order-control layout. */
body.woocommerce-checkout .bacb-persistent-order .bacb-persistent-order__button:is(:hover,:focus-visible):not(:disabled) {
  background-color: var(--bde-button-primary-background-color-hover,#b0b83b);
  border-color: var(--bde-button-primary-background-color-hover,#b0b83b);
  color: #293b40; filter: none;
}
/* Keep the open help panel above the sticky checkout navigation. */
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-header .bacb-purchase-help[open] .bacb-purchase-help-content { z-index: 120; }
/* Improve visibility without changing the review invitation or consent choice. */
body.woocommerce-checkout .bacb-purchase-page p.cr-customer-consent label { font-size: 14px !important; font-weight: 500 !important; line-height: 1.5 !important; }
body:is(.woocommerce-cart,.woocommerce-checkout) .bacb-purchase-header .bacb-purchase-help[open] > summary::after { transform: rotate(225deg) !important; margin-top: 4px; }

/* Restore the native checkout coupon form in its own disclosure, outside
   the purchase form. The stronger selector supersedes the old hidden rule. */
body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon {
  display: block; margin: 0 0 24px; padding: 16px 20px;
  border: 1px solid #dce0d7; border-radius: 8px; background: #fafbf7;
}
body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon > summary { cursor: pointer; min-height: 44px; font-weight: 500; }
body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon[open] > form#woocommerce-checkout-form-coupon {
  display: block !important; margin: 16px 0 0; padding: 0; border: 0; background: transparent;
}
/* Only the orphaned promotional panel, never a PayPal payment control. */
body.woocommerce-checkout .bacb-purchase-page #order_review > .ppcp-messages { display: none !important; }
/* Completed receipt steps are confirmation text, not links to resubmit. */
body.woocommerce-order-received .bacb-checkout-progress--confirmed { position: static; margin: 0 0 24px; }
body.woocommerce-order-received .bacb-checkout-progress--confirmed ol { padding-inline: 0; }

body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon > summary { list-style: none; }
body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon > summary::-webkit-details-marker { display: none; }
body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon > summary::after { content: '+'; font-size: 18px; }
body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon[open] > summary::after { content: '−'; }
body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon[open] > form#woocommerce-checkout-form-coupon { display: grid !important; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: end; }
body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon form#woocommerce-checkout-form-coupon p.form-row { float: none !important; width: auto !important; margin: 0 !important; }
body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon input[name=coupon_code] { width: 100%; min-height: 48px; box-sizing: border-box; }
body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon button[name=apply_coupon] { min-height: 48px; padding: 12px 20px; white-space: normal; }
body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon form .clear { display: none; }
@media(max-width:479px) {
  body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon[open] > form#woocommerce-checkout-form-coupon { grid-template-columns: minmax(0,1fr); }
  body.woocommerce-checkout .bacb-purchase-page details.bacb-checkout-coupon button[name=apply_coupon] { width: 100%; }
}
