/* 本站公共覆盖样式：从各页面重复的 wp-custom-css 内联样式抽出，集中维护静态站的导航、产品卡片和响应式修正。 */

/* 隐藏 Astra 产品卡片右上角的购物车、选项和快速查看入口，避免静态站出现不可用操作。 */
.ast-shop-thumbnail-helper,
.ast-add-to-cart-button,
.ast-select-options-trigger,
.ast-quick-view-button {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 兼容 Astra 新版产品图标容器，确保同类入口同步隐藏。 */
.astra-shop-thumbnail-helper {
    display: none !important;
}

/* 隐藏产品列表上方的统计和排序控件，保持静态产品页简洁。 */
.woocommerce-result-count,
.woocommerce-ordering {
    display: none !important;
}

/* 隐藏 Astra 工具栏容器，避免空工具栏占用页面空间。 */
.ast-shop-toolbar-container {
    display: none !important;
}

/* 固定桌面端主导航，保持滚动时可见。 */
.ast-main-header-wrap {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 9999;
    /* 为固定导航增加轻微阴影，区分导航和正文层级。 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 为正文预留顶部空间，避免内容被固定导航遮挡。 */
body {
    /* 与固定导航高度保持一致。 */
    padding-top: 80px;
}

/* 设置半透明白色背景，保证滚动时导航文字清晰可读。 */
.main-header-bar {
    background: rgba(255, 255, 255, 0.98) !important;
    /* 增加背景模糊，弱化正文透出对导航可读性的影响。 */
    backdrop-filter: blur(5px);
}

/* 固定移动端导航，与桌面端保持一致的滚动体验。 */
@media (max-width: 921px) {
    .ast-mobile-header-wrap {
        position: fixed;
        width: 100%;
        top: 0;
        z-index: 9999;
    }
}

/* 禁止页面横向滚动，避免移动端出现右侧空白。 */
html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* 限制重点内容容器宽度，避免轮播或区块撑出视口。 */
#xp-patent-slider-section,
#st-applications,
#st-service-commitments,
.st-container,
.xp-patent-container {
    max-width: 100% !important;
    overflow: hidden !important;
}

/* 优化 Swiper 轮播容器，避免初始化前撑宽页面。 */
.patent-swiper {
    display: flex;
    overflow: hidden;
    /* 在脚本完成初始化前限制轮播宽度，避免页面横向溢出。 */
    touch-action: pan-y;
}

.swiper-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
}

/* 限制轮播卡片图片宽度，保证图片不会超过卡片容器。 */
.patent-card img {
    max-width: 100%;
    height: auto;
}

/* 全站图片默认随容器缩放，避免图片撑破布局。 */
img {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

/* 统一产品标题排版，保证产品卡片高度和行数稳定。 */
.product-title,
.ast-loop-product__link h2,
.woocommerce-loop-product__title {
    /* 允许长标题自动换行，避免单行撑宽卡片。 */
    white-space: normal !important;
    word-wrap: break-word !important;

    /* 标题最多显示两行，超出内容省略，保证卡片列表整齐。 */
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;

    /* 固定标题区域高度，确保同一行产品卡片对齐。 */
    /* 对应两行标题的高度。 */
    min-height: 3em;
    line-height: 1.5em;

    margin-bottom: 10px !important;
    font-size: 1.1rem !important;
    color: #0f172a !important;
}

/* 产品卡片内容纵向排列，避免标题、价格或按钮互相重叠。 */
.astra-shop-summary-wrap {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

/* 产品卡片悬停状态：增加边框、阴影和轻微上移反馈。 */
.ast-article-inner {
    border: 1px solid #e2e8f0 !important;
    transition: all 0.3s ease !important;
    border-radius: 4px !important;
}

.ast-article-inner:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
    border-color: #FF5B00 !important;
    transform: translateY(-5px);
}
