/* Agossa v4.6 — checkout spacing / corporate fields / summary height polish.
 * Loaded after v4.5 so the fixes are deterministic without disturbing the
 * established cart, archive and product-page layers.
 */
:root{--ag46-soft:#f7f5f2;--ag46-line:#e5e2de;--ag46-ink:#171716}

/* Compact the top of checkout and begin useful content sooner. */
body.woocommerce-checkout .agossa-checkout-topbar{height:72px!important;min-height:72px!important}
body.woocommerce-checkout .agossa-checkout-topbar-inner{height:72px!important}
body.woocommerce-checkout .agossa-checkout-logo img{max-height:36px!important;width:auto!important}
body.woocommerce-checkout .agossa-checkout-left{padding-top:24px!important}
body.woocommerce-checkout .agossa-checkout-right{padding-top:24px!important}

/* Inputs need breathing room; preserve the clean two-column rhythm. */
body.woocommerce-checkout .agossa-checkout-primary-fields{column-gap:14px!important;row-gap:14px!important}
body.woocommerce-checkout .agossa-checkout-primary-fields .form-row-first,
body.woocommerce-checkout .agossa-checkout-primary-fields .form-row-last{width:calc(50% - 7px)!important}
body.woocommerce-checkout .agossa-phone-shell{margin-top:0!important;margin-bottom:0!important}
body.woocommerce-checkout .agossa-corporate-toggle-row{margin-top:2px!important}
body.woocommerce-checkout .woocommerce-additional-fields{margin-top:28px!important}
body.woocommerce-checkout .agossa-checkout-payment{margin-top:30px!important}

/* Corporate invoice fields: deterministic show/hide and correct hierarchy. */
body.woocommerce-checkout .agossa-corporate-field[hidden]{display:none!important}
body.woocommerce-checkout #billing_company_field{width:100%!important;flex:0 0 100%!important}
body.woocommerce-checkout #billing_tax_office_field,
body.woocommerce-checkout #billing_tax_no_field{width:calc(50% - 7px)!important;flex:0 0 calc(50% - 7px)!important}
body.woocommerce-checkout #billing_company_field:not([hidden]),
body.woocommerce-checkout #billing_tax_office_field:not([hidden]),
body.woocommerce-checkout #billing_tax_no_field:not([hidden]){display:block!important}

/* Do not trap the order products in a short inner scroller on desktop. The
 * summary column grows with the order and the page itself scrolls naturally. */
@media (min-width:981px){
  body.woocommerce-checkout .agossa-review-products{max-height:none!important;overflow:visible!important;padding-right:0!important;scrollbar-width:auto!important}
  body.woocommerce-checkout .agossa-order-summary{position:sticky!important;top:20px!important}
}

/* Give the right canvas a little more visual room and maintain its color to
 * the viewport edge. */
body.woocommerce-checkout .agossa-checkout-layout{background:linear-gradient(to right,#fff 0,#fff 55%,var(--ag46-soft) 55%,var(--ag46-soft) 100%)!important}
body.woocommerce-checkout .agossa-checkout-layout::after{background:var(--ag46-soft)!important}
body.woocommerce-checkout .agossa-checkout-right{background:var(--ag46-soft)!important}

/* VAT belongs immediately before grand total and should read as a real summary
 * line even when WooCommerce itself did not emit tax rows. */
body.woocommerce-checkout .agossa-review-tax-row{margin-top:10px!important;padding-top:14px!important;border-top:1px solid var(--ag46-line)!important}
body.woocommerce-checkout .agossa-review-tax-row span,
body.woocommerce-checkout .agossa-review-tax-row strong{font-weight:550!important;color:#4f4c47!important}
body.woocommerce-checkout .agossa-review-total{margin-top:8px!important;padding-top:16px!important;border-top:1px solid var(--ag46-line)!important}

@media (max-width:980px){
  body.woocommerce-checkout .agossa-checkout-topbar,
  body.woocommerce-checkout .agossa-checkout-topbar-inner{height:66px!important;min-height:66px!important}
  body.woocommerce-checkout .agossa-checkout-right{padding-top:20px!important}
  body.woocommerce-checkout .agossa-review-products{max-height:none!important;overflow:visible!important;padding-right:0!important}
}
@media (max-width:560px){
  body.woocommerce-checkout .agossa-checkout-left{padding-top:20px!important}
  body.woocommerce-checkout .agossa-checkout-primary-fields{row-gap:12px!important;column-gap:0!important}
  body.woocommerce-checkout .agossa-checkout-primary-fields .form-row-first,
  body.woocommerce-checkout .agossa-checkout-primary-fields .form-row-last,
  body.woocommerce-checkout #billing_tax_office_field,
  body.woocommerce-checkout #billing_tax_no_field{width:100%!important;flex-basis:100%!important}
}
