/* 产品缩略图"收藏/询价"按钮 + 询价弹窗 公共样式 */

/* ============ 卡片缩略图上的按钮组（外层 .product-inq-wrap 包「图片+标题」） ============ */
/* 全站统一走「显式外层锚点模型」（见本文件底部）：
   .product-inq-wrap 加在外层（图片+标题盒）身上，内层图片框加 .wap-product-inqu-wrap。
   PC：按钮组/遮罩锚外层盒（bottom:12px）；WAP：锚内层图片框（bottom:6px）。
   下面 .product-inq-wrap 基座同时是内层绝对定位的兜底包含块；!important 必需：
   站点 wap 样式里 .product-line .main-img{position:initial} 权重更高会把它压成 static，按钮会跳到更外层 */
.product-inq-wrap {
    /* !important 是必需的：站点 wap 样式里 .product-line .main-img{position:initial} 权重更高，
       会把这里覆盖成 static，按钮组就跳到更外层的 .product-item 上 */
    position: relative !important;
    display: block;
    overflow: hidden;
}

/* 内层图片框(.wap-product-inqu-wrap)单独包图当 WAP 锚点时，竖图会比外层方框高，夹住不溢出到标题上 */
.wap-product-inqu-wrap.inq-img {
    max-height: 100%;
}

.product-inq-wrap .inq-mask {
    position: absolute;
    inset: 0;
    /* 组件输出的遮罩带 hidden（忘引本样式表的页面不裸奔），靠这条作者规则解除隐藏 */
    display: block;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    z-index: 2;
}

/* 按钮组：默认隐藏，hover 时浮现（PC） */
.product-inq-wrap .inq-actions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    display: flex;
    justify-content: space-evenly;
    z-index: 3;
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 992px) {
    .product-inq-wrap:hover .inq-mask {
        background: rgba(0, 0, 0, 0.35);
    }
    .product-inq-wrap:hover .inq-actions {
        opacity: 1;
        pointer-events: auto;
    }

    /* 新模型把内层图片框(.wap-product-inqu-wrap)在 PC 转成 static，站点给 .zoomImg 的 hover 高光(::before，left:-90% 停在框外)
       就不再被内层 overflow 裁住、会扫到隔壁卡片；包含块升到外层后它也被整卡遮罩盖住，故撤掉。
       用 @supports 兜底：仅支持 :has 的浏览器才走新模型(static 提升)，才需要这条；老浏览器外层 overflow:hidden 自会裁掉。
       选择器必须带 .zoomImg：suppliers/new.css 在本表之后加载，其 .zoomImg:before{display:block} 与单写同类名同权重会赢 */
    @supports selector(:has(*)) {
        .zoomImg.wap-product-inqu-wrap::before {
            display: none;
        }
    }
}

/* 手机端（含 PC 窗口缩至 <992px）：没有 hover，上面靠 :hover 浮现的写法在这里失效；
   窄屏卡片很窄，按钮排在标题下会被 overflow 裁字，所以改为常驻浮在图片下边缘并整体缩小 */
@media (max-width: 991px) {
    /* 「图铺满锚点」由本文件底部新模型 WAP 段（.wap-product-inqu-wrap > a/img）负责，这里不重复；
       这样容器底边 = 图片可见底边，bottom 才能写成常量。 */

    /* 贴图片下边缘：WAP 锚点是内层图片框（见底部新模型段），所以直接用 bottom，
       不再用百分比 padding 推图片高度——那种写法依赖“图片正方形且容器宽 = 图宽”，任何一页不满足就偏移；
       也不占正常流高度，不会反过来压缩 Swiper 拉齐的 slide */
    .product-inq-wrap .inq-actions {
        position: absolute;
        opacity: 1;
        pointer-events: auto;
        top: auto;
        left: 0;
        right: 0;
        height: auto;
        padding: 0;
        /* 不跟图片底边齐平，往上留 6px 空隙。
           这里能写成常量，靠的是上面那条“图铺满锚点”把容器底边和图片可见底边对齐；
           新页面挂锚点时守住这个约定就行，不要回头再写 JS 去量 */
        bottom: 6px;
        /* 三段间隙等分；这里不能再叠 gap，否则中间那段 = gap + 分配值，就不等了 */
        justify-content: space-evenly;
    }

    /* 不给整条按钮栏加深灰衬底（会在卡片间连成突兀色块），改由按钮自带半透明白底；
       flex 锁 0 0 auto 并禁断行，避免被压缩后中文竖排。
       尺寸比 PC 再压一档（18px 高 / 10px 字 / 左右 3px）：窄屏卡片真的很窄，而英文站文案是
       Inquire / Favorite / Favorited，比中文「询价 / 收藏」长一截，按 PC 的 13px 字号排两颗胶囊
       会超出卡片宽被 wrap 的 overflow 裁掉尾巴。两颗胶囊实测总宽：
       Inquire + Favorite = 87.5px，已收藏态 Inquire + Favorited = 93.9px（Favorited 是最宽的一组）。
       产品列表页（卡片最窄的一页）实测：vw 375 卡片 100px → 放得下，余 6.1px；
       vw 360 卡片 95px → 刚好卡满；vw 320 卡片 83px → 已收藏态溢出约 11px（左右各被裁几像素）。
       数值来自 .env 切 LANG_LOCALE=en 后的 375/360/320 实测，改之前先照同样方法量一次 */
    .product-inq-wrap .inq-btn {
        flex: 0 0 auto;
        min-width: 0;
        white-space: nowrap;
        height: 18px;
        padding: 0 3px;
        font-size: 10px;
        line-height: 1;
        border-radius: 9px;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    }

    /* 没有 hover 时遮罩永远是全透明，留着只会干扰点击 */
    .product-inq-wrap .inq-mask {
        display: none;
    }
}

