/* Home — Featured / Product Categories */

#featured-product-categories.popular-categories,
#product-categories.popular-categories {
    padding-bottom: 20px;
}

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

/* ---------- Image-only showcase grid (featured) ---------- */
.nest-categories-image-only__head {
    margin-bottom: 10px !important;
}

.nest-categories-image-only__head .title h3 {
    margin-bottom: 0;
}

#featured-product-categories .nest-cat-showcase {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px;
    width: 100%;
}

#featured-product-categories .nest-cat-showcase__item {
    display: block;
    min-width: 0;
    width: auto;
    max-width: 100%;
    padding: 0;
    line-height: 0;
    text-decoration: none;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(var(--color-brand-rgb, 59, 183, 126), 0.22);
    box-shadow:
        0 0 0 1px rgba(var(--color-brand-rgb, 59, 183, 126), 0.08),
        0 6px 22px rgba(var(--color-brand-rgb, 59, 183, 126), 0.28),
        0 2px 8px rgba(15, 23, 42, 0.05);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

#featured-product-categories .nest-cat-showcase__item:hover {
    text-decoration: none;
    transform: translateY(-3px);
    border-color: rgba(var(--color-brand-rgb, 59, 183, 126), 0.45);
    box-shadow:
        0 0 0 1px rgba(var(--color-brand-rgb, 59, 183, 126), 0.18),
        0 12px 34px rgba(var(--color-brand-rgb, 59, 183, 126), 0.42),
        0 4px 16px rgba(var(--color-brand-rgb, 59, 183, 126), 0.24);
}

.nest-cat-showcase__media {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    line-height: 0;
    background: #fff;
}

.nest-cat-showcase__media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.35s ease;
}

#featured-product-categories .nest-cat-showcase__item:hover .nest-cat-showcase__media img {
    transform: scale(1.03);
}

/* ---------- Legacy card styles (product-categories shortcode) ---------- */
#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;
}

#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;
}

/* Legacy mobile grid (product-categories) */
.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.nest-categories-image-only.popular-categories,
    #product-categories.popular-categories {
        padding-top: 10px;
        padding-bottom: 14px;
    }

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

    #featured-product-categories .nest-cat-showcase {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }

    #featured-product-categories .nest-cat-showcase__item {
        border-radius: 12px;
    }

    #featured-product-categories .nest-cat-showcase__item:hover {
        transform: none;
        box-shadow:
            0 0 0 1px rgba(var(--color-brand-rgb, 59, 183, 126), 0.16),
            0 8px 26px rgba(var(--color-brand-rgb, 59, 183, 126), 0.34),
            0 3px 12px rgba(var(--color-brand-rgb, 59, 183, 126), 0.2);
    }

    #featured-product-categories .nest-cat-showcase__item:hover .nest-cat-showcase__media img {
        transform: none;
    }
}

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

    .nest-cat-grid:not(.nest-cat-grid--image-only) .nest-cat-grid__item {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 10px;
        padding: 10px;
    }

    .nest-cat-grid:not(.nest-cat-grid--image-only) .nest-cat-grid__media {
        margin-bottom: 0;
        flex: 0 0 96px;
        width: 96px;
        min-height: 96px;
        aspect-ratio: 1;
        padding: 8px;
    }

    .nest-cat-grid:not(.nest-cat-grid--image-only) .nest-cat-grid__body {
        flex: 1;
        min-width: 0;
    }
}
