/* ==========================================================================
   ROBINSON NUTRITION — PRODUCT CATALOGUE PAGE STYLES
   Premium dark navy hero, search toolbar, filterable card grid, and CTA
   ========================================================================== */

/* -----------------------------------------------------------------------
   1. PRODUCT HERO BANNER (Full-Width Navy Gradient + Particles)
   ----------------------------------------------------------------------- */
.products-hero-section {
  position: relative;
  background: linear-gradient(165deg, #07152B 0%, #0F2B5C 40%, #1A3E7A 100%);
  padding: 10rem 0 6rem;
  overflow: hidden;
  text-align: center;
}

.products-hero-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.products-hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
}

.products-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.1;
  letter-spacing: 0.04em;
  margin: 0.6rem 0 1.2rem;
}

.products-hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.7);
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

/* Hero Quick Stats Row */
.products-hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.products-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.products-hero-stat-val {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-accent-gold);
  letter-spacing: 0.03em;
}

.products-hero-stat-lbl {
  font-family: var(--font-badge);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
}

/* Curved Bottom */
.products-hero-curve {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  z-index: 1;
  line-height: 0;
}

.products-hero-curve svg {
  width: 100%;
  height: 80px;
}

/* -----------------------------------------------------------------------
   2. SEARCH & FILTER TOOLBAR — Premium Gen Z Aesthetic
   ----------------------------------------------------------------------- */
.products-toolbar-section {
  padding: 1rem 0 0.6rem;
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  border-bottom: 1px solid rgba(15, 43, 92, 0.06);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 1px 12px -3px rgba(15, 43, 92, 0.06);
}

/* ── Toolbar Row: search left, controls right ── */
.products-toolbar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

/* ── Premium Search Bar ── */
.products-search-wrap {
  position: relative;
  flex: 0 1 320px;
  min-width: 200px;
}

.search-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.products-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-primary-navy);
  opacity: 0.4;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.products-search-input {
  width: 100%;
  padding: 0.6rem 2.4rem 0.6rem 2.5rem;
  border-radius: 100px;
  border: 1.5px solid rgba(15, 43, 92, 0.1);
  background: rgba(15, 43, 92, 0.02);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  letter-spacing: 0.01em;
}

.products-search-input::placeholder {
  color: rgba(15, 43, 92, 0.32);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Focus State — Gold Accent Glow */
.products-search-input:focus {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 3px rgba(212, 175, 55, 0.12),
    0 2px 12px -2px rgba(212, 175, 55, 0.15);
}

.products-search-input:focus ~ .search-glow-line {
  transform: scaleX(1);
  opacity: 1;
}

.search-inner:focus-within .products-search-icon {
  color: var(--color-accent-gold);
  opacity: 1;
}

/* Animated Gold Glow Line under search */
.search-glow-line {
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    var(--color-accent-gold) 20%,
    var(--color-accent-gold-dark) 50%,
    var(--color-accent-gold) 80%,
    transparent
  );
  border-radius: 2px;
  transform: scaleX(0);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

/* Clear button */
.products-search-clear {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(15, 43, 92, 0.3);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: all 0.25s ease;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.products-search-clear:hover {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.08);
  transform: translateY(-50%) scale(1.1);
}

/* ── Right Controls Group ── */
.products-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Mobile Filter Toggle — hidden on desktop */
.mobile-filter-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 100px;
  border: 1.5px solid rgba(15, 43, 92, 0.12);
  background: rgba(15, 43, 92, 0.03);
  color: var(--color-primary-navy);
  font-family: var(--font-badge);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.mobile-filter-toggle svg {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.mobile-filter-toggle:hover,
.mobile-filter-toggle.active {
  border-color: var(--color-accent-gold);
  background: rgba(212, 175, 55, 0.06);
  color: var(--color-accent-gold-dark);
}

.mobile-filter-toggle.active svg {
  opacity: 1;
}

/* ── Results Count ── */
.products-results-count {
  font-family: var(--font-badge);
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(15, 43, 92, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ── View Toggle ── */
.products-view-toggle {
  display: flex;
  gap: 0.25rem;
}

.view-toggle-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1.5px solid rgba(15, 43, 92, 0.08);
  background: transparent;
  color: rgba(15, 43, 92, 0.3);
  cursor: pointer;
  transition: all 0.25s ease;
}

.view-toggle-btn:hover {
  border-color: var(--color-primary-navy);
  color: var(--color-primary-navy);
  background: rgba(15, 43, 92, 0.04);
}

.view-toggle-btn.active {
  background: var(--color-primary-navy);
  color: var(--text-white);
  border-color: var(--color-primary-navy);
  box-shadow: 0 2px 8px rgba(15, 43, 92, 0.2);
}

/* ── Filter Category Chips ── */
.products-filter-chips {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-bottom: 0.25rem;
}

.filter-chip {
  font-family: var(--font-badge);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(15, 43, 92, 0.08);
  background: transparent;
  color: rgba(15, 43, 92, 0.5);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.filter-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary-navy), var(--color-primary-navy-dark));
  opacity: 0;
  transition: opacity var(--transition-base);
  border-radius: inherit;
  z-index: -1;
}

.filter-chip:hover {
  border-color: var(--color-primary-navy);
  color: var(--color-primary-navy);
  background: rgba(15, 43, 92, 0.04);
  transform: translateY(-1px);
}

.filter-chip.active {
  background: var(--color-primary-navy);
  color: var(--text-white);
  border-color: var(--color-primary-navy);
  box-shadow: 0 3px 12px rgba(15, 43, 92, 0.2);
}

.filter-chip.active::before {
  opacity: 1;
}

.filter-chip .chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 800;
  margin-left: 0.3rem;
  background: rgba(15, 43, 92, 0.06);
  color: rgba(15, 43, 92, 0.4);
  transition: all var(--transition-base);
}

