﻿/* services-professional.css
   Fully theme-aware professional services grid
   Uses global theme variables:
   --accent-color
   --background-color
   --surface-color
   --default-color
   --heading-color
   --contrast-color
   --shadow-md
*/

/* =========================
   Theme Mapping
========================= */
:root {
    --brand: var(--accent-color);
    --muted: color-mix(in srgb, var(--default-color), transparent 40%);
    --muted-2: color-mix(in srgb, var(--default-color), transparent 55%);
    --bg: var(--surface-color);
    --card-border: color-mix(in srgb, var(--default-color), transparent 85%);
    --text: var(--heading-color);
    --radius: 10px;
    --gap: 18px;
    --card-padding: 14px;
    --max-card-width: 420px;
}

/* =========================
   Global Box Sizing
========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* =========================
   Grid Container
========================= */
#serviceGrid {
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Responsive grid */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--gap);
    align-items: start;
    width: 100%;
}

    .service-grid.compact {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
    }

    .service-grid > * {
        width: 100%;
        min-width: 0;
    }

/* =========================
   Service Card
========================= */
.service-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: var(--card-padding);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    background: var(--bg);
    transition: transform .12s ease, box-shadow .12s ease;
    min-height: 110px;
    overflow: hidden;
    width: 100%;
}

    .service-card:hover,
    .service-card:focus-within {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
    }

/* =========================
   Thumbnail
========================= */
.service-thumb {
    width: 110px;
    height: 80px;
    flex: 0 0 110px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .service-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* =========================
   Body
========================= */
.service-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

/* Title */
.service-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .service-title:hover {
        color: var(--brand);
    }

/* Description */
.service-desc {
    font-size: 0.9rem;
    color: var(--muted-2);
    line-height: 1.25;
    max-height: 2.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    hyphens: auto;
}

/* Meta row */
.service-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: auto;
}

/* =========================
   Actions
========================= */
.service-actions {
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

    /* Price */
    .service-actions .price {
        color: var(--brand);
        font-weight: 700;
        font-size: 1rem;
    }

    /* CTA */
    .service-actions .cta {
        display: inline-block;
        width: 100%;
        text-align: center;
        padding: 8px 10px;
        border-radius: 8px;
        border: 1px solid color-mix(in srgb, var(--brand), transparent 80%);
        color: var(--brand);
        background: transparent;
        text-decoration: none;
        font-size: 0.9rem;
        transition: all .15s ease;
    }

        .service-actions .cta:hover {
            background: color-mix(in srgb, var(--brand), transparent 90%);
        }

        /* Primary CTA */
        .service-actions .cta.primary {
            background: var(--brand);
            color: var(--contrast-color);
            border-color: transparent;
        }

            .service-actions .cta.primary:hover {
                filter: brightness(1.05);
            }

/* =========================
   Compact Mode
========================= */
.service-grid.compact .service-card {
    padding: 10px;
    min-height: 88px;
}

.service-grid.compact .service-thumb {
    width: 88px;
    height: 64px;
    flex: 0 0 88px;
}

.service-grid.compact .service-actions {
    flex: 0 0 110px;
}

/* =========================
   Accessibility
========================= */
.service-card:focus {
    outline: 3px solid color-mix(in srgb, var(--brand), transparent 75%);
    outline-offset: 2px;
}

/* =========================
   Responsive Adjustments
========================= */
@media (max-width: 900px) {
    .service-actions {
        flex: 0 0 120px;
    }
}

@media (max-width: 640px) {
    .service-card {
        gap: 10px;
        padding: 10px;
    }

    .service-actions {
        flex: 0 0 100px;
        align-items: flex-start;
    }

        .service-actions .cta {
            width: auto;
        }

    .service-title {
        white-space: normal;
    }

    .service-desc {
        max-height: 4.2em;
    }
}

/* =========================
   Utility
========================= */
.muted {
    color: var(--muted);
    font-size: .85rem;
}

/* Clamp Fix */
.product-desc {
    min-width: 0 !important;
    width: 100%;
}

    .product-desc .clamp {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.3em;
        max-height: calc(1.3em * 2);
    }
