/* services.css */

/* ================================================
   ОБЩИЕ СТИЛИ СЕКЦИИ
   ================================================ */

.services-new {
    position: relative;
    z-index: 2;
    padding: 60px 0 60px;
    background: linear-gradient(
            180deg,
            #f8fafc 0%,
            #f8fafc 70%,
            var(--color-bg-blue) 100%
    );
    overflow: visible;
}

.services-new::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(
            180deg,
            var(--color-bg-blue) 0%,
            rgba(244, 247, 255, 0) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.services-new > * {
    position: relative;
    z-index: 2;
}

/* ================================================
   ТЕГИ СИМПТОМОВ
   ================================================ */

.accordion-item__symptoms,
.service-detail-card__symptoms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.symptom-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, #e8f6fd 0%, #d0ecf9 100%);
    border: 1.5px solid #b8dff0;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #1e7a9c;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.3;
}

.symptom-tag:hover {
    background: linear-gradient(135deg, #d0ecf9 0%, #bae6fd 100%);
    border-color: #93d5f0;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(48, 166, 218, 0.15);
}

/* Адаптив для тегов */
@media (max-width: 600px) {
    .symptom-tag {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .accordion-item__symptoms,
    .service-detail-card__symptoms {
        gap: 6px;
    }
}

@media (max-width: 360px) {
    .symptom-tag {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}

/* ================================================
   ЗАГОЛОВОК И ФИЛЬТРЫ
   ================================================ */

.services-new__header {
    text-align: center;
    margin-bottom: 32px;
}

.services-new__header .section-subtitle {
    max-width: 540px;
    margin: 0 auto 24px;
}

.services-new__filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.services-new__filter-btn {
    padding: 7px 18px;
    border-radius: 50px;
    border: 1.5px solid #d1d9e6;
    background: #fff;
    color: #4a5568;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.4;
}

.services-new__filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.services-new__filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(48, 166, 218, 0.3);
}

/* ================================================
   МОБИЛЬНАЯ ВЕРСИЯ: АККОРДЕОН
   ================================================ */

.services-new__accordion {
    display: none;
}

.accordion-item {
    background: #fff;
    border-radius: 16px;
    margin-bottom: 12px;
    border: 1.5px solid #e8eef5;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-item.hidden {
    display: none;
}

.accordion-item__header {
    width: 100%;
    padding: 16px 18px;
    background: transparent;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background-color 0.2s ease;
}

.accordion-item__header:active {
    background: #f8fafc;
}

.accordion-item__title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.accordion-item__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e8f6fd 0%, #d0ecf9 100%);
    padding: 8px;
    object-fit: contain;
}

.accordion-item__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a2742;
    margin: 0;
}

.accordion-item__arrow {
    flex-shrink: 0;
    color: var(--color-primary);
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-item__arrow {
    transform: rotate(180deg);
}

.accordion-item__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 18px;
}

.accordion-item.active .accordion-item__content {
    max-height: 800px;
    padding: 0 18px 20px;
}

.accordion-item__tagline {
    font-size: 0.78rem;
    color: var(--color-primary);
    font-weight: 500;
    margin: 0 0 10px;
}

.accordion-item__symptoms {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.accordion-item__description {
    font-size: 0.92rem;
    color: #4a5568;
    line-height: 1.6;
    margin: 0 0 16px;
}

/* ================================================
   ДЕСКТОПНАЯ ВЕРСИЯ: ОБЛАКО + КАРТОЧКИ
   ================================================ */

.services-new__desktop {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    min-height: 520px; /* Увеличено с 480px */
    position: relative;
    margin-bottom: 28px;
}

/* Облако услуг */
.services-cloud {
    position: relative;
    height: 520px; /* Увеличено с 480px */
    background: radial-gradient(circle at center, rgba(186, 230, 253, 0.1) 0%, rgba(224, 242, 254, 0.05) 50%, transparent 100%);
    border-radius: 24px;
    overflow: hidden;
}

.services-cloud::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: radial-gradient(
            circle,
            rgba(48, 166, 218, 0.7) 0%,
            rgba(48, 166, 218, 0.4) 40%,
            rgba(48, 166, 218, 0) 100%
    );
    border-radius: 50%;
    box-shadow:
            0 0 20px rgba(48, 166, 218, 0.8),
            0 0 45px rgba(48, 166, 218, 0.5),
            0 0 75px rgba(48, 166, 218, 0.35),
            0 0 110px rgba(48, 166, 218, 0.2),
            0 0 160px rgba(48, 166, 218, 0.1);
    filter: blur(4px);
    z-index: 1;
    pointer-events: none;
}

/* Canvas для линий */
.services-cloud__canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.services-cloud__item {
    position: absolute;
    padding: 10px 20px;
    background: transparent;
    border: none;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-primary);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 2;
    text-shadow: 0 2px 8px rgba(48, 166, 218, 0.2);
}

.services-cloud__item.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.7);
    visibility: hidden;
}

.services-cloud__item:hover {
    color: #1e88c7;
    transform: scale(1.15);
    text-shadow: 0 4px 16px rgba(48, 166, 218, 0.4);
    z-index: 10;
}

.services-cloud__item.fixed {
    color: #10b981 !important;
    font-weight: 700 !important;
    text-shadow: 0 4px 20px rgba(16, 185, 129, 0.5) !important;
    transform: scale(1.15);
}

.services-cloud__item.fixed::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #10b981 50%, transparent 100%);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Карточки услуг */
.services-cards {
    position: relative;
    height: 520px; /* Увеличено с 480px */
    overflow: hidden;
    background: radial-gradient(ellipse at center, rgba(186, 230, 253, 0.05) 0%, transparent 70%);
}

.service-detail-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 24px;
    border: 2px solid #e8eef5;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0) scale(1);
    transition:
            opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            visibility 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            filter 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: blur(20px) brightness(1.1);
    will-change: opacity, filter, transform;
    display: flex;
    flex-direction: column;
}

.service-detail-card.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    filter: blur(0px) brightness(1);
    z-index: 2;
    transition:
            opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s,
            visibility 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s,
            transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s,
            filter 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s;
}

.service-detail-card__image {
    width: 100%;
    height: 220px; /* Увеличено с 180px */
    flex-shrink: 0;
    background: linear-gradient(135deg, #e8f6fd 0%, #d0ecf9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.service-detail-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.service-detail-card__content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-height: 0;
}

.service-detail-card__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a2742;
    margin: 0 0 6px;
    flex-shrink: 0;
}

.service-detail-card__tagline {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: 500;
    margin: 0 0 12px;
    flex-shrink: 0;
}

.service-detail-card__symptoms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    min-height: 58px;
    max-height: 58px;
    overflow: hidden;
    flex-shrink: 0;
    align-content: flex-start;
}

.service-detail-card__description {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.6;
    margin: 0 0 auto;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Уменьшено с 4 до 3 строк */
    -webkit-box-orient: vertical;
}

.service-detail-card__content .btn {
    margin-top: 14px;
    flex-shrink: 0;
}

/* ================================================
   БЛОК ОЖИДАЕМЫХ РЕЗУЛЬТАТОВ
   ================================================ */

.services-new__results {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    border-radius: 20px;
    padding: 24px 24px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.services-new__results::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(134, 239, 172, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.services-new__results.updating {
    opacity: 0.4;
    transform: translateY(-8px);
}

.services-new__results-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.services-new__results-icon-header {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    color: #10b981;
    stroke-width: 2.5;
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.2));
}

.services-new__results-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #065f46;
    margin: 0;
    line-height: 1.3;
}

.services-new__results-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    position: relative;
    z-index: 1;
}

.services-new__results-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(134, 239, 172, 0.4);
    transition: all 0.3s ease;
}

.services-new__results-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: #86efac;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.services-new__results-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: #10b981;
    stroke-width: 2.5;
    margin-top: 2px;
}

.services-new__results-item span {
    font-size: 0.875rem;
    color: #047857;
    line-height: 1.5;
    font-weight: 500;
}

/* ================================================
   CTA БЛОК
   ================================================ */

