/* ============================================================
   询价车（RFQ）与产品列表工具条 —— v2.2.0

   这份样式分两块：
     一、页头工具簇 + 侧滑询价车面板（全站页头元素，全局加载）
     二、产品列表的搜索条 / 排序条（仅在商品列表 / 详情入队）

   依赖：入队依赖 cy-main，保证排在 main.css 之后，
   主题的 --cy-* 变量（配色 / 边框 / 圆角 / 阴影）都已经就绪。

   规格表（.cy-woo-attrs）**不在这里重复定义** —— 它已经在
   assets/css/woo.css 里，商品详情页本来就加载 woo.css；
   这里若再写一份，同一张表两处演化，改一处必漏另一处。
   ============================================================ */

/* ============================================================
   一、页头工具簇
   ------------------------------------------------------------
   购物车图标 / 询价车图标 / 我的账户，与主题的 .cy-header-actions
   共用 flex 布局，这里只补图标与角标的外观。
   ============================================================ */

.cy-header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------- 中英语言切换（v2.10.0） ----------
   放在工具簇最前，视觉上比购物车/账户更轻；当前语言加粗高亮，
   另一个语言是链接，点击跳到对应 /en 前缀（或去掉前缀）的同路径页面。 */
.cy-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}

.cy-lang-btn {
    color: var(--cy-text-muted);
    text-decoration: none;
    padding: 5px 3px;
    border-radius: 4px;
    transition: color .2s;
}

.cy-lang-btn:hover {
    color: var(--cy-primary);
}

.cy-lang-btn.is-active {
    color: var(--cy-primary);
    font-weight: 700;
}

.cy-lang-sep {
    color: var(--cy-border);
}

.cy-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--cy-text);
    background: none;
    border: 1px solid var(--cy-border);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}

.cy-cart:hover {
    color: var(--cy-primary);
    background: var(--cy-bg-soft);
}

/* 询价车入口（v2.2.5 起与「免费咨询」合并为一个按钮）：
   外观走 main.css 的 .cy-btn-primary，这里只保留角标需要的
   relative 定位，不再写死 40×40 图标尺寸（否则会把文案挤没）。 */
.cy-rfq-toggle {
    position: relative;
}

.cy-cart-icon,
.cy-rfq-icon {
    width: 20px;
    height: 20px;
}

/* 角标：购物车角标（Store API items_count 刷新）与询价车角标（localStorage 计数）共用同一套外观 */
.cy-cart-count,
.cy-rfq-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: #e11d48;
    border: 2px solid #fff;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

/* 我的账户：桌面显示文字，窄屏只留一个「登录」短文案（与 .cy-header-tel 的降级一致） */
.cy-account {
    display: inline-flex;
    align-items: center;
    padding: 9px 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--cy-text);
    text-decoration: none;
    white-space: nowrap;
}

.cy-account:hover {
    color: var(--cy-primary);
}

@media (max-width: 900px) {
    .cy-header-tools {
        gap: 6px;
    }
    .cy-account {
        font-size: 12.5px;
        padding: 9px 2px;
    }
}

/* ============================================================
   二、侧滑询价车面板
   ------------------------------------------------------------
   面板是 fixed 定位的右侧抽屉；遮罩铺满全屏。JS 在 body 上加
   .cy-rfq-open 后，下面两条规则才会把它显示出来。
   ============================================================ */

.cy-rfq-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: rgba(15, 23, 42, .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.cy-rfq-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9991;
    width: min(420px, 92vw);
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: var(--cy-shadow-lg);
    transform: translateX(100%);
    transition: transform .28s ease;
}

.cy-rfq-open .cy-rfq-overlay {
    opacity: 1;
    visibility: visible;
}

.cy-rfq-open .cy-rfq-panel {
    transform: translateX(0);
}

.cy-rfq-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--cy-border);
}

.cy-rfq-panel-title {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
}

.cy-rfq-close {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
    color: var(--cy-text-muted);
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.cy-rfq-close:hover {
    color: var(--cy-text);
    background: var(--cy-bg-soft);
}

.cy-rfq-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 24px;
}

/* ---------- 行项 ---------- */

