/* 选品页 - 定柔科技 */

.select-page {
  flex: 1;
  min-height: 0;
}

.select-page__inner {
  width: 100%;
}

/* 发货区域按钮 */
.select-regions {
  display: flex;
  flex-wrap: wrap;
  column-gap: 4px;
  row-gap: 10px;
}

.select-region-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  background: #f3f4f6;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.select-region-btn:hover {
  background: #eef5ff;
  color: #3b82f6;
}

.select-region-btn--active {
  background: #eef5ff;
  color: #3b82f6;
}

/* ========== 主体布局 ========== */
.select-main {
  display: flex;
  gap: 24px;
  margin-top: 0;
}

/* ========== 左侧分类树 ========== */
.select-sidebar {
  flex-shrink: 0;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  height: fit-content;
}

.select-category-tree__title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.select-category-tree__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.select-category-tree__item {
  margin: 0;
}

.select-category-tree__item--child {
  margin-left: 12px;
}

/* 三级分类：左侧竖线 */
.select-category-tree__item--level3 {
  border-left: 1px solid #e5e7eb;
  margin-left: 12px;
  padding-left: 8px;
}

.select-category-tree__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}

.select-category-tree__btn:hover {
  color: #111827;
}

/* 仅当前激活项显示蓝色 */
.select-category-tree__item:not(.select-category-tree__item--child)
  > .select-category-tree__btn--active,
.select-category-tree__item:not(.select-category-tree__item--child)
  > .select-category-tree__btn[aria-current='true'] {
  color: #3b82f6;
}

.select-category-tree__btn--active .select-category-tree__name,
.select-category-tree__btn[aria-current='true'] .select-category-tree__name {
  position: relative;
  padding-left: 12px;
}

.select-category-tree__btn--active .select-category-tree__name::before,
.select-category-tree__btn[aria-current='true']
  .select-category-tree__name::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #3b82f6;
}

/* 子级激活态蓝色 */
.select-category-tree__item--child .select-category-tree__btn--active,
.select-category-tree__item--child
  .select-category-tree__btn[aria-current='true'] {
  color: #3b82f6;
}

.select-category-tree__btn--child {
  font-size: 13px;
  font-weight: 400;
}

.select-category-tree__arrow {
  font-size: 16px;
  color: #9ca3af;
  transition: transform 0.25s ease;
}

/* 仅旋转当前展开项自身按钮内的箭头，不影响子级 */
.select-category-tree__item.is-open
  > .select-category-tree__btn
  .select-category-tree__arrow {
  transform: rotate(180deg);
}

.select-category-tree__children {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
}

.select-category-tree__children:not([hidden]) {
  display: block;
}

/* ========== 右侧内容区 ========== */
.select-content {
  flex: 1;
  min-width: 0;
}

.select-results-summary {
  margin: 0 0 16px;
  color: #323843;
  font-size: 16px;
  line-height: 22px;
}

.select-results-summary__count {
  font-weight: 500;
}

/* 条件筛选 */
.select-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 12px;
}

.select-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-page .filter-select-trigger {
  padding: 6px 12px;
  padding-right: 2.25rem;
  min-height: 34px;
}

.select-page .form-select-value {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 商品网格 */
.select-grid {
  display: grid;
  gap: 32px;
  background: #fff;
  border-radius: 12px;
  margin-top: 0;
}

@media (max-width: 768px) {
  .select-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* 条件筛选 - 移动端适配（Figma：两行两列，商品重量|发货中心 / 发货区域|综合排序） */
@media (max-width: 1023px) {
  .select-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0;
  }

  .select-filter {
    min-width: 0;
  }

  .select-filters .form-select-wrap {
    flex: 1;
    min-width: 0;
  }

  .select-filters .filter-select-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 6px 12px;
    padding-right: 2.25rem;
    min-height: 34px;
    border: 1px solid #d2d9e0;
    border-radius: 4px;
    color: #5d697a;
    font-size: 14px;
  }

  .select-filter.sm\:ml-auto {
    margin-left: 0;
  }
}
.select-product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #f2f3f5;
  border-radius: 10px;
  overflow: hidden;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
  padding: 16px;
  cursor: pointer;
}
@media (max-width: 768px) {
  .select-product-card {
    padding: 4px;
  }
}

