/* Priebe Staging / Design 2022 v0.6.1 - WooCommerce layout only.
   Baseline: the shop page (ID 309) had Jupiter meta _layout=left in BOTH
   the 2022-06-23 and 2025-07-18 database backups.
   Jupiter's Woo wrapper appends #mk-sidebar AFTER .theme-content in markup;
   restore visual sidebar-left layout without moving DOM nodes or widgets.
   Do not modify checkout, scripts, prices, currencies or PayPal's SDK. */

/* Shop archives: explicit left filter column, three-up product grid stays
   inside the remaining content width. The selectors intentionally exclude
   the product detail, cart and checkout views. */
@media screen and (min-width: 961px) {
  body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
    #theme-page .theme-page-wrapper:is(.left-layout, .right-layout):has(> #mk-sidebar) {
      display: flex !important;
      flex-flow: row nowrap !important;
      justify-content: space-between;
      align-items: flex-start;
      gap: 0;
  }
  body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
    #theme-page .theme-page-wrapper:is(.left-layout, .right-layout):has(> #mk-sidebar) > #mk-sidebar {
      flex: 0 0 27% !important;
      order: 0;
      width: 27% !important;
      max-width: 27% !important;
      min-width: 0 !important;
      float: none !important;
      box-sizing: border-box !important;
  }
  body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
    #theme-page .theme-page-wrapper:is(.left-layout, .right-layout):has(> #mk-sidebar) > .theme-content {
      flex: 0 0 73% !important;
      order: 1;
      width: 73% !important;
      max-width: 73% !important;
      min-width: 0 !important;
      float: none !important;
      box-sizing: border-box !important;
  }
  body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
    #theme-page .theme-page-wrapper:is(.left-layout, .right-layout):has(> #mk-sidebar) > .clearboth {
      display: none !important;
  }
}

/* Stacked mobile/tablet view: controls before results, not buried after
   many products. Same original widgets, no duplicated form controls. */
@media screen and (max-width: 960px) {
  body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
    #theme-page .theme-page-wrapper:is(.left-layout, .right-layout):has(> #mk-sidebar) {
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
  }
  body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
    #theme-page .theme-page-wrapper:is(.left-layout, .right-layout):has(> #mk-sidebar) > #mk-sidebar,
  body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
    #theme-page .theme-page-wrapper:is(.left-layout, .right-layout):has(> #mk-sidebar) > .theme-content {
      width: 100% !important;
      max-width: 100% !important;
      float: none !important;
      flex: 0 1 auto !important;
      min-width: 0 !important;
  }
  body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
    #theme-page .theme-page-wrapper:is(.left-layout, .right-layout):has(> #mk-sidebar) > #mk-sidebar {
      order: 0;
  }
  body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
    #theme-page .theme-page-wrapper:is(.left-layout, .right-layout):has(> #mk-sidebar) > .theme-content {
      order: 1;
  }
}

/* Cart: native PayPal Smart Buttons use the full width of the wrapper.
   Constrain the wrapper, NOT the cross-domain PayPal iframe or JS internals.
   The two payment options stay vertically arranged, but are no longer
   stretched across the entire 1140px cart. */
body.woocommerce-cart #theme-page .ppc-button-wrapper,
body.woocommerce-cart #theme-page #ppc-button-ppcp-gateway,
body.woocommerce-cart #theme-page #ppc-button-ppcp-cart {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 390px !important;
  margin-left: 0 !important;
  margin-right: auto !important;
}

@media screen and (max-width: 440px) {
  body.woocommerce-cart #theme-page .ppc-button-wrapper,
  body.woocommerce-cart #theme-page #ppc-button-ppcp-gateway,
  body.woocommerce-cart #theme-page #ppc-button-ppcp-cart {
    max-width: 100% !important;
  }
}

/* Child 1.0.5 – visible SELECT2 product-category widget only.
   The native #product_cat select is hidden (.select2-hidden-accessible).
   Its dimensions must not be styled: Select2 owns the visible markup. */
body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  #mk-sidebar .widget_product_categories select.dropdown_product_cat:not(.select2-hidden-accessible) {
    box-sizing: border-box !important;
    height: 38px !important;
    line-height: 36px !important;
    padding: 0 34px 0 12px !important;
    font-size: 13px !important;
}
body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  #mk-sidebar .widget_product_categories .select2-container {
    max-width: 100% !important;
}
body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  #mk-sidebar .widget_product_categories .select2-container--default .select2-selection--single {
    box-sizing: border-box !important;
    height: 38px !important;
    min-height: 38px !important;
    border: 1px solid #c9c9c9 !important;
    background-color: #fff !important;
}
body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  #mk-sidebar .widget_product_categories .select2-container--default .select2-selection--single .select2-selection__rendered {
    box-sizing: border-box !important;
    display: block !important;
    height: 36px !important;
    line-height: 36px !important;
    padding: 0 32px 0 10px !important;
    margin: 0 !important;
    color: #4b4b4b !important;
    font-size: 13px !important;
    font-weight: 400 !important;
}
body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  #mk-sidebar .widget_product_categories .select2-container--default .select2-selection--single .select2-selection__placeholder {
    display: inline !important;
    line-height: inherit !important;
    vertical-align: baseline !important;
}
body:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat, .tax-product_tag)
  #mk-sidebar .widget_product_categories .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    top: 0 !important;
    right: 4px !important;
}
