/* Astra Child – стили страницы услуги (page-service-single)
   Только переопределения: hero meta для услуги, inline-форма, SEO.
   Pricing SaaS (.ps-pricing-*) и авторы – page-front.css.
   ============================================================================= */

/* Inline-форма под hero (как на главной; сетка и кнопка – page-front.css .hero-form-container) */
.service-single .inline-form-section {
    margin-top: -24px;
    padding-bottom: 24px;
}

@media (max-width: 921px) {
    .service-single .inline-form-section .hero-horizontal-form {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 922px) {
    .service-single .inline-form-section .hero-horizontal-form {
        grid-template-columns: 1fr 1fr 1fr auto;
    }
}


/* Hero услуги: тот же density, что главная; ~50/50 desktop */
.hero-section.hero-section--service-single {
    padding-top: var(--spacing-hero-top, 20px);
    padding-bottom: var(--spacing-hero-bottom, 48px);
}

.hero-section--service-single .breadcrumbs {
    margin-bottom: var(--spacing-breadcrumb-gap, 12px);
}

.hero-section--service-single__container {
    display: flex;
    flex-direction: column;
}

.hero-section--service-single .hero-title {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    min-width: 0;
}

@media (min-width: 922px) {
    .hero-section.hero-section--service-single {
        padding-top: 20px;
    }

    .hero-section--service-single .breadcrumbs {
        margin-bottom: 12px;
    }

    /* Выравнивание по верху – как на главной (page-front .hero-flex) */
    .hero-section--service-single .hero-flex {
        align-items: start;
    }

    .hero-section--service-single .hero-content--intro,
    .hero-section--service-single .hero-content--body,
    .hero-section--service-single .hero-visual {
        align-self: start;
    }

    /* На услугах body обычно выше 200px (meta+promo) – CTA сразу после контента */
    .hero-section--service-single .hero-content--body {
        min-height: 0;
    }

    .hero-section--service-single .hero-actions {
        margin-top: 0;
        padding-top: 4px;
    }
}

@media (max-width: 921px) {
    .hero-section.hero-section--service-single {
        padding-top: 10px;
        padding-bottom: 28px;
    }

    .hero-section--service-single .breadcrumbs {
        margin-bottom: 8px;
        font-size: 0.75rem;
    }

    /* Длинные H1 услуг: чуть плотнее, без «стены» из 5–6 строк */
    .hero-section--service-single .hero-title {
        font-size: 1.3125rem; /* ~21px */
        line-height: 1.22;
        margin-bottom: 8px;
    }

    .hero-section--service-single .hero-tagline {
        font-size: 0.9375rem;
        margin-bottom: 6px;
    }

    .hero-section--service-single .hero-desc {
        margin-bottom: 10px;
    }

    .hero-section--service-single .hero-subtitle {
        font-size: 0.8125rem;
        line-height: 1.45;
    }
}

/*
 * Ряд: meta (стоимость / срок) + promo-скидка.
 * Mobile: колонка. Desktop ≥922: одна линия, wrap если узко.
 */
.hero-section--service-single .hero-meta-promo-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0; /* gap body-колонки задаёт отступы */
    width: 100%;
    min-width: 0;
}

.hero-section--service-single .hero-service-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0;
    align-items: stretch;
    flex: 0 0 auto;
}

.hero-section--service-single .hero-service-meta__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--color-white);
    /* Как у promo-pill / скидки – полные скругления */
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
}

/* Promo в ряду с meta – на mobile full width, на desktop – рядом */
.hero-section--service-single .hero-promo--with-meta {
    margin: 0;
    align-self: stretch;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 922px) {
    .hero-section--service-single .hero-meta-promo-row {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 12px;
        margin-bottom: 0;
    }

    .hero-section--service-single .hero-service-meta__item {
        /* Фиксированный «пилюльный» размер, не тянется */
        flex: 0 0 auto;
        width: auto;
        min-width: 148px;
    }

    .hero-section--service-single .hero-promo--with-meta {
        flex: 0 1 auto;
        align-self: center;
        max-width: min(100%, 280px);
        min-width: 0;
        padding: 8px 12px;
        /* Совпадает по высоте с meta-карточками */
        min-height: 52px;
    }

    .hero-section--service-single .hero-promo--with-meta .hero-promo__text {
        font-size: 0.75rem;
        line-height: 1.25;
    }

    .hero-section--service-single .hero-promo--with-meta .hero-promo__icon {
        width: 26px;
        height: 26px;
    }

    .hero-section--service-single .hero-promo--with-meta .hero-promo__icon svg {
        width: 13px;
        height: 13px;
    }
}

.hero-section--service-single .hero-service-meta__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hero-section--service-single .hero-service-meta__icon svg {
    width: 18px;
    height: 18px;
}

.hero-section--service-single .hero-service-meta__icon--blue {
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
}

.hero-section--service-single .hero-service-meta__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hero-section--service-single .hero-service-meta__label {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    line-height: 1.2;
}

.hero-section--service-single .hero-service-meta__value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-dark);
    line-height: 1.2;
    margin-bottom: 0;
}

