/*
	Предложение: страница «Гастроэнтерология и эндоскопия», вариант 1.
	Новые блоки названы по BEM сайта (b-gastro-*), цвета и размеры — из frontend/src/style/_config.scss.
	Точки разрыва как в $breakpoints: small 430, medium 768, large 1024, xlarge 1280.
	Существующие блоки сайта (b-page-header-v2, b-stages, b-doc-card, b-area-services,
	b-text-accordion, b-feedback-form) используются как есть.
*/
:root {
	--g-black: #1d1d1d;      /* $black-color */
	--g-text: #595959;       /* $text-color */
	--g-accent: #3356a3;     /* $accent-color */
	--g-accent-dark: #002370;/* $accent-dark-color */
	--g-tertiary: #ebeff6;   /* $tertiary-color */
	--g-light: #f7f8fc;      /* $light-grey-color-3 */
	--g-grey: #e8e8e8;       /* $grey-color */
	--g-orange-light: #fff1e5; /* $orange-light-color */
	--g-mars: #ff8516;       /* $mars-color */
	--g-red: #b91c1c;        /* $red-color */
}

.b-gastro-section { margin-bottom: 48px; scroll-margin-top: 120px; }
@media (min-width: 768px) { .b-gastro-section { margin-bottom: 64px; } }
@media (min-width: 1024px) { .b-gastro-section { margin-bottom: 96px; } }

/* Заголовок секции: размеры как у b-text-accordion__title */
.b-gastro-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
@media (min-width: 1024px) { .b-gastro-head { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 32px; } }
.b-gastro-head__title { margin: 0; color: var(--g-black); font-size: 26px; font-weight: 600; line-height: 115%; }
@media (min-width: 768px) { .b-gastro-head__title { font-size: 32px; } }
@media (min-width: 1024px) { .b-gastro-head__title { font-size: 42px; max-width: 640px; } }
.b-gastro-head__text { margin: 0; font-size: 15px; line-height: 22px; color: var(--g-text); }
@media (min-width: 1024px) { .b-gastro-head__text { max-width: 420px; font-size: 16px; line-height: 24px; } }
.b-gastro-head__link { color: var(--g-accent); font-weight: 500; text-decoration: none; white-space: nowrap; }

