.app-cats-grid {
    display: grid;
    /* auto-fill so the column count follows the frame width rather than being
       pinned to one number — a vendor may have 4 categories or 40. */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

/* Two per line on a phone. auto-fill's 150px minimum would give three on a
   wide phone, which leaves the names too cramped to read. */
@media (max-width: 560px) {
    .app-cats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

.app-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 10px;
    border: 1px solid #eceef1;
    border-radius: 16px;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

/* The grid wraps rather than scrolling, so it does not clip — these cards can
   lift, unlike the home page's strip. */
.app-cat-card:hover {
    transform: translateY(-4px);
    border-color: var(--app-theme-border);
    box-shadow: 0 12px 26px rgba(16, 24, 40, .15);
}

/* Circular thumb in a theme ring, matching the home page's category strip so
   the two read as the same object. */
.app-cat-card-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    padding: 4px;
    border: 1px solid var(--app-theme-border, #e6e8eb);
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
}

/* cover, not contain: these are photographic category images, and contain
   letterboxes them inside the circle. */
.app-cat-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform .35s ease;
}

.app-cat-card:hover .app-cat-card-thumb img {
    transform: scale(1.1);
}

.app-cat-card-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--app-theme);
    text-align: center;
    /* Two lines clamped at a fixed height, so a one-word and a three-word name
       leave their cards the same height and the grid rows stay even. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.7em;
}

/* --- Empty state -------------------------------------------------------- */

.app-cats-empty {
    padding: 40px var(--app-pad);
    text-align: center;
}

.app-cats-empty i {
    font-size: 34px;
    color: #d3d7dd;
}

.app-cats-empty p {
    margin: 14px 0 18px;
    font-size: 14px;
    color: var(--app-muted);
}

/* .app-card-btn is the shared card CTA; here it should not stretch the page. */
.app-cats-empty .app-card-btn {
    display: inline-block;
    width: auto;
    padding: 11px 22px;
}
