/* =========================================================
   Category Detail Page - Table Layout
   类别详情页 - 全宽布局，商品表格展示
   ========================================================= */

/* ── Page Hero ── */
.category-detail-hero {
  background: linear-gradient(135deg, #0f3460 0%, #1a1a2e 100%);
  padding: 48px 0 36px;
  color: #fff;
}
.category-detail-hero h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 6px 0 0;
  color: #fff;
}

/* ── Breadcrumb ── */
.hero-breadcrumb {
  color: #e94560;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.hero-breadcrumb a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: color .15s;
}
.hero-breadcrumb a:hover {
  color: rgba(255,255,255,.9);
}
.hero-breadcrumb .sep {
  font-size: 10px;
  margin: 0 6px;
  color: rgba(255,255,255,.4);
}

/* ── Main Wrapper ── */
/* 直接继承 .container (max-width:1320px, padding:0 24px) */
.category-detail-wrap {
  padding-top: 36px;
  padding-bottom: 80px;
  background: #f4f7fb;
  min-height: 60vh;
}

/* 加载完毕后内容淡入 */
.content-fade-in {
  animation: contentFadeIn .35s ease both;
}
@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Category Info Card ── */
.category-info-card {
  background: #fff;
  border: 1px solid #e0e6ef;
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.category-info-img {
  width: 80px;
  height: 80px;
  border: 1px solid #d0dae8;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.category-info-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}
.category-info-text {
  flex: 1;
  min-width: 0;
}
.category-info-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}
.category-info-name strong {
  color: #e94560;
}
.category-info-text .desc {
  font-size: 13.5px;
  color: #555;
  line-height: 1.65;
  margin: 0;
  border: 1px solid #e0e6ef;
  padding: 10px 14px;
  border-radius: 6px;
  background: #fafbfc;
}

/* ── Subcategories ── */
.subcategories-section {
  margin-bottom: 28px;
}
.subcategories-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.subcategories-section h3::before {
  content: '';
  display: block;
  width: 4px;
  height: 16px;
  background: #e94560;
  border-radius: 2px;
}
.subcategories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.subcategory-card {
  background: #fff;
  border: 1px solid #e0e6ef;
  border-radius: 8px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all .18s;
  font-size: 13px;
}
.subcategory-card:hover {
  background: #eef2ff;
  border-color: #0f3460;
  box-shadow: 0 2px 8px rgba(15,52,96,.08);
}
.subcategory-card .name {
  font-weight: 600;
  color: #0f3460;
}
.subcategory-card .count {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  margin-left: 8px;
}

/* ── Products Table Section ── */
.products-table-section {
  background: #fff;
  border: 1px solid #e0e6ef;
  border-radius: 10px;
  overflow: hidden;
}
.products-table-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  padding: 18px 24px 16px;
  margin: 0;
  border-bottom: 1px solid #e8edf4;
  background: #fff;
}
.products-table-title span.cat-name-highlight {
  color: #e94560;
}