/* ============ 显式外层锚点模型（新）：任何 .product-inq-wrap 直接包裹 .wap-product-inqu-wrap 即生效 ============
   结构：<div class="product-inq-wrap">（图片+标题） > <div class="…wap-product-inqu-wrap">（图片，内含遮罩/按钮组） + 标题(.bd/.name/.info)
   PC：外层设为锚点(relative)、图片层转 static，遮罩/按钮组包含块上升到外层 → 按钮恒贴「图片+标题」盒底 12px，
        与外层卡片(li / .product-item / .inq-card)用 padding 做的行距无关，从根上替掉旧 :has(> .product-inq-wrap) 卡片提升 + --inq-pad-b 数值补偿。
   WAP：外层转 static、图片层成为锚点(relative)，按钮贴图片下沿 6px。
   旧版 :has(> .product-inq-wrap) 卡片提升 + --inq-pad-b 补偿那套已整体移除（含嵌套 :has() 在 Chromium 非法，全站迁移后也无卡片命中）。 */
.product-inq-wrap:has(> .wap-product-inqu-wrap) {
    /* 外层（图片+标题盒）作 PC 锚点；overflow 放开让标题与整卡遮罩显形 */
    position: relative !important;
    overflow: visible !important;
}
.product-inq-wrap:has(> .wap-product-inqu-wrap) .wap-product-inqu-wrap {
    /* PC：图片层转 static，遮罩/按钮组的包含块上移到外层 .product-inq-wrap（= 图片+标题盒） */
    position: static !important;
}
/* 新结构里图片直接挂在 .wap-product-inqu-wrap 下（如 _right 无 <a> 包裹），补回 display:block 消除行盒基线空隙 */
.wap-product-inqu-wrap > img,
.wap-product-inqu-wrap > a > img {
    display: block;
}
@media (max-width: 991px) {
    /* WAP：外层退回 static，图片层 wap-product-inqu-wrap 成为基准，贴图片下沿 */
    .product-inq-wrap:has(> .wap-product-inqu-wrap) {
        position: static !important;
        overflow: visible !important;
    }
    .product-inq-wrap:has(> .wap-product-inqu-wrap) .wap-product-inqu-wrap {
        position: relative !important;
        overflow: hidden !important;
    }
    .wap-product-inqu-wrap > a {
        display: block;
        height: 100%;
    }
    .wap-product-inqu-wrap > a > img,
    .wap-product-inqu-wrap > img {
        display: block;
        height: 100%;
        object-fit: cover;
    }
}

/* 单个按钮：白底描边圆角 */
.inq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 62px;
    height: 30px;
    padding: 0 12px;
    background: #fff;
    color: #666;
    font-size: 13px;
    line-height: 1;
    border: 1px solid #ddd;
    border-radius: 15px;
    cursor: pointer;
    user-select: none;
}

.inq-btn .iconfont {
    font-size: 15px;
    line-height: 1;
}

/* 询价按钮图标（assets/img/xunjia.png） */
.inq-btn .inq-ico {
    display: inline-block;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    background: url(../img/xunjia.png) no-repeat center center;
    background-size: contain;
}

/* hover 与已选态：橙底白字 */
.inq-btn:hover,
.inq-btn.on {
    border-color: #FFA70E !important;
    background: #FFA70E !important;
    color: #fff !important;
}

/* hover 时把询价图标变成纯白，避免橙色图标融进橙色背景；
   xunjia.png 自身是橙色，单用 invert(1) 会得到补色（蓝），故先 brightness(0) 压成黑色剪影再 invert(1) 翻白（保留 alpha 形状） */
.inq-btn:hover .inq-ico,
.inq-btn.on .inq-ico {
    filter: brightness(0) invert(1);
}

/* ============ 首页"发现好货"：图片右下角常驻按钮组（仅图标，30px 圆形；其余页面用文字按钮） ============ */
/* 站点基础样式 .picbox 未定位（仅 WAP 媒体查询里有 relative），PC 端需自行锚定 */
.product-sort-cont .picbox {
    position: relative;
}

