/* V15 — compact internal category tiles. Scoped to pages/category.php only.
 * Homepage categories (V14), product cards, search strip, filtering and URLs remain unchanged.
 * All category images are shown as-is with contain; no synthetic background cutout.
 */
.store-front .catalog-section .sf-subcategory-panel {
  margin: 7px 0 26px;
}
.store-front .catalog-section .sf-subcategory-heading {
  display: flex;
  align-items: baseline;
  margin: 0 0 13px;
}
.store-front .catalog-section .sf-subcategory-heading h2 {
  margin: 0;
  color: #000;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -.025em;
}
.store-front .catalog-section .sf-subcategory-panel .sf-subcategory-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 11px;
  margin: 0;
}
.store-front .catalog-section .sf-subcategory-panel .sf-subcategory-grid > .category-card {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(50px, 41%);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 5px;
  height: 106px;
  min-height: 0;
  min-width: 0;
  padding: 12px 9px 12px 13px;
  background: var(--brand-ice, #E8F4FD);
  border: 1px solid #D7E8F5;
  border-radius: 11px;
  box-shadow: none;
  text-decoration: none;
  overflow: hidden;
  transform: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.store-front .catalog-section .sf-subcategory-panel .sf-subcategory-grid > .category-card:hover {
  transform: translateY(-2px);
  border-color: #AACFEB;
  box-shadow: 0 7px 18px rgba(13, 43, 94, .055);
}
.store-front .catalog-section .sf-subcategory-grid .category-card .title {
  min-width: 0;
  max-width: 100%;
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  margin: 0 0 5px;
  color: #000;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.27;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.store-front .catalog-section .sf-subcategory-grid .category-card .count {
  min-width: 0;
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  color: #5C6F82;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0;
}
.store-front .catalog-section .sf-subcategory-grid .category-card img {
  display: block;
  position: static;
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: center;
  width: 100%;
  height: 77px;
  max-width: 100%;
  max-height: 77px;
  margin: 0;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: normal;
}
.store-front .catalog-section .sf-subcategory-grid .category-card img[src*="no-image.svg"] {
  width: 45px;
  max-height: 45px;
  opacity: .43;
}
.store-front .catalog-section .sf-subcategory-grid .category-card:focus-visible {
  outline: 2px solid var(--brand-blue, #012F91);
  outline-offset: 3px;
}
@media (min-width: 992px) and (max-width: 1199px) {
  .store-front .catalog-section .sf-subcategory-panel .sf-subcategory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }
}
@media (min-width: 768px) and (max-width: 991px) {
  .store-front .catalog-section .sf-subcategory-panel .sf-subcategory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}
@media (max-width: 767px) {
  .store-front .catalog-section .sf-subcategory-panel { margin: 0 0 19px; }
  .store-front .catalog-section .sf-subcategory-heading { margin-bottom: 10px; }
  .store-front .catalog-section .sf-subcategory-heading h2 { font-size: 16px; }
  .store-front .catalog-section .sf-subcategory-panel .sf-subcategory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 !important;
  }
  .store-front .catalog-section .sf-subcategory-panel .sf-subcategory-grid > .category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    height: 108px;
    min-height: 0;
    padding: 10px;
    border-radius: 10px;
  }
  .store-front .catalog-section .sf-subcategory-grid .category-card .title {
    position: relative;
    z-index: 1;
    flex: none;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    font-size: 11.5px;
    line-height: 1.23;
  }
  .store-front .catalog-section .sf-subcategory-grid .category-card .count {
    position: absolute;
    bottom: 9px;
    left: 10px;
    z-index: 1;
    width: 57%;
    font-size: 9px;
  }
  .store-front .catalog-section .sf-subcategory-grid .category-card img {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 61%;
    height: 58px;
    max-height: 58px;
    object-position: right bottom;
  }
}
@media (max-width: 359px) {
  .store-front .catalog-section .sf-subcategory-panel .sf-subcategory-grid { gap: 7px; }
  .store-front .catalog-section .sf-subcategory-panel .sf-subcategory-grid > .category-card { height: 104px; padding: 9px; }
  .store-front .catalog-section .sf-subcategory-grid .category-card .title { font-size: 11px; }
  .store-front .catalog-section .sf-subcategory-grid .category-card .count { left: 9px; bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .store-front .catalog-section .sf-subcategory-panel .category-card { transition: none; }
}
