/**
 * Category tiles — home grid (2 per row, all devices)
 */

.section--shop-preview .shop-cats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  align-items: stretch;
}

.section--shop-preview .shop-cats-grid .shop-cat-tile {
  flex: none;
  width: 100%;
  max-width: none;
  --cat-tile-w: 100%;
}

.shop-cats__track {
  align-items: stretch;
}

.shop-cat-tile {
  --cat-tile-w: 11rem;
  --cat-label-h: 4.85rem;
  --cat-media-ratio: 5 / 6;
  flex: 0 0 var(--cat-tile-w);
  display: grid;
  grid-template-rows: auto var(--cat-label-h);
  grid-template-columns: 1fr;
  align-content: start;
  min-height: 0;
  background: var(--linen, #faf7f2);
  color: var(--ink, #1a1a1a);
}

.shop-cat-tile__media {
  aspect-ratio: var(--cat-media-ratio);
  width: 100%;
  flex-shrink: 0;
}

.shop-cat-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.shop-cat-tile__shade {
  background: linear-gradient(180deg, transparent 42%, rgba(26, 26, 26, 0.35) 100%);
}

.shop-cat-tile__label {
  box-sizing: border-box;
  min-height: var(--cat-label-h);
  height: var(--cat-label-h);
  max-height: var(--cat-label-h);
  padding: 0.45rem 0.5rem;
  align-items: center;
  overflow: hidden;
}

.shop-cat-tile__label-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.shop-cat-tile__icon {
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.05rem;
}

.shop-cat-tile__icon .ti {
  font-size: 0.95rem;
  opacity: 0.9;
}

.shop-cat-tile__titles {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.shop-cat-tile__primary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.28;
  text-transform: uppercase;
}

.shop-cat-tile__alt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  margin: 0;
  font-size: 0.52rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.25;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.52);
}

.shop-cat-tile__count {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  font-size: 0.54rem;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(26, 26, 26, 0.14);
  background: rgba(26, 26, 26, 0.05);
}

/* Hover invert — desktop pointer only (prevents stuck black tile on touch) */
@media (hover: hover) {
  .section--shop-preview .shop-cat-tile:hover {
    background: var(--ink, #1a1a1a);
    color: var(--linen, #faf7f2);
  }

  .section--shop-preview .shop-cat-tile:hover .shop-cat-tile__alt {
    color: rgba(246, 241, 234, 0.65);
  }

  .section--shop-preview .shop-cat-tile:hover .shop-cat-tile__count {
    background: rgba(246, 241, 234, 0.12);
    border-color: rgba(246, 241, 234, 0.25);
    color: var(--linen, #faf7f2);
  }

  .shop-cat-tile:hover .shop-cat-tile__shade {
    background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.45) 100%);
  }
}

.section--shop-preview .shop-cat-tile:focus-visible {
  outline: 2px solid var(--ink, #1a1a1a);
  outline-offset: 2px;
}

.section--shop-preview .shop-cat-tile:active {
  background: var(--linen, #faf7f2);
  color: var(--ink, #1a1a1a);
}

@media (max-width: 768px) {
  .shop-cat-tile {
    --cat-tile-w: 10.25rem;
    --cat-label-h: 4.65rem;
  }
}

@media (max-width: 480px) {
  .shop-cat-tile {
    --cat-tile-w: 9.25rem;
    --cat-label-h: 4.5rem;
  }

  .shop-cat-tile__primary {
    font-size: 0.54rem;
  }
}
