/* Collection / product list */

.collection-page {
  background: var(--surface);
  overflow-x: clip;
  max-width: 100%;
}

.collection-hero {
  padding: 28px 0 12px;
  background:
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--line);
}

.collection-hero__content {
  max-width: 760px;
  padding: 18px 0 36px;
}

.collection-hero__content h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin: 0 0 14px;
}

.collection-hero__content p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

.collection-body {
  padding: 36px 0 72px;
}

.collection-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.collection-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.collection-chip em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}

.collection-chip:hover,
.collection-chip.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.collection-chip:hover em,
.collection-chip.is-active em {
  color: rgba(255, 255, 255, 0.7);
}

.collection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.collection-toolbar__count {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.collection-toolbar__count strong {
  color: var(--ink);
  font-weight: 600;
}

/* 手机端紧凑标题条（桌面隐藏） */
.collection-mobile-bar {
  display: none;
}

.collection-page .product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 18px;
  min-width: 0;
}

/* reuse shop-card from home — duplicated essentials for list pages */
.collection-page .shop-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}

.collection-page .shop-card__media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface-2);
}

.collection-page .shop-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease);
}

.collection-page .shop-card:hover .shop-card__media img {
  transform: scale(1.04);
}

.collection-page .shop-card__quick {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.collection-page .shop-card:hover .shop-card__quick {
  opacity: 1;
  transform: translateY(0);
}

.collection-page .shop-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 2px 0;
}

.collection-page .shop-card__sku {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.collection-page .shop-card__title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.collection-page .shop-card__title a:hover {
  color: var(--accent);
}

.collection-page .shop-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.collection-page .shop-card__cart {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.collection-page .shop-card__cart svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.collection-page .shop-card__cart:hover,
.collection-page .shop-card__cart.is-added {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.collection-cta {
  padding: 56px 0;
  background: var(--ink);
  color: #fff;
}

.collection-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.collection-cta h2 {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 8px;
}

.collection-cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
}

@media (max-width: 1100px) {
  .collection-page .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  /* 产品页：收起顶部占用，首屏直接看产品 */
  body:has(.collection-page) .announce-bar {
    display: none;
  }

  body:has(.collection-page) .site-header .brand__logo {
    height: 40px;
  }

  body:has(.collection-page) .header-bar {
    min-height: 56px;
  }

  .collection-hero {
    display: none;
  }

  .collection-mobile-bar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 8px;
  }

  .collection-mobile-bar__title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
  }

  .collection-mobile-bar__count {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--muted);
  }

  .collection-body {
    display: flex;
    flex-direction: column;
    padding: 0 0 48px;
  }

  .collection-chips {
    order: 2;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    margin: 10px 0 0;
    padding: 0 0 2px;
    scrollbar-width: none;
  }

  .collection-chips::-webkit-scrollbar {
    display: none;
  }

  .collection-chip {
    flex-shrink: 0;
    min-height: 30px;
    padding: 0 11px;
    font-size: 12px;
  }

  .collection-toolbar {
    display: none;
  }

  .product-grid {
    order: 1;
  }

  .collection-body .pager {
    order: 3;
    margin-top: 20px;
  }

  .collection-page .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px 8px;
  }

  .collection-page .shop-card__media {
    aspect-ratio: 1 / 0.92;
  }

  .collection-page .shop-card__body {
    padding-top: 8px;
    gap: 4px;
  }

  .collection-page .shop-card__title {
    font-size: 13px;
    min-height: 2.5em;
  }

  .collection-page .shop-card__sku {
    display: none;
  }

  .collection-cta__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .collection-page .shop-card__quick {
    opacity: 1;
    transform: none;
    font-size: 0;
    background: transparent;
    pointer-events: none;
  }

  .collection-page .shop-card__row .price {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
  }

  .collection-page .shop-card__cart {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .collection-page .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px 6px;
  }

  .collection-mobile-bar__title {
    font-size: 16px;
  }
}