/* ── Table ── */
.products-table-wrap {
  overflow-x: auto;
}
.products-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  table-layout: fixed;
}
.products-table thead tr {
  background: #f4f7fb;
  border-bottom: 2px solid #e0e6ef;
}
.products-table thead th {
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  text-align: left;
  white-space: nowrap;
}
.products-table thead th.col-no {
  width: 48px;
  min-width: 48px;
  text-align: right;
  padding-right: 8px;
}
.products-table thead th.col-img {
  width: 90px;
  min-width: 90px;
  text-align: center;
}
.products-table thead th.col-part {
  width: 18%;
  min-width: 18%;
}
.products-table thead th.col-mfr {
  width: 20%;
  min-width: 20%;
  text-align: left;
  padding-left: 8px;
}
.products-table thead th.col-pkg {
  width: 14%;
  min-width: 14%;
  text-align: left;
  padding-left: 8px;
}
.products-table thead th.col-desc {
  width: 30%;
  min-width: 30%;
  padding-left: 16px;
}
.products-table thead th.col-rfq {
  width: 80px;
  min-width: 80px;
  text-align: center;
}
.products-table tbody tr {
  border-bottom: 1px solid #f0f3f8;
  transition: background .12s;
}
.products-table tbody tr:hover {
  background: #f8faff;
}
.products-table tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  color: #333;
}
.products-table tbody td.col-no {
  text-align: right;
  padding-right: 8px;
  color: #888;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.products-table tbody td.col-img {
  width: 90px;
  min-width: 90px;
  text-align: center;
}
.products-table tbody td.col-img img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 1px solid #e8edf4;
  border-radius: 4px;
  background: #f8fafc;
}
.products-table tbody td.col-img .img-placeholder {
  width: 64px;
  height: 64px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #94a3b8;
}
.products-table tbody td.col-part {
  width: 18%;
  min-width: 18%;
}
.products-table tbody td.col-mfr {
  width: 20%;
  min-width: 20%;
  padding-left: 8px;
}
.products-table tbody td.col-pkg {
  width: 14%;
  min-width: 14%;
  color: #444;
  font-size: 13px;
  padding-left: 8px;
  white-space: normal;
  word-break: break-all;
}
.products-table tbody td.col-desc {
  width: 30%;
  min-width: 30%;
  padding-left: 16px;
}
.products-table tbody td.col-part a {
  color: #0f3460;
  font-weight: 600;
  text-decoration: none;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}
.products-table tbody td.col-part a:hover {
  color: #e94560;
  text-decoration: underline;
}
.products-table tbody td.col-mfr {
  color: #444;
  font-weight: 500;
  padding-left: 8px;
}
.products-table tbody td.col-desc {
  color: #555;
  line-height: 1.5;
  overflow: hidden;
}
.products-table tbody td.col-rfq {
  width: 80px;
  min-width: 80px;
  text-align: right;
  padding-right: 30px;
  padding-left: 8px;
}
.btn-rfq {
  display: inline-block;
  background: #e94560;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 4px;
  text-decoration: none;
  letter-spacing: .5px;
  transition: background .15s;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-rfq:hover {
  background: #c73652;
  color: #fff;
}

/* ── Skeleton ── */
.skeleton-box {
  background: linear-gradient(90deg, #e2e8f0 25%, #f0f4f8 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  display: block;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.category-empty {
  text-align: center;
  padding: 64px 20px;
  color: #64748b;
}
.category-empty i {
  font-size: 40px;
  color: #d0dae8;
  margin-bottom: 14px;
  display: block;
}
.category-empty .title {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 6px;
}
.category-empty .desc {
  font-size: 13px;
}

/* ── Warning variant (orange) ── */
.category-empty--warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 4px solid #f59e0b;
  border-radius: 6px;
  padding: 24px 20px;
}
.category-empty--warning i {
  color: #f59e0b;
}
.category-empty--warning .title {
  color: #92400e;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 20px 24px;
  border-top: 1px solid #f0f3f8;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #d0dae8;
  background: #fff;
  color: #1a1a2e;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.page-btn:hover:not([disabled]):not(.active) {
  background: #eef2ff;
  border-color: #0f3460;
  color: #0f3460;
}
.page-btn.active {
  background: #0f3460;
  border-color: #0f3460;
  color: #fff;
  cursor: default;
}
.page-btn[disabled],
.page-btn.disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .category-detail-hero { padding: 32px 0 24px; }
  .category-detail-hero h1 { font-size: 22px; }
  .category-detail-wrap { padding-top: 20px; padding-bottom: 60px; }
  .category-info-card { flex-direction: column; gap: 14px; }
  .category-info-img { width: 60px; height: 60px; }
  .products-table thead th.col-desc { display: none; }
  .products-table tbody td.col-desc { display: none; }
}

@media (max-width: 480px) {
  .products-table thead th.col-mfr { display: none; }
  .products-table tbody td.col-mfr { display: none; }
}

