/* =========================================================
   FAYADH WEBSITE — SERVICES
   Category cards (from the API, with the app's categories
   as fallback) and the "View all services" button.
   Each card opens its services on services.html.
========================================================= */


/* =========================================================
   1. SECTION
========================================================= */

.services {
    background: var(--white);
}


/* =========================================================
   2. CATEGORY GRID
========================================================= */

.category-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));

    gap: 18px;

    list-style: none;
}


/* =========================================================
   3. CATEGORY CARD
   Colour, like the app's CategoryTile:
     --category-bg     used as-is (light colours from the API)
     --category-color  turned into a soft tint (strong colours)
   js/components/services.js decides which one to set.
========================================================= */

.category-card {
    height: 100%;

    padding: 22px 12px 20px;

    /* Top-aligned, so icons line up even when a name takes two lines. */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    gap: 12px;

    /* Fallback for browsers without color-mix(). */
    background: var(--background);
    background: var(
        --category-bg,
        color-mix(in srgb, var(--category-color, var(--primary)) 13%, var(--white))
    );

    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 18px;

    text-align: center;

    transition: var(--transition);
}

/* Cards open their category on services.html. */

a.category-card:hover {
    border-color: rgba(0, 0, 0, 0.08);

    box-shadow: var(--shadow-md);

    transform: translateY(-3px);
}


/* Icon */

.category-icon {
    width: 64px;
    height: 64px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    background: var(--white);

    border-radius: 50%;

    box-shadow: var(--shadow-sm);
}

.category-icon img {
    width: 38px;
    height: 38px;

    object-fit: contain;
}


/* Name */

.category-name {
    color: var(--heading);

    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}


/* =========================================================
   4. CALL TO ACTION
========================================================= */

.services-cta {
    margin-top: 28px;

    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 12px;
}


/* =========================================================
   5. RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

}

@media (max-width: 600px) {

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 12px;
    }

    .category-card {
        padding: 18px 10px 16px;

        gap: 10px;
    }

    .category-icon {
        width: 56px;
        height: 56px;
    }

    .category-icon img {
        width: 34px;
        height: 34px;
    }

    .category-name {
        font-size: 13px;
    }

    .services-cta .button {
        width: 100%;

        white-space: normal;
    }

}
