/* ============================================================
   STYLE 9 - 绿色系工业风（由风格 8 派生）
   配色：浅绿头部/页脚 #166534 · 琥珀金按钮 #D97706
   特点：表格化产品列表 · 简化筛选 · 完全匹配 · 纯中文
   类名沿用 s2- 前缀（独立页面，不影响其他风格）
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #fff;
    font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    color: #333;
}

.s2-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部工具条样式已抽离到 /static/common/utility.css（公共组件） */

/* 主头栏/促销条样式已抽离到 /static/common/header.css（公共组件） */

/* ---------- 面包屑 ---------- */
.s2-breadcrumb { padding: 14px 0; font-size: 13px; color: #666; }
.s2-breadcrumb a { color: #2E8B57; text-decoration: none; }
.s2-breadcrumb a:hover { text-decoration: underline; }

/* ---------- 内容布局 ---------- */
.s2-content { padding-bottom: 48px; }
.s2-layout { display: flex; gap: 24px; align-items: flex-start; }

/* ---------- 左侧筛选栏 ---------- */
.s2-filter {
    width: 224px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #E3E6EA;
    border-radius: 10px;
    padding: 18px 16px;
    position: sticky;
    top: 80px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.s2-filter-heading { font-size: 16px; font-weight: 800; color: #14532D; margin-bottom: 14px; }
.s2-filter-group { padding: 12px 0; border-top: 1px solid #EEF1EF; }
.s2-filter-title { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: #6B7280; margin-bottom: 8px; }
.s2-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    padding: 3px 0;
    cursor: pointer;
}
.s2-filter-item:hover { color: #B45309; }
.s2-filter-item input { accent-color: #D97706; cursor: pointer; }
.s2-checkrow { padding: 4px 0; }
.s2-text-input {
    width: 100%;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    padding: 7px 9px;
    font-size: 13px;
    outline: none;
    color: #333;
}
.s2-text-input:focus { border-color: #D97706; box-shadow: 0 0 0 2px rgba(217,119,6,.15); }

/* ---------- 工具栏 ---------- */
.s2-results { flex: 1; min-width: 0; }
.s2-toolbar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #E3E6EA;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.s2-found { font-size: 14px; color: #1F2937; font-weight: 700; margin-right: auto; }
.s2-tool-group { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6B7280; }
.s2-tool-group select {
    background: #fff;
    border: 1px solid #D1D5DB;
    color: #333;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
    outline: none;
}

/* ---------- 排序横向单选按钮组（替代原下拉菜单） ---------- */
.s2-sort-tabs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.s2-sort-tab {
    background: #fff;
    border: 1px solid #D1D5DB;
    color: #4B5563;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: all .15s ease;
}
.s2-sort-tab:hover { border-color: #16A34A; color: #15803D; }
.s2-sort-tab.is-on {
    background: #16A34A;
    border-color: #16A34A;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(22, 163, 74, .3);
}

/* ---------- 表格化产品列表 ---------- */
.s2-table {
    border: 1px solid #E3E6EA;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.s2-tr {
    display: grid;
    grid-template-columns: 92px 1fr 90px 62px 92px 104px 68px 118px;
    align-items: center;
    column-gap: 6px;
}
.s2-tr-head {
    background: #F0F6F2;
    border-bottom: 1px solid #DCE8E1;
}
.s2-tr-head .s2-td {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .5px;
    color: #14532D;
}
.s2-td {
    padding: 12px 8px;
    font-size: 13px;
    border-bottom: 1px solid #F0F2F1;
    min-width: 0;
}
.s2-item:last-child .s2-td { border-bottom: none; }
.s2-item.hidden-row { display: none; }
.s2-item:hover { background: #F7FBF8; }
.s2-item:hover .s2-td { border-bottom-color: #EDF4EF; }
/* 品牌列无左侧内边距 */

/* 主行各单元格等高、内容垂直居中，保证下边线齐平 */
.s2-item {
    align-items: stretch; /* 覆盖 .s2-tr 的 center */
}
.s2-item .s2-td {
    display: flex;
    align-items: center;
}
.s2-item .s2-td-model {
    justify-content: flex-start;
    flex-wrap: wrap; /* 别名型号换行到第二行（无别名时不生效） */
}
/* 型号别名（海外行 xhname_alias 有值时显示）：小字一行，样式对齐产地·包装次行 */
.s2-model-alias {
    flex-basis: 100%;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    line-height: 1.3;
    word-break: break-all;
}
/* 数量列（库存）内容统一居中：真实库存数字、「--」占位符、无货都居中显示 */
.s2-td-stock {
    justify-content: center;
    text-align: center;
}

/* 产地·包装 列：产地一行、包装小字一行（纵向排列，单字段时垂直居中） */
.s2-item .s2-td-origin {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}
.s2-origin-line { font-size: 13px; color: #333; line-height: 1.3; }
.s2-origin-sub { font-size: 11px; color: #999; margin-top: 2px; line-height: 1.3; }

.s2-brand-dot {
    display: inline-block;
    width: 3px;
    height: 15px;
    border-radius: 2px;
    margin-right: 8px;
    vertical-align: middle;
}
/* 品牌列：超长品牌由 JS 截为前 7 个字母 + 省略号，悬停 title 显示全部 */
.s2-brand-name {
    display: inline-block;
    white-space: nowrap;
    vertical-align: middle;
}
.s2-item-title { font-size: 15px; font-weight: 700; color: #14532D; text-decoration: none; white-space: nowrap; }
.s2-item-title:hover { color: #D97706; text-decoration: underline; }
/* 促销小火焰图标（型号后，促销表商品显示） */
.s2-promo-flame {
    display: inline-block;
    margin-left: 6px;
    font-size: 13px;
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
}
/* 型号超过 26 字符时换行显示 */
.s2-item-title.s2-model-long {
    white-space: normal;
    word-break: break-all;
    max-width: 100%;
}

.s2-stock { color: #16A34A; font-weight: 700; font-size: 14px; }
.s2-stock-out { color: #B91C1C; font-weight: 700; font-size: 13px; }
.s2-future { color: #2E8B57; font-weight: 700; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.s2-future-none { color: #C4C9C6; font-weight: 400; }
/* 货期列 */

/* 折叠展开箭头 */
.s2-arrow {
    display: inline-block;
    width: 14px;
    margin-right: 2px;
    font-size: 10px;
    line-height: 1;
    color: #2E8B57;
    cursor: pointer;
    transition: transform .15s;
    vertical-align: middle;
    user-select: none;
}
.s2-arrow.open { transform: rotate(90deg); }
.s2-arrow-empty { visibility: hidden; }

/* 折叠明细行（库房1/库房2...） */
.s2-detail-row {
    background: #FBFDFC;
    align-items: stretch; /* 覆盖 .s2-tr 的 center：各单元格等高，保证下边线齐平 */
}
.s2-detail-row .s2-td {
    display: flex;
    align-items: center;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 12px;
    border-bottom: 1px dashed #E3EDE7;
    background: transparent;
    min-height: 34px;
}
.s2-detail-row:last-child .s2-td { border-bottom: none; }
.s2-detail-tag {
    display: inline-block;
    background: #E3F2E9;
    color: #14532D;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
}

.s2-price-now { color: #C9820A; font-weight: 800; font-size: 15px; white-space: nowrap; }
.s2-price-old { color: #999; text-decoration: line-through; font-size: 12px; margin-left: 4px; }
/* 会员 V 徽章（有折扣时紧跟划线原价；title 展示具体折扣） */
.s2-price-tag { display: inline-flex; align-items: center; justify-content: center; flex: none; margin-left: 6px; width: 16px; height: 16px; padding: 0; border-radius: 50%; background: linear-gradient(135deg, #F5C97B, #C9820A); color: #fff; font-size: 10px; font-weight: 800; line-height: 1; box-shadow: 0 1px 2px rgba(201, 130, 10, .35); white-space: nowrap; }

.s2-qty {
    width: 52px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    padding: 6px 4px;
    text-align: center;
    font-size: 13px;
    color: #333;
    outline: none;
}
.s2-qty:focus { border-color: #D97706; }

/* 明细行只读数量框（灰色，不可编辑） */
.s2-detail-row .s2-qty:read-only {
    background: #EEF1EF;
    color: #666;
    cursor: not-allowed;
}
.s2-detail-row .s2-qty:read-only:focus { border-color: #D1D5DB; }

.s2-cart-btn {
    background: #D97706;
    color: #fff;
    border: none;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(217,119,6,.3);
    transition: background .15s;
}
.s2-cart-btn:hover { background: #B45309; }
.s2-check-btn {
    background: #fff;
    color: #2E8B57;
    border: 1px solid #2E8B57;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.s2-check-btn:hover { background: #F0F9F4; border-color: #16A34A; color: #15803D; }

.s2-empty {
    text-align: center;
    padding: 48px 0;
    color: #888;
    font-size: 15px;
}

/* ---------- 分页 ---------- */
.s2-pagination { display: flex; justify-content: center; margin-top: 20px; }
.s2-pager {
    list-style: none;
    display: flex;
    gap: 6px;
    align-items: center;
}
.s2-pg {
    min-width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid #E2E5E9;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    background: #fff;
    user-select: none;
}
.s2-pg:hover { border-color: #D97706; color: #B45309; }
.s2-pg.active { color: #fff; background: #D97706; border-color: #D97706; font-weight: 800; }
.s2-pg-more { color: #999; padding: 0 4px; border: none; cursor: default; }

/* ---------- 页脚（浅绿） ---------- */
/* 页脚已抽离到 /static/common/footer.css（.util-footer 系列），删除原 s2-footer/s2-benefits 等样式 */

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .s2-layout { flex-direction: column; }
    .s2-filter { width: 100%; position: static; }
    .s2-table { overflow-x: auto; }
    .s2-tr { min-width: 880px; }
}

/* ---------- 加购成功提示弹框（继续购物 / 去结算） ---------- */
.s2-tip { position: fixed; inset: 0; z-index: 999; display: none; }
.s2-tip.on { display: block; }
.s2-tip-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 30, 22, .45);
    backdrop-filter: blur(2px);
}
.s2-tip-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    max-width: 90vw;
    background: #fff;
    border-radius: 12px;
    padding: 26px 24px 22px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.s2-tip-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #2E8B57;
    color: #fff;
    font-size: 28px;
    line-height: 54px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(46, 139, 87, .3);
}
.s2-tip-title { font-size: 17px; font-weight: 700; color: #0F3D2E; margin: 0 0 6px; }
.s2-tip-desc { font-size: 13px; color: #6B7F73; margin: 0 0 18px; word-break: break-all; }
.s2-tip-ops { display: flex; gap: 10px; }
.s2-tip-btn {
    flex: 1;
    height: 40px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all .15s;
}
.s2-tip-continue { background: #fff; color: #33423A; border: 1px solid #CBDCD0; }
.s2-tip-continue:hover { border-color: #2E8B57; color: #2E8B57; }
.s2-tip-checkout {
    background: #D97706;
    color: #fff;
    box-shadow: 0 3px 10px rgba(217, 119, 6, .3);
}
.s2-tip-checkout:hover { background: #B45309; }
