/* 对齐 Nuxt front：ProductCenter.vue + CategoryCatalogCard.vue */

.product-center .page-header--brands {
  background: transparent;
  color: inherit;
  padding: 18px 0 8px;
  text-align: left;
  margin-bottom: 0;
  border-bottom: 1px solid #eef0f3;
}
.product-center .page-header__title-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 0;
}
.product-center .page-header__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--primary-color, #e83500);
  background: rgba(232, 53, 0, 0.08);
  flex-shrink: 0;
}
.product-center .page-header__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  color: #1f2937;
}
.product-center .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 4px;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.product-center .btn-primary {
  background: var(--primary-color, #e83500);
  color: #fff;
  border-color: var(--primary-color, #e83500);
}
.product-center .btn-primary:hover {
  background: var(--primary-dark, #c42d00);
}
.product-center .btn-default {
  background: #fff;
  color: #606266;
  border-color: #dcdfe6;
}
.product-center .btn-default:hover {
  color: var(--primary-color, #e83500);
  border-color: var(--primary-color, #e83500);
}

.product-list-section {
  padding: 24px 0 40px;
  min-height: 500px;
  background: #f5f7fa;
}
.product-locate-tip {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 6px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
}
.category-catalog-card--product-center.is-locate-target {
  box-shadow: 0 0 0 2px var(--primary-color, #e83500), 0 10px 24px rgba(15, 23, 42, 0.1);
  outline: none;
}
.brand-row.is-brand-hit,
.dialog-brand-item.is-brand-hit {
  box-shadow: 0 0 0 2px var(--primary-color, #e83500);
  background: #fff7ed;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.product-empty {
  text-align: center;
  color: #909399;
  padding: 48px 0;
  font-size: 14px;
}
.product-center .pagination,
.product-center .brands-pagination {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 20px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #ebeef5;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  color: #606266;
  font-size: 14px;
}
.product-center .pagination__meta {
  color: #909399;
  font-size: 13px;
}
.product-center .pagination__meta strong {
  color: #303133;
  font-weight: 600;
}
.product-center .pagination__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.product-center .pagination__pages {
  display: flex;
  align-items: center;
  gap: 6px;
}
.product-center .pagination__btn,
.product-center .pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  background: #fff;
  color: #606266;
  text-decoration: none;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.product-center .pagination__btn:hover,
.product-center .pagination__page:hover {
  color: var(--primary-color, #e83500);
  border-color: var(--primary-color, #e83500);
  background: #fff7f4;
}
.product-center .pagination__page.is-active {
  background: var(--primary-color, #e83500);
  border-color: var(--primary-color, #e83500);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(232, 53, 0, 0.25);
  pointer-events: none;
}
.product-center .pagination__btn--disabled {
  color: #c0c4cc;
  background: #f5f7fa;
  border-color: #ebeef5;
  cursor: not-allowed;
}
.product-center .pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  color: #c0c4cc;
  letter-spacing: 1px;
}
@media (max-width: 640px) {
  .product-center .brands-pagination {
    padding: 14px 12px;
    gap: 12px;
  }
  .product-center .pagination__btn,
  .product-center .pagination__page {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
  }
}

/* CategoryCatalogCard */
.category-catalog-card {
  background: var(--white, #fff);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  height: 288px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s;
}
.category-catalog-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
.category-catalog-card--product-center {
  height: 268px;
}
.category-catalog-card--product-center .brands-area {
  flex: 0 0 224px;
  height: 224px;
  padding: 10px 12px 6px;
}
.category-catalog-card--product-center .brands-area--grid {
  grid-template-rows: repeat(4, 48px);
  column-gap: 16px;
  row-gap: 8px;
}
.category-catalog-card--product-center .brand-row {
  min-height: 48px;
  gap: 8px;
}
.category-catalog-card--product-center .brand-logo-wrap {
  width: 42px;
  height: 42px;
  padding: 4px;
}
.category-catalog-card--product-center .brand-name { font-size: 14px; }
.category-catalog-card--product-center .category-title { font-size: 16px; }
.category-catalog-card--product-center .brand-row--placeholder { opacity: 0.92; }

.brands-area {
  flex: 0 0 244px;
  height: 244px;
  box-sizing: border-box;
  overflow: hidden;
  padding: 10px 12px 6px;
  border-bottom: 1px solid var(--border-color, #ebeef5);
}
.brands-area--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(4, 50px);
  grid-auto-flow: column;
  column-gap: 14px;
  row-gap: 8px;
  align-content: start;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #303133;
  font-size: 16px;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.brand-row--clickable { cursor: pointer; }
.brand-row--clickable:hover .brand-name { color: var(--primary-color, #e83500); }
.brand-row--clickable:hover .brand-logo-wrap {
  border-color: var(--primary-color, #e83500);
  box-shadow: 0 2px 8px rgba(232, 53, 0, 0.15);
}
.brand-row--placeholder { cursor: default; }
.brand-logo-wrap {
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  padding: 4px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e4e7ed;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-logo-fallback {
  width: 100%;
  height: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: linear-gradient(180deg, #fafbfc 0%, #eef1f5 100%);
  color: #909399;
  font-size: 13px;
  font-weight: 600;
}
/* display:flex 会盖掉原生 [hidden]，有 logo 时必须强制隐藏 fallback */
.brand-logo-fallback[hidden] {
  display: none !important;
}
.brand-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.category-title-row {
  position: relative;
  flex: 0 0 44px;
  height: 44px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: #fff;
}
.category-title-row--with-more { padding-right: 48px; }
.category-title {
  display: block;
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-color, #303133);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.category-more {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #909399;
  border-radius: 6px;
  line-height: 1;
}
.category-more:hover {
  color: var(--primary-color, #e83500);
  background: rgba(232, 53, 0, 0.08);
}
.category-more-text {
  font-size: 12px;
  font-weight: 500;
}

/* dialogs */
.portal-dialog[hidden] { display: none !important; }
.portal-dialog {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portal-dialog__mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.portal-dialog__panel {
  position: relative;
  z-index: 1;
  width: min(400px, 92vw);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.portal-dialog__panel--wide {
  width: min(720px, 94vw);
}
.portal-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #ebeef5;
}
.portal-dialog__head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #303133;
}
.portal-dialog__close {
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: #909399;
  cursor: pointer;
}
.portal-dialog__body { padding: 16px 18px 24px; }
.portal-dialog__panel--msg {
  width: min(420px, 92vw);
}
.portal-dialog__msg {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: #606266;
  text-align: center;
  word-break: break-word;
  white-space: pre-line;
}
.portal-dialog__msg--lead {
  margin-top: 0;
  font-size: 15px;
  font-weight: 600;
  color: #303133;
}
.portal-dialog__foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 18px;
}
.portal-dialog__foot--center {
  justify-content: center;
}
.portal-dialog__foot .btn {
  min-width: 88px;
  height: 36px;
  padding: 0 16px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 34px;
  cursor: pointer;
  box-sizing: border-box;
  border: 1px solid transparent;
  text-align: center;
  font-family: inherit;
}
.portal-dialog__foot .btn-primary {
  background: var(--primary-color, #e83500);
  color: #fff;
  border-color: var(--primary-color, #e83500);
}
.portal-dialog__foot .btn-primary:hover {
  filter: brightness(0.95);
}
.portal-dialog__foot .btn-default {
  background: #fff;
  color: #606266;
  border-color: #dcdfe6;
}
.portal-dialog__foot .btn-default:hover {
  color: var(--primary-color, #e83500);
  border-color: var(--primary-color, #e83500);
}
.dialog-brands-scroll {
  max-height: 196px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 2px 8px;
}
.dialog-brands-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 10px;
  align-content: start;
}
.dialog-brand-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 50px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #303133;
  font-size: 15px;
  text-align: left;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
}
.dialog-brand-item:hover .dialog-brand-name { color: var(--primary-color, #e83500); }
.dialog-brand-item:hover .brand-logo-wrap {
  border-color: var(--primary-color, #e83500);
  box-shadow: 0 2px 8px rgba(232, 53, 0, 0.12);
}
.dialog-brand-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-action-tip {
  margin: 0 0 20px;
  text-align: center;
  color: #606266;
  font-size: 14px;
}
.brand-action-btns {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 10px;
}
.brand-action-btn {
  min-width: 0;
  flex: 1 1 0;
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
}
.portal-dialog__panel--actions {
  width: min(460px, 94vw);
}
.portal-dialog__panel--actions .brand-action-btns {
  flex-wrap: nowrap;
}
.portal-dialog__panel--actions .brand-action-btn {
  flex: 1 1 0;
  min-width: 0;
}
.brand-action-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: #909399;
}

@media (max-width: 1200px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 768px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product-center .page-header--brands { padding: 14px 0 6px; }
  .product-center .page-header__title { font-size: 18px; }
  .product-center .page-header__icon { width: 32px; height: 32px; }
  .category-catalog-card--product-center { height: 252px; }
  .category-catalog-card--product-center .brands-area {
    flex: 0 0 208px;
    height: 208px;
    padding: 8px 10px 6px;
  }
  .category-catalog-card--product-center .brands-area--grid {
    grid-template-rows: repeat(4, 44px);
    column-gap: 12px;
    row-gap: 6px;
  }
  .category-catalog-card--product-center .brand-row { min-height: 44px; gap: 6px; }
  .category-catalog-card--product-center .brand-logo-wrap { width: 38px; height: 38px; }
  .category-catalog-card--product-center .brand-name { font-size: 13px; }
  .category-catalog-card--product-center .category-title { font-size: 15px; }
  .dialog-brands-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
}
