/* ==========================================================================
   Service directory
   ========================================================================== */

.vs-services-page {
    background: #f6f8fb;
    padding-top: 72px;
    min-height: 100vh;
}

.vs-services-page main {
    background:
        linear-gradient(180deg, #ffffff 0, #f6f8fb 340px),
        #f6f8fb;
}

.vs-search-header {
    position: relative;
    overflow: hidden;
    padding: 5rem max(2rem, calc((100vw - 1180px) / 2)) 3.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 58%, #164994 100%);
    color: #ffffff;
}

.vs-search-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(135deg, rgba(116, 180, 217, 0.16), transparent 38%);
    background-size: 82px 82px, 82px 82px, auto;
    pointer-events: none;
}

.vs-search-header > * {
    position: relative;
    z-index: 1;
}

.vs-page-title {
    max-width: 760px;
    margin: 0 0 1rem;
    color: #ffffff;
    font-size: 3.4rem;
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: 0;
}

.vs-page-subtitle {
    max-width: 720px;
    margin: 0 0 2rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.08rem;
    line-height: 1.7;
}

.vs-service-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 0 2rem;
}

.vs-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 40px;
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.88rem;
    font-weight: 700;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.vs-stat-pill i {
    color: var(--accent);
    font-size: 1rem;
}

.vs-search-container {
    position: relative;
    display: flex;
    align-items: stretch;
    width: min(760px, 100%);
    padding: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.vs-search-icon {
    position: absolute;
    top: 50%;
    left: 1.25rem;
    z-index: 2;
    color: #667085;
    transform: translateY(-50%);
    pointer-events: none;
}

.vs-search-input {
    flex: 1;
    min-width: 0;
    min-height: 52px;
    padding: 0.9rem 1rem 0.9rem 2.7rem;
    border: 0;
    border-radius: 6px;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    background: transparent;
}

.vs-search-input::placeholder {
    color: #8a96a8;
}

.vs-search-input:focus {
    box-shadow: inset 0 0 0 2px rgba(255, 208, 0, 0.5);
}

.vs-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 52px;
    padding: 0 1.35rem;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: var(--primary);
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.vs-search-button:hover,
.vs-search-button:focus-visible {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(255, 208, 0, 0.25);
    outline: none;
}

.vs-directory-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    max-width: 1180px;
    margin: 0 auto;
    padding: 3rem 2rem 6rem;
}

.vs-category {
    position: relative;
    overflow: hidden;
    min-height: 100%;
    padding: 1.25rem;
    border: 1px solid #e3e9f1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(2, 43, 80, 0.06);
    break-inside: avoid;
    page-break-inside: avoid;
    opacity: 0;
    animation: vsFadeUp 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.vs-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--sky-blue), var(--primary));
}

.vs-category:hover {
    transform: translateY(-4px);
    border-color: rgba(10, 74, 128, 0.18);
    box-shadow: 0 22px 50px rgba(2, 43, 80, 0.11);
}

.vs-category[hidden] {
    display: none;
}

.vs-category:nth-child(1) { animation-delay: 40ms; }
.vs-category:nth-child(2) { animation-delay: 80ms; }
.vs-category:nth-child(3) { animation-delay: 120ms; }
.vs-category:nth-child(4) { animation-delay: 160ms; }
.vs-category:nth-child(5) { animation-delay: 200ms; }
.vs-category:nth-child(6) { animation-delay: 240ms; }
.vs-category:nth-child(7) { animation-delay: 280ms; }
.vs-category:nth-child(8) { animation-delay: 320ms; }
.vs-category:nth-child(9) { animation-delay: 360ms; }
.vs-category:nth-child(10) { animation-delay: 400ms; }
.vs-category:nth-child(11) { animation-delay: 440ms; }
.vs-category:nth-child(12) { animation-delay: 480ms; }
.vs-category:nth-child(13) { animation-delay: 520ms; }

@keyframes vsFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.vs-category-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
    color: var(--primary);
    font-size: 1.02rem;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.vs-category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #fff8d6;
    color: var(--primary);
    font-size: 1.08rem;
}

.vs-service-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 24px;
    margin-left: auto;
    padding: 0.25rem 0.45rem;
    border-radius: 999px;
    background: #f0f4f8;
    color: #667085;
    font-size: 0.74rem;
    font-weight: 800;
}

.vs-service-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.vs-service-list li {
    display: block;
}

.vs-service-list li[hidden] {
    display: none;
}

.vs-service-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 40px;
    padding: 0.55rem 0.65rem;
    border-radius: 6px;
    color: #4b5a6d;
    font-size: 0.93rem;
    line-height: 1.35;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.vs-service-link::after {
    content: '';
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    opacity: 0;
    transform: rotate(45deg) translateX(-3px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.vs-service-link:hover,
.vs-service-link:focus-visible {
    background: #f6f8fb;
    color: var(--primary);
    transform: translateX(2px);
    outline: none;
}

.vs-service-link:hover::after,
.vs-service-link:focus-visible::after {
    opacity: 1;
    transform: rotate(45deg) translateX(0);
}

.vs-no-results {
    grid-column: 1 / -1;
    padding: 2rem;
    border: 1px dashed #cad4df;
    border-radius: 8px;
    background: #ffffff;
    color: #667085;
    text-align: center;
    font-weight: 700;
}

@media (max-width: 992px) {
    .vs-page-title {
        font-size: 2.7rem;
    }

    .vs-directory-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .vs-search-header {
        padding: 4rem 1.25rem 2.5rem;
    }

    .vs-page-title {
        font-size: 2.2rem;
    }

    .vs-page-subtitle {
        font-size: 1rem;
    }

    .vs-search-container {
        flex-direction: column;
        align-items: stretch;
    }

    .vs-search-icon {
        top: 1.95rem;
        transform: none;
    }

    .vs-search-button {
        width: 100%;
    }

    .vs-directory-container {
        grid-template-columns: 1fr;
        padding: 2rem 1.25rem 4.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vs-category,
    .vs-search-button,
    .vs-service-link {
        animation: none;
        transition: none;
    }

    .vs-category {
        opacity: 1;
    }
}