.select-product-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.select-product-card__img-wrap {
  aspect-ratio: 1;
  background: #f3f4f6;
  overflow: hidden;
  margin-bottom: 16px;
}

.select-product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.select-product-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 12px;
}

.select-product-card__row {
  display: flex;
  align-items: center;
}

.select-product-card__row--title {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.select-product-card__name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 400;
  color: #1f2937;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.select-product-card__flag {
  flex-shrink: 0;
  object-fit: contain;
}

.select-product-card__price {
  font-size: 16px;
  font-weight: 600;
  color: #3b82f6;
}
.select-product-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 0 40px;
  text-align: center;
}

.select-product-empty__icon {
  width: 140px;
  height: 140px;
  object-fit: contain;
}

.select-product-empty__text {
  margin: 0;
  color: #828da5;
  font-size: 16px;
  line-height: 23px;
}

/* 分页：total | pageSize 选择器 | 页码 | 跳转（左到右） */
.select-pagination {
  max-width: 617px;
  margin: 0 auto;
}

.select-pagination__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
}

/* PC：info-row 为横向，与 nav、jump 同一行 */
.select-pagination__info-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.select-pagination__total {
  font-size: 14px;
  color: #6b7280;
  flex-shrink: 0;
}

.select-pagination__pagesize {
  min-width: 90px;
}

.select-pagination__pagesize-trigger {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 14px;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  width: 128px !important;
}

.select-pagination__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.select-pagination__arrow {
  font-size: 14px;
  color: #6b7280;
  background: transparent;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s;
}

.select-pagination__arrow:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #111827;
}

.select-pagination__arrow:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.select-pagination__btn {
  min-width: 34px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.select-pagination__btn:hover {
  color: #111827;
}

.select-pagination__btn--active {
  color: #3b82f6;
  background: transparent;
}

.select-pagination__ellipsis {
  padding: 0 4px;
  font-size: 14px;
  color: #9ca3af;
}

.select-pagination__jump {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-pagination__jump-label,
.select-pagination__jump-unit {
  font-size: 14px;
  color: #6b7280;
}

.select-pagination__jump-input {
  width: 48px;
  padding: 6px 8px;
  font-size: 14px;
  text-align: center;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  outline: none;
  -moz-appearance: textfield;
}
.select-pagination__jump-input::-webkit-outer-spin-button,
.select-pagination__jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.select-pagination__jump-input:focus {
  border-color: #3b82f6;
}

/* 分页 - 移动端适配（Figma 设计稿：两行布局，上行页码导航，下行共x条+每页条数） */
@media (max-width: 768px) {
  .select-pagination {
    padding: 12px 0;
    max-width: none;
  }

  .select-pagination__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* 上行：页码导航居中 */
  .select-pagination__nav {
    order: -1;
    justify-content: center;
    min-height: 34px;
  }

  /* 下行：共x条 + 每页条数选择器，与设计稿一致 */
  .select-pagination__info-row {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 34px;
  }

  .select-pagination__total {
    color: #323843;
  }

  .select-pagination__pagesize-trigger {
    border-color: #d2d9e0;
    border-radius: 4px;
  }

  /* 移动端隐藏「前往 x 页」跳转 */
  .select-pagination__jump {
    display: none;
  }

  /* 页码与箭头 32px 触控区域，与设计稿一致 */
  .select-pagination__arrow,
  .select-pagination__btn {
    min-width: 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
  }

  .select-pagination__btn {
    font-size: 14px;
    color: #606266;
  }

  .select-pagination__btn--active {
    color: #409eff;
  }

  .select-pagination__ellipsis {
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #606266;
  }
}

/* ========== 移动端分类底部弹窗（Figma 2575-17064） ========== */
.category-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.25s ease;
}

.category-drawer--open {
  pointer-events: auto;
  visibility: visible;
}

.category-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.category-drawer--open .category-drawer__backdrop {
  opacity: 1;
}

.category-drawer__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-height: 96vh;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.category-drawer--open .category-drawer__panel {
  transform: translateY(0);
}

/* 分类弹窗内三级分类按钮：未选中透明背景，选中保持蓝色高亮 */
.category-drawer .select-region-btn {
  background: transparent;
}
.category-drawer .select-region-btn:hover {
  background: #eef5ff;
}
.category-drawer .select-region-btn--active {
  background: #eef5ff;
  color: #3b82f6;
}
