/* WooCommerce layout repairs. Loaded after Bootstrap and the theme stylesheet. */
body.woocommerce #maincontent.middle-align {
  padding: 32px 0;
}
body.woocommerce-page #maincontent > .middle-align.container {
  padding: 32px 15px;
}
body.woocommerce #primary,
body.woocommerce #main,
body.woocommerce .bh-shop-layout > div {
  min-width: 0;
}

/* Respect the configured desktop column count, without float/first/last gaps. */
body.woocommerce #main ul.products {
  --bh-columns: 3;
  display: grid;
  grid-template-columns: repeat(var(--bh-columns), minmax(0, 1fr));
  gap: 24px;
  margin: 0 0 32px;
  padding: 0;
  clear: both;
}
body.woocommerce #main ul.products.columns-1 { --bh-columns: 1; }
body.woocommerce #main ul.products.columns-2 { --bh-columns: 2; }
body.woocommerce #main ul.products.columns-4 { --bh-columns: 4; }
body.woocommerce #main ul.products.columns-5 { --bh-columns: 5; }
body.woocommerce #main ul.products.columns-6 { --bh-columns: 6; }
body.woocommerce #main ul.products::before,
body.woocommerce #main ul.products::after {
  content: none;
}
body.woocommerce #main ul.products li.product {
  float: none;
  clear: none;
  width: auto !important; /* Supersede the legacy related-products mobile rule. */
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}
body.woocommerce #main ul.products li.product > .button {
  align-self: center;
  margin-top: auto;
  white-space: normal;
}
body.woocommerce #main ul.products li.product img {
  width: 100%;
  height: auto;
}

/* Bootstrap's .form-row and .col-* classes collide with classic WooCommerce. */
body.woocommerce-page .woocommerce form .form-row {
  display: block;
  margin-left: 0;
  margin-right: 0;
}
body.woocommerce-page .woocommerce .col2-set > .col-1,
body.woocommerce-page .woocommerce .col2-set > .col-2 {
  flex: none;
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}
body.woocommerce-page .woocommerce form .form-row .input-text,
body.woocommerce-page .woocommerce form .form-row select,
body.woocommerce-page .woocommerce form .form-row .select2-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
body.woocommerce-page #maincontent h1 {
  font-size: clamp(26px, 3.5vw, 48px);
  line-height: 1.2;
  overflow-wrap: anywhere;
  margin-bottom: 24px;
}
body.woocommerce-page #maincontent h2 {
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.3;
}
body.woocommerce.single-product #maincontent .product_title {
  font-size: clamp(26px, 3vw, 36px);
  text-align: left;
}
body.woocommerce.single-product #maincontent .product_title::before,
body.woocommerce.single-product #maincontent .product_title::after {
  content: none;
}

@media (max-width: 991px) {
  body.woocommerce #main ul.products:not(.columns-1) {
    --bh-columns: 2;
    gap: 20px;
  }
}
@media (max-width: 767px) {
  body.woocommerce #maincontent.middle-align { padding: 24px 0; }
  body.woocommerce-page #maincontent > .middle-align.container { padding: 24px 15px; }
  body.woocommerce-page #maincontent h1::before,
  body.woocommerce-page #maincontent h1::after { content: none; }
  body.woocommerce #main .woocommerce-result-count,
  body.woocommerce #main .woocommerce-ordering {
    float: none;
    width: 100%;
    margin-bottom: 16px;
  }
  body.woocommerce #main .woocommerce-ordering select { width: 100%; }
  body.woocommerce-page .woocommerce .col2-set > .col-1,
  body.woocommerce-page .woocommerce .col2-set > .col-2,
  body.woocommerce-page .woocommerce form .form-row-first,
  body.woocommerce-page .woocommerce form .form-row-last {
    float: none;
    width: 100%;
  }
  body.woocommerce-page .woocommerce .col2-set > .col-2 { margin-top: 24px; }
  body.woocommerce-page .woocommerce form .form-row .input-text,
  body.woocommerce-page .woocommerce form .form-row select { font-size: 16px; }
  body.woocommerce-page .woocommerce table.shop_table { overflow-wrap: anywhere; }
  body.woocommerce-page .woocommerce table.cart td.actions .coupon {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  body.woocommerce-page .woocommerce table.cart td.actions .coupon .input-text,
  body.woocommerce-page .woocommerce table.cart td.actions .coupon .button {
    float: none;
    width: 100%;
    margin: 0;
  }
}
@media (max-width: 479px) {
  body.woocommerce #main ul.products:not(.columns-1) { --bh-columns: 1; }
}

