/* Home — Featured / Product Categories */

#featured-product-categories .section-title,
#product-categories .section-title {
    align-items: center;
    margin-bottom: 16px;
}

/* ---------- Shared card (desktop slider) ---------- */
#featured-product-categories .slick-slide > div,
#product-categories .slick-slide > div {
    height: 100%;
}

.nest-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nest-category-card:hover {
    text-decoration: none;
    color: inherit;
}

.nest-category-card__media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.nest-category-card__media img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.nest-category-card__body {
    width: 100%;
    margin-top: 10px;
}

.nest-category-card__name {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #253d4e;
}

.nest-category-card__count {
    display: inline-block;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.3;
}

#featured-product-categories .category-card-lg.nest-category-card {
    min-height: 200px;
    padding: 20px 14px 18px;
}

#featured-product-categories .category-card-lg .nest-category-card__media img {
    max-height: 120px;
    width: auto;
}

#product-categories .nest-category-card {
    padding: 16px 12px;
    min-height: 140px;
    background: #f4f6f8;
    border: 1px solid #eef0f2;
}

#product-categories .nest-category-card__media img {
    max-height: 56px;
    max-width: 56px;
}

#product-categories .nest-category-card__name {
    font-size: 14px;
}

/* ---------- Mobile grid (no slider) ---------- */
.nest-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.nest-cat-grid__item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    text-decoration: none;
    color: inherit;
    background: #f8f9fa;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    padding: 10px 10px 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.nest-cat-grid__item:hover,
.nest-cat-grid__item:active {
    color: inherit;
    text-decoration: none;
    border-color: rgba(59, 183, 126, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.nest-cat-grid__item:active {
    transform: scale(0.985);
}

.nest-cat-grid__media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    min-height: 118px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
    padding: 10px;
    box-sizing: border-box;
}

.nest-cat-grid__media img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.nest-cat-grid__body {
    width: 100%;
    padding: 0 2px;
}

.nest-cat-grid__name {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    color: #253d4e;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 0;
}

.nest-cat-grid__count {
    display: block;
    margin: 2px 0 0;
    font-size: 11.5px;
    line-height: 1.2;
    color: #6c757d;
}

@media (max-width: 767.98px) {
    #featured-product-categories.popular-categories,
    #product-categories.popular-categories {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    #featured-product-categories .section-title .title h3,
    #product-categories .section-title .title h3 {
        font-size: 1.2rem;
        margin-bottom: 0;
    }
}

@media (max-width: 359.98px) {
    .nest-cat-grid {
        grid-template-columns: 1fr;
    }

    .nest-cat-grid__item {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 10px;
        padding: 10px;
    }

    .nest-cat-grid__media {
        margin-bottom: 0;
        flex: 0 0 96px;
        width: 96px;
        min-height: 96px;
        aspect-ratio: 1;
        padding: 8px;
    }

    .nest-cat-grid__body {
        flex: 1;
        min-width: 0;
    }
}
