/* 40-mobile-general.css — a3 (2026-11-03): sửa trình bày mobile/tablet chung.
   Không đụng: "Đối tác chiến lược" trang chủ, mọi danh sách/thẻ bài viết. */

/* ===== Tablet + mobile (≤1024) ===== */
@media (max-width: 1024px) {
  /* iOS tự phóng to khi ô nhập < 16px — ô SĐT hero trang chủ đang 13px */
  .ld_sf_form .ld_sf_text,
  .wpcf7-form input:not([type=submit]):not([type=checkbox]):not([type=radio]),
  .wpcf7-form select, .wpcf7-form textarea { font-size: 16px !important; }

  /* Ô form CF7 cao 40px — nâng lên 48px cho dễ chạm */
  .wpcf7-form input:not([type=submit]):not([type=checkbox]):not([type=radio]),
  .wpcf7-form select { min-height: 48px; }

  /* Bài viết: chữ căn đều (justify) trên màn hẹp tạo khoảng trắng loang → căn trái */
  body.single-post .elementor-widget-theme-post-content,
  body.single-post .elementor-widget-theme-post-content :is(p, li, h1, h2, h3, h4, h5, h6, td, th) { text-align: left !important; }
  body.single-post .elementor-widget-theme-post-content p,
  body.single-post .elementor-widget-theme-post-content li { line-height: 1.65; }

  /* URL dài trong bài (nguồn tham khảo) tràn lề phải → cho xuống dòng */
  body.single-post .elementor-widget-theme-post-content a { overflow-wrap: anywhere; word-break: break-word; }

  /* Ảnh/ hình trong bài: luôn vừa khung, không méo */
  body.single-post .elementor-widget-theme-post-content img { max-width: 100%; height: auto; }
  body.single-post .elementor-widget-theme-post-content :is(figure, .wp-caption, .wp-block-image) { max-width: 100%; width: auto !important; }
  body.single-post .elementor-widget-theme-post-content :is(iframe, video, embed) { max-width: 100%; }

  /* Chân trang + menu con trong trang (Giới thiệu/Dịch vụ): link menu cao 27px, sát nhau → vùng chạm 44px */
  .elementor-location-footer .lqd-custom-menu li,
  :is([data-elementor-type=archive], [data-elementor-type=wp-page]) .elementor-widget-ld_custom_menu .lqd-custom-menu li { margin: 0 !important; }
  .elementor-location-footer .lqd-custom-menu li a,
  :is([data-elementor-type=archive], [data-elementor-type=wp-page]) .elementor-widget-ld_custom_menu .lqd-custom-menu li a { display: inline-flex; align-items: center; min-height: 44px; }
  /* Icon MXH 25px → vùng chạm 44px (giữ cỡ icon) */
  .elementor-location-footer .elementor-social-icon { width: 44px !important; height: 44px !important; display: inline-flex !important; align-items: center; justify-content: center; }

  /* Ô tìm kiếm header (hiện ở tablet) 15px → 16px, tránh iOS phóng to */
  .elementor-search-form__input { font-size: 16px !important; }

  /* Bảng (bảng giá, bảng so sánh) rộng hơn màn → cuộn ngang TRONG khung, không làm tràn trang */
  .elementor-widget-theme-post-content table,
  .elementor-widget-text-editor table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ===== Mobile (≤767) ===== */
@media (max-width: 767px) {
  /* Tiêu đề bài 42.5px chiếm 5 dòng màn hình đầu → 28px */
  body.single-post .elementor-widget-theme-post-title .elementor-heading-title { font-size: 28px !important; line-height: 1.25 !important; }
  /* H2/H3 trong bài 34px/25.5px quá to so với chữ thân 17px */
  body.single-post .elementor-widget-theme-post-content h2 { font-size: 24px !important; line-height: 1.3 !important; margin-top: 1.4em; }
  body.single-post .elementor-widget-theme-post-content h3 { font-size: 20px !important; line-height: 1.35 !important; }
  body.single-post .elementor-widget-theme-post-content h4 { font-size: 18px !important; line-height: 1.4 !important; }

  /* Ảnh đại diện tác giả 200px chiếm nửa màn → 96px */
  body.single-post .elementor-author-box__avatar img { width: 96px !important; height: 96px !important; }

  /* Nút chia sẻ 38px → 44px vùng chạm */
  .elementor-share-btn { width: 44px !important; height: 44px !important; }

  /* Breadcrumb/ thẻ chủ đề: link 27–31px → nới vùng chạm */
  .elementor-widget-ld_breadcrumb a { display: inline-block; padding: 9px 0; }
  .elementor-post-info__terms-list-item { display: inline-flex; align-items: center; min-height: 44px; }

  /* Trang thường (giới thiệu, đội ngũ…): H2 trong khối chữ 34px → 26px */
  body:not(.home) :is(.elementor-element-40fc231, .elementor-element-e4ddc6b, .elementor-element-affcaed, .elementor-element-84218e1) h2 { font-size: 26px !important; line-height: 1.25 !important; }

  /* Spacer 50px + padding khối tạo khoảng trống ~100px dưới ảnh đầu trang (giới thiệu, dịch vụ) */
  body:not(.home) .elementor-widget-slides + .elementor-widget-spacer .elementor-spacer-inner { height: 20px !important; }

  /* Header: nút "ĐẶT LỊCH KHÁM" chỉ cao 30px → 44px vùng chạm */
  .elementor-location-header .elementor-button.btn-underlined { padding-top: 14px !important; margin-top: -14px; } /* nới vùng chạm lên trên, giữ nguyên icon–chữ–gạch chân */

  /* Trang chủ: ảnh trang trí "tay vỗ" (absolute) đè lên chữ đánh giá khách → ẩn trên mobile */
  body.home .elementor-element-70a4ac49 { display: none !important; }

  /* Liên hệ: ảnh mặt tiền 100px đứng cạnh bản đồ, cột lệch → xếp chồng, full width */
  .elementor-element-d296db2 > .e-con-inner { flex-direction: column !important; }
  .elementor-element-d296db2 > .e-con-inner > .elementor-element { width: 100% !important; max-width: 100% !important; }
  .elementor-element-84a3721 img { width: 100%; height: auto; max-height: 360px; object-fit: cover; border-radius: 12px; }
  .elementor-element-6504703 iframe { width: 100% !important; height: 300px !important; }

  /* Dòng bản quyền/miễn trừ 12px, giãn dòng 1.2 dính chùm → 1.5 */
  .elementor-location-footer .elementor-element-21dd6c3e :is(p, div) { line-height: 1.5 !important; }
}

/* ===== Chỉ tablet (768–1024): header bản desktop ===== */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Ở 1024: cột header @3a53c11 không co → hàng tìm kiếm/Hotline/nút rộng 901px, trang tràn ngang 20px */
  .elementor-location-header .elementor-element-3a53c11 { min-width: 0; flex: 1 1 0%; }
  .elementor-location-header .elementor-element-2763177 { max-width: calc(100% - 20px); min-width: 0; }
  /* Ở 768: menu chính 1 hàng rộng 759px → "Tin tức", "Liên hệ" bị cắt mất; cho xuống dòng */
  .elementor-location-header #main-header-collapse { max-width: 100%; }
  .elementor-location-header #primary-nav { flex-wrap: wrap; }
  /* Trang chủ: nút mũi tên carousel đánh giá đặt right:-29px → lòi ra mép phải, trang tràn ngang 14px ở 1024 */
  body.home .elementor-element-79b04ba1 .lqd-carousel-stack-next { right: 0 !important; }
  body.home .elementor-element-79b04ba1 .lqd-carousel-stack-prev { left: 0 !important; }
}
