/* ============================================================

   CATEGORIES PAGE

   Simple category cards: image, title, product count.

============================================================ */

.categories-section {
  padding: 72px 0 86px;
}

.section-header {
  margin-bottom: 30px;
}

.header-content {
  max-width: 620px;
}

.header-content h2 {
  margin-top: 8px;

  color: var(--ink);

  font-family: var(--f-display);

  font-size: clamp(2rem, 3vw, 2.6rem);

  line-height: 1.12;
}

.categories-grid {
  display: grid;

  grid-template-columns: repeat(5, minmax(0, 1fr));

  gap: 18px;

  align-items: stretch;
}

.category-card {
  min-width: 0;

  display: flex;

  flex-direction: column;

  overflow: hidden;

  background: var(--white);

  border: 1px solid var(--line);

  border-radius: 14px;

  box-shadow: 0 8px 22px rgba(20, 16, 15, 0.05);

  opacity: 0;

  transform: translateY(18px);

  transition: border-color 0.28s var(--ease), box-shadow 0.28s var(--ease), transform 0.28s var(--ease), opacity 0.28s var(--ease);
}

.category-card.animate-in {
  opacity: 1;

  transform: translateY(0);
}

.category-card:hover {
  border-color: rgba(155, 12, 14, 0.22);

  box-shadow: 0 16px 36px rgba(155, 12, 14, 0.11);

  transform: translateY(-4px);
}

.card-image-wrapper {
  width: 100%;

  aspect-ratio: 4 / 3;

  overflow: hidden;

  background: var(--sand);
}

.card-image-wrapper img {
  width: 100%;

  height: 100%;

  object-fit: cover;

  transition: transform 0.45s var(--ease);
}

.category-card:hover .card-image-wrapper img {
  transform: scale(1.045);
}

.card-content {
  flex: 1;

  padding: 15px 15px 16px;

  background: var(--white);
}

.card-header {
  display: grid;

  grid-template-columns: minmax(0, 1fr) auto;

  align-items: center;

  gap: 10px;
}

.card-title {
  min-width: 0;

  color: var(--ink);

  font-family: var(--f-body);

  font-size: 1rem;

  font-weight: 700;

  line-height: 1.25;

  letter-spacing: 0;

  display: -webkit-box;

  -webkit-line-clamp: 2;

  -webkit-box-orient: vertical;

  overflow: hidden;

  text-transform: capitalize;
}

.product-count {
  min-width: 48px;

  min-height: 44px;

  display: inline-flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 1px;

  padding: 6px 8px;

  border-radius: 10px;

  background: var(--red-soft);

  color: var(--c1);

  flex-shrink: 0;
}

.count-number {
  color: var(--c1);

  font-family: var(--f-display);

  font-size: 1.25rem;

  font-weight: 800;

  line-height: 1;
}

.count-label {
  color: var(--muted);

  font-size: 0.6rem;

  font-weight: 700;

  line-height: 1;

  letter-spacing: 0.04em;

  text-transform: uppercase;
}

@media (max-width: 1280px) {
  .categories-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .categories-section {
    padding: 62px 0 76px;
  }

  .categories-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .categories-section {
    padding: 50px 0 62px;
  }

  .section-header {
    margin-bottom: 24px;
  }

  .categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 14px;
  }

  .card-content {
    padding: 13px 13px 14px;
  }

  .card-header {
    grid-template-columns: repeat(1, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .card-image-wrapper {
    aspect-ratio: 16 / 9;
  }
}