.filter-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-white);
}


/* -----------------------------------------------------------------------
   3. PRODUCT CARDS GRID
   ----------------------------------------------------------------------- */
.products-grid-section {
  padding: 3rem 0 4rem;
  background: var(--bg-body);
  min-height: 50vh;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.8rem;
  transition: all var(--transition-base);
}

/* List view layout */
.products-grid.list-view {
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* --- INDIVIDUAL PRODUCT CARD --- */
.product-card {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-accent-gold);
}

/* Card Badge */
.product-card-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-family: var(--font-badge);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-accent-gold) 0%, var(--color-accent-gold-dark) 100%);
  color: #0A1D3F;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

/* Card Number Tag */
.product-card-num {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.4;
  z-index: 3;
}

/* Card Image */
.product-card-img-wrap {
  position: relative;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-subtle) 100%);
  overflow: hidden;
  padding: 1.5rem;
}

.product-card-img-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, var(--bg-surface-elevated), transparent);
  z-index: 1;
  pointer-events: none;
}

.product-card-img {
  max-width: 75%;
  max-height: 200px;
  object-fit: contain;
  transition: transform 0.5s var(--ease-smooth);
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 20px rgba(15, 43, 92, 0.12));
}

.product-card:hover .product-card-img {
  transform: scale(1.08) translateY(-4px);
}

/* Card Body */
.product-card-body {
  padding: 1.2rem 1.4rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-series {
  font-family: var(--font-badge);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-gold);
  margin-bottom: 0.3rem;
}

.product-card-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.product-card-tagline {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Card Macro Chips Row */
.product-card-macros {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.product-macro-tag {
  font-family: var(--font-badge);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-navy-surface);
  color: var(--color-primary-navy);
  border: 1px solid rgba(15, 43, 92, 0.1);
}

/* Flavour Dots Row */
.product-card-flavours {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.flavour-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface-elevated);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  cursor: default;
  transition: transform var(--transition-fast);
}

.flavour-dot:hover {
  transform: scale(1.2);
  z-index: 2;
}

.flavour-dot-more {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 800;
  color: var(--text-muted);
  font-family: var(--font-badge);
}

/* Card CTA */
.product-card-cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-badge);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary-navy);
  transition: all var(--transition-base);
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.product-card-cta .cta-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary-navy-surface);
  color: var(--color-primary-navy);
  font-size: 0.9rem;
  transition: all var(--transition-base);
}

.product-card:hover .product-card-cta {
  color: var(--color-accent-gold-dark);
}