.hero-section--service-single .hero-trust--service {
    font-size: var(--fs-sm, 0.8125rem);
    color: var(--color-text-muted);
    margin-left: 0;
    align-self: center;
}

.hero-section--service-single .hero-actions__row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 0;
}

@media (max-width: 921px) {
    /* Чек-лист → meta/скидка → кнопка: дыхание между блоками */
    .hero-section--service-single .hero-content--body {
        gap: 16px;
    }

    .hero-section--service-single .hero-meta-promo-row {
        margin-bottom: 0;
        gap: 8px;
    }

    .hero-section--service-single .hero-actions {
        padding-top: 2px;
    }

    /* Две meta-карточки в ряд – экономия вертикали */
    .hero-section--service-single .hero-service-meta {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        width: 100%;
        margin-bottom: 0;
    }

    .hero-section--service-single .hero-service-meta__item {
        width: auto;
        min-width: 0;
        flex: 1 1 0;
        padding: 8px 10px;
        gap: 8px;
    }

    .hero-section--service-single .hero-promo--with-meta {
        width: 100%;
        max-width: 100%;
        align-self: stretch;
    }

    .hero-section--service-single .hero-service-meta__icon {
        width: 32px;
        height: 32px;
    }

    .hero-section--service-single .hero-service-meta__icon svg {
        width: 16px;
        height: 16px;
    }

    .hero-section--service-single .hero-service-meta__value {
        font-size: 0.9375rem;
    }

    .hero-section--service-single .hero-trust--service {
        margin-left: 0;
        margin-top: 0;
        width: 100%;
        text-align: left;
    }
}

/* Описание Hero */
.hero-section--service-single .hero-subtitle {
    font-size: var(--fs-body, 0.9375rem);
    line-height: 1.5;
    margin-bottom: 0;
    max-width: none;
    color: var(--color-text-muted, #64748b);
}

.hero-section--service-single .hero-desc {
    margin-bottom: 14px;
    max-width: none;
}

/* =============================================================================
   Блок SEO Интро (Шахматный порядок) – seo-intro-section
   ============================================================================= */
.seo-intro-section {
    padding: var(--spacing-section) 0;
    background: var(--color-bg-light);
}

.seo-intro-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.seo-intro-row {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
}

.seo-intro-visual {
    width: 100%;
}

.seo-intro-image-wrapper {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.4s ease;
    max-width: 550px;
    margin: 0 auto;
    /* transform не влияет на document flow – соседний текст не сдвигается */
    will-change: transform;
}

.seo-intro-row:hover .seo-intro-image-wrapper {
    transform: translateY(-8px);
}

@media (min-width: 922px) {
    .seo-intro-image-wrapper {
        margin: 0;
    }

    .seo-intro-row--reverse .seo-intro-image-wrapper {
        margin-left: auto;
    }
}

/* Форма-карточка внутри SEO Intro */
.seo-intro-form-card {
    background: var(--color-white);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border);
    max-width: 450px;
    margin: 0 auto;
}

.seo-intro-form-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 8px;
    text-align: center;
}

.seo-intro-form-card__cta {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.4;
}

.seo-intro-form-card .form-group {
    margin-bottom: 16px;
}

.seo-intro-form-card label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text-dark);
}

.seo-intro-form-card input,
.seo-intro-form-card textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--color-bg-light);
    transition: all 0.3s ease;
}

.seo-intro-form-card textarea {
    min-height: 100px;
    resize: vertical;
}

.seo-intro-form-card input:focus,
.seo-intro-form-card textarea:focus {
    border-color: var(--color-primary);
    background: var(--color-white);
    outline: none;
    box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.seo-intro-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 4/3; /* Оптимально для Mobile First и Desktop */
    object-fit: cover;
}

.seo-intro-content {
    width: 100%;
    padding-top: 0; /* Заголовок на одной линии с верхом картинки */
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.seo-intro-title {
    font-size: var(--fs-h2, 1.375rem);
    font-weight: 700;
    color: var(--color-text-dark);
    margin: 0 0 12px;
    line-height: var(--lh-snug, 1.28);
    flex-shrink: 0;
    text-wrap: balance;
}

.seo-intro-body {
    position: relative;
    min-height: 0;
}

.seo-intro-text {
    font-size: var(--fs-body, 0.9375rem);
    line-height: var(--lh-body, 1.55);
    color: var(--color-text-muted);
}

.seo-intro-text p {
    margin-bottom: 16px;
}

.seo-intro-text p:last-child {
    margin-bottom: 0;
}

/* «Читать далее» – компонент .ps-read-more в _components.css.
   Здесь только позиционирование в блоке SEO-интро. */
.seo-intro-content .ps-read-more,
.seo-intro-content .seo-intro-more {
    align-self: flex-start;
    margin-top: 10px !important;
}

.seo-intro-content.is-collapsed .seo-intro-body {
    overflow: hidden;
}

.seo-intro-content.is-collapsed .seo-intro-body::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    background: linear-gradient(to bottom, rgba(248, 250, 252, 0), var(--color-bg-light) 90%);
    pointer-events: none;
}