/* Speedy's legacy inline stylesheet uses 273/181/110px widths. Preserve its
   conditional show/hide rules and group short fields in the grid below. */
body.woocommerce-checkout.bh-speedy-selected #customer_details .form-row {
  float: none;
  clear: both;
  width: 100% !important;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 0;
  box-sizing: border-box;
}
body.woocommerce-checkout.bh-speedy-selected #customer_details label {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 6px;
  text-align: left;
}
body.woocommerce-checkout.bh-speedy-selected #customer_details input.input-text,
body.woocommerce-checkout.bh-speedy-selected #customer_details select,
body.woocommerce-checkout.bh-speedy-selected #customer_details .select2-selection--single {
  width: 100%;
  min-height: 48px;
  height: 48px !important;
  margin-left: 0 !important;
  padding: 10px 12px;
  border: 1px solid #bcbcbc;
  border-radius: 4px;
  background: #fff;
  color: #2f3a40;
  font-size: 16px;
  line-height: 26px;
  box-sizing: border-box;
}
body.woocommerce-checkout.bh-speedy-selected #customer_details .select2-container {
  width: 100% !important;
  max-width: 100%;
}
body.woocommerce-checkout.bh-speedy-selected #customer_details .select2-selection__rendered {
  display: block;
  height: 26px;
  min-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 24px;
  line-height: 26px;
}
body.woocommerce-checkout.bh-speedy-selected #customer_details .select2-selection__arrow {
  height: 46px;
  top: 1px;
}
body.woocommerce-checkout.bh-speedy-selected #billing_address_2_field > label {
  display: block !important;
  position: static !important;
  width: auto;
  height: auto;
  clip: auto;
  clip-path: none;
  overflow: visible;
  white-space: normal;
}

/* Use the whole checkout width instead of reserving a column for order notes. */
body.woocommerce-checkout.bh-speedy-selected .woocommerce #customer_details > .col-1,
body.woocommerce-checkout.bh-speedy-selected .woocommerce #customer_details > .col-2 {
  float: none;
  flex: none;
  width: 100%;
  max-width: 100%;
  padding: 0;
}
body.woocommerce-checkout.bh-speedy-selected #customer_details > .col-2,
body.woocommerce-checkout.bh-speedy-selected #customer_details > .woocommerce-additional-fields {
  clear: both;
  margin-top: 24px;
}
body.woocommerce-checkout.bh-speedy-selected .woocommerce-billing-fields__field-wrapper {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 16px;
  align-items: start;
}
body.woocommerce-checkout.bh-speedy-selected .woocommerce-billing-fields__field-wrapper::before,
body.woocommerce-checkout.bh-speedy-selected .woocommerce-billing-fields__field-wrapper::after {
  content: none;
}
body.woocommerce-checkout.bh-speedy-selected .woocommerce-billing-fields__field-wrapper > * {
  grid-column: 1 / -1;
  min-width: 0;
}
body.woocommerce-checkout.bh-speedy-selected #order_comments {
  width: 100%;
  min-height: 120px;
  box-sizing: border-box;
}
@media (min-width: 480px) {
  body.woocommerce-checkout.bh-speedy-selected .woocommerce-billing-fields__field-wrapper > .form-row {
    grid-column: span 6;
  }
  body.woocommerce-checkout.bh-speedy-selected #billing_street_number_field,
  body.woocommerce-checkout.bh-speedy-selected #billing_block_field,
  body.woocommerce-checkout.bh-speedy-selected #billing_entrance_field,
  body.woocommerce-checkout.bh-speedy-selected #billing_floor_field,
  body.woocommerce-checkout.bh-speedy-selected #billing_apartment_field {
    grid-column: span 6;
  }
}
@media (min-width: 992px) {
  body.woocommerce-checkout.bh-speedy-selected #billing_street_number_field {
    grid-column: span 4;
  }
  body.woocommerce-checkout.bh-speedy-selected #billing_block_field,
  body.woocommerce-checkout.bh-speedy-selected #billing_entrance_field,
  body.woocommerce-checkout.bh-speedy-selected #billing_floor_field,
  body.woocommerce-checkout.bh-speedy-selected #billing_apartment_field {
    grid-column: span 2;
  }
}
