/* ============================================================
   BuzzReicpe — Products Page
   Apple Education Page Style | Text-first resource cards
   Complete standalone stylesheet
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-rgb: 0, 113, 227;
  --bg: #ffffff;
  --light-bg: #f5f5f7;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --border: rgba(0,0,0,.08);
  --radius: 16px;
  --radius-sm: 12px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.08);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; color: transparent; font-size: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---- Layout ---- */
.content-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 980px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  padding: 12px 28px;
  transition: background .2s ease, transform 160ms var(--ease-out), box-shadow .2s ease;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(.97); }

.btn-sm { padding: 8px 20px; font-size: 13px; }

.btn-subscribe {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   HEADER — Frosted glass
   ============================================================ */
.site-header {
  position: relative;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo i { color: var(--accent); font-size: 20px; }

.main-nav { display: flex; align-items: center; gap: 32px; }
.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s ease;
  position: relative;
}
.main-nav a:hover { color: var(--text); }
.main-nav a:active { transform: scale(.97); }
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .2s var(--ease-out);
}
.main-nav a:hover::after { transform: scaleX(1); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-search {
  width: 38px;
  height: 38px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, color .2s ease, transform 160ms var(--ease-out);
}
.btn-search:hover { background: var(--light-bg); color: var(--text); }
.btn-search:active { transform: scale(.92); }

/* ============================================================
   PAGE HERO — Gradient only, no photo
   ============================================================ */
.page-hero {
  position: relative;
  padding: 120px 0 80px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%);
  z-index: 0;
}

.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  width: 800px;
  height: 600px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 50% at center, rgba(0,113,227,.08), transparent 70%);
  z-index: 1;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 16px;
}

.page-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.03em;
  max-width: 720px;
  margin: 0 auto 16px;
  color: var(--text);
}

.page-hero-desc {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.55;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 36px;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-width: 140px;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.hero-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.hero-stat:active { transform: scale(.97); }

.hero-stat-num {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--text);
}

.hero-stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ============================================================
   CATEGORY PILLS
   ============================================================ */
.category-pills {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
  top: 56px;
  z-index: 50;
}

.pills-scroll {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  padding-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pills-scroll::-webkit-scrollbar { display: none; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--light-bg);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: all .2s var(--ease-out);
}
.pill:hover { color: var(--text); background: #e8e8ed; }
.pill:active { transform: scale(.96); }
.pill.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.pill.active:hover { background: var(--accent-hover); }

/* ============================================================
   PRODUCTS SECTION — Sidebar + Grid layout
   ============================================================ */
.products-section {
  padding-top: 48px;
  padding-bottom: 100px;
}

.with-sidebar {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  position: relative;
  top: 120px;
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-title i { color: var(--accent); font-size: 12px; }

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .2s ease;
}
.sidebar-link:hover { color: var(--text); background: var(--light-bg); }
.sidebar-link:active { transform: scale(.97); }
.sidebar-link.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), .06);
  font-weight: 600;
}

/* Price range inputs */
.price-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .2s ease;
}
.price-input:focus { border-color: var(--accent); }
.price-input::placeholder { color: #aeaeb2; }

/* Hide number input spinners */
.price-input::-webkit-inner-spin-button,
.price-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.price-input[type=number] { -moz-appearance: textfield; }

.price-sep {
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
}

/* Availability checkbox */
.sidebar-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox-label {
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.checkbox-label i { color: var(--accent); font-size: 13px; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  min-width: 0;
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.toolbar-count {
  font-size: 14px;
  color: var(--text-muted);
}
.toolbar-count strong { color: var(--text); font-weight: 600; }

.toolbar-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.sort-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 980px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236e6e73'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color .2s ease;
}
.sort-select:focus { border-color: var(--accent); }

/* ============================================================
   PRODUCT GRID
   ============================================================ */
.product-grid {
  display: grid;
  gap: 24px;
}

.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ---- Product Card ---- */
.product-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  text-decoration: none;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
  opacity: 0;
  transform: translateY(24px);
  animation: card-fade-in .5s var(--ease-out) forwards;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.product-card:active { transform: scale(.97); }

@keyframes card-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

.product-card:nth-child(1) { animation-delay: 0ms; }
.product-card:nth-child(2) { animation-delay: 60ms; }
.product-card:nth-child(3) { animation-delay: 120ms; }
.product-card:nth-child(4) { animation-delay: 180ms; }
.product-card:nth-child(5) { animation-delay: 240ms; }
.product-card:nth-child(6) { animation-delay: 300ms; }

.product-card-bg {
  position: absolute;
  inset: 0;
  transition: transform .8s var(--ease-out);
}
.product-card:hover .product-card-bg { transform: scale(1.06); }

.product-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 15%, rgba(0,0,0,.55));
  z-index: 1;
}

