/* Force full-page mobile width and prevent zoom */
html, body {
  max-width: 100% !important;
  overflow-x: hidden !important;
  /* zoom: 1 !important; */  /* Commented out */
  margin: 0 !important;
  padding: 0 !important;
}

/* Fix container and block layout scaling */
@media (max-width: 768px) {
  .container,
  .site,
  .wp-site-blocks,
  .entry-content,
  .wp-block-group,
  .wp-block-columns {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 15px !important;
    box-sizing: border-box !important;
  }
}

/* Fix large tables from causing horizontal scroll */
table, .wp-block-table {
  width: 100% !important;
  display: block;
  overflow-x: auto;
}

/* Normalize image sizes site-wide */
img {
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
  /* object-fit: contain; */ /* Optional: remove if causing issues */
}

/* Fix Cover block hero images and background scaling */
.wp-block-cover,
.wp-block-cover-image {
  height: auto !important;
  min-height: unset !important;
  aspect-ratio: 16 / 9 !important;
  padding: 0 !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  overflow: hidden !important;
}

.wp-block-cover img,
.wp-block-cover-image img {
  width: 100% !important;
  height: auto !important;
  max-height: 100% !important;
  object-fit: cover !important;
}

/* WooCommerce mobile product gallery: full-width images and larger thumbnails */
@media (max-width: 768px) {
  body.single-product .wp-site-blocks,
  body.single-product .wp-site-blocks > .wp-block-group.woocommerce.product {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.single-product main.wp-block-group {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.single-product main > .wp-block-columns {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    gap: 24px !important;
  }

  body.single-product main > .wp-block-columns > .wp-block-column:first-child,
  body.single-product .wp-block-woocommerce-product-image-gallery,
  body.single-product .woocommerce-product-gallery {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.single-product .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  body.single-product .woocommerce-product-gallery .flex-control-thumbs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 8px !important;
  }

  body.single-product .woocommerce-product-gallery .flex-control-thumbs li {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
  }

  body.single-product .woocommerce-product-gallery .flex-control-thumbs img {
    width: 100% !important;
    aspect-ratio: 4 / 3;
    object-fit: cover !important;
  }
}
/* WooCommerce listing buttons: readable and consistent */
body.archive.woocommerce ul.products li.product .button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 44px !important;
  margin: 14px 0 0 !important;
  padding: 11px 10px !important;
  box-sizing: border-box !important;
  border: 2px solid #e7b83e !important;
  border-radius: 6px !important;
  background: #e7b83e !important;
  color: #111 !important;
  font-size: 0 !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-decoration: none !important;
}
body.archive.woocommerce ul.products li.product .button::after {
  content: "View Available Parts";
  color: #111 !important;
  font-size: 15px !important;
  line-height: 1.25 !important;
  letter-spacing: 0.01em !important;
}
body.archive.woocommerce ul.products li.product .button:hover,
body.archive.woocommerce ul.products li.product .button:focus {
  background: #f4cd66 !important;
  border-color: #f4cd66 !important;
}
@media (max-width: 768px) {
  body.archive.woocommerce ul.products li.product .woocommerce-loop-product__title {
    min-height: 4.2em;
  }
}

/* Block-based WooCommerce product listing buttons */
body.archive.woocommerce .wc-block-product-template .wc-block-components-product-button__button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 44px !important;
  margin: 14px 0 0 !important;
  padding: 11px 8px !important;
  box-sizing: border-box !important;
  border: 2px solid #e7b83e !important;
  border-radius: 6px !important;
  background: #e7b83e !important;
  color: #111 !important;
  font-size: 0 !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-decoration: none !important;
}
body.archive.woocommerce .wc-block-product-template .wc-block-components-product-button__button::after {
  content: "View Available Parts";
  color: #111 !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
}
body.archive.woocommerce .wc-block-product-template .wc-block-components-product-button__button:hover,
body.archive.woocommerce .wc-block-product-template .wc-block-components-product-button__button:focus {
  background: #f4cd66 !important;
  border-color: #f4cd66 !important;
}
@media (max-width: 768px) {
  body.archive.woocommerce .wc-block-product-template .wp-block-post-title {
    min-height: 4.2em;
  }
}

/* Related-product buttons on individual product pages */
body.single-product.woocommerce .wc-block-product-template .wc-block-components-product-button__button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 44px !important;
  margin: 14px 0 0 !important;
  padding: 11px 8px !important;
  box-sizing: border-box !important;
  border: 2px solid #e7b83e !important;
  border-radius: 6px !important;
  background: #e7b83e !important;
  color: #111 !important;
  font-size: 0 !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-decoration: none !important;
}
body.single-product.woocommerce .wc-block-product-template .wc-block-components-product-button__button::after {
  content: "View Available Parts";
  color: #111 !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
}
body.single-product.woocommerce .wc-block-product-template .wc-block-components-product-button__button:hover,
body.single-product.woocommerce .wc-block-product-template .wc-block-components-product-button__button:focus {
  background: #f4cd66 !important;
  border-color: #f4cd66 !important;
}
