/* ========================================
   XuZhiShi — Products Page
   Apple Design Language · Clean cards
   ======================================== */

/* --- Page Hero --- */
.products-hero {
  background: linear-gradient(180deg, #f0f4fa 0%, #f5f5f7 40%, #fff 100%);
  padding: clamp(6rem, 12vw, 10rem) clamp(1.5rem, 8vw, 6rem) clamp(3rem, 6vw, 5rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.products-hero::before {
  content: '';
  position: absolute;
  top: -30%; right: -20%;
  width: clamp(400px, 60vw, 700px);
  height: clamp(400px, 60vw, 700px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,113,227,0.04), transparent 70%);
  pointer-events: none;
}

/* --- Filter Tabs --- */
.product-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  position: relative;
  z-index: 2;
}
.tab-btn {
  padding: 0.55rem 1.2rem;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--card-border);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  white-space: nowrap;
}
.tab-btn:hover {
  background: var(--bg);
  color: var(--text);
  border-color: rgba(0,113,227,0.2);
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(0,113,227,0.22);
}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* --- Product Card --- */
.product-card {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  overflow: hidden;
  transition: all 0.45s var(--ease-out);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 44px rgba(0,0,0,0.07);
  border-color: rgba(0,0,0,0.12);
}
.product-card.hidden { display: none; }

/* Thumbnail */
.pc-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-secondary);
  position: relative;
}
.pc-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-out);
}
.product-card:hover .pc-thumb img {
  transform: scale(1.03);
}

/* Tag overlay on image */
.pc-thumb-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  z-index: 2;
}

/* Body */
.pc-body {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.pc-body h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
  color: var(--text);
  line-height: 1.3;
}
.pc-body > p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
  flex: 1;
}

/* Feature pills */
.pc-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.pc-feat {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

/* CTA link */
.pc-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  margin-top: auto;
  transition: gap 0.25s var(--ease-out);
}
.pc-link:hover { gap: 8px; }
.pc-link i {
  font-size: 0.75rem;
  transition: transform 0.25s var(--ease-out);
}
.pc-link:hover i { transform: translateX(2px); }

/* --- Fallback icon badge --- */
.pc-icon-badge {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 0.75rem;
}

/* --- Filter transition --- */
.product-grid.filtering .product-card:not(.hidden) {
  animation: cardFadeIn 0.35s var(--ease-out);
}
@keyframes cardFadeIn {
  from { opacity: 0.5; transform: translateY(8px); }
  to   { opacity: 1;   transform: translateY(0); }
}

/* --- Empty State --- */
.products-empty {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
  grid-column: 1/-1;
}
.products-empty i {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  color: var(--text-muted);
  opacity: 0.3;
}

/* --- Reveal Animation --- */
.product-card.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.product-card.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Page Content --- */
.page-content {
  max-width: 720px;
  margin: 4rem auto 0;
  color: var(--text-secondary);
  line-height: 1.9;
  font-size: 1rem;
}
.page-content h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; }
.page-content h3 { font-size: 1.125rem; margin: 1.5rem 0 0.5rem; }
.page-content ul, .page-content ol { padding-left: 1.5rem; margin: 1rem 0; }
.page-content li { margin-bottom: 0.5rem; }

/* --- Responsive --- */
@media (max-width: 1023px) {
  .product-grid { gap: 16px; }
  .pc-body { padding: 16px 18px 18px; }
}
@media (max-width: 767px) {
  .product-grid { grid-template-columns: 1fr; gap: 14px; }
  .product-tabs { gap: 5px; }
  .tab-btn { font-size: 0.75rem; padding: 0.45rem 0.9rem; }
  .pc-body { padding: 14px 16px 16px; }
  .products-hero { padding: clamp(4rem, 8vw, 6rem) 1.25rem clamp(2rem, 4vw, 3rem); }
}
@media (max-width: 480px) {
  .pc-body h3 { font-size: 1rem; }
  .pc-thumb { aspect-ratio: 4/3; }
}
