/* 商品列表页 */

.page-products.is-loading #storeHeader,
.page-products.is-loading .tk-products-shell,
.page-products.is-loading #storeFooter,
.page-products.is-loading #storeFooterLinks {
  visibility: hidden;
  pointer-events: none;
}

.page-products.is-loading .tk-products-loading {
  display: flex;
}

.tk-products-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 420px;
  color: #666;
  font-size: 14px;
}

.tk-products-loading__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #f0f0f0;
  border-top-color: #ff9900;
  border-radius: 50%;
  animation: tk-products-spin 0.8s linear infinite;
}

@keyframes tk-products-spin {
  to { transform: rotate(360deg); }
}

.page-products .tk-wrap,
.page-products .store-footer__inner {
  max-width: 1500px;
}

.page-products .store-footer {
  margin-top: 0;
}

.tk-products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
}

.tk-products-toolbar__sort {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #333;
}

.tk-products-toolbar__sort label {
  font-weight: 500;
  white-space: nowrap;
}

.tk-products-toolbar__sort select {
  min-width: 160px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 36px 8px 12px;
  font-size: 14px;
  color: #333;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  cursor: pointer;
}

.tk-products-toolbar__count {
  margin: 0;
  font-size: 14px;
  color: #666;
  white-space: nowrap;
}

.tk-products-main {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  padding-top: 24px;
  padding-bottom: 48px;
}

.tk-products-sidebar {
  align-self: start;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.tk-products-sidebar__title {
  margin: 0;
  padding: 20px 16px 12px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: #222;
}

.tk-products-sidebar__title::after {
  content: '';
  display: block;
  width: 42px;
  height: 3px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: #ffb800;
}

.tk-products-cat {
  list-style: none;
  margin: 0;
  padding: 6px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tk-products-cat__item {
  margin: 0;
}

.tk-products-cat__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  font-size: 14px;
  color: #333;
  line-height: 1.35;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}

.tk-products-cat__link:hover {
  border-color: #ffe0a3;
  box-shadow: 0 2px 10px rgba(255, 153, 0, 0.1);
  color: #ff9900;
}

.tk-products-cat__link.is-active {
  border-color: #ffb800;
  background: #fffbf0;
  color: #ff9900;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(255, 153, 0, 0.12);
}

.tk-products-cat__link.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: #ffb800;
  transform: translateY(-50%);
}

.tk-products-cat__icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #fafafa;
  border: 1px solid #f0f0f0;
}

.tk-products-cat__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tk-products-cat__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tk-products-content {
  min-width: 0;
}

.tk-products-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.tk-products-pagination a,
.tk-products-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background: #fff;
}

.tk-products-pagination a:hover {
  border-color: #ffb800;
  color: #ff9900;
}

.tk-products-pagination .is-current {
  background: #ff9900;
  border-color: #ff9900;
  color: #fff;
  font-weight: 600;
}

.tk-products-pagination .is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.tk-products-shell.is-busy .tk-products-content {
  opacity: 0.55;
  pointer-events: none;
}

.tk-products-shell.is-busy .tk-product-grid {
  min-height: 120px;
}

@media (max-width: 960px) {
  .tk-products-main {
    grid-template-columns: 1fr;
  }

  .tk-products-sidebar {
    order: -1;
  }
}

@media (max-width: 768px) {
  .page-products .tk-wrap {
    padding-left: 16px;
    padding-right: 16px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  .page-products .tk-products-shell,
  .page-products .tk-products-main,
  .page-products .tk-products-sidebar,
  .page-products .tk-products-content {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  .tk-products-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 0 10px;
    border-bottom: 0;
    background: #fff;
  }

  .tk-products-toolbar__sort {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    gap: 8px;
  }

  .tk-products-toolbar__sort label {
    flex-shrink: 0;
  }

  .tk-products-toolbar__sort select {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    padding: 7px 30px 7px 10px;
    font-size: 13px;
    border-radius: 8px;
    background-color: #f7f8fa;
    border-color: transparent;
  }

  .tk-products-toolbar__count {
    width: 100%;
    font-size: 12px;
    color: #999;
  }

  .tk-products-main {
    gap: 8px;
    padding-top: 0;
    padding-bottom: 20px;
  }

  .tk-products-sidebar {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .tk-products-sidebar__title {
    padding: 4px 0 10px;
    font-size: 15px;
  }

  .tk-products-sidebar__title::after {
    width: 36px;
    height: 2px;
    margin-top: 8px;
  }

  .tk-products-cat {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 0 12px;
  }

  .tk-products-cat__item:first-child {
    grid-column: 1 / -1;
  }

  .tk-products-cat__link {
    min-height: 42px;
    height: 100%;
    padding: 8px 10px;
    gap: 8px;
    font-size: 13px;
    border-radius: 8px;
    border-color: #eee;
    box-shadow: none;
    background: #fff;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .tk-products-cat__link.is-active {
    box-shadow: none;
  }

  .tk-products-cat__link.is-active::before {
    height: 18px;
  }

  .tk-products-cat__icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
  }

  .tk-products-cat__name {
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .tk-products-content {
    padding-top: 0;
  }

  .tk-products-pagination {
    margin-top: 16px;
    gap: 6px;
  }

  .tk-products-pagination a,
  .tk-products-pagination span {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .tk-products-loading {
    min-height: 280px;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  .tk-products-toolbar__sort,
  .tk-products-toolbar__sort select {
    width: auto;
  }
}