.product-card-body {
  position: relative;
  z-index: 2;
  padding: 28px;
  width: 100%;
}

.product-card-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.8);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
  background: rgba(255,255,255,.15);
  padding: 4px 12px;
  border-radius: 980px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.product-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.product-card-excerpt {
  font-size: 13px;
  color: rgba(255,255,255,.8);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 95%;
}

.product-card-price {
  display: inline-block;
  margin-top: 12px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  font-family: 'Playfair Display', serif;
}

/* ============================================================
   SSR SAMPLE HIDING
   ============================================================ */
.product-grid:has(.product-card:not(.ssr-sample)) .ssr-sample {
  display: none;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .2s var(--ease-out);
  border: 1px solid var(--border);
  background: var(--bg);
}
.page-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), .04);
}
.page-btn:active { transform: scale(.92); }
.page-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.page-btn.disabled {
  opacity: .3;
  pointer-events: none;
  cursor: default;
}

/* ============================================================
   FOOTER — 4-column, matches homepage
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 0;
  background: var(--light-bg);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
}

.footer-col h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 18px;
  color: var(--text);
}

.footer-col p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 8px;
}

.footer-col a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  margin-bottom: 10px;
  line-height: 1.5;
  transition: color .2s ease;
}
.footer-col a:hover { color: var(--text); }
.footer-col a:active { transform: scale(.97); }

.footer-col-brand p { max-width: 300px; }

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
  transition: background .2s ease, color .2s ease, transform 160ms var(--ease-out);
  margin-bottom: 0;
}
.footer-social a:hover { background: var(--accent); color: #fff; }
.footer-social a:active { transform: scale(.92); }

/* Newsletter form */
.newsletter-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.newsletter-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 980px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.newsletter-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12);
}
.newsletter-form input::placeholder { color: #aeaeb2; }

.footer-bottom {
  margin-top: 48px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero-kicker,
  .page-hero-title,
  .page-hero-desc,
  .hero-stats,
  .product-card {
    opacity: 1;
    transform: translateY(0);
    animation: none;
  }
  .product-card:hover { transform: none; }
  .product-card:active,
  .pill:active,
  .hero-stat:active,
  .page-btn:active,
  .sidebar-link:active,
  .btn-primary:active,
  .btn-search:active,
  .main-nav a:active,
  .footer-social a:active,
  .footer-col a:active { transform: none; }
  .product-card:hover .product-card-bg { transform: none; }
}

/* ============================================================
   RESPONSIVE — 960px (Tablet)
   ============================================================ */
@media (max-width: 960px) {
  .cols-3 { grid-template-columns: repeat(2, 1fr); }

  .with-sidebar {
    flex-direction: column;
    gap: 32px;
  }

  .sidebar {
    width: 100%;
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 32px;
  }

  .sidebar-section { margin-bottom: 24px; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-col-brand { grid-column: 1 / -1; }

  .main-nav { display: none; }

  .page-hero { padding: 100px 0 60px; }
  .products-section { padding-top: 32px; padding-bottom: 80px; }

  .hero-stats { gap: 24px; }
  .hero-stat { padding: 16px 24px; min-width: 120px; }

  .category-pills { top: 56px; }
}

/* ============================================================
   RESPONSIVE — 600px (Mobile)
   ============================================================ */
@media (max-width: 600px) {
  .cols-3 { grid-template-columns: 1fr; }

  .page-hero { padding: 80px 0 48px; }
  .products-section { padding-top: 24px; padding-bottom: 60px; }

  .hero-stats {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .hero-stat { min-width: 160px; }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .footer-inner { grid-template-columns: 1fr; gap: 32px; }

  .toolbar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .toolbar-sort { width: 100%; }
  .sort-select { flex: 1; }

  .product-card { min-height: 240px; }
  .product-card-body { padding: 24px; }
  .product-card-title { font-size: 18px; }

  .pagination { gap: 4px; }
  .page-btn { width: 36px; height: 36px; font-size: 13px; }

  .header-inner { height: 50px; }
  .logo { font-size: 19px; }
}
