/* MessageCard Boutique v2.9 — central-column width fix (Zen Cart 2.1.0)
 * Applies ONLY to cart, checkout, login and customer-account pages.
 * Zen Cart responsive_classic computes a narrower colXXX center when side columns
 * are enabled; expanding the inner .centerColumn alone cannot change that width.
 * No checkout, payment, customer or database behavior is changed.
 */

/* Identify only transaction / account pages. Do not affect homepage, catalog,
   product details or general informational pages. */
body.tpl_messagecard:has(:is(
  #shoppingCartDefault, #loginDefault, #createAcctDefault,
  #checkoutShipping, #checkoutPayment, #checkoutConfirmDefault,
  #checkoutSuccess, #checkoutShipAddressDefault, #checkoutPayAddressDefault,
  #accountDefault, #accountHistoryDefault, #accountHistInfo,
  #accountEditDefault, #addressBookDefault, #addressBookProcessDefault,
  #accountPassword, #accountNewslettersDefault, #accountNotificationsDefault
)) #contentMainWrapper {
  display: flow-root !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

/* Old responsive_classic template allocates widths for a side-box column even
   when that column has no visible boxes. On checkout/account pages, hide those
   sidebar columns and let the real center column use the available width. */
body.tpl_messagecard:has(:is(
  #shoppingCartDefault, #loginDefault, #createAcctDefault,
  #checkoutShipping, #checkoutPayment, #checkoutConfirmDefault,
  #checkoutSuccess, #checkoutShipAddressDefault, #checkoutPayAddressDefault,
  #accountDefault, #accountHistoryDefault, #accountHistInfo,
  #accountEditDefault, #addressBookDefault, #addressBookProcessDefault,
  #accountPassword, #accountNewslettersDefault, #accountNotificationsDefault
)) #contentMainWrapper > div:not(:has(> .centerColumn)) {
  display: none !important;
}

/* Take the fixed-width colXXX wrapper out of float/column grid layout.
   Keep the existing individual page design and padding inside .centerColumn. */
body.tpl_messagecard #contentMainWrapper > div:has(> :is(
  #shoppingCartDefault, #loginDefault, #createAcctDefault,
  #checkoutShipping, #checkoutPayment, #checkoutConfirmDefault,
  #checkoutSuccess, #checkoutShipAddressDefault, #checkoutPayAddressDefault,
  #accountDefault, #accountHistoryDefault, #accountHistInfo,
  #accountEditDefault, #addressBookDefault, #addressBookProcessDefault,
  #accountPassword, #accountNewslettersDefault, #accountNotificationsDefault
)) {
  box-sizing: border-box !important;
  display: block !important;
  float: none !important;
  clear: both !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

/* Enlarge and center the page contents, respecting the original v2.5–v2.8
   per-page styling. Avoid global .centerColumn overrides. */
body.tpl_messagecard #contentMainWrapper > div > :is(
  #shoppingCartDefault, #loginDefault, #createAcctDefault,
  #checkoutShipping, #checkoutPayment, #checkoutConfirmDefault,
  #checkoutSuccess, #checkoutShipAddressDefault, #checkoutPayAddressDefault,
  #accountDefault, #accountHistoryDefault, #accountHistInfo,
  #accountEditDefault, #addressBookDefault, #addressBookProcessDefault,
  #accountPassword, #accountNewslettersDefault, #accountNotificationsDefault
) {
  box-sizing: border-box !important;
  float: none !important;
  clear: both !important;
  width: 100% !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Small screens: keep enough space for controls; tables that need horizontal
   scroll retain their existing v2.8 scroll wrappers. */
@media (max-width: 700px) {
  body.tpl_messagecard #contentMainWrapper > div:has(> :is(
    #shoppingCartDefault,#loginDefault,#createAcctDefault,
    #checkoutShipping,#checkoutPayment,#checkoutConfirmDefault,#checkoutSuccess,
    #accountDefault,#accountHistoryDefault,#accountHistInfo,
    #accountEditDefault,#addressBookDefault,#addressBookProcessDefault,#accountPassword
  )) { width: 100% !important; }
}
