/*
 Theme Name:   Hello Elementor Child
 Theme URI:    https://zhangmuyi.com/hello-elementor-child
 Description:  Hello Elementor 的子主题
 Author:       Soar
 Author URI:   https://zhangmuyi.com
 Template:     hello-elementor
 Version:      1.0.5
 Text Domain:  hello-elementor-child
*/

/* 这里可以添加你的自定义 CSS */

/* ============================================================
   LiXin 产品详情页 - 手机端 / 平板端自适应
   添加日期：2026-11-19
   说明：只使用稳定的 class 选择器，不使用 Elementor 元素 ID，
        清理缓存或重新生成元素 ID 后仍然有效。
   ============================================================ */

/* 全站通用：窄屏隐藏 Elementor 轮播左右箭头（手势滑动仍可用），
   避免箭头超出屏幕导致页面横向滚动 */
@media (max-width: 1024px) {
  .elementor-swiper-button { display: none !important; }
}

@media (max-width: 1024px) {
  /* 防止轮播箭头等元素把页面撑出横向滚动 */
  body.single-post { overflow-x: hidden; }

  /* 产品首屏：图片在上、文字在下；图文各占满宽度 */
  body.single-post .e-con:has(> .elementor-widget-media-carousel) {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 24px !important;
  }
  body.single-post .e-con:has(> .elementor-widget-media-carousel) > .elementor-widget-media-carousel,
  body.single-post .e-con:has(> .elementor-widget-media-carousel) > .e-con {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 产品图轮播高度：平板 380px，手机 300px（见下方断点） */
  body.single-post .elementor-widget-media-carousel .elementor-main-swiper { height: 380px !important; }
  body.single-post .elementor-widget-media-carousel .elementor-carousel-image { height: 100% !important; }

  /* Why Choose 三个卖点卡片：占满整行，避免文字被挤成一行一个字 */
  body.single-post .elementor-widget-icon-box { width: 100% !important; max-width: 100% !important; }
  body.single-post .elementor-widget-icon-box .elementor-widget-container { padding: 22px 18px !important; }

  /* 轮播箭头在窄屏隐藏（用手势滑动即可），避免超出屏幕 */
  body.single-post .elementor-widget-media-carousel .elementor-swiper-button,
  body.single-post .elementor-widget-loop-carousel .elementor-swiper-button { display: none !important; }

  /* 技术参数表格：允许横向滑动，不撑破页面 */
  body.single-post .elementor-widget-text-editor div[style*="overflow-x"] {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
}

@media (max-width: 767px) {
  /* 手机端产品图高度 */
  body.single-post .elementor-widget-media-carousel .elementor-main-swiper { height: 300px !important; }

  /* 手机端标题字号收敛，避免大段换行 */
  body.single-post .elementor-widget-heading .elementor-heading-title {
    font-size: 24px !important;
    line-height: 1.25 !important;
  }

  /* 卖点卡片正文 */
  body.single-post .elementor-widget-icon-box .elementor-icon-box-description {
    font-size: 15px !important;
    line-height: 1.6 !important;
  }

  /* 技术参数表格：缩小字号/内边距，第一列固定，方便横向查看 */
  body.single-post .elementor-widget-text-editor table { font-size: 13px !important; }
  body.single-post .elementor-widget-text-editor table th,
  body.single-post .elementor-widget-text-editor table td { padding: 8px 10px !important; }
  body.single-post .elementor-widget-text-editor table tr > *:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
  }
  body.single-post .elementor-widget-text-editor table thead tr > *:first-child { background: #f2f2f2 !important; }
  body.single-post .elementor-widget-text-editor table tbody tr > *:first-child {
    background: #fff !important;
    white-space: nowrap;
  }
}

/* ============================================================
   右下角悬浮联系按钮（WhatsApp / Email / Chat）
   说明：原 Elementor 结构为“手风琴式”展开，白色内容框会在两个
        图标之间撑开、把按钮挤乱；这里统一成右下角竖排圆形按钮，
        联系方式改为鼠标悬停时显示在左侧的小提示框。
   选择器使用 [data-settings] 与组件 class，不使用临时元素 ID。
   ============================================================ */

/* 外层容器：固定在右下角，竖排、右对齐 */
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) {
  right: 18px !important;
  bottom: 74px !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 8px !important;
  z-index: 9999 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* 隐藏原来的 hover 脚本占位 widget */
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) > .elementor-widget-html {
  display: none !important;
}

/* Tabs 外层 widget 收窄，避免容器保留 140px 的空宽度 */
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) > .elementor-widget {
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
}

/* Tabs 组件收窄成 45px 宽 */
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tabs {
  position: relative !important;
  width: 45px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  background: transparent !important;
}
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tabs-heading {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 8px !important;
}

/* 每个图标按钮：45 × 45 圆形，图标居中 */
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tab-title {
  flex: 0 0 45px !important;
  width: 45px !important;
  height: 45px !important;
  min-width: 45px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
}
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tab-title .e-n-tab-icon {
  margin: 0 !important;
}
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tab-title-text {
  display: none !important;
}

/* 展开的联系方式：绝对定位到按钮左侧，不再把按钮挤开 */
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tabs-content {
  display: contents !important;
}
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tabs-content > div {
  position: absolute !important;
  right: 57px !important;
  top: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 8px 12px !important;
  background: #fff !important;
  border: 1px solid #DC0909 !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
  white-space: nowrap !important;
  z-index: 10000 !important;
}
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tabs-content > div:nth-of-type(2) {
  top: 53px !important;
}
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tabs-content > div .elementor-widget,
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tabs-content > div .e-con-inner {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tabs-content > div p {
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
}

/* 聊天按钮（独立 fixed 的那个）与上面两个按钮对齐成同一列 */
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .elementor-widget-button.elementor-fixed {
  right: 18px !important;
  bottom: 18px !important;
  top: auto !important;
  left: auto !important;
  width: 45px !important;
  height: 45px !important;
  z-index: 9999 !important;
}
.e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .elementor-widget-button.elementor-fixed a {
  width: 45px !important;
  height: 45px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
}

/* 手机端稍微缩小、贴近边缘 */
@media (max-width: 767px) {
  .e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) {
    right: 12px !important;
    bottom: 66px !important;
  }
  .e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tab-title {
    flex: 0 0 42px !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
  }
  .e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .elementor-widget-button.elementor-fixed {
    right: 12px !important;
    bottom: 12px !important;
    width: 42px !important;
    height: 42px !important;
  }
  .e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .elementor-widget-button.elementor-fixed a {
    width: 42px !important;
    height: 42px !important;
  }
  .e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tabs-content > div {
    right: 54px !important;
  }
  .e-con[data-settings*='"position":"fixed"']:has(.e-n-tabs) .e-n-tabs-content > div:nth-of-type(2) {
    top: 50px !important;
  }
}

/* 产品页 CTA（Get Quick Quote + 社交图标）：
   手机端换行时按钮与图标之间留出间距，避免叠在一起 */
body.single-post .e-con:has(> .elementor-widget-button):has(> .elementor-widget-social-icons) {
  row-gap: 16px !important;
}
