/* Miklahon QA – checkout, cart, mini-cart and simulator fixes */

/* C-02: the theme appends an English " (optional)" after labels that already say (אופציונלי) */
html body.woocommerce-checkout .form-row:not(.validate-required) label::after,
html body.woocommerce-checkout .form-row.validate-required label::after { content: none !important; }

/* C-03 / F-08: Israel-only store – the country row is not shown */
.woocommerce .form-row.mqa-hidden-row,
.woocommerce-checkout .form-row.mqa-hidden-row { display: none !important; }

/* C-07: error icon sits at the top-right corner, text starts after it (RTL) */
html body .woocommerce-error.woocommerce-error,
html body .woocommerce-message.woocommerce-message,
html body .woocommerce-info.woocommerce-info { position: relative; }
html body.rtl .woocommerce-error.woocommerce-error { padding-right: 52px !important; }
html body.rtl .woocommerce-error.woocommerce-error::before {
  top: 16px !important; right: 18px !important; left: auto !important;
  margin-top: 0 !important; transform: none !important;
}

/* F-08: one message per field. WooCommerce's inline copy duplicates the theme's message under each field */
.woocommerce-checkout .form-row .checkout-inline-error-message { display: none !important; }
/* field errors are listed under each field; the banner shows one summary line instead (see JS) */
.woocommerce-NoticeGroup-checkout .woocommerce-error li.mqa-field-err { display: none; }
.woocommerce-NoticeGroup-checkout .woocommerce-error li.mqa-summary { font-weight: 600; }

/* C-10: the single shipping method is information, not a control */
.woocommerce-cart .woocommerce-shipping-methods li,
.woocommerce-checkout .woocommerce-shipping-methods li {
  border: 0 !important; background: none !important; padding: 0 !important; margin: 0 !important;
  display: block !important; cursor: default !important;
}
.woocommerce-cart .woocommerce-shipping-methods label,
.woocommerce-checkout .woocommerce-shipping-methods label { font-size: 14px !important; font-weight: 600 !important; }
.woocommerce-cart .woocommerce-shipping-destination { display: none !important; }
.mqa-ship-note { display: block; margin-top: 4px; font-size: 13px; font-weight: 400; color: #555; line-height: 1.45; }

/* C-13: sizes such as 77-79 never break across lines */
.mqa-nw { white-space: nowrap; unicode-bidi: isolate; }

@media (max-width: 1024px) {
  /* C-20: mini-cart tap targets ≥ 44px */
  .cart-widget-side .woocommerce-mini-cart-item .remove,
  .cart-widget-side .remove_from_cart_button {
    width: 44px !important; height: 44px !important;
    display: inline-flex !important; align-items: center; justify-content: center;
  }
  .cart-widget-side .quantity input.minus,
  .cart-widget-side .quantity input.plus,
  .cart-widget-side .quantity .minus,
  .cart-widget-side .quantity .plus { min-width: 44px !important; width: 44px !important; height: 44px !important; }
  .cart-widget-side .quantity input.qty { width: 48px !important; height: 44px !important; font-size: 16px !important; }
  .cart-widget-side .wd-heading .close-side-widget a,
  .cart-widget-side .close-side-widget a { display: inline-flex !important; align-items: center; min-height: 44px; padding: 0 12px !important; }

  /* C-23: checkout order summary – no iOS zoom, 44px steppers */
  .woocommerce-checkout-review-order-table .quantity input.qty,
  #order_review .quantity input.qty { font-size: 16px !important; height: 44px !important; width: 52px !important; }
  .woocommerce-checkout-review-order-table .quantity .minus,
  .woocommerce-checkout-review-order-table .quantity .plus,
  #order_review .quantity .minus,
  #order_review .quantity .plus { min-width: 44px !important; width: 44px !important; height: 44px !important; }
  #order_review .remove, .woocommerce-checkout-review-order-table .remove {
    width: 44px !important; height: 44px !important; display: inline-flex !important; align-items: center; justify-content: center;
  }
  /* all checkout inputs at 16px to stop iOS zoom */
  .woocommerce-checkout .form-row input.input-text,
  .woocommerce-checkout .form-row textarea { font-size: 16px !important; }
}

/* C-41: on phones the WhatsApp bubble covered the simulator's "חזור" button; the simulator has its own contact form */
@media (max-width: 767px) {
  body.mqa-sim-page .joinchat { display: none !important; }
}

/* C-43: simulator lead form – 16px inputs (no iOS zoom), visible focus */
.sp-sim-form input, .sp-sim-form textarea, .sp-sim-form select { font-size: 16px !important; }
.sp-sim-form label { cursor: pointer; }

/* ===== Round 2 ===== */

/* C-14: on phones, no floating WhatsApp bubble over the cart/checkout totals (the header phone icon is there),
   and room at the bottom so the back-to-top circle never sits on the last button */
@media (max-width: 1024px) {
  body.woocommerce-cart .joinchat, body.woocommerce-checkout .joinchat { display: none !important; }
  body.woocommerce-cart .main-page-wrapper, body.woocommerce-checkout .main-page-wrapper { padding-bottom: 90px; }
}

/* C-24: checkout field labels readable (was #9CA3AF = 2.5:1, now #4B5563 = 7.6:1). The labels sit inside the fields and act as placeholders. */
html body.woocommerce-checkout .form-row label,
html body.woocommerce-checkout .form-row label .optional { color: #4b5563 !important; }
html body.woocommerce-checkout .form-row label .required { color: #b42318 !important; }