.product-card:hover .cta-arrow {
  background: var(--color-primary-navy);
  color: var(--text-white);
  transform: translateX(3px);
}

/* --- LIST VIEW CARD LAYOUT --- */
.products-grid.list-view .product-card {
  flex-direction: row;
  border-radius: var(--radius-md);
}

.products-grid.list-view .product-card-img-wrap {
  width: 220px;
  min-width: 220px;
  height: auto;
  min-height: 180px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.products-grid.list-view .product-card-body {
  padding: 1.2rem 1.5rem;
}

.products-grid.list-view .product-card-macros {
  margin-bottom: 0.6rem;
}

/* --- Card Stagger Animation --- */
.product-card {
  opacity: 0;
  transform: translateY(30px);
  animation: cardFadeIn 0.5s var(--ease-smooth) forwards;
}

@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger delays (applied via JS) */


/* -----------------------------------------------------------------------
   4. EMPTY STATE
   ----------------------------------------------------------------------- */
.products-empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.products-empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.products-empty-state h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.products-empty-state p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* -----------------------------------------------------------------------
   5. BOTTOM CTA SECTION
   ----------------------------------------------------------------------- */
.products-cta-section {
  padding: 5rem 0;
  background: var(--bg-surface);
}

.products-cta-box {
  background: linear-gradient(145deg, #0A1D3F 0%, #0F2B5C 50%, #1A3E7A 100%);
  border-radius: var(--radius-xl);
  padding: 4rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.products-cta-box::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.products-cta-box::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.products-cta-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
}

.products-cta-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.15;
  letter-spacing: 0.03em;
  margin-bottom: 1rem;
}

.products-cta-desc {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 2rem;
}

.products-cta-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* -----------------------------------------------------------------------
   6. PRODUCT HERO PARTICLES (Mini Floating Dots)
   ----------------------------------------------------------------------- */
.products-hero-particles .particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: heroParticleFloat linear infinite;
}

@keyframes heroParticleFloat {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(-100vh) scale(0.5);
    opacity: 0;
  }
}

/* -----------------------------------------------------------------------
   7. RESPONSIVE BREAKPOINTS
   ----------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.4rem;
  }

  .products-search-wrap {
    flex: 0 1 280px;
  }
}

@media (max-width: 768px) {
  .products-hero-section {
    padding: 8rem 0 5rem;
  }

  .products-hero-title {
    font-size: 2rem;
  }

  .products-hero-stats {
    gap: 1.5rem;
  }

  .products-hero-stat-val {
    font-size: 1.6rem;
  }

  .products-toolbar-section {
    position: relative;
    top: 0;
  }

  /* Search bar takes more space on tablet */
  .products-search-wrap {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Show the filter toggle button */
  .mobile-filter-toggle {
    display: flex;
  }

  /* Hide chips by default, show via JS toggle */
  .products-filter-chips {
    display: none;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 0.6rem 0 0.35rem;
    scrollbar-width: none;
    border-top: 1px solid rgba(15, 43, 92, 0.06);
    margin-top: 0.5rem;
    animation: chipsPanelSlide 0.3s ease forwards;
  }

  .products-filter-chips.filters-open {
    display: flex;
  }

  .products-filter-chips::-webkit-scrollbar {
    display: none;
  }

  @keyframes chipsPanelSlide {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Hide results count on mobile to save space */
  .products-results-count {
    display: none;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
  }

  .products-grid.list-view .product-card {
    flex-direction: column;
  }

  .products-grid.list-view .product-card-img-wrap {
    width: 100%;
    min-width: unset;
    min-height: 200px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .products-cta-box {
    padding: 2.5rem 1.5rem;
  }

  .products-cta-title {
    font-size: 1.6rem;
  }

  .products-view-toggle {
    display: none;
  }
}

@media (max-width: 480px) {
  .products-hero-section {
    padding: 7rem 0 4rem;
  }

  .products-hero-stats {
    gap: 1rem;
  }

  /* Hide the "Filters" label on small phones, icon only */
  .filter-toggle-label {
    display: none;
  }

  .mobile-filter-toggle {
    padding: 0.45rem 0.65rem;
  }

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

  .product-card-img-wrap {
    height: 200px;
  }
}