/**
 * Mobile checkout overflow and uppercase mobile menu labels.
 * Plugin 1.2.5. Overrides theme nowrap on checkout review-table
 * last cells, WP Responsive Menu capitalize, and collapsed address details.
 */

/* Checkout: keep the page and review table inside the viewport on phones. */
@media (max-width: 800px) {
  body.woocommerce-checkout #bs-commerce,
  body.woocommerce-checkout form.woocommerce-checkout,
  body.woocommerce-checkout #order_review,
  body.woocommerce-checkout .woocommerce-checkout-review-order,
  body.woocommerce-checkout .woocommerce-checkout-review-order-table,
  body.woocommerce-checkout .bs-order-panel {
    max-width: 100%;
    min-width: 0;
  }

  body.woocommerce-checkout #bs-commerce table.woocommerce-checkout-review-order-table,
  body.woocommerce-checkout table.woocommerce-checkout-review-order-table {
    table-layout: fixed;
    width: 100% !important;
    max-width: 100%;
  }

  body.woocommerce-checkout #bs-commerce table.woocommerce-checkout-review-order-table th,
  body.woocommerce-checkout #bs-commerce table.woocommerce-checkout-review-order-table td,
  body.woocommerce-checkout #bs-commerce table.woocommerce-checkout-review-order-table td:last-child,
  body.woocommerce-checkout table.woocommerce-checkout-review-order-table td:last-child,
  body.woocommerce-checkout #bs-commerce .bs-shipping-value {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
  }

  /* Keep the total price on one line once labels are allowed to wrap. */
  body.woocommerce-checkout #bs-commerce table.woocommerce-checkout-review-order-table .order-total td,
  body.woocommerce-checkout table.woocommerce-checkout-review-order-table .order-total td {
    white-space: nowrap !important;
  }

  body.woocommerce-checkout #bs-commerce ul.woocommerce-shipping-methods,
  body.woocommerce-checkout #bs-commerce ul.woocommerce-shipping-methods li,
  body.woocommerce-checkout #bs-commerce ul.woocommerce-shipping-methods label,
  body.woocommerce-checkout ul.woocommerce-shipping-methods label {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    min-width: 0;
  }
}

/* Mobile menus: every label uppercase, including WP Responsive Menu. */
#mg-wprm-wrap li.menu-item a,
#mg-wprm-wrap li.menu-item,
#wprmenu_menu_ul li a,
#wprmenu_bar,
.wprmenu-container .menu-item a,
#bs-home-draft .bs-mobile-menu a,
#bs-home-draft .bs-mobile-menu summary,
#bs-home-draft .bs-mobile-menu .bs-nav-direct,
#bs-home-draft .bs-mobile-menu .bs-nav-item > summary,
#bs-home-draft .bs-mobile-menu .bs-menu-group > a,
.bs-mobile-menu a,
.bs-mobile-menu summary {
  text-transform: uppercase !important;
}


/* Checkout address form: hide the theme's + toggles. JS unwraps
   details.bs-optional-field so the fields stay in the layout; these
   rules cover the moment before that runs, and any re-wrap. */
body.woocommerce-checkout #bs-commerce details.bs-optional-field,
body.woocommerce-checkout details.bs-optional-field {
  border-bottom: 0;
  display: block;
}
body.woocommerce-checkout #bs-commerce details.bs-optional-field > summary,
body.woocommerce-checkout details.bs-optional-field > summary,
body.woocommerce-checkout #bs-commerce details.bs-optional-field > summary:after,
body.woocommerce-checkout details.bs-optional-field > summary:after {
  display: none !important;
  content: none !important;
}
body.woocommerce-checkout #bs-commerce details.bs-optional-field::details-content,
body.woocommerce-checkout details.bs-optional-field::details-content,
body.woocommerce-checkout #bs-commerce details.bs-optional-field > .form-row,
body.woocommerce-checkout details.bs-optional-field > .form-row {
  display: block !important;
}

/* Footer links in all caps, to match the mobile menu (approved).
   Leave newsletter body copy and the "Keep in the loop" heading alone. */
#bs-home-footer .bfo-link-group a,
#bs-home-footer nav.bfo-link-group a,
body:has(#bs-home-draft) .footer-container .sub-links a,
body:has(#bs-home-draft) .footer-container a.sub-links,
body:has(#bs-home-draft) .footer-container .f-left a {
  text-transform: uppercase !important;
}