.seo-intro-content.is-expanded .seo-intro-body {
    overflow: visible;
}

/* Mobile stack density */
.seo-intro-section {
    padding: var(--spacing-section) 0;
}
.seo-intro-grid {
    gap: 28px;
}
.seo-intro-row {
    gap: 16px;
}
.seo-intro-more {
    margin-top: 10px;
    font-size: var(--fs-sm, 0.875rem);
}

/* Десктоп: шахматный порядок + обрезка текста по высоте картинки */
@media (min-width: 922px) {
    .seo-intro-row {
        flex-direction: row;
        gap: 64px;
        align-items: flex-start;
    }

    .seo-intro-row--reverse {
        flex-direction: row-reverse;
    }

    .seo-intro-visual,
    .seo-intro-content {
        flex: 1;
        width: 50%;
    }

    /* Высота контента = высота картинки (задаётся через --seo-img-h в JS) */
    .seo-intro-content.is-collapsed {
        height: var(--seo-img-h);
        max-height: var(--seo-img-h);
        overflow: hidden;
    }

    .seo-intro-content.is-collapsed .seo-intro-body {
        flex: 1 1 auto;
    }

    .seo-intro-content.is-expanded {
        height: auto;
        max-height: none;
    }

    .seo-intro-title {
        font-size: 2.25rem;
        margin-bottom: 16px;
    }

    .seo-intro-text {
        font-size: 1rem;
        line-height: 1.6;
    }

    .seo-intro-grid {
        gap: 48px;
    }

    .seo-intro-form-card {
        margin: 0;
    }

    .seo-intro-row--reverse .seo-intro-form-card {
        margin-left: auto;
    }
}

/* Хвостовая секция (после CTA-баннера) – те же стили что у основной */
.seo-intro-section-tail {
    padding: 0 0 64px;
    background: var(--color-bg-light);
}

/* =============================================================================
   CTA-баннер с формой – вписан в ритм секции seo-intro
   ============================================================================= */
.seo-cta-banner {
    background: var(--color-white);
    padding: 0 0 48px;
}


.seo-cta-banner__inner {
    display: flex;
    flex-direction: column;
    gap: 32px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 55%, #1d4ed8 100%);
    box-shadow: var(--shadow-xl);
}

.seo-cta-banner__form-side {
    padding: 40px 32px 32px;
    display: flex;
    flex-direction: column;
}

.seo-cta-banner__title {
    font-size: clamp(1.375rem, 4.2vw, 1.75rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin: 0 0 16px;
    text-wrap: balance;
    max-width: 18em;
}

.seo-cta-banner__trust {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.seo-cta-banner__trust li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.seo-cta-banner__trust svg {
    flex-shrink: 0;
}

/* Поля формы */
.seo-cta-banner__card .form-group {
    margin-bottom: 14px;
}

.seo-cta-banner__card label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #e2e8f0;
}

.seo-cta-banner__card input[type="text"],
.seo-cta-banner__card input[type="email"],
.seo-cta-banner__card textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.seo-cta-banner__card input::placeholder,
.seo-cta-banner__card textarea::placeholder {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.875rem;
    line-height: 1.4;
}

.seo-cta-banner__card textarea {
    min-height: 96px;
    resize: vertical;
    line-height: 1.45;
}

@media (max-width: 921px) {
    .seo-cta-banner__form-side {
        padding: 28px 20px 24px;
    }

    .seo-cta-banner__title {
        font-size: 1.375rem;
        margin-bottom: 12px;
        max-width: none;
    }

    .seo-cta-banner__trust {
        margin-bottom: 18px;
        gap: 6px;
    }

    .seo-cta-banner__trust li {
        font-size: 0.8125rem;
    }

    .seo-cta-banner__card input[type="text"],
    .seo-cta-banner__card input[type="email"],
    .seo-cta-banner__card textarea {
        font-size: 0.9375rem;
        padding: 12px 14px;
    }

    .seo-cta-banner__card textarea {
        min-height: 104px;
    }
}

.seo-cta-banner__card input:focus,
.seo-cta-banner__card textarea:focus {
    border-color: #60a5fa;
    background: rgba(255, 255, 255, 0.13);
    outline: none;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

/* Фото – скрыто на мобильном */
.seo-cta-banner__photo-side {
    display: none;
}

.seo-cta-banner__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

@media (min-width: 922px) {
    .seo-cta-banner {
        padding: 0 0 64px;
    }

    .seo-cta-banner__inner {
        flex-direction: row;
        gap: 0;
    }

    .seo-cta-banner__form-side {
        flex: 0 0 55%;
        padding: 48px 48px 48px 52px;
    }

    .seo-cta-banner__title {
        font-size: 2.125rem;
        max-width: 14em;
    }

    .seo-cta-banner__photo-side {
        display: block;
        flex: 0 0 45%;
        position: relative;
        min-height: 420px;
    }

    .seo-cta-banner__photo {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top center;
    }
}
