/* ============================================================
 * 页眉小部件
 * ============================================================ */
/* 防止页眉整宽背景(100vw)在出现竖向滚动条时撑出横向滚动条 */
body { overflow-x: hidden; }

.qing-hd { width: 100%; }

/* 解除 Elementor 容器对页眉的宽度限制：
 * 仅作用于「直接包含页眉的容器 inner」，不影响全站其他容器。
 * 原因：.e-con>.e-con-inner 的 max-width:var(--content-width) 会把
 * 页眉（含全宽背景）一起收窄，页眉本身已通过 .qing-hd-nav-inner 控制内容宽度。 */
.e-con-inner:has(> .elementor-widget-wrap .qing-hd),
.e-con-inner:has(.qing-hd) {
    max-width: none !important;
}

/* Logo */
.qing-hd-logo { flex-shrink: 0; }
.qing-hd-logo a { display: inline-flex; align-items: center; text-decoration: none; }
.qing-hd-logo img { display: block; height: auto; }
.qing-hd-logo-text { font-size: 24px; font-weight: 800; color: #222; }

/* 右侧工具区（靠右） */
.qing-hd-tools {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
    color: #333;
    margin-left: auto;
}
.qing-hd-tools a,
.qing-hd-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color .2s;
    white-space: nowrap;
}
.qing-hd-tools svg { width: 20px; height: 20px; flex-shrink: 0; }

/* 搜索切换按钮 */
.qing-hd-search-toggle { display: none; }

/* 语言/货币下拉 */
.qing-hd-dropdown { position: relative; }
.qing-hd-dropdown .qing-hd-tool-btn svg:last-child { width: 14px; height: 14px; }
.qing-hd-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin: 10px 0 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    min-width: max-content;
    width: auto;
    display: none;
    z-index: 100;
}
/* 透明桥接，避免按钮和菜单之间的间隙导致悬停丢失 */
.qing-hd-dropdown::after {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 100%;
    height: 10px;
}
.qing-hd-dropdown:hover .qing-hd-dropdown-menu { display: block; }
.qing-hd-dropdown-menu li a {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
    color: #333;
    text-align: center;
    white-space: nowrap;
}
.qing-hd-dropdown-menu li a:hover,
.qing-hd-dropdown-menu li a.active { background: transparent; color: #103A8E; }

/* 购物车角标 */
.qing-hd-cart { position: relative; }
.qing-hd-cart-count {
    position: absolute;
    top: -6px; right: -10px;
    background: #c8a24a;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 10px;
}

/* 询盘按钮 */
.qing-hd-inq-open {
    background: #c8a24a;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 9px 22px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity .2s;
    white-space: nowrap;
}
.qing-hd-inq-open:hover { opacity: .9; }

/* ── 菜单栏 ── */
.qing-hd-nav {
    background: #2a5bd7;
    min-height: 48px;
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 990;
}
/* 背景全宽：向两侧延伸覆盖容器边距 */
.qing-hd-nav::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background-color: inherit;
    background-image: inherit;
    z-index: 0;
}
.qing-hd-nav-inner {
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    position: relative;
    z-index: 1;
    padding: 8px 24px;
    box-sizing: border-box;
    overflow: visible;
}

/* ── 单行页眉：各区块排列顺序 ── */
/* DOM 顺序为 Logo → 汉堡 → 工具区 → 菜单 → 搜索，用 order 重排为
   Logo（最左）→ 菜单 → 搜索 → 工具区（最右）→ 汉堡 */
.qing-hd-nav-inner .qing-hd-logo         { order: 1; flex-shrink: 0; }
.qing-hd-nav-inner .qing-hd-menu         { order: 2; margin-right: auto; }
.qing-hd-nav-inner .qing-hd-store-search { order: 3; }
.qing-hd-nav-inner .qing-hd-tools        { order: 4; margin-left: 0; }
.qing-hd-nav-inner .qing-hd-burger       { order: 5; }

/* Logo 尺寸由 Elementor「Logo 大小（高度）」控件设定，此处仅保证行内不被压缩 */
.qing-hd .qing-hd-nav-inner .qing-hd-logo img { width: auto; }

/* 工具区（语言切换）在蓝色栏内：垂直居中 */
.qing-hd .qing-hd-nav-inner .qing-hd-tools { align-self: center; align-items: center; }
.qing-hd .qing-hd-nav-inner .qing-hd-tools .qing-hd-dropdown { display: flex; align-items: center; }
.qing-hd .qing-hd-nav-inner .qing-hd-tools .qing-hd-tool-btn { line-height: 1; }

/* 工具区（语言切换）固定为白色，且不显示悬停变色（!important 覆盖 Elementor 悬停色控件）
   仅作用于工具按钮与直接链接，避免影响白底下拉菜单里的选项 */
.qing-hd .qing-hd-nav-inner .qing-hd-tools,
.qing-hd .qing-hd-nav-inner .qing-hd-tools > a,
.qing-hd .qing-hd-nav-inner .qing-hd-tools .qing-hd-tool-btn,
.qing-hd .qing-hd-nav-inner .qing-hd-tools .qing-hd-tool-btn:hover,
.qing-hd .qing-hd-nav-inner .qing-hd-tools > a:hover { color: #fff !important; }

/* 单行页眉内不显示询盘按钮（语言切换靠最右） */
.qing-hd-nav-inner .qing-hd-inq-open { display: none; }
/* 确保菜单容器不裁剪子菜单 */
.qing-hd-nav, .qing-hd-menu, .qing-hd-menu li { overflow: visible; }
.qing-hd-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.qing-hd-menu li { position: relative; }
.qing-hd-menu a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    padding: 14px 18px;
    font-size: 15px;
    transition: color .2s;
    white-space: nowrap;
}
.qing-hd-menu a:hover { color: #ffd966; }
.qing-hd-menu .current-menu-item > a { color: #ffd966; }

/* 有子菜单的项显示下拉箭头 */
.qing-hd-menu .menu-item-has-children > a::after {
    content: '';
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .25s ease;
    margin-left: 2px;
    margin-top: -3px;
    flex-shrink: 0;
}
/* 悬停时箭头翻转 */
.qing-hd-menu .menu-item-has-children:hover > a::after {
    transform: rotate(-135deg);
    margin-top: 3px;
}

/* 一级子菜单 */
.qing-hd-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    min-width: 210px;
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
    display: none;
    z-index: 200;
    border-radius: 4px 4px 4px 4px;
}
.qing-hd-menu li:hover > .sub-menu { display: block; }
.qing-hd-menu .sub-menu a {
    color: #333;
    padding: 11px 18px;
    font-size: 14px;
    justify-content: space-between;
}
.qing-hd-menu .sub-menu a:hover { color: #2a5bd7; background: #f5f8ff; }
.qing-hd-menu .sub-menu .current-menu-item > a { color: #2a5bd7; }

/* 子菜单里有下级的项：右向箭头 */
.qing-hd-menu .sub-menu .menu-item-has-children > a::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #999;
    border-bottom: 2px solid #999;
    transform: rotate(-45deg);
    margin: 0 0 0 8px;
}
.qing-hd-menu .sub-menu .menu-item-has-children:hover > a::after {
    border-color: #2a5bd7;
    transform: rotate(-45deg);
}

/* 二级及以上子菜单：向右弹出 */
.qing-hd-menu .sub-menu .sub-menu {
    top: -6px;
    left: 100%;
    border-radius: 4px;
}

/* 店内搜索（单行页眉内，行内排列） */
.qing-hd-store-search {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    height: 34px;
    flex-shrink: 0;
}
.qing-hd-store-search input {
    border: none;
    outline: none;
    padding: 0 14px;
    font-size: 13px;
    width: 160px;
    background: transparent;
}

/* 覆盖浏览器自动填充的浅蓝/浅黄底色，保持搜索框为白底 */
.qing-hd-store-search input:-webkit-autofill,
.qing-hd-store-search input:-webkit-autofill:hover,
.qing-hd-store-search input:-webkit-autofill:focus,
.qing-hd-store-search input:-webkit-autofill:active,
.qing-hd-drawer-search input:-webkit-autofill,
.qing-hd-drawer-search input:-webkit-autofill:hover,
.qing-hd-drawer-search input:-webkit-autofill:focus,
.qing-hd-drawer-search input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    box-shadow: 0 0 0 1000px #fff inset;
    -webkit-text-fill-color: #333;
    caret-color: #333;
    transition: background-color 99999s ease-in-out 0s;
}
.qing-hd-store-search button,
.qing-hd-store-search .qing-hd-search-submit {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0 12px;
    color: #888;
    display: flex;
    align-items: center;
}
.qing-hd-store-search svg { width: 16px; height: 16px; }

/* ── 询盘弹窗 ── */
.qing-hd-modal {
    position: fixed; inset: 0;
    z-index: 99999;
    display: flex; align-items: center; justify-content: center;
}
.qing-hd-modal[hidden] { display: none; }
.qing-hd-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.qing-hd-modal-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 480px;
    padding: 28px;
    box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.qing-hd-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    background: none; border: none; cursor: pointer;
    color: #999;
}
.qing-hd-modal-close svg { width: 22px; height: 22px; }
.qing-hd-modal-title { margin: 0 0 18px; font-size: 20px; color: #222; }

/* 弹窗表单样式 */
.qing-hd-modal .qing-hd-inq-form { display: flex; flex-direction: column; gap: 12px; }
.qing-hd-modal .qing-inq-row { display: flex; gap: 12px; }
.qing-hd-modal .qing-inq-row input { flex: 1; }
.qing-hd-modal .qing-hd-inq-form input,
.qing-hd-modal .qing-hd-inq-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.qing-hd-modal .qing-hd-inq-form textarea { resize: vertical; }
.qing-hd-modal .qing-hd-inq-form button[type=submit] {
    padding: 12px;
    background: #103A8E;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity .2s;
}
.qing-hd-modal .qing-hd-inq-form button[type=submit]:hover { opacity: .9; }
.qing-hd-modal .qing-inq-msg { font-size: 14px; margin: 4px 0 0; }

/* ── 移动端汉堡按钮 ── */
.qing-hd-burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    color: inherit;
}
.qing-hd-burger svg { width: 28px; height: 28px; }

/* ── 移动端左侧抽屉 ── */
.qing-hd-drawer {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}
.qing-hd-drawer[hidden] { display: none; }
/* 仅移动端、且未隐藏时才显示 */
@media (max-width: 768px) {
    .qing-hd-drawer:not([hidden]) { display: flex; }
}
.qing-hd-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}
.qing-hd-drawer-panel {
    position: relative;
    z-index: 1;
    width: 85%;
    max-width: 320px;
    background: #fff;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    transform: translateX(-100%);
    animation: qing-hd-drawer-in .3s ease forwards;
}
@keyframes qing-hd-drawer-in {
    to { transform: translateX(0); }
}
.qing-hd-drawer-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 4px;
}
.qing-hd-drawer-close svg { width: 24px; height: 24px; }

/* 抽屉搜索框 */
.qing-hd-drawer-search {
    display: flex;
    align-items: stretch;
    border: 1px solid #ddd;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 20px;
    margin-top: 20px;
}
.qing-hd-drawer-search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    padding: 10px 16px;
    font-size: 14px;
    background: transparent;
}
.qing-hd-drawer-search button,
.qing-hd-drawer-search .qing-hd-search-submit {
    flex-shrink: 0;
    border: none;
    background: #c8a24a;
    color: #fff;
    padding: 0 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qing-hd-drawer-search svg { width: 18px; height: 18px; }

/* 抽屉菜单（手风琴） */
.qing-hd-drawer-menu {
    list-style: none;
    padding: 0;
}
.qing-hd-drawer-menu li { margin-bottom: 0; position: relative; }
.qing-hd-drawer-menu a {
    display: block;
    padding: 12px 8px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: color .2s;
}
.qing-hd-drawer-menu a:hover { color: #c8a24a; }

/* 手风琴展开按钮（有子菜单时由 JS 注入） */
.qing-hd-acc-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}
.qing-hd-acc-toggle::before {
    content: '';
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .25s ease;
    margin-top: -3px;
}
.qing-hd-drawer-menu li.qing-acc-open > .qing-hd-acc-toggle::before {
    transform: rotate(-135deg);
    margin-top: 3px;
}

/* 子菜单默认收起（高度由 JS 按内容实际高度过渡，动画更自然） */
.qing-hd-drawer-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding-left: 16px;
    height: 0;
    overflow: hidden;
    box-sizing: border-box;
    transition: height .32s cubic-bezier(.4, 0, .2, 1);
    will-change: height;
}
.qing-hd-drawer-menu .sub-menu a { font-size: 14px; padding: 10px 8px; }

/* 抽屉工具区 */
.qing-hd-drawer-tools { display: flex; flex-direction: column; gap: 0; }
.qing-hd-drawer-group {
    border-bottom: 1px solid #eee;
}
.qing-hd-drawer-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding: 12px 8px;
    cursor: pointer;
    position: relative;
}
.qing-hd-drawer-label svg { width: 18px; height: 18px; }
/* 手风琴箭头 */
.qing-hd-drawer-label::after {
    content: '';
    position: absolute;
    right: 8px;
    width: 9px;
    height: 9px;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: rotate(45deg);
    transition: transform .25s ease;
    margin-top: -3px;
}
.qing-hd-drawer-group.qing-acc-open .qing-hd-drawer-label::after {
    transform: rotate(-135deg);
    margin-top: 3px;
}
.qing-hd-drawer-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    height: 0;
    overflow: hidden;
    box-sizing: border-box;
    transition: height .32s cubic-bezier(.4, 0, .2, 1);
    will-change: height;
    padding: 0 8px;
}
/* 竖向内边距仅在展开时生效，避免收起后残留 padding 造成无法完全收起 */
.qing-hd-drawer-group.qing-acc-open .qing-hd-drawer-opts {
    padding-top: 2px;
    padding-bottom: 12px;
}
.qing-hd-drawer-opts a {
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 16px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: background .2s;
}
.qing-hd-drawer-opts a:hover { background: #c8a24a; color: #fff; }
.qing-hd-drawer-login {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
}
.qing-hd-drawer-login svg { width: 20px; height: 20px; }
.qing-hd-drawer-inq {
    width: 100%;
    margin-top: 20px;
    padding: 12px 20px;
    background: #c8a24a;
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* ── 吸顶下滑效果 ── */
.qing-hd-nav.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
    transform: translateY(-100%);
    animation: qing-hd-slidedown .35s ease forwards;
}
@keyframes qing-hd-slidedown {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}
/* 占位，避免吸顶时内容跳动 */
.qing-hd-nav-placeholder { display: none; }
.qing-hd-nav-placeholder.active { display: block; }

/* ── 响应式 ── */
@media (max-width: 1024px) {
    .qing-hd-tools span:not(.qing-hd-cart-count) { display: none; } /* 仅保留图标 */
    .qing-hd-inq-open { padding: 8px 14px; }
}
@media (max-width: 768px) {
    /* 移动端：保留蓝色单行页眉，仅显示 Logo + 汉堡（白色） */
    .qing-hd-nav-inner { padding: 10px 16px; gap: 12px; }
    .qing-hd-nav-inner .qing-hd-menu,
    .qing-hd-nav-inner .qing-hd-store-search,
    .qing-hd-nav-inner .qing-hd-tools { display: none; }
    .qing-hd-burger {
        display: inline-flex;
        align-items: center;
        margin-left: auto;
        color: #fff;
    }
}

/* 隐藏 bai-fan-huo 插件自带的货币切换器(页头) 与悬浮语言切换器
   —— 本主题已用 header 工具区的语言/货币下拉替代 */
.bfh-currency-switcher.bfh-position-header,
.bfh-language-switcher-floating {
    display: none !important;
}

/* 询盘弹窗 — 选填文件上传 */
.qing-hd-modal .qing-hd-inq-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    font-size: 13px;
    transition: border-color .2s, background .2s;
}
.qing-hd-modal .qing-hd-inq-upload:hover { border-color: #103A8E; background: rgba(16,58,142,.05); }
.qing-hd-modal .qing-hd-inq-upload svg { width: 20px; height: 20px; flex-shrink: 0; color: #103A8E; }
.qing-hd-modal .qing-hd-inq-upload-text { word-break: break-all; }

/* WhatsApp 复选框 */
.qing-hd-modal .qing-hd-inq-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #444;
    cursor: pointer;
}
.qing-hd-modal .qing-hd-inq-check input[type=checkbox] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #25D366;
}

/* 隐藏 header 工具区的货币切换器（桌面 + 抽屉） */
.qing-hd-dropdown.qing-hd-currency,
.qing-hd-drawer-group.qing-hd-currency {
    display: none !important;
}
