/* Covers have their own sizing, independent of compact navigation icons. */
.category-cover {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 12px;
    background: #f5f6f8;
}
.category-cover img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    padding: 6px;
}
.home-cats, .home-cats-mobile, .category-cover-grid, .subcat-tiles-grid, .mobile-category-covers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.category-cover-grid { padding: 24px 0 40px; }
.mobile-category-covers { padding: 12px; }
.home-cat, .home-cat-m, .category-cover-card, .subcat-tile {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-width: 0;
    min-height: 0;
    height: 100%;
    gap: 10px;
    padding: 0 0 12px;
    background: #fff;
    border: 1px solid #e9ecf1;
    border-radius: 12px;
    color: #1f2330;
    text-decoration: none;
}
/* Reference: one white card, a large photograph and a separate two-line caption. */
.home-cat, .home-cat-m {
    gap: 6px;
    border-radius: 16px;
    overflow: hidden;
}
.home-cat .category-cover, .home-cat-m .category-cover {
    aspect-ratio: 16 / 10;
    border-radius: 16px 16px 0 0;
    background: #fff;
}
.home-cat .category-cover img, .home-cat-m .category-cover img {
    padding: 8px 10px 0;
}
.home-cats .home-cat > span:last-child,
.home-cats-mobile .home-cat-m__name,
.category-cover-card__title, .subcat-tile__title {
    display: block;
    padding: 0 8px;
    width: 100%;
    min-height: 0;
    max-height: none;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    overflow: visible;
    overflow-wrap: anywhere;
}
.category-cover-card:hover { border-color: #2549d8; color: #2549d8; }
.category-cover-card:focus-visible { outline: 2px solid #2549d8; outline-offset: 3px; }
.home-cats .home-cat > span:last-child, .home-cats-mobile .home-cat-m__name {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.7em;
    font-size: 14px;
    overflow-wrap: normal;
}
@media (min-width: 480px) and (max-width: 767.98px) {
    .home-cats-mobile, .category-cover-grid, .subcat-tiles-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
    .home-cats, .home-cats-mobile, .category-cover-grid, .subcat-tiles-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
    .home-cats, .home-cats-mobile { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
    .home-cats, .category-cover-grid, .subcat-tiles-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
/* Equal cover, title and action rows keep category tiles aligned. */
.mega-menu .subcategories-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); align-items: stretch; }
.mega-menu .subcategory-group { display: flex; flex-direction: column; min-width: 0; }
.mega-menu .subcategory-title { flex-direction: column; align-items: center; text-align: center; }
.mega-menu .subcategory-thumb.category-cover { width: 100%; max-width: 160px; height: 120px; aspect-ratio: auto; border: 0; }
.mega-menu .subcategory-thumb.category-cover img { padding: 4px; }
.mega-menu .subcategory-name { min-height: 3.9em; width: 100%; overflow-wrap: anywhere; }
.mega-menu .subcategory-expand { align-self: center; margin-top: auto; }
.mega-menu .category-link { min-height: 76px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 12px; }
.mega-menu .category-link > span:not(.category-count) { min-width: 0; }
.mega-menu .category-link > .category-count { white-space: nowrap; }
.mega-menu-subcategories { min-width: 0; }
@media (max-width: 991px) { .mega-menu-subcategories { width: 100%; } }