/* Первый экран: короткие факты вместо двух абзацев */
.b-gastro-hero .b-page-header-v2__descr p { margin: 0; }
.b-gastro-hero__facts { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; width: 100%; }
@media (min-width: 1024px) { .b-gastro-hero__facts { gap: 10px; margin-bottom: 20px; } }
.b-gastro-hero__fact { display: flex; flex-direction: column; padding: 10px 14px 10px 40px; border-radius: 16px; background: var(--g-light); position: relative; }
.b-gastro-hero__fact::before { content: ""; position: absolute; left: 14px; top: 14px; width: 16px; height: 16px; border-radius: 50%; background: var(--g-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='none'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='m2 5.2 2 2 4-4.4'/%3E%3C/svg%3E") center no-repeat; }
.b-gastro-hero__fact b { color: var(--g-black); font-weight: 600; font-size: 15px; line-height: 20px; }
.b-gastro-hero__fact span { color: var(--g-text); font-size: 13px; line-height: 18px; }
@media (min-width: 1024px) { .b-gastro-hero__fact b { font-size: 16px; } .b-gastro-hero__fact span { font-size: 14px; } }
.b-gastro-hero .b-page-header-v2__image img { object-position: center 30%; }

/* Сетки карточек */
.b-gastro-grid { display: grid; gap: 12px; }
@media (min-width: 768px) { .b-gastro-grid { grid-template-columns: 1fr 1fr; gap: 16px; } }
@media (min-width: 1024px) { .b-gastro-grid--3 { grid-template-columns: repeat(3, 1fr); } .b-gastro-grid--4 { grid-template-columns: repeat(4, 1fr); } }

/* Карточка: как b-cards-with-icons__item (рамка $grey-color, радиус 24) */
.b-gastro-card { border: 1px solid var(--g-grey); border-radius: 24px; padding: 16px; background: #fff; }
@media (min-width: 1024px) { .b-gastro-card { padding: 24px; } }
.b-gastro-card__icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 16px; background: var(--g-tertiary); color: var(--g-accent); margin-bottom: 14px; }
.b-gastro-card__icon svg { width: 26px; height: 26px; }
.b-gastro-card__name { margin: 0; color: var(--g-black); font-weight: 600; font-size: 17px; line-height: 22px; }
.b-gastro-card__text { margin: 6px 0 0; font-size: 14px; line-height: 20px; color: var(--g-text); }
.b-gastro-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.b-gastro-card__tags span { font-size: 13px; line-height: 16px; background: var(--g-tertiary); color: var(--g-accent); padding: 6px 12px; border-radius: 12px; }
.b-gastro-card--tags { background: var(--g-light); border-color: transparent; }
@media (min-width: 768px) and (max-width: 1023.98px) { .b-gastro-card--wide { grid-column: 1 / -1; } }
@media (min-width: 1024px) { .b-gastro-card--wide { grid-column: span 2; } }

/* Предупреждение о неотложных симптомах */
.b-gastro-alert { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: 20px; background: var(--g-orange-light); font-size: 14px; line-height: 20px; color: var(--g-black); }
.b-gastro-alert p { margin: 0; }
.b-gastro-alert a { color: var(--g-accent); font-weight: 600; white-space: nowrap; text-decoration: none; }
.b-gastro-alert__icon { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--g-mars); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
@media (min-width: 1024px) { .b-gastro-alert { padding: 18px 24px; font-size: 15px; line-height: 22px; } }

/* Два направления */
.b-gastro-dirs { display: grid; gap: 12px; }
@media (min-width: 1024px) { .b-gastro-dirs { grid-template-columns: 1fr 1fr; gap: 16px; } }
.b-gastro-dirs__col { background: var(--g-light); border-radius: 32px; padding: 8px 16px 12px; }
@media (min-width: 1024px) { .b-gastro-dirs__col { padding: 12px 32px 20px; } }
.b-gastro-dirs__top { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.b-gastro-dirs__label { font-size: 22px; font-weight: 600; color: var(--g-black); }
@media (min-width: 1024px) { .b-gastro-dirs__label { font-size: 26px; } }
.b-gastro-dirs__count { font-size: 13px; color: var(--g-accent); background: var(--g-tertiary); padding: 4px 12px; border-radius: 12px; }
.b-gastro-dirs__item { display: block; position: relative; padding: 16px 36px 16px 0; border-top: 1px solid var(--g-grey); color: var(--g-text); text-decoration: none; font-size: 14px; line-height: 20px; }
.b-gastro-dirs__item b { display: block; color: var(--g-black); font-weight: 600; font-size: 16px; line-height: 22px; margin-bottom: 4px; transition: color .3s ease-out; }
a.b-gastro-dirs__item::after { content: ""; position: absolute; right: 0; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none'%3E%3Cpath stroke='%233356A3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.4' d='M.55 6.55h12m-6 6 6-6-6-6'/%3E%3C/svg%3E") center / 12px no-repeat; }
a.b-gastro-dirs__item:hover b { color: var(--g-accent); }
.b-gastro-more { margin-top: 20px; display: flex; justify-content: center; }
.b-gastro-more .more-link { width: 100%; max-width: 420px; text-align: center; }

/* Этапы: заголовок шага внутри b-stages__item */
.b-gastro-step { display: block; color: var(--g-black); font-weight: 600; font-size: 18px; line-height: 24px; margin-bottom: 4px; }
.b-stages .b-stages__items .b-stages__item { text-align: left; }
.b-stages__image-wrap { min-height: 360px; }

/* Баннер «во сне» */
.b-gastro-banner { display: grid; overflow: hidden; border-radius: 32px; background: var(--g-accent); color: #fff; }
@media (min-width: 1024px) { .b-gastro-banner { grid-template-columns: 1.1fr 1fr; border-radius: 40px; } }
.b-gastro-banner__content { padding: 24px 20px; }
@media (min-width: 1024px) { .b-gastro-banner__content { padding: 48px; } }
.b-gastro-banner__label { display: inline-block; font-size: 13px; padding: 4px 12px; border-radius: 12px; background: rgba(255 255 255 / 16%); margin-bottom: 14px; }
.b-gastro-banner__title { margin: 0 0 12px; font-size: 26px; line-height: 115%; font-weight: 600; color: #fff; }
@media (min-width: 1024px) { .b-gastro-banner__title { font-size: 38px; } }
.b-gastro-banner__text { margin: 0 0 20px; font-size: 15px; line-height: 22px; color: rgba(255 255 255 / 88%); }
@media (min-width: 1024px) { .b-gastro-banner__text { font-size: 17px; line-height: 26px; } }
.b-gastro-banner__list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
@media (min-width: 768px) { .b-gastro-banner__list { grid-template-columns: repeat(3, 1fr); } }
.b-gastro-banner__list li { padding: 12px 14px; border-radius: 16px; background: rgba(255 255 255 / 10%); font-size: 14px; line-height: 19px; color: rgba(255 255 255 / 88%); }
.b-gastro-banner__list b { display: block; color: #fff; font-size: 18px; line-height: 24px; font-weight: 600; margin-bottom: 2px; }
.b-gastro-banner__btns { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.b-gastro-banner__btn.btn-fill { background: #fff; color: var(--g-accent); border-color: #fff; min-width: 180px; }
.b-gastro-banner__link { color: #fff; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.b-gastro-banner__image { min-height: 220px; position: relative; }
.b-gastro-banner__image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Почему МАРС */
.b-gastro-why { padding: 20px; border-radius: 24px; background: var(--g-light); }
.b-gastro-why__num { display: block; color: var(--g-accent); font-weight: 600; font-size: 14px; margin-bottom: 20px; }
@media (min-width: 1024px) { .b-gastro-why { padding: 24px; } .b-gastro-why__num { margin-bottom: 40px; } }
.b-gastro-why__name { margin: 0 0 6px; color: var(--g-black); font-weight: 600; font-size: 18px; line-height: 24px; }
.b-gastro-why__text { margin: 0; font-size: 14px; line-height: 20px; color: var(--g-text); }

/* Врачи: ограничиваем 6 карточками в предложении */
#doctors .b-doc-list { margin: 0; }

/* Услуги: блок сайта, без отступа сверху */
#all-services .b-area-services { margin: 0; }

/* Вопросы */
.b-gastro-faq .b-gastro-head__title { margin-bottom: 0; }
.b-gastro-faq .b-text-accordion__items { margin-top: 24px; }

/* Статьи */
.b-gastro-article { display: flex; flex-direction: column; gap: 12px; padding: 20px; min-height: 150px; border: 1px solid var(--g-grey); border-radius: 24px; text-decoration: none; color: var(--g-black); font-size: 17px; line-height: 23px; transition: box-shadow .3s ease-out; }
.b-gastro-article:hover { box-shadow: 0 4px 48px 0 rgba(0 35 112 / 12%); }
.b-gastro-article b { font-weight: 600; }
.b-gastro-article__tag { align-self: flex-start; font-size: 12px; line-height: 16px; padding: 4px 12px; border-radius: 12px; background: var(--g-orange-light); color: var(--g-mars); }

/* Запись и контакты */
.b-gastro-contact { display: grid; gap: 24px; }
@media (min-width: 1024px) { .b-gastro-contact { grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; } }
.b-gastro-contact__info { padding: 24px 20px; border-radius: 32px; background: var(--g-light); display: flex; flex-direction: column; }
@media (min-width: 1024px) { .b-gastro-contact__info { padding: 40px; border-radius: 40px; } }
.b-gastro-contact__text { margin: 12px 0 20px; color: var(--g-text); font-size: 15px; line-height: 22px; }
.b-gastro-contact__list { margin: 0 0 20px; display: grid; gap: 14px; }
.b-gastro-contact__list dt { font-size: 13px; color: var(--g-text); margin-bottom: 2px; }
.b-gastro-contact__list dd { margin: 0; color: var(--g-black); font-weight: 500; font-size: 16px; line-height: 22px; }
.b-gastro-contact__list a { color: var(--g-accent); text-decoration: none; font-weight: 600; font-size: 18px; }
.b-gastro-contact__photo { width: 100%; border-radius: 24px; margin-top: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.b-gastro-contact__form .b-feedback-form--new { margin: 0; height: 100%; }
.b-gastro-contact__form .l-container { padding: 0; max-width: none; }

/* правки после первого просмотра */
.b-stages .b-stages__title { margin-bottom: 20px; }
@media (min-width: 1024px) { .b-stages .b-stages__title { margin-bottom: 32px; } }
@media (min-width: 1280px) { #all-services .l-container { max-width: 1502px; padding: 0 15px; } }
.b-gastro-contact__form .b-feedback-form__title { margin-top: 0; }

/* мобильная версия: карточки компактнее — иконка слева, номер в строку */
@media (max-width: 767.98px) {
	.b-gastro-card:has(.b-gastro-card__icon) { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; padding: 14px 16px; }
	.b-gastro-card__icon { width: 44px; height: 44px; margin: 0; grid-row: span 2; border-radius: 14px; }
	.b-gastro-card:has(.b-gastro-card__icon) .b-gastro-card__name { font-size: 16px; }
	.b-gastro-card:has(.b-gastro-card__icon) .b-gastro-card__text { margin-top: 2px; }
	.b-gastro-why { padding: 16px; }
	.b-gastro-why__num { display: inline; margin: 0 8px 0 0; }
	.b-gastro-why__name { display: inline; font-size: 17px; }
	.b-gastro-why__text { margin-top: 6px; }
	.b-gastro-grid { gap: 8px; }
	.b-gastro-banner__image { min-height: 200px; }
}
