/* Hero Section */
.services-hero {
    background: var(--bg-section);
    padding: 60px 0;
    text-align: center;
}

.services-hero .section-title {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.services-hero .section-description {
    max-width: 700px;
    margin: 0 auto;
    color: var(--text-medium);
    line-height: 1.6;
}

/* Navigation Sticky Bar */
.services-nav {
  position: sticky;
  top: 80px;
  z-index: 50;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.services-nav-wrapper {
    position: sticky;
    top: 0px;
    z-index: 90;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border-gray);
    backdrop-filter: var(--backdrop-blur);
}

.services-nav-container {
    padding: 16px 24px;
    overflow-x: auto;
    max-width: 1280px;
    margin: 0 auto;
}

.services-page-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.services-nav-pills {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.category-anchor {
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

/* Services Content & Categories */
.services-content {
    padding: 40px 0;
}

.service-category-section {
    padding: 60px 0;
    border-bottom: 1px solid var(--border-light);
    scroll-margin-top: 60px; /* Додано для коректного скролу */
}

.service-category-section:last-child {
    border-bottom: none;
}

.service-category-header {
    margin-bottom: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    cursor: pointer;
    user-select: none;
}

.header-content-wrapper {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
}

.service-category-icon-box {
    width: 64px;
    height: 64px;
    background: var(--bg-badge);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary);
    flex-shrink: 0;
}

.service-category-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.service-category-desc {
    font-size: 18px;
    color: var(--text-medium);
    line-height: 1.6;
}

.category-toggle-icon {
    font-size: 24px;
    color: var(--text-medium);
    transition: transform 0.3s ease;
    padding: 10px;
}

/* Accordion Animation */
.service-category-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease-out, opacity 0.3s ease, padding 0.3s ease;
    opacity: 0;
    overflow: hidden;
    margin: 0 -20px; /* Компенсація padding для картки */
    padding: 0 20px;
}

.service-category-body > div {
    min-height: 0;
}

.service-category-section.active .service-category-body {
    grid-template-rows: 1fr;
    opacity: 1;
    padding-top: 24px;
    padding-bottom: 20px;
}

.service-category-section.active .category-toggle-icon {
    transform: rotate(180deg);
}

/* === GRID STYLES (Повернуто для сторінки послуг) === */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    width: 100%;
}

/* === CARD STYLES (Повернуто стилі карток) === */
.service-card {
    height: 100%;
    background-color: var(--bg-white, #fff);
    border: 1px solid var(--border-gray, #e5e7eb);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    scroll-margin-top: 180px;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: var(--primary, #4361ee);
}

.service-icon {
    width: 64px;
    height: 64px;
    background-color: var(--bg-badge, #eef2ff);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary, #4361ee);
    font-size: 32px;
}

.service-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark, #1f2937);
    margin-bottom: 12px;
}

.service-description {
    font-size: 15px;
    color: var(--text-medium, #6b7280);
    line-height: 1.6;
}

/* CTA Section Spacer */
.services-cta {
    text-align: center;
    margin-top: 48px;
}

/* Highlight Animation */
@keyframes highlightFade {
    0% {
        background-color: var(--primary-light, #e6f4ea);
        box-shadow: 0 0 0 4px var(--primary-light, #e6f4ea);
    }
    100% {
        background-color: transparent;
        box-shadow: 0 0 0 0 transparent;
    }
}

.category-highlight {
    animation: highlightFade 2s ease-out forwards;
    border-radius: 12px;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services-nav-wrapper {
        top: 5px;
    }

    .services-nav-container {
        padding: 10px 16px;
    }

    .service-category-section {
        padding: 24px 0;
    }

    .service-category-header {
        align-items: center;
        padding-bottom: 0;
        min-height: 60px;
    }

    .header-content-wrapper {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 16px;
        width: 100%;
    }

    .service-category-icon-box {
        width: 48px;
        height: 48px;
        font-size: 20px;
        border-radius: 12px;
        flex-shrink: 0;
    }

    .service-category-title {
        font-size: 18px;
        margin-bottom: 2px;
        line-height: 1.2;
    }

    .service-category-desc {
        font-size: 13px;
        line-height: 1.4;
        margin-bottom: 0;
        display: block;
        color: var(--text-medium);
    }

    .category-toggle-icon {
        font-size: 18px;
        padding: 0 0 0 10px;
        margin-left: auto;
    }

    .services-grid {
        gap: 16px;
        grid-template-columns: 1fr;
    }

    .service-category-section.active .service-category-body {
        padding-top: 16px;
    }
}