/* ==========================================================
   CATEGORY CARDS
   ========================================================== */
.sl-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.sl-category-card {
    background: var(--sl-cream-deep);
    border-radius: var(--sl-radius);
    display: flex;
    flex-direction: column;
    min-height: 300px;
    cursor: pointer;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), box-shadow 0.28s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.sl-category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sl-shadow-lift);
    color: inherit;
}

.sl-category-card:nth-child(2) { background: var(--sl-soft-green); }
.sl-category-card:nth-child(3) { background: #ECE5DA; }
.sl-category-card:nth-child(4) { background: #EFE8DF; }

.sl-category-card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    width: 100%;
    overflow: hidden;
    background: var(--sl-sand);
}

.sl-cat-icon {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 48px;
}

.sl-cat-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.sl-category-card-body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 20px;
    flex: 1;
}

.sl-cat-name {
    font-family: var(--sl-font-display);
    font-size: 20px;
    font-weight: 500;
    color: var(--sl-charcoal);
    margin-bottom: 4px;
    line-height: 1.15;
}

.sl-cat-count {
    font-size: 11px;
    color: var(--sl-mist);
    letter-spacing: 0.02em;
}

.sl-cat-arrow {
    font-size: 16px;
    color: var(--sl-sage);
    margin-top: 14px;
    align-self: flex-end;
    flex-shrink: 0;
}

/* ==========================================================
   PHASE 4 CATEGORY GRID RESPONSIVE CLEANUP
   ========================================================== */
@media (max-width: 1023px) {
    .sl-categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .sl-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .sl-category-card {
        min-height: auto;
    }

    .sl-category-card-media {
        aspect-ratio: 1 / 1;
    }

    .sl-category-card-body {
        padding: 14px 14px 16px;
        gap: 10px;
    }

    .sl-cat-name {
        font-size: 16px;
        line-height: 1.25;
        margin-bottom: 4px;
    }

    .sl-cat-count {
        font-size: 11px;
    }
}

/* ==========================================================
   PREMIUM HOMEPAGE PATCH — CATEGORY TIGHTENING
   ========================================================== */
.sl-section--compact-first {
    padding-top: 22px;
}

@media (max-width: 767px) {
    .sl-categories-grid {
        gap: 10px;
    }

    .sl-category-card {
        border-radius: 20px;
        min-height: 0;
        box-shadow: 0 10px 24px rgba(30,28,26,0.04);
    }

    .sl-category-card-media {
        aspect-ratio: 1 / 1;
    }

    .sl-category-card-body {
        padding: 12px 12px 14px;
        gap: 8px;
    }

    .sl-category-card-kicker {
        font-size: 9px;
        letter-spacing: 0.14em;
    }

    .sl-cat-name {
        font-size: 17px;
        line-height: 1.2;
    }

    .sl-cat-count {
        font-size: 10px;
    }

    .sl-cat-arrow {
        font-size: 14px;
        margin-top: 8px;
    }
}

/* ==========================================================
   MARKET HOMEPAGE PATCH — CATEGORY CARDS EASIER ON MOBILE
   ========================================================== */
.sl-home-categories .sl-categories-grid {
    align-items: stretch;
}

@media (max-width: 767px) {
    .sl-home-categories .sl-categories-grid {
        gap: 10px;
    }

    .sl-home-categories .sl-category-card-media {
        aspect-ratio: 4 / 3;
    }

    .sl-home-categories .sl-category-card-body {
        min-height: 96px;
    }
}