/* ── RFQ Cart Modal Styles (from product.css) ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

    .modal-overlay.active {
        display: flex;
    }

.modal-box {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 860px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: modalIn .25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.modal-header {
    padding: 18px 36px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-radius: 10px 10px 0 0;
}

    .modal-header h2 {
        font-size: 16px;
        font-weight: 700;
        color: var(--text-dark);
        display: flex;
        align-items: center;
        gap: 10px;
        line-height: 1;
    }

        .modal-header h2::before {
            content: '';
            display: block;
            width: 4px;
            height: 16px;
            background: var(--accent);
            border-radius: 2px;
            flex-shrink: 0;
        }

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--transition);
}

    .modal-close:hover {
        color: var(--accent);
        background: #fef2f2;
    }

.modal-body {
    padding: 24px 36px;
}

/* ── 弹窗表头行（rfq 风格） ── */
.modal-table-header {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1.4fr 0.7fr 1.2fr auto;
    gap: 10px;
    align-items: center;
    border-bottom: 2px solid #eaeef2;
    padding-bottom: 12px;
    margin-bottom: 0;
    font-weight: 700;
    font-size: 10.5px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}

/* ── 弹窗数据行（rfq 风格） ── */
.modal-item-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1.4fr 0.7fr 1.2fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* 新增行红色边框动画 */
.modal-item-row.row-new {
    border: 2px solid #e94560;
    border-radius: 6px;
    padding: 8px 4px;
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.15);
    animation: modalNewRowFade 3s ease forwards;
}
@keyframes modalNewRowFade {
    0%, 70% { border-color: #e94560; box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.15); }
    100% { border-color: transparent; border-width: 0; box-shadow: none; padding: 10px 0; border-bottom: 1px solid #f0f2f5; }
}

    .modal-item-row .form-input,
    .modal-item-row input {
        margin: 0;
        font-size: 13px;
        padding: 10px 14px;
        border: 1px solid var(--border);
        border-radius: 6px;
        outline: none;
        transition: border-color var(--transition), box-shadow var(--transition);
        font-family: inherit;
        color: var(--text-dark);
        background: #fff;
        width: 100%;
    }

    .modal-item-row .form-input:focus,
    .modal-item-row input:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(15,23,42,.08);
    }

    .modal-item-row input[readonly] {
        background: #f8f9fc;
        color: #64748b;
        cursor: default;
        font-weight: 600;
    }

/* ── 弹窗删除按钮（与 cart.css 一致） ── */
.modal-item-row .btn-remove-item {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1.5px solid #f0f2f5;
    background: #fff;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
    font-size: 13px;
}

    .modal-item-row .btn-remove-item:hover {
        border-color: #e94560;
        color: #e94560;
        background: #fff1f3;
    }

/* ── 弹窗表单区域 ── */
#cart-form-wrap {
    padding: 24px 36px;
}

/* ── Add Part 按钮 ── */
#cart-form-wrap .btn-add-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fc;
    border: 1.5px dashed #c8d6e8;
    color: #0f3460;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 12px;
    transition: all .15s;
}

#cart-form-wrap .btn-add-row:hover {
    border-color: #0f3460;
    background: #eef2ff;
}

.modal-product-hint {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

    .modal-product-hint strong {
        color: var(--text-dark);
    }

.modal-footer {
    padding: 14px 0 0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

    .btn-cancel:hover {
        background: var(--bg-light);
        color: var(--text-dark);
    }

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

    .btn-submit:hover {
        background: var(--accent-hover);
    }

    .btn-submit:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

.modal-success {
    text-align: center;
    padding: 40px 36px;
    display: none;
}

    .modal-success.active {
        display: block;
    }

    .modal-success .success-icon {
        width: 64px;
        height: 64px;
        background: #f0fdf4;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        color: #16a34a;
        margin: 0 auto 16px;
    }

    .modal-success h3 {
        font-size: 18px;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 8px;
    }