.home-inq-corner {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.home-inq-corner .inq-btn {
    min-width: 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.home-inq-corner .inq-btn.collect {
    color: #666;
}

/* 首页角标只显示图标：隐藏询价文字，与收藏同为 30px 圆形 */
.home-inq-corner .inq-btn.inquiry-btn .inq-btn-text {
    display: none;
}

.home-inq-corner .inq-btn:hover,
.home-inq-corner .inq-btn.inquiry-btn.on {
    background: #FFA70E;
    border-color: #FFA70E;
    color: #fff;
}

/* wap 端角标回到胶囊形态：显示文字、宽度自适应 */
@media (max-width: 991px) {
    .home-inq-corner .inq-btn {
        width: auto;
        min-width: 30px;
        height: 30px;
        padding: 0 10px;
        border-radius: 15px;
        gap: 4px;
    }
}

/* ============ 询价弹窗 ============ */
/* 遮罩层默认不渲染，由 JS 只切 .show 一个类 */
.inq-pup-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    overflow: auto;
}

.inq-pup-mask.show {
    display: block;
}

.inq-pup {
    position: relative;
    width: 460px;
    max-width: calc(100vw - 32px);
    margin: 8vh auto 40px;
    background: #fff;
    border-radius: 10px;
    padding: 24px 26px 22px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.inq-pup-close {
    position: absolute;
    right: 16px;
    top: 12px;
    font-size: 22px;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
}

.inq-pup-close:hover {
    color: #666;
}

.inq-pup-title {
    font-size: 16px;
    color: #333;
    font-weight: 700;
    margin-bottom: 4px;
    padding-right: 24px;
    line-height: 1.4;
}

.inq-pub-subtitle {
    font-size: 13px;
    color: #999;
    margin-bottom: 18px;
}

.inq-field {
    margin-bottom: 16px;
}

.inq-field label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.inq-field label .req {
    color: #FF4D4D;
    margin-left: 2px;
}

.inq-input,
.inq-textarea {
    width: 100%;
    height: 40px;
    line-height: 40px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    box-sizing: border-box;
    outline: none;
}

.inq-textarea {
    height: 90px;
    line-height: 1.5;
    padding: 8px 12px;
    resize: none;
}

.inq-input:focus,
.inq-textarea:focus {
    border-color: #FFA70E;
}

.inq-row-2 {
    display: flex;
    gap: 12px;
}

/* 姓/名并排：min-width:0 解除 flex 项的固有宽度下限，避免窄屏下 input 默认宽度把弹窗撑出场 */
.inq-row-2 .inq-field {
    flex: 1;
    min-width: 0;
}

.inq-code-row {
    display: flex;
    gap: 10px;
}

.inq-code-row .inq-input {
    flex: 1;
}

.inq-code-btn {
    flex: 0 0 auto;
    width: 120px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: #fff;
    color: #FFA70E;
    border: 1px solid #FFA70E;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}

.inq-code-btn:disabled,
.inq-code-btn.disabled {
    color: #bbb;
    border-color: #ddd;
    cursor: not-allowed;
}

/* 阿里云验证码容器（popup 弹窗模式）：#inqDrag 为 SDK 挂载点，本身不再渲染内联勾选框；
   容器不能隐藏，否则验证弹窗无法弹出 */
.inq-afs {
    margin-top: 8px;
}

/* 隐藏的验证触发按钮：阿里云 popup 绑定在此，仅由 sendCode 主动 click 触发；
   不能 display:none（否则不可点），用移出视口的方式隐藏 */
.inq-code-trigger {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    border: 0;
    padding: 0;
    margin: 0;
}

.inq-terms {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    color: #888;
    line-height: 1.5;
    margin: 4px 0 16px;
}

.inq-terms input {
    margin-top: 2px;
    flex: 0 0 auto;
}

/* 站点全局 reset 把 input 的 border 去掉了（zh/pc/css/common.css），原生复选框会隐形；
   这里显式补回尺寸/边框/勾选态，保证中英站 PC/WAP 都可见 */
.inq-terms input[type=checkbox] {
    -webkit-appearance: checkbox;
    appearance: auto;
    box-sizing: border-box;
    width: 14px;
    height: 14px;
    margin: 2px 0 0;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: #fff;
    cursor: pointer;
    accent-color: #FFA70E;
}

.inq-terms input[type=checkbox]:checked {
    border-color: #FFA70E;
}

.inq-terms a {
    color: #FFA70E;
    text-decoration: none;
}

.inq-err {
    color: #FF4D4D;
    font-size: 12px;
    min-height: 16px;
    margin-bottom: 8px;
}

.inq-submit {
    width: 100%;
    height: 44px;
    line-height: 44px;
    text-align: center;
    background: #FFA70E;
    color: #fff;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.inq-submit:hover {
    background: #f59a00;
}

.inq-submit:disabled {
    background: #ffd9a0;
    cursor: not-allowed;
}

/* 手机端弹窗贴近底部、占满宽度 */
@media (max-width: 559px) {
    .inq-pup {
        margin: 0;
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        border-radius: 0;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}
