/* Product listing — page-specific styles */

.product-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Each li is a flex container so the card inside stretches to fill the
   full grid cell height — this is what pins the "Add to cart" button
   to the bottom regardless of description length.
   The [hidden] rule restores display:none for filtered items —
   .product-grid li { display: flex } would otherwise win on specificity.
   CSS specificity pitfall discussed in Section 6, Chapter 12 — Live
   regions and error announcement (hidden attribute vs display property). */
.product-grid li {
  display: flex;
  list-style: none;
}

.product-grid li[hidden] {
  display: none;
}

.product-card,
.product-card .card-body {
  display: flex;
  flex: 1; /* fill the li (or card) so both reach the same height */
  flex-direction: column;
}

.product-image {
  align-items: center;
  aspect-ratio: 4/3;
  background: linear-gradient(
    135deg,
    var(--color-brand) 0%,
    var(--color-brand-mid) 100%
  );
  display: flex;
  font-size: 3.5rem;
  justify-content: center;
  user-select: none;
}

.product-header {
  align-items: flex-start;
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.product-name {
  color: var(--color-brand-text);
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.3;
}

.product-price {
  color: var(--color-brand-text);
  font-size: var(--text-lg);
  font-weight: 800;
  white-space: nowrap;
}

.product-desc {
  color: var(--color-muted);
  flex: 1;
  font-size: var(--text-sm);
  line-height: 1.5;
  margin-bottom: var(--space-4);
}

.product-meta {
  align-items: center;
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.product-weight {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.product-rating {
  color: var(--color-gold-text);
  font-size: var(--text-xs);
  font-weight: 600;
}

.product-cta {
  width: 100%;
}

/* Hero banner */
.site-hero {
  background: var(--color-brand);
  color: var(--color-white);
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.site-hero h1 {
  color: var(--color-white);
  font-size: var(--text-4xl);
  margin: 0 auto var(--space-4);
  max-width: 680px;
}

.site-hero p {
  color: var(--color-gold-light);
  font-size: var(--text-lg);
  font-style: italic;
  margin: 0 auto var(--space-8);
  max-width: 520px;
}

.hero-cta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}

.btn-hero-primary {
  background: var(--color-gold-light);
  border-color: var(--color-gold-light);
  color: var(--color-brand);
}

.btn-hero-primary:hover {
  background: #c09030;
  border-color: #c09030;
}

.btn-hero-secondary {
  background: transparent;
  border-color: rgb(255 255 255 / 50%);
  color: var(--color-white);
}

.btn-hero-secondary:hover,
.btn-hero-secondary:focus-visible {
  background: rgb(255 255 255 / 10%);
  border-color: var(--color-white);
  outline: none;
}

/* Hero — responsive font size and padding */
@media (width <= 640px) {
  .site-hero {
    padding: var(--space-8) var(--space-4);
  }

  .site-hero h1 {
    font-size: var(--text-2xl); /* 24px — readable without overflowing */
  }

  .site-hero p {
    font-size: var(--text-base);
  }
}

/* Section divider */
.section-header {
  align-items: baseline;
  display: flex;
  gap: var(--space-4);
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.section-header h2 {
  color: var(--color-brand-text);
}

.view-all {
  color: var(--color-brand-text);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}