.cy-rfq-list {
    min-height: 80px;
}

.cy-rfq-empty {
    padding: 36px 0;
    text-align: center;
    color: var(--cy-text-muted);
}

.cy-rfq-items {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.cy-rfq-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--cy-border);
}

.cy-rfq-item-main {
    min-width: 0;
    flex: 1;
}

.cy-rfq-item-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    font-size: 14.5px;
    font-weight: 700;
}

.cy-rfq-item-brand {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--cy-primary);
}

.cy-rfq-item-name {
    color: var(--cy-text);
    text-decoration: none;
}

.cy-rfq-item-name:hover {
    color: var(--cy-primary);
}

.cy-rfq-item-specs {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--cy-text-muted);
}

.cy-rfq-item-side {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.cy-rfq-item-qty {
    min-width: 22px;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cy-rfq-qty-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    font-size: 15px;
    line-height: 1;
    color: var(--cy-text);
    background: var(--cy-bg-soft);
    border: 1px solid var(--cy-border);
    border-radius: 6px;
    cursor: pointer;
}

.cy-rfq-qty-btn:hover {
    color: var(--cy-primary);
    border-color: var(--cy-primary);
}

.cy-rfq-remove {
    margin-left: 4px;
    padding: 4px;
    font-size: 12px;
    color: var(--cy-text-muted);
    background: none;
    border: none;
    cursor: pointer;
}

.cy-rfq-remove:hover {
    color: #e11d48;
}

/* ---------- 联系表单 ---------- */

.cy-rfq-form {
    border-top: 1px solid var(--cy-border);
    padding-top: 18px;
}

.cy-rfq-form-title {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
}

.cy-rfq-field {
    display: block;
    margin: 0 0 12px;
}

.cy-rfq-field span {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cy-text);
}

.cy-rfq-field input,
.cy-rfq-field textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--cy-text);
    background: #fff;
    border: 1px solid var(--cy-border);
    border-radius: 8px;
    box-sizing: border-box;
}

.cy-rfq-field input:focus,
.cy-rfq-field textarea:focus {
    outline: none;
    border-color: var(--cy-primary);
}

.cy-rfq-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    font-size: 13px;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

.cy-rfq-submit {
    width: 100%;
}

.cy-rfq-success {
    padding: 28px 0;
    text-align: center;
}

.cy-rfq-success h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 900;
}

.cy-rfq-success p {
    margin: 0;
    color: var(--cy-text-muted);
}

/* ============================================================
   三、产品列表搜索条 / 排序条
   ------------------------------------------------------------
   DOM 由 archive-product.php 输出。核心筛选 / 排序在服务端完成
   （GET 表单 + query var），这里只负责把两条并排摆开。
   ============================================================ */

.cy-archive-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 18px;
}

.cy-archive-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 320px;
}

.cy-archive-search input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--cy-text);
    background: #fff;
    border: 1px solid var(--cy-border);
    border-radius: 8px;
}

.cy-archive-search input[type="search"]:focus {
    outline: none;
    border-color: var(--cy-primary);
}

.cy-archive-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.cy-archive-sort select {
    padding: 10px 12px;
    font-size: 14px;
    color: var(--cy-text);
    background: #fff;
    border: 1px solid var(--cy-border);
    border-radius: 8px;
}

@media (max-width: 640px) {
    .cy-archive-tools {
        flex-direction: column;
        align-items: stretch;
    }
    .cy-archive-search,
    .cy-archive-sort {
        flex: 1 1 auto;
    }
    .cy-archive-sort select {
        flex: 1;
    }
}

/* ============================================================
   v2.8.21：首页底部 CTA 里的主按钮
   ------------------------------------------------------------
   按钮已改回「打开客户信息留资弹窗」（js-cy-lead-open），不再引用询价车：
   没有角标、没有 aria-controls，也不需要 relative 定位锚点。
   这里只保留一条：SVG 固定 20×20 且不参与伸缩，避免与 .cy-btn 的 gap
   叠加造成图标被压扁。规则限定在 .cy-cta 内，其它页面 / 其它按钮不受影响。
   ============================================================ */
.cy-cta .cy-cta-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
}
