/* Card Grid style for the Ecommerce Categories shortcode. */
.tp-category-card-grid {
    --category-card-border: #e5e5e5;
    --category-card-panel: #f5f5f5;
    --category-card-accent: #f7b500;
}

.tp-category-card-grid__divider {
    position: relative;
    height: 1px;
    margin-bottom: 20px;
    background: #e8e8e8;
}

.tp-category-card-grid__divider::before {
    position: absolute;
    top: -1px;
    inset-inline-start: 0;
    width: 60px;
    height: 2px;
    background: var(--category-card-accent);
    content: '';
}

.tp-category-card-grid__item {
    height: calc(100% - 16px);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--category-card-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 4px rgb(0 0 0 / 16%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tp-category-card-grid__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgb(0 0 0 / 14%);
}

.tp-category-card-grid__image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 135px;
    margin: 4px 4px 0;
    overflow: hidden;
    border-radius: 10px;
    background: var(--category-card-panel);
}

.tp-category-card-grid__image img {
    width: auto;
    max-width: 90%;
    height: auto;
    max-height: 128px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.tp-category-card-grid__item:hover .tp-category-card-grid__image img {
    transform: scale(1.04);
}

.tp-category-card-grid__content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 5px 9px;
    text-align: center;
}

.tp-category-card-grid__title {
    margin: 0;
    color: var(--tp-common-black);
    font-family: var(--primary-font);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
}

.tp-category-card-grid__title a:hover {
    color: var(--tp-theme-primary);
}

@media (max-width: 767px) {
    .tp-category-card-grid__image {
        height: 110px;
    }

    .tp-category-card-grid__image img {
        max-height: 104px;
    }

    .tp-category-card-grid__title {
        font-size: 14px;
    }
}
