/* Storefront category tile. Same story as product-card.css: the component
   first appeared on the homepage, but the catalog page (root category list
   and a category's own subcategories) renders the identical tile - one
   implementation, one stylesheet, included wherever the tile is used. */

.home-category-card {
  display: flex;
  min-width: 0;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 18px 20px;
  border: 1px solid var(--site-border);
  border-radius: var(--site-radius-md);
  background: var(--site-surface);
  color: var(--site-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 120ms var(--site-ease), border-color 120ms var(--site-ease), color 120ms var(--site-ease);
}

.home-category-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.home-category-card svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--site-text-muted);
  transition: color 120ms var(--site-ease), translate 120ms var(--site-ease);
}

.home-category-card:hover {
  border-color: var(--site-border-strong);
  background: var(--site-surface-raised);
}

.home-category-card:hover svg,
.home-category-card:focus-visible svg {
  color: var(--site-accent);
  translate: 2px 0;
}

/* Tile with a photo (set in /admin/pages/home/, not on the category):
   media on the same light surface as the homepage product cards, name and
   arrow in a footer row. Used for every tile of the block once any has a
   photo, so the row keeps one height. */
.home-category-card--media {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.home-category-card--media .home-category-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-block-end: 1px solid var(--site-border);
  background: #e9ece7;
}

.home-category-card--media .home-category-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.home-category-card--media .home-category-card__placeholder,
.home-category-card--media:hover .home-category-card__placeholder,
.home-category-card--media:focus-visible .home-category-card__placeholder {
  width: 40px;
  height: 40px;
  flex: none;
  color: #9aa197;
  translate: none;
}

.home-category-card__footer {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 16px 20px;
}

@media (max-width: 620px) {
  .home-category-card {
    min-height: 70px;
    padding: 15px 16px;
  }

  .home-category-card--media {
    min-height: 0;
    padding: 0;
  }

  .home-category-card__footer {
    padding: 15px 16px;
  }
}
