/* Category cards — vertical package-card shape the client asked for:
   square image filling the top of the card, name below, View All beneath.
   Four per row on desktop, two on mobile.

   Self-contained (own classes, own #categoryList container) so main.css's
   #productList product-card rules never apply — there is no price, cart or
   WhatsApp button here. */

.tests-by-category .category-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    background-color: #fff;
    border: 1.5px solid #DDDDDD;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.35s, box-shadow 0.35s;
}

/* padding-bottom 100% keeps every thumbnail a perfect square regardless of
   the source image, so the grid stays even. */
.tests-by-category .category-card-img {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
}

.tests-by-category .category-card-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tests-by-category .category-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 14px 16px;
}

.tests-by-category .category-card-title {
    color: #212121;
    font-family: 'Lato', sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 12px;
}

/* margin-top:auto pins the button to the bottom so buttons align across a
   row even when a category name wraps to two lines. */
.tests-by-category .category-card-btn {
    margin-top: auto;
    align-self: flex-end;
    display: inline-block;
    padding: 8px 22px;
    background-color: var(--primary, #681E77);
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50rem;
    white-space: nowrap;
    transition: background-color 0.35s;
}

@media (min-width: 768px) {
    .tests-by-category .category-card:hover {
        border-color: var(--primary, #681E77);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
    }

    .tests-by-category .category-card:hover .category-card-btn {
        background-color: var(--secondary, #FE5E00);
    }
}

@media (min-width: 992px) {
    .tests-by-category .category-card-body {
        padding: 16px 16px 18px;
    }

    .tests-by-category .category-card-title {
        font-size: 16px;
    }
}
