/* Agossa v4.7 — compact checkout header, real field rhythm, sticky summary
 * controls, scrollable product list, and checkout-only footer removal support.
 * Loaded last so older commerce layers cannot reintroduce the spacing issues.
 */
:root{
  --ag47-soft:#f7f5f2;
  --ag47-line:#e5e2de;
  --ag47-ink:#171716;
  --ag47-muted:#77736d;
}

/* Checkout owns the full viewport. Remove theme/header wrapper residue that can
 * create a blank band above the dedicated checkout bar. */
body.woocommerce-checkout{margin:0!important;padding:0!important;background:#fff!important}
body.woocommerce-checkout>.header,
body.woocommerce-checkout>.mobile-header,
body.woocommerce-checkout .container-fluid.header,
body.woocommerce-checkout .container-fluid.mobile-header{display:none!important;height:0!important;min-height:0!important;margin:0!important;padding:0!important;overflow:hidden!important}
body.woocommerce-checkout .site-main,
body.woocommerce-checkout main.site-main,
body.woocommerce-checkout .woocommerce,
body.woocommerce-checkout .woocommerce-checkout{margin-top:0!important;padding-top:0!important}

/* Slim checkout-only header. */
body.woocommerce-checkout .agossa-checkout-topbar{height:60px!important;min-height:60px!important;margin:0!important;padding:0!important}
body.woocommerce-checkout .agossa-checkout-topbar-inner{height:60px!important;width:min(calc(100% - 40px),1260px)!important}
body.woocommerce-checkout .agossa-checkout-logo img{max-height:30px!important;max-width:138px!important}
body.woocommerce-checkout .agossa-checkout-back{width:34px!important;height:34px!important}
body.woocommerce-checkout .agossa-checkout-back svg{width:20px!important;height:20px!important}
body.woocommerce-checkout .agossa-checkout-left,
body.woocommerce-checkout .agossa-checkout-right{padding-top:20px!important}

/* Form rhythm — use a real two-column grid instead of depending on WooCommerce
 * floats. Every row has visible breathing room and wide fields span both cols. */
body.woocommerce-checkout .agossa-checkout-primary-fields{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  column-gap:14px!important;
  row-gap:14px!important;
  align-items:start!important;
}
body.woocommerce-checkout .agossa-checkout-primary-fields>.form-row{
  width:auto!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
  float:none!important;
  min-width:0!important;
}
body.woocommerce-checkout .agossa-checkout-primary-fields>.form-row-wide{grid-column:1/-1!important}
body.woocommerce-checkout .agossa-checkout-primary-fields>.form-row-first{grid-column:1!important}
body.woocommerce-checkout .agossa-checkout-primary-fields>.form-row-last{grid-column:2!important}
body.woocommerce-checkout #billing_first_name_field{grid-column:1!important}
body.woocommerce-checkout #billing_last_name_field{grid-column:2!important}
body.woocommerce-checkout #billing_address_1_field,
body.woocommerce-checkout #billing_email_field,
body.woocommerce-checkout .agossa-phone-shell,
body.woocommerce-checkout #billing_corporate_invoice_field,
body.woocommerce-checkout #billing_company_field{grid-column:1/-1!important}
body.woocommerce-checkout #billing_state_field{grid-column:1!important}
body.woocommerce-checkout #billing_city_field{grid-column:2!important}
body.woocommerce-checkout #billing_tax_office_field{grid-column:1!important}
body.woocommerce-checkout #billing_tax_no_field{grid-column:2!important}
body.woocommerce-checkout .agossa-phone-shell{
  width:100%!important;
  margin:0!important;
  min-width:0!important;
}
body.woocommerce-checkout .agossa-corporate-toggle-row,
body.woocommerce-checkout #billing_corporate_invoice_field{margin:0!important}
body.woocommerce-checkout .agossa-corporate-field[hidden]{display:none!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}

/* Keep notes/payment separated from the customer fields without oversized gaps. */
body.woocommerce-checkout .woocommerce-additional-fields{margin-top:24px!important}
body.woocommerce-checkout .agossa-checkout-payment{margin-top:26px!important;padding-top:24px!important}
body.woocommerce-checkout .agossa-checkout-actions-bottom{display:none!important}

/* Desktop order summary: one viewport-height surface. Products are the only
 * scrolling region; coupon and monetary totals remain visible underneath. */
@media (min-width:981px){
  body.woocommerce-checkout .agossa-checkout-layout{
    min-height:calc(100vh - 60px)!important;
    background:linear-gradient(to right,#fff 0,#fff 55%,var(--ag47-soft) 55%,var(--ag47-soft) 100%)!important;
  }
  body.woocommerce-checkout .agossa-checkout-layout::after{background:var(--ag47-soft)!important}
  body.woocommerce-checkout .agossa-checkout-right{
    min-height:calc(100vh - 60px)!important;
    padding-bottom:20px!important;
    background:var(--ag47-soft)!important;
  }
  body.woocommerce-checkout .agossa-order-summary{
    position:sticky!important;
    top:14px!important;
    height:calc(100vh - 88px)!important;
    max-height:calc(100vh - 88px)!important;
    overflow:hidden!important;
  }
  body.woocommerce-checkout .agossa-review-order,
  body.woocommerce-checkout .woocommerce-checkout-review-order-table{
    display:flex!important;
    flex-direction:column!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.woocommerce-checkout .agossa-review-products{
    flex:1 1 auto!important;
    min-height:150px!important;
    max-height:none!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    scrollbar-width:thin!important;
    scrollbar-color:#b6b1aa transparent!important;
    padding:0 9px 10px 0!important;
    margin-right:-9px!important;
  }
  body.woocommerce-checkout .agossa-review-products::-webkit-scrollbar{width:5px!important}
  body.woocommerce-checkout .agossa-review-products::-webkit-scrollbar-track{background:transparent!important}
  body.woocommerce-checkout .agossa-review-products::-webkit-scrollbar-thumb{background:#b6b1aa!important;border-radius:99px!important}
  body.woocommerce-checkout .agossa-review-coupon,
  body.woocommerce-checkout .agossa-review-totals{flex:0 0 auto!important;background:var(--ag47-soft)!important}
  body.woocommerce-checkout .agossa-review-coupon{padding-top:14px!important}
  body.woocommerce-checkout .agossa-review-totals{padding-bottom:2px!important}
}

/* Summary hierarchy: VAT directly above grand total. */
body.woocommerce-checkout .agossa-review-tax-row{
  margin-top:8px!important;
  padding:13px 0 8px!important;
  border-top:1px solid var(--ag47-line)!important;
}
body.woocommerce-checkout .agossa-review-tax-row span,
body.woocommerce-checkout .agossa-review-tax-row strong{font-weight:550!important;color:#55514b!important}
body.woocommerce-checkout .agossa-review-total{
  margin-top:4px!important;
  padding:14px 0 0!important;
  border-top:1px solid var(--ag47-line)!important;
}
body.woocommerce-checkout .agossa-review-tax-note{display:none!important}

/* No decorative footer/feature panels on checkout. PHP also avoids rendering
 * them, while wp_footer() remains present for payment gateway scripts. */
body.woocommerce-checkout .agossa-footer-feature-panels-area,
body.woocommerce-checkout .agossa-footer-icons-area,
body.woocommerce-checkout .desktop-footer,
body.woocommerce-checkout .mobile-footer,
body.woocommerce-checkout .site-footer,
body.woocommerce-checkout footer{display:none!important}

@media (max-width:980px){
  body.woocommerce-checkout .agossa-checkout-topbar,
  body.woocommerce-checkout .agossa-checkout-topbar-inner{height:58px!important;min-height:58px!important}
  body.woocommerce-checkout .agossa-checkout-right{padding-top:18px!important}
  body.woocommerce-checkout .agossa-review-products{max-height:360px!important;overflow-y:auto!important;padding-right:5px!important;scrollbar-width:thin!important}
}
@media (max-width:560px){
  body.woocommerce-checkout .agossa-checkout-topbar,
  body.woocommerce-checkout .agossa-checkout-topbar-inner{height:54px!important;min-height:54px!important}
  body.woocommerce-checkout .agossa-checkout-topbar-inner{width:calc(100% - 24px)!important}
  body.woocommerce-checkout .agossa-checkout-logo img{max-height:27px!important;max-width:126px!important}
  body.woocommerce-checkout .agossa-checkout-left{padding-top:18px!important}
  body.woocommerce-checkout .agossa-checkout-primary-fields{grid-template-columns:1fr!important;row-gap:12px!important;column-gap:0!important}
  body.woocommerce-checkout .agossa-checkout-primary-fields>.form-row,
  body.woocommerce-checkout #billing_first_name_field,
  body.woocommerce-checkout #billing_last_name_field,
  body.woocommerce-checkout #billing_state_field,
  body.woocommerce-checkout #billing_city_field,
  body.woocommerce-checkout #billing_tax_office_field,
  body.woocommerce-checkout #billing_tax_no_field{grid-column:1!important;width:100%!important}
  body.woocommerce-checkout .agossa-review-products{max-height:300px!important}
}
