
/* ==========================================
   КАТАЛОГ СОЦИАЛЬНЫХ УСЛУГ
   ========================================== */

/* Основная компоновка */

.catalog-section {
    background: var(--color-white);
}

.catalog-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    align-items: start;
    gap: 30px;
}

/* ==========================================
   ЛЕВАЯ ПАНЕЛЬ КАТЕГОРИЙ
   ========================================== */

.catalog-sidebar {
    padding: 20px;
    background: #FFFFFF;
    border: 1px solid #E5EBF3;
    border-radius: 16px;
}

.catalog-sidebar h2 {
    margin-bottom: 22px;
    font-size: 21px;
}

.catalog-categories {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

/* Строка категории */

.catalog-category {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 13px;

    width: 100%;
    min-height: 62px;
    padding: 9px 12px;

    border: 1px solid transparent;
    border-radius: 11px;

    background: #FFFFFF;
    color: #26364B;
    text-align: left;
    text-decoration: none;

    transition:
        background-color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

/* КРУГЛАЯ ИКОНКА КАТЕГОРИИ */

.catalog-category__icon {
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 46px;

    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;

    aspect-ratio: 1 / 1;
    padding: 0;

    border-radius: 50%;
    overflow: hidden;

    background: #EAF1FC;
    color: #18438C;

    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease;
}

.catalog-category__icon svg {
    display: block;
    flex: 0 0 23px;

    width: 23px;
    height: 23px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Название категории */

.catalog-category__name {
    flex: 1;
    min-width: 0;

    color: #26364B;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;

    transition: color 0.3s ease;
}

/* Стрелка */

.catalog-category__arrow {
    flex: 0 0 auto;

    color: #91A2B8;
    font-size: 18px;

    opacity: 0;
    transform: translateX(-5px);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

/* Наведение */

.catalog-category:hover {
    background: #F3F7FD;
    border-color: #DCE7F7;
    transform: translateX(3px);
    box-shadow: 0 3px 12px rgba(24, 67, 140, 0.06);
}

.catalog-category:hover .catalog-category__icon {
    background: #18438C;
    color: #FFFFFF;
    transform: scale(1.06);
}

.catalog-category:hover .catalog-category__name {
    color: #18438C;
}

.catalog-category:hover .catalog-category__arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Выбранная категория */

.catalog-category.active {
    background: #F3F7FD;
    border-color: #DCE7F7;
}

.catalog-category.active .catalog-category__icon {
    background: #18438C;
    color: #FFFFFF;
}

.catalog-category.active .catalog-category__name {
    color: #18438C;
    font-weight: 700;
}

.catalog-category.active .catalog-category__arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================
   ПРАВАЯ ЧАСТЬ КАТАЛОГА
   ========================================== */

.catalog-content {
    min-width: 0;
}

.catalog-content__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.catalog-content__heading h2 {
    font-size: 27px;
}

.catalog-count {
    flex: 0 0 auto;

    padding: 7px 13px;

    color: #18438C;
    background: #EAF1FC;
    border-radius: 20px;

    font-size: 13px;
    font-weight: 700;
}

/* ==========================================
   ПОИСК
   ========================================== */

.catalog-search {
    display: flex;
    gap: 8px;

    min-height: 55px;
    margin-bottom: 24px;
    padding: 5px;

    border: 1px solid #DCE4EF;
    border-radius: 12px;
    background: #FFFFFF;
}

.catalog-search input {
    flex: 1;
    min-width: 0;

    width: 100%;
    min-height: 45px;
    padding: 10px 14px;

    border: 0;
    border-radius: 8px;
    outline: none;

    background: transparent;
    color: #26364B;
    font: inherit;
}

.catalog-search input:focus {
    box-shadow: 0 0 0 2px rgba(24, 67, 140, 0.12);
}

.catalog-search button {
    flex: 0 0 auto;

    padding: 0 22px;

    border: 0;
    border-radius: 8px;

    background: #18438C;
    color: #FFFFFF;

    font: inherit;
    font-weight: 700;

    cursor: pointer;
    transition: background-color 0.2s ease;
}

.catalog-search button:hover {
    background: var(--color-primary-dark);
}

/* ==========================================
   НАПРАВЛЕНИЯ И УСЛУГИ
   ========================================== */

.catalog-directions {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.catalog-direction {
    min-width: 0;
}

.catalog-direction__heading {
    margin-bottom: 16px;
}

.catalog-direction__heading h3 {
    margin-bottom: 7px;
    font-size: 21px;
}

.catalog-direction__heading p {
    margin-bottom: 0;
    color: #68788D;
    font-size: 14px;
    line-height: 1.55;
}

/* Сетка карточек */

.catalog-services {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

/* Карточка услуги */

.catalog-service {
    display: block;
    min-width: 0;
    padding: 21px;

    border: 1px solid #E5EBF3;
    border-radius: 15px;

    background: #FFFFFF;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.catalog-service:hover {
    border-color: #B9CDEB;
    box-shadow: 0 5px 18px rgba(24, 67, 140, 0.07);
    transform: translateY(-2px);
}

.catalog-service__body {
    min-width: 0;
}

/* КРУГЛАЯ ИКОНКА УСЛУГИ */

.catalog-service__icon {
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 58px;
    height: 58px;
    min-width: 58px;
    min-height: 58px;

    flex: 0 0 58px;
    aspect-ratio: 1 / 1;

    margin-bottom: 17px;
    padding: 0;

    border-radius: 50%;
    overflow: hidden;

    background: #EAF1FC;
    color: #18438C;
}

.catalog-service:nth-child(even) .catalog-service__icon {
    background: #FCEBF0;
    color: #BC204B;
}

.catalog-service__icon svg {
    display: block;
    flex: 0 0 29px;

    width: 29px;
    height: 29px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Категория услуги */

.catalog-service__category {
    display: inline-block;
    margin-bottom: 9px;
    padding: 5px 10px;

    color: #18438C;
    background: #EAF1FC;
    border-radius: 5px;

    font-size: 12px;
    font-weight: 700;
}

/* Название и описание */

.catalog-service h3 {
    margin-bottom: 9px;
    font-size: 17px;
    line-height: 1.35;
}

.catalog-service p {
    margin-bottom: 14px;

    color: #68788D;
    font-size: 14px;
    line-height: 1.55;
}

/* Ссылка */

.catalog-service .text-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    color: #18438C;
    font-weight: 700;
    text-decoration: none;
}

.catalog-service .text-link:hover {
    text-decoration: underline;
}

/* ==========================================
   ПУСТОЙ РЕЗУЛЬТАТ
   ========================================== */

.catalog-empty {
    padding: 30px;
    border: 1px dashed #DCE4EF;
    border-radius: 14px;

    color: #68788D;
    text-align: center;
}

/* Раскрывающиеся подблоки внутри выбранной категории */
.catalog-content__hint {
    max-width: 680px;
    margin: 8px 0 0;
    color: #65748a;
    font-size: 16px;
}

.service-accordion {
    display: grid;
    gap: 14px;
}

.service-accordion__section {
    overflow: hidden;
    border: 1px solid #dce5ef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(24, 67, 140, .06);
    transition: border-color .3s ease, box-shadow .3s ease;
    scroll-margin-top: 24px;
}

.service-accordion__section[open] {
    border-color: #91aed3;
    box-shadow: 0 13px 30px rgba(24, 67, 140, .1);
}

.service-accordion__summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 17px;
    min-height: 104px;
    padding: 20px 22px;
    list-style: none;
    cursor: pointer;
    transition: background-color .3s ease;
}

.service-accordion__summary::-webkit-details-marker {
    display: none;
}

.service-accordion__summary:hover {
    background: #f7faff;
}

.service-accordion__summary:focus-visible {
    outline: 3px solid #bc204b;
    outline-offset: -4px;
}

.service-accordion__icon,
.service-accordion__service-icon {
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #18438c;
    background: #eaf1fc;
}

.service-accordion__icon {
    width: 58px;
    height: 58px;
    transition: color .3s ease, background-color .3s ease, transform .3s ease;
}

.service-accordion__section[open] .service-accordion__icon {
    color: #fff;
    background: #18438c;
    transform: scale(1.04);
}

.service-accordion__icon svg {
    width: 29px;
    height: 29px;
}

.service-accordion__heading {
    display: grid;
    gap: 6px;
}

.service-accordion__heading strong {
    color: #173b70;
    font-size: 20px;
    line-height: 1.35;
}

.service-accordion__heading > span {
    color: #65748a;
    font-size: 14px;
    line-height: 1.5;
}

.service-accordion__chevron {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #18438c;
    background: #eff5fc;
    transition: color .3s ease, background-color .3s ease, transform .35s ease;
}

.service-accordion__section[open] .service-accordion__chevron {
    color: #fff;
    background: #18438c;
    transform: rotate(180deg);
}

.service-accordion__chevron svg,
.service-accordion__icon svg,
.service-accordion__service-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.service-accordion__chevron svg {
    width: 21px;
    height: 21px;
}

.service-accordion__body {
    display: block;
    overflow: hidden;
    border-top: 1px solid #e7edf5;
    background: #fbfdff;
    will-change: height;
}

/* Сетка размещена внутри отдельной обёртки, чтобы высота раскрытия анимировалась без скачка отступов. */
.service-accordion__body-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 20px 22px 22px 97px;
}

.service-accordion__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    min-height: 82px;
    padding: 14px;
    border: 1px solid #dce5ef;
    border-radius: 12px;
    background: #fff;
    transition: border-color .3s ease, background-color .3s ease, transform .3s ease;
}

.service-accordion__item:hover,
.service-accordion__item:focus-visible {
    border-color: #7fa2d0;
    background: #f3f7fd;
    transform: translateY(-2px);
}

.service-accordion__service-icon {
    width: 44px;
    height: 44px;
}

.service-accordion__service-icon svg {
    width: 23px;
    height: 23px;
}

.service-accordion__service-text {
    display: grid;
    gap: 4px;
}

.service-accordion__service-text strong {
    color: #183f78;
    font-size: 16px;
    line-height: 1.4;
}

.service-accordion__service-text > span {
    color: #65748a;
    font-size: 14px;
    line-height: 1.45;
}

.service-accordion__empty {
    grid-column: 1 / -1;
    margin: 16px 0 0;
    color: #65748a;
}

/* Подблоки каталога: категория → направление → услуги */
.direction-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.direction-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 118px;
    padding: 22px;
    border: 1px solid #dce5ef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 67, 140, .06);
    transition: border-color .35s ease, box-shadow .35s ease, transform .35s ease;
}

.direction-card:hover,
.direction-card:focus-visible {
    border-color: #89aad6;
    box-shadow: 0 14px 32px rgba(24, 67, 140, .11);
    transform: translateY(-3px);
}

.direction-card__icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #eaf1fc;
    color: #18438c;
}

.direction-card__icon svg {
    width: 29px;
    height: 29px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.direction-card__content {
    display: grid;
    gap: 7px;
}

.direction-card__content strong {
    color: #173b70;
    font-size: 19px;
    line-height: 1.35;
}

.direction-card__content > span {
    color: #65748a;
    font-size: 14px;
    line-height: 1.55;
}

.direction-card__chevron {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #18438c;
    background: #f1f6fd;
}

.direction-card__chevron svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.direction-grid--categories .direction-card {
    min-height: 132px;
}

.catalog-back {
    margin-top: 28px;
}

.catalog-back .text-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding: 0 16px;
    border: 1px solid #bfd0e5;
    border-radius: 9px;
    color: #18438c;
    font-weight: 700;
}

.catalog-back .text-link:hover {
    border-color: #18438c;
    background: #f0f5fc;
}

/* ==========================================
   ДОСТУПНОСТЬ
   ========================================== */

.catalog-category:focus-visible,
.catalog-search button:focus-visible,
.catalog-service a:focus-visible {
    outline: 3px solid #F39200;
    outline-offset: 3px;
}

/* ==========================================
   АДАПТИВНОСТЬ
   ========================================== */

@media (max-width: 900px) {
    .catalog-layout {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 20px;
    }

    .catalog-services {
        grid-template-columns: 1fr;
    }

    .service-accordion__body-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .catalog-sidebar {
        padding: 14px;
    }

    .catalog-category {
        min-height: 56px;
    }

    .catalog-category__icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        flex-basis: 42px;
    }

    .catalog-category__icon svg {
        width: 21px;
        height: 21px;
        flex-basis: 21px;
    }

    .catalog-service {
        padding: 16px;
    }

    .catalog-service__icon {
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
        flex-basis: 52px;
    }

    .catalog-service__icon svg {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
    }

    .catalog-content__heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .direction-grid {
        grid-template-columns: 1fr;
    }

    .direction-card {
        min-height: 104px;
        padding: 17px;
    }

    .direction-card__icon {
        width: 50px;
        height: 50px;
    }

    .service-accordion__summary {
        min-height: 88px;
        gap: 12px;
        padding: 16px;
    }

    .service-accordion__icon {
        width: 48px;
        height: 48px;
    }

    .service-accordion__heading strong {
        font-size: 17px;
    }

    .service-accordion__chevron {
        width: 38px;
        height: 38px;
    }

    .service-accordion__body-inner {
        padding: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .service-accordion__section,
    .service-accordion__summary,
    .service-accordion__icon,
    .service-accordion__chevron,
    .service-accordion__item {
        transition-duration: .01ms !important;
    }
}

@media (max-width: 500px) {
    .catalog-search button {
        padding: 0 13px;
    }
}
