/* Spartacus Protein – scoped mobile improvements, 2026-10-16 */
/* Keep all desktop layout unchanged. */
@media screen and (max-width: 767px) {
  /* Prevent the Elementor / JetBlocks header mini-cart from widening Arabic articles. */
  #jet-theme-core-header {
    max-width: 100%;
    overflow-x: clip;
  }

  /* Images and article content stay inside the phone viewport. */
  .entry-content img,
  .elementor-widget-theme-post-content img,
  .woocommerce div.product div.images img {
    max-width: 100%;
    height: auto;
  }
  .entry-content,
  .woocommerce-product-details__short-description,
  .elementor-widget-theme-post-content {
    overflow-wrap: anywhere;
  }
  .entry-content pre,
  .entry-content table,
  .entry-content .wp-block-table {
    max-width: 100%;
    overflow-x: auto;
  }

  /* Spartacus AI chat: better phone usability and iOS input zoom prevention. */
  #spai-root { left: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  #spai-box { width: min(365px, calc(100vw - 24px)); max-height: min(520px, 77dvh); }
  #spai-messages { min-height: 0; }
  #spai-input { font-size: 16px !important; }
  #spai-open, #spai-send, #spai-close { min-height: 44px; }
}
@media screen and (max-width: 359px) {
  #spai-root { left: 8px; bottom: max(8px, env(safe-area-inset-bottom)); }
  #spai-box { width: calc(100vw - 16px); }
  #spai-open { padding: 10px 14px; }
}

/* Optional, unchecked conversation-review consent within the existing chat. */
#spai-root .spai-review-consent {
  display:flex;
  align-items:flex-start;
  gap:8px;
  padding:7px 12px;
  background:#fff;
  color:#334155;
  font-size:11px;
  line-height:1.5;
  cursor:pointer;
}
#spai-root .spai-review-consent input {
  flex:0 0 17px;
  width:17px;
  height:17px;
  margin:2px 0 0;
}
@media (max-width:767px) {
  #spai-root .spai-review-consent { font-size:12px; }
  .woocommerce div.product form.cart .single_add_to_cart_button {
    min-height:44px;
    max-width:100%;
  }
  .woocommerce-checkout input[type="text"],
  .woocommerce-checkout input[type="email"],
  .woocommerce-checkout input[type="tel"],
  .woocommerce-checkout select,
  .woocommerce-checkout textarea {
    font-size:16px !important;
    max-width:100%;
  }
  .entry-content table { display:block; max-width:100%; overflow-x:auto; }
  .entry-content pre { max-width:100%; overflow-x:auto; }
}
