/* ============================================================
   CATEGORIES PAGE
   Grid of garment-type "boxes", grouped by Men / Women / etc.
   Reached from the mobile appbar; works on all viewports.
   ============================================================ */

.categories {
  padding: 0.25rem var(--gutter) 4rem;
  max-width: 73.75rem;
  margin: 0 auto;
}

.categories__group {
  margin-top: 2.75rem;
}
.categories__group:first-child {
  margin-top: 0.5rem;
}

.categories__title {
  font-family: "Marcellus", serif;
  font-weight: 400;
  font-size: 1.625rem;
  line-height: 1.15;
  color: var(--ink-heading);
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.catgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.25rem;
}

.catcard {
  position: relative;
  display: block;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--cream-warm);
  box-shadow: 0 1px 2px rgba(51, 42, 32, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.catcard:hover,
.catcard:focus-visible {
  transform: translateY(-0.1875rem);
  box-shadow: 0 10px 26px rgba(51, 42, 32, 0.16);
}

.catcard__media {
  display: block;
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

/* placeholder cards (no image yet) reuse the theme's woven texture */
.catcard--ph .catcard__media {
  background: repeating-linear-gradient(
    135deg,
    var(--ph-a),
    var(--ph-a) 0.6875rem,
    var(--ph-b) 0.6875rem,
    var(--ph-b) 1.375rem
  );
}

.catcard__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.catcard__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--scrim-dark) 0%,
    rgba(0, 0, 0, 0.12) 42%,
    rgba(0, 0, 0, 0) 68%
  );
}

.catcard__name {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.875rem;
  font-family: "Marcellus", serif;
  font-size: 1.375rem;
  line-height: 1.15;
  color: var(--white);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

/* placeholder cards have no image, so keep the label legible on the light
   woven texture */
.catcard--ph .catcard__name {
  color: var(--ink-heading);
  text-shadow: none;
}

@media (max-width: 767px) {
  .catgrid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
  .catcard__media {
    aspect-ratio: 16 / 9;
  }
  .categories__title {
    font-size: 1.375rem;
  }
  .catcard__name {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.6875rem;
    font-size: 1.0625rem;
  }
}
