@media (max-width: 991px) {
  /* Scoped to the content wrapper, not html/body — hiding overflow on the
     root elements is what tends to clip mobile dropdown menus. */
  #wrapper,
  #content-wrapper,
  main {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Mobile menu fix: was previously toggled by JS with no matching CSS
     (a dead setting). Real fix: bigger tap targets and no double-tap zoom
     delay on the mobile nav, which is the usual cause of "Android/Samsung
     menu taps not registering". */
  body.mmc-menu-fix #_desktop_top_menu .menu > li > a,
  body.mmc-menu-fix #_mobile_top_menu .menu > li > a,
  body.mmc-menu-fix .js-top-menu-bottom a {
    touch-action: manipulation !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Space below callback / above review — scoped to the product page only */
  body.mmc-layout-fix #product .request-callback-wrapper,
  body.mmc-layout-fix #product .request-callback,
  body.mmc-layout-fix #product [class*="callback"] {
    margin-bottom: 24px !important;
  }

  body.mmc-layout-fix #product .product-comments-additional-info,
  body.mmc-layout-fix #product .product-comments-additional-info a,
  body.mmc-layout-fix #product .write-review,
  body.mmc-layout-fix #product [class*="write-review"] {
    margin-top: 14px !important;
    margin-bottom: 18px !important;
    display: block !important;
    line-height: 1.35 !important;
  }

  /* Purchase controls */
  body.mmc-quantity-fix #product .product-actions,
  body.mmc-quantity-fix #product .product-add-to-cart,
  body.mmc-quantity-fix #product .product-quantity {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body.mmc-quantity-fix #product .product-quantity {
    display: grid !important;
    grid-template-columns: 108px minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 14px !important;
  }

  body.mmc-quantity-fix #product .product-quantity .qty,
  body.mmc-quantity-fix #product .product-quantity .input-group,
  body.mmc-quantity-fix #product .product-quantity .bootstrap-touchspin {
    display: flex !important;
    flex-flow: row nowrap !important;
    width: 108px !important;
    min-width: 108px !important;
    max-width: 108px !important;
    height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.mmc-quantity-fix #product input#quantity_wanted,
  body.mmc-quantity-fix #product input[name="qty"],
  body.mmc-quantity-fix #product .bootstrap-touchspin input {
    flex: 0 0 70px !important;
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    height: 46px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    border: 1px solid #c9c9c9 !important;
    border-radius: 0 !important;
    text-align: center !important;
    font-size: 20px !important;
    line-height: 44px !important;
    box-sizing: border-box !important;
  }

  body.mmc-quantity-fix #product .bootstrap-touchspin .input-group-btn-vertical,
  body.mmc-quantity-fix #product .input-group-btn-vertical {
    display: flex !important;
    flex: 0 0 38px !important;
    flex-direction: column !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 46px !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  body.mmc-quantity-fix #product .bootstrap-touchspin-up,
  body.mmc-quantity-fix #product .bootstrap-touchspin-down,
  body.mmc-quantity-fix #product .input-group-btn-vertical .btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 23px !important;
    min-height: 23px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #c9c9c9 !important;
    border-left: 0 !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
  }

  body.mmc-quantity-fix #product .bootstrap-touchspin-up {
    border-bottom-width: 0 !important;
  }

  body.mmc-quantity-fix #product .product-quantity .add,
  body.mmc-quantity-fix #product .product-quantity .add-to-cart {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  body.mmc-quantity-fix #product .product-quantity .add-to-cart {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 46px !important;
    padding: 0 14px !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }

  /* Wishlist / compare: clean separate lines — scoped to the product
     actions area only, not the whole page, so unrelated elements
     elsewhere on the site that happen to share the word "compare" or
     "wishlist-button" in their class name are no longer affected. */
  body.mmc-quantity-fix #product .product-additional-info,
  body.mmc-quantity-fix #product .product-actions .product-additional-info {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 22px !important;
    overflow: visible !important;
  }

  body.mmc-quantity-fix #product .product-additional-info > *,
  body.mmc-quantity-fix #product .product-additional-info .wishlist-button-add,
  body.mmc-quantity-fix #product .product-additional-info .add-to-wishlist,
  body.mmc-quantity-fix #product .product-additional-info [class*="wishlist-button"],
  body.mmc-quantity-fix #product .product-additional-info [class*="addToWishlist"],
  body.mmc-quantity-fix #product .product-additional-info [class*="compare"] {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    float: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 8px 0 10px !important;
    white-space: normal !important;
    line-height: 1.3 !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid #e3e3e3 !important;
  }

  /* Colour controls */
  body.mmc-variant-fix .product-variants .color,
  body.mmc-variant-fix .product-variants .input-color,
  body.mmc-variant-fix .product-variants label {
    position: relative !important;
    z-index: 30 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
  }

  body.mmc-variant-fix .product-variants .mmc-colour-selected {
    outline: 3px solid #222 !important;
    outline-offset: 3px !important;
  }
}

@media (max-width: 479px) {
  body.mmc-quantity-fix #product .product-quantity {
    grid-template-columns: 100px minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body.mmc-quantity-fix #product .product-quantity .qty,
  body.mmc-quantity-fix #product .product-quantity .input-group,
  body.mmc-quantity-fix #product .product-quantity .bootstrap-touchspin {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
  }

  body.mmc-quantity-fix #product input#quantity_wanted,
  body.mmc-quantity-fix #product input[name="qty"],
  body.mmc-quantity-fix #product .bootstrap-touchspin input {
    flex-basis: 64px !important;
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
  }

  body.mmc-quantity-fix #product .bootstrap-touchspin .input-group-btn-vertical,
  body.mmc-quantity-fix #product .input-group-btn-vertical,
  body.mmc-quantity-fix #product .bootstrap-touchspin-up,
  body.mmc-quantity-fix #product .bootstrap-touchspin-down,
  body.mmc-quantity-fix #product .input-group-btn-vertical .btn {
    width: 36px !important;
    min-width: 36px !important;
  }

  body.mmc-quantity-fix #product .product-quantity .add-to-cart {
    font-size: 16px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}