.services-new__cta {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: linear-gradient(135deg, #e8f6fd 0%, #d0ecf9 100%);
    border-radius: 20px;
    padding: 24px 28px;
    border: 1.5px solid #b8dff0;
    max-width: 900px; /* Добавлено ограничение ширины */
    margin: 0 auto; /* Центрирование */
    box-sizing: border-box;
}

.services-new__cta-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a2742;
    margin: 0;
    text-align: left;
    max-width: 480px;
    word-wrap: break-word;
    line-height: 1.5;
}

.services-new__cta .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ================================================
   АНИМАЦИИ
   ================================================ */

@keyframes fadeInCard {
    0% {
        opacity: 0;
        filter: blur(20px) brightness(1.1);
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        filter: blur(0px) brightness(1);
        transform: scale(1);
    }
}

@keyframes fadeOutCard {
    0% {
        opacity: 1;
        filter: blur(0px) brightness(1);
        transform: scale(1);
    }
    100% {
        opacity: 0;
        filter: blur(20px) brightness(1.1);
        transform: scale(0.98);
    }
}

/* ================================================
   АДАПТИВ: ДЕСКТОП СРЕДНИЙ (1025-1399px)
   ================================================ */

@media (min-width: 1025px) and (max-width: 1399px) {
    .services-new {
        padding: 50px 0 50px;
    }

    .services-new__header {
        margin-bottom: 28px;
    }

    .services-new__desktop {
        gap: 28px;
        margin-bottom: 24px;
        min-height: 500px;
    }

    .services-cloud,
    .services-cards {
        height: 500px;
    }

    .service-detail-card__image {
        height: 200px;
    }

    .service-detail-card__description {
        -webkit-line-clamp: 3;
    }

    .services-new__cta {
        max-width: 850px;
        padding: 22px 26px;
    }

    .services-new__results {
        padding: 24px 24px;
        margin-bottom: 24px;
    }

    .services-new__results-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ================================================
   АДАПТИВ: ДЕСКТОП БОЛЬШОЙ (1400px+)
   ================================================ */

@media (min-width: 1400px) {
    .services-new {
        padding: 60px 0 60px;
    }

    .services-new__header {
        margin-bottom: 32px;
    }

    .services-new__desktop {
        gap: 36px;
        margin-bottom: 28px;
        min-height: 560px;
    }

    .services-cloud,
    .services-cards {
        height: 560px;
    }

    .service-detail-card__image {
        height: 240px;
    }

    .service-detail-card__title {
        font-size: 1.45rem;
    }

    .service-detail-card__symptoms {
        min-height: 62px;
        max-height: 62px;
    }

    .service-detail-card__description {
        font-size: 0.925rem;
        -webkit-line-clamp: 4;
    }

    .services-new__results {
        padding: 28px 28px;
        margin-bottom: 28px;
    }

    .services-new__results-title {
        font-size: 1.25rem;
    }

    .services-new__results-items {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .services-new__results-item span {
        font-size: 0.9rem;
    }

    .services-new__cta {
        max-width: 950px;
        padding: 28px 32px;
    }
}

/* ================================================
   АДАПТИВ: ПЛАНШЕТ (до 1024px)
   ================================================ */

@media (max-width: 1024px) {
    .services-new {
        padding: var(--space-10) 0;
    }

    .services-new::after {
        height: 120px;
    }

    .services-new__desktop {
        display: none;
    }

    .services-new__accordion {
        display: block;
    }

    .services-new__results {
        margin-top: 32px;
    }
}

/* ================================================
   АДАПТИВ: ПЛАНШЕТ/МОБИЛЬНЫЙ (до 768px)
   ================================================ */

@media (max-width: 768px) {
    .services-new {
        padding: var(--space-16) 0;
        background: linear-gradient(
                180deg,
                #f8fafc 0%,
                #f8fafc 60%,
                var(--color-bg-blue) 100%
        );
    }

    .services-new__header {
        margin-bottom: var(--space-10);
    }

    .services-new::after {
        height: 100px;
    }

    .services-new__results {
        padding: 24px 20px;
        margin-top: 28px;
        margin-bottom: 24px;
        border-radius: 16px;
    }

    .services-new__results-header {
        gap: 10px;
        margin-bottom: 16px;
    }

    .services-new__results-icon-header {
        width: 24px;
        height: 24px;
    }

    .services-new__results-title {
        font-size: 1.1rem;
    }

    .services-new__results-items {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .services-new__results-item {
        padding: 10px 12px;
    }

    .services-new__results-icon {
        width: 18px;
        height: 18px;
    }

    .services-new__results-item span {
        font-size: 0.875rem;
    }

    .services-new__cta {
        flex-direction: column;
        padding: 24px 16px;
        gap: 16px;
        margin-left: 0;
        margin-right: 0;
        border-radius: 16px;
    }

    .services-new__cta-text {
        font-size: 0.95rem;
        text-align: center;
    }

    .services-new__cta .btn {
        width: 100%;
        min-width: unset;
        justify-content: center;
    }
}

/* ================================================
   АДАПТИВ: СРЕДНИЕ ПЛАНШЕТЫ (600-750px)
   ================================================ */

@media (max-width: 750px) and (min-width: 600px) {
    .services-new__cta {
        padding: 22px 18px;
    }

    .services-new__cta-text {
        font-size: 0.92rem;
        max-width: 90%;
    }
}

/* ================================================
   АДАПТИВ: МОБИЛЬНЫЙ (до 600px)
   ================================================ */

@media (max-width: 600px) {
    .services-new {
        padding: 50px 0 40px;
    }

    .accordion-item__header {
        padding: 14px 14px;
    }

    .accordion-item__icon {
        width: 36px;
        height: 36px;
    }

    .accordion-item__title {
        font-size: 0.95rem;
    }

    .accordion-item.active .accordion-item__content {
        padding: 0 14px 16px;
    }

    .services-new__results {
        padding: 20px 16px;
        margin-top: 24px;
        margin-bottom: 20px;
    }

    .services-new__results-title {
        font-size: 1rem;
    }

    .services-new__results-items {
        gap: 10px;
    }

    .services-new__results-item {
        padding: 9px 11px;
    }

    .services-new__results-item span {
        font-size: 0.85rem;
    }

    .services-new__cta {
        padding: 20px 14px;
        gap: 14px;
        margin-left: 0;
        margin-right: 0;
        border-radius: 14px;
    }

    .services-new__cta-text {
        font-size: 0.9rem;
        padding: 0 4px;
    }

    .services-new__cta .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ================================================
   АДАПТИВ: МАЛЫЙ МОБИЛЬНЫЙ (до 480px)
   ================================================ */

@media (max-width: 480px) {
    .services-new {
        padding: var(--space-12) 0;
    }

    .services-new::after {
        height: 80px;
    }

    .services-new__cta {
        padding: 18px 12px;
        gap: 12px;
        margin-top: 30px;
        margin-left: 0;
        margin-right: 0;
    }

    .services-new__cta-text {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .services-new__cta .btn {
        font-size: 0.875rem;
        padding: 12px 16px;
    }
}

/* ================================================
   АДАПТИВ: ОЧЕНЬ УЗКИЕ ЭКРАНЫ (до 360px)
   ================================================ */

@media (max-width: 360px) {
    .services-new__results {
        padding: 18px 14px;
    }

    .services-new__results-header {
        gap: 8px;
        margin-bottom: 14px;
    }

    .services-new__results-icon-header {
        width: 22px;
        height: 22px;
    }

    .services-new__results-title {
        font-size: 0.95rem;
    }

    .services-new__results-item span {
        font-size: 0.8rem;
    }

    .services-new__cta {
        padding: 16px 10px;
        gap: 10px;
    }

    .services-new__cta-text {
        font-size: 0.85rem;
    }

    .services-new__cta .btn {
        font-size: 0.85rem;
        padding: 11px 14px;
    }
}

/* ================================================
   АДАПТИВ: LANDSCAPE МОБИЛЬНЫЙ
   ================================================ */

@media (orientation: landscape) and (max-height: 500px) {
    .services-new::after {
        height: 60px;
    }
}
