/* ═══════════════════════════════════════════════════════════
   Shop by Category — homepage-only section, loaded via index.php's
   $extraCss (not shared with any other page). Same design as the
   Spare Parts Offers section further down the page (see
   assets/css/homepage-promo.css, .spare-offers*): lavender outer
   panel, header with a circular "view all" arrow, white cards
   (square image, title, pill CTA), same shape/size/spacing —
   built with the same shared --color-*/--space-*/--radius-* tokens
   so the two sections match value-for-value, not just visually.

   Scoped entirely under .shop-by-category — no bare element
   selectors, consistent with the rest of this homepage CSS set.
   ═══════════════════════════════════════════════════════════ */

.shop-by-category {
  padding-inline: var(--space-6);
  padding-top: clamp(2.5rem, 5vw, 4rem);
}

.shop-by-category__panel {
  max-width: var(--container-2xl);
  margin-inline: auto;
  padding: clamp(1.5rem, 3vw, 2rem);
  border-radius: var(--radius-2xl);
  background: #EDE9FE;
}

.shop-by-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
}

.shop-by-category__heading {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  color: var(--color-text-dark);
  margin: 0;
}

.shop-by-category__all {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-text-dark);
  color: #fff;
  transition: transform 0.2s ease;
}

.shop-by-category__all:hover {
  transform: translateX(2px);
}

.shop-by-category__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.shop-by-category__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-bg-white);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.shop-by-category__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.shop-by-category__media {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-light);
}

.shop-by-category__media picture,
.shop-by-category__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Title left, CTA right, on the same row — replaces the earlier
   stacked layout so the button sits aligned with the card text
   instead of on its own line below it. */
.shop-by-category__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  margin-top: auto;
}

.shop-by-category__title {
  flex: 1;
  min-width: 0;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.3;
  color: var(--color-text-dark);
}

.shop-by-category__cta {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--color-text-dark);
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease;
}

.shop-by-category__cta:hover {
  background: var(--color-accent);
}

@media (prefers-reduced-motion: reduce) {
  .shop-by-category__card,
  .shop-by-category__all {
    transition: none;
  }
  .shop-by-category__card:hover {
    transform: none;
  }
}

@media (max-width: 899.98px) {
  .shop-by-category__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479.98px) {
  .shop-by-category__grid {
    grid-template-columns: 1fr;
  }
}
