/* ============================================================
   А-Медия · новые компоненты сайта — сборник

   1. Форма записи на приём      .afm
   2. Ядро: токены, шаг сайдбара .am / --am-widget-gap
   3. Теги                       .am-tags
   4. Листинг статей             .am-articles
   5. Виджет контактов           .am-contacts
   6. Форма в сайдбаре           .am-sform
   7. Врачи (слайдер/сетка)      .am-doctors
                                 .am-doctors--center — шапка по центру
                                 .am-doctors--bare — без шапки
                                 .am-doctors--grid — сеткой, все врачи
   8. Страница врача, шапка      .am-dhero
   9. Контакты в три колонки     .am-cg
  10. Галерея / сертификаты     .am-gal
  11. Фильтр по категориям      .am-filter
  12. Последние материалы       .am-recent
   ============================================================ */

/* ============================================================
   1. ФОРМА ЗАПИСИ НА ПРИЁМ
   ============================================================ */

/* ============================================================
   А-Медия · форма записи на приём
   Токены нового дизайна с фолбэками — работает и на странице,
   где :root ещё не подключён.
   ============================================================ */

.afm {
  --afm-teal-900: var(--teal-900, #0D3B41);
  --afm-teal-800: var(--teal-800, #124A51);
  --afm-teal-500: var(--teal-500, #2E7B81);
  --afm-teal-100: var(--teal-100, #DCEAE8);
  --afm-teal-050: var(--teal-050, #EDF4F3);
  --afm-card: var(--card, #FFFFFF);
  --afm-line: var(--line, #E4E8E5);
  --afm-ink: var(--ink, #123A3F);
  --afm-ink-soft: var(--ink-soft, #54696B);
  --afm-flame: var(--flame, #D14E24);
  --afm-flame-dark: var(--flame-dark, #B4401B);
  --afm-flame-050: var(--flame-050, #FBEDE7);
  --afm-err: #C0392B;
  --afm-r-sm: var(--r-sm, 12px);
  --afm-r-md: var(--r-md, 18px);
  --afm-r-lg: var(--r-lg, 26px);
  --afm-shadow: var(--shadow-md, 0 10px 30px -12px rgba(13, 59, 65, .18));
  --afm-font-d: var(--font-d, 'Nunito', system-ui, sans-serif);
  --afm-font-b: var(--font-b, 'Golos Text', system-ui, sans-serif);

  font-family: var(--afm-font-b);
  color: var(--afm-ink);
  font-size: 16px;
  line-height: 1.55;
}

.afm *, .afm *::before, .afm *::after { box-sizing: border-box; }

.afm__card {
  position: relative;
  background: var(--afm-card);
  border: 1px solid var(--afm-line);
  border-radius: var(--afm-r-lg);
  padding: 36px 36px 32px;
  box-shadow: var(--afm-shadow);
  overflow: hidden;
}

/* Мягкий акцент в углу карточки */
.afm__card::before {
  content: "";
  position: absolute; top: -90px; right: -90px;
  width: 240px; height: 240px; border-radius: 50%;
  background: var(--afm-teal-050);
  pointer-events: none;
}

.afm__head { position: relative; margin-bottom: 26px; }

.afm__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 13px/1 var(--afm-font-b);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--afm-teal-500); margin-bottom: 14px;
}
.afm__eyebrow svg { width: 14px; height: 14px; color: var(--afm-flame); }

.afm__title {
  margin: 0; font-family: var(--afm-font-d);
  font-size: clamp(24px, 3vw, 32px); font-weight: 800;
  line-height: 1.2; letter-spacing: -.01em; color: var(--afm-teal-900);
}

.afm__lead { margin: 12px 0 0; color: var(--afm-ink-soft); max-width: 520px; }

/* ── Поля ─────────────────────────────────────────────────── */

.afm__grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.afm__field { display: flex; flex-direction: column; gap: 7px; }
.afm__field--wide { grid-column: 1 / -1; }

.afm__label { font-size: 13px; font-weight: 600; color: var(--afm-ink-soft); }
.afm__req { color: var(--afm-flame); margin-left: 2px; }

.afm__input,
.afm__select,
.afm__textarea {
  width: 100%; font: 400 15px/1.4 var(--afm-font-b); color: var(--afm-ink);
  background: var(--afm-card);
  border: 1.5px solid var(--afm-line); border-radius: 14px;
  padding: 14px 16px;
  transition: border-color .16s ease, box-shadow .16s ease;
  -webkit-appearance: none; appearance: none;
}

.afm__input::placeholder, .afm__textarea::placeholder { color: var(--afm-ink-soft); opacity: .65; }
.afm__input:hover, .afm__select:hover, .afm__textarea:hover { border-color: var(--afm-teal-100); }

.afm__input:focus, .afm__select:focus, .afm__textarea:focus {
  outline: none; border-color: var(--afm-teal-500);
  box-shadow: 0 0 0 4px rgba(46, 123, 129, .12);
}

.afm__select {
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E7B81' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 18px;
}

.afm__textarea { min-height: 124px; resize: vertical; }

.afm__field.is-error .afm__input,
.afm__field.is-error .afm__select,
.afm__field.is-error .afm__textarea { border-color: var(--afm-err); }
.afm__field.is-error .afm__input:focus { box-shadow: 0 0 0 4px rgba(192, 57, 43, .1); }

.afm__error { font-size: 13px; color: var(--afm-err); min-height: 0; }
.afm__error:empty { display: none; }

/* ── Согласие и кнопка ────────────────────────────────────── */

.afm__foot {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-top: 24px;
}

.afm__consent { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--afm-ink-soft); max-width: 420px; cursor: pointer; }
.afm__consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--afm-teal-500); flex: none; cursor: pointer; }
.afm__consent a { color: var(--afm-teal-500); }
.afm__consent.is-error { color: var(--afm-err); }

.afm__submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 700 15px/1 var(--afm-font-b); color: #fff;
  background: var(--afm-flame); border: 0; border-radius: 14px;
  padding: 17px 30px; cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.afm__submit:hover { background: var(--afm-flame-dark); }
.afm__submit:active { transform: translateY(1px); }
.afm__submit[disabled] { opacity: .7; cursor: default; }
.afm__submit svg { width: 16px; height: 16px; transition: transform .16s ease; }
.afm__submit:hover svg { transform: translateX(3px); }

.afm__spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff; border-radius: 50%; animation: afm-spin .7s linear infinite;
}
@keyframes afm-spin { to { transform: rotate(360deg); } }

.afm a:focus-visible, .afm button:focus-visible, .afm input:focus-visible,
.afm select:focus-visible, .afm textarea:focus-visible {
  outline: 2px solid var(--afm-teal-500); outline-offset: 3px;
}

@media (max-width: 720px) {
  .afm__card { padding: 26px 20px 24px; border-radius: var(--afm-r-md); }
  .afm__grid { grid-template-columns: 1fr; gap: 15px; }
  .afm__foot { flex-direction: column; align-items: stretch; }
  .afm__submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .afm *, .afm *::before, .afm *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* ============================================================
   2–3. ЯДРО И КОМПОНЕНТЫ
   ============================================================ */

/* ── ЯДРО: токены и общие правила ─────────────────────────── */

.am {
  --am-teal-900: var(--teal-900, #0D3B41);
  --am-teal-800: var(--teal-800, #124A51);
  --am-teal-500: var(--teal-500, #2E7B81);
  --am-teal-100: var(--teal-100, #DCEAE8);
  --am-teal-050: var(--teal-050, #EDF4F3);
  --am-card: var(--card, #FFFFFF);
  --am-line: var(--line, #E4E8E5);
  --am-ink: var(--ink, #123A3F);
  --am-ink-soft: var(--ink-soft, #54696B);
  --am-flame: var(--flame, #D14E24);
  --am-flame-dark: var(--flame-dark, #B4401B);
  --am-flame-050: var(--flame-050, #FBEDE7);
  --am-r-sm: var(--r-sm, 12px);
  --am-r-md: var(--r-md, 18px);
  --am-r-lg: var(--r-lg, 26px);
  --am-shadow-sm: var(--shadow-sm, 0 1px 2px rgba(13, 59, 65, .06));
  --am-shadow-md: var(--shadow-md, 0 10px 30px -12px rgba(13, 59, 65, .18));
  --am-font-d: var(--font-d, 'Nunito', system-ui, sans-serif);
  --am-font-b: var(--font-b, 'Golos Text', system-ui, sans-serif);

  font-family: var(--am-font-b);
  color: var(--am-ink);
  font-size: 16px;
  line-height: 1.55;
}

.am *, .am *::before, .am *::after { box-sizing: border-box; }

/* Единый шаг между виджетами сайдбара.
   Правило перекрывает старые модификаторы widget_mb80 / widget_mb40,
   поэтому новые и старые блоки стоят с одинаковым отступом.
   Меняется одним значением ниже. */

:root { --am-widget-gap: 32px; }

.section__widget,
.am-widget,
.am-contacts-wrap { margin-bottom: var(--am-widget-gap); }

.section__widget[class*="widget_mb"] { margin-bottom: var(--am-widget-gap); }

.section__widget:last-child,
.am-widget:last-child,
.am-contacts-wrap:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
  :root { --am-widget-gap: 24px; }
}

.am-h2 {
  margin: 0 0 18px;
  font-family: var(--am-font-d);
  font-size: clamp(22px, 2.6vw, 28px); font-weight: 800;
  line-height: 1.2; letter-spacing: -.01em;
  color: var(--am-teal-900);
}

.am-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 13px/1 var(--am-font-b);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--am-teal-500); margin-bottom: 14px;
}

.am-more {
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 14px/1 var(--am-font-b); color: var(--am-teal-800);
  background: var(--am-card); border: 1.5px solid var(--am-line);
  border-radius: var(--am-r-sm); padding: 12px 20px; cursor: pointer;
  transition: border-color .16s ease, color .16s ease;
}
.am-more:hover { border-color: var(--am-teal-500); color: var(--am-teal-500); }
.am-more span { color: var(--am-ink-soft); font-weight: 500; }

.am a:focus-visible, .am button:focus-visible {
  outline: 2px solid var(--am-teal-500); outline-offset: 3px; border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .am *, .am *::before, .am *::after {
    transition-duration: .01ms !important; animation-duration: .01ms !important;
  }
}

/* ── КОМПОНЕНТ: теги ──────────────────────────────────────── */

.am-tags {
  background: var(--am-card);
  border: 1px solid var(--am-line);
  border-radius: var(--am-r-lg);
  padding: 28px 28px 26px;
}

.am-tags__title { margin: 0 0 18px; font-family: var(--am-font-d); font-size: 20px; font-weight: 800; color: var(--am-teal-900); line-height: 1.25; }
.am-tags__title:empty { display: none; }

.am-tags__list { display: flex; flex-wrap: wrap; gap: 9px; }

.am-tag {
  display: inline-flex; align-items: center;
  padding: 10px 16px; border-radius: 999px;
  background: var(--am-teal-050); color: var(--am-teal-800);
  border: 1px solid transparent;
  font: 500 14px/1.25 var(--am-font-b); text-decoration: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.am-tag:hover {
  background: var(--am-flame-050); color: var(--am-flame-dark);
  border-color: var(--am-flame-050); transform: translateY(-1px);
}

.am-tag.is-hidden { display: none; }

.am-tags__foot { margin-top: 18px; }

@media (max-width: 720px) {
  .am-tags { padding: 20px 18px; border-radius: var(--am-r-md); }
  .am-tags__list { gap: 8px; }
  .am-tag { padding: 9px 14px; font-size: 13px; }
}

/* ── КОМПОНЕНТ: листинг статей ────────────────────────────── */

.am-articles { display: flex; flex-direction: column; gap: 18px; }

.am-article {
  position: relative;
  display: grid; grid-template-columns: 300px 1fr; gap: 0;
  background: var(--am-card);
  border: 1px solid var(--am-line);
  border-radius: var(--am-r-lg);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.am-article:hover {
  transform: translateY(-2px);
  border-color: var(--am-teal-100);
  box-shadow: var(--am-shadow-md);
}

/* Карточка без картинки — текст на всю ширину */
.am-article:not(:has(.am-article__media)) { grid-template-columns: 1fr; }

.am-article__media {
  display: block; position: relative;
  background: var(--am-teal-050);
  min-height: 100%; overflow: hidden;
}

.am-article__img {
  display: block; width: 100%; height: 100%;
  min-height: 220px; object-fit: cover;
  transition: transform .35s ease;
}

.am-article:hover .am-article__img { transform: scale(1.04); }

.am-article__body {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 26px 28px 24px;
}

.am-article__meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }

.am-article__meta-item {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--am-ink-soft); white-space: nowrap;
}

.am-article__meta-item svg { width: 15px; height: 15px; color: var(--am-teal-500); flex: none; }

.am-article__title {
  margin: 0 0 10px;
  font-family: var(--am-font-d);
  font-size: 21px; font-weight: 800; line-height: 1.3;
  letter-spacing: -.01em;
}

.am-article__title a {
  color: var(--am-teal-900); text-decoration: none;
  transition: color .16s ease;
}

.am-article:hover .am-article__title a { color: var(--am-teal-500); }

.am-article__text {
  margin: 0 0 18px; color: var(--am-ink-soft); font-size: 15px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

.am-article__more {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: auto;
  font: 700 14px/1 var(--am-font-b); color: var(--am-flame);
  text-decoration: none;
  padding: 11px 18px; border-radius: var(--am-r-sm);
  background: var(--am-flame-050);
  transition: background .16s ease, color .16s ease;
}

.am-article__more svg { width: 15px; height: 15px; transition: transform .16s ease; }
.am-article__more:hover { background: var(--am-flame); color: #fff; }
.am-article__more:hover svg { transform: translateX(3px); }

.am-article[data-am-href] { cursor: pointer; }
.am-article[data-am-href] a { position: relative; z-index: 1; }

/* Пагинация из includes.pagination */

.am-articles__pages { margin-top: 12px; }
.am-articles__pages:empty { display: none; }

.am-articles__pages ul,
.am-articles__pages .pagination {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  list-style: none; margin: 0; padding: 0;
}

.am-articles__pages li { list-style: none; }

.am-articles__pages a,
.am-articles__pages span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 12px;
  border: 1px solid var(--am-line); border-radius: var(--am-r-sm);
  background: var(--am-card); color: var(--am-teal-800);
  font: 600 14px/1 var(--am-font-b); text-decoration: none;
  transition: border-color .16s ease, color .16s ease;
}

.am-articles__pages a:hover { border-color: var(--am-teal-500); color: var(--am-teal-500); }

.am-articles__pages .active a,
.am-articles__pages .current,
.am-articles__pages a.current,
.am-articles__pages .is-active a {
  background: var(--am-teal-800); border-color: var(--am-teal-800); color: #fff;
}

@media (max-width: 860px) {
  .am-article { grid-template-columns: 220px 1fr; }
  .am-article__body { padding: 20px 22px; }
  .am-article__title { font-size: 19px; }
}

@media (max-width: 640px) {
  .am-article { grid-template-columns: 1fr; border-radius: var(--am-r-md); }
  .am-article__img { min-height: 190px; max-height: 220px; }
  .am-article__body { padding: 18px 18px 20px; }
  .am-article__more { width: 100%; justify-content: center; }
}

/* ── КОМПОНЕНТ: виджет контактов ──────────────────────────── */

.am-contacts {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--am-teal-800) 0%, var(--am-teal-900) 100%);
  border-radius: var(--am-r-lg);
  padding: 30px 30px 26px;
  color: #fff;
}

/* мягкое пятно в углу */
.am-contacts::before {
  content: ""; position: absolute; top: -70px; right: -70px;
  width: 210px; height: 210px; border-radius: 50%;
  background: rgba(255, 255, 255, .05); pointer-events: none;
}

.am-contacts > * { position: relative; }

.am-contacts__title {
  margin: 0 0 22px;
  font-family: var(--am-font-d);
  font-size: 20px; font-weight: 800; line-height: 1.2;
  letter-spacing: -.01em; color: #fff;
}

/* Телефон */

.am-contacts__phone {
  display: flex; align-items: center; gap: 12px;
  color: #fff; text-decoration: none;
  padding-bottom: 22px; margin-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.am-contacts__phone-ic {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12);
  transition: background .16s ease;
}
.am-contacts__phone-ic svg { width: 19px; height: 19px; color: #fff; }
.am-contacts__phone:hover .am-contacts__phone-ic { background: var(--am-flame); }

.am-contacts__phone-value {
  font-family: var(--am-font-d);
  font-size: 22px; font-weight: 800; letter-spacing: -.01em;
  line-height: 1.15; white-space: nowrap;
}

/* Строки с иконкой */

.am-contacts__row { display: flex; gap: 12px; }
.am-contacts__row + .am-contacts__row { margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14); }

.am-contacts__ic {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .9);
}
.am-contacts__ic svg { width: 19px; height: 19px; }

.am-contacts__body { flex: 1; min-width: 0; }

.am-contacts__metro {
  margin: 0 0 4px; font-size: 14px; font-weight: 600;
  color: #fff; display: flex; align-items: center; gap: 8px;
}

.am-contacts__metro::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--am-flame); flex: none;
}

.am-contacts__address { margin: 0 0 10px; font-size: 15px; color: rgba(255, 255, 255, .78); line-height: 1.45; }

.am-contacts__map {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 14px/1 var(--am-font-b);
  color: var(--am-teal-100); text-decoration: none;
  border-bottom: 1px solid rgba(220, 234, 232, .35); padding-bottom: 3px;
  transition: color .16s ease, border-color .16s ease;
}
.am-contacts__map svg { width: 14px; height: 14px; transition: transform .16s ease; }
.am-contacts__map:hover { color: #fff; border-color: #fff; }
.am-contacts__map:hover svg { transform: translateX(3px); }

/* Часы работы */

.am-contacts__schedule { list-style: none; margin: 0; padding: 0; }

.am-contacts__day {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 15px; padding: 5px 0;
}

.am-contacts__day-name { color: rgba(255, 255, 255, .78); white-space: nowrap; }

.am-contacts__day-dots {
  flex: 1; min-width: 12px; height: 1px; align-self: flex-end; margin-bottom: 5px;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .3) 1px, transparent 1px);
  background-size: 6px 2px; background-repeat: repeat-x;
}

.am-contacts__day-time { font-weight: 600; color: #fff; white-space: nowrap; }

.am-contacts a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

@media (max-width: 720px) {
  .am-contacts { padding: 24px 20px 22px; border-radius: var(--am-r-md); }
  .am-contacts__phone-value { font-size: 20px; }
}

/* ── КОМПОНЕНТ: форма в сайдбаре ──────────────────────────── */
/* Внутренние классы (field, field__input, form__res и все js-*)
   не переименованы — за них цепляется app.js. Стилизуем их
   вложенными селекторами внутри .am-sform, чтобы не задеть
   формы в старом оформлении на других страницах. */

.am-sform {
  position: relative; overflow: hidden;
  background: var(--am-card);
  border: 1px solid var(--am-line);
  border-radius: var(--am-r-lg);
  padding: 28px 28px 24px;
}

.am-sform::before {
  content: ""; position: absolute; top: -80px; right: -80px;
  width: 200px; height: 200px; border-radius: 50%;
  background: var(--am-flame-050); pointer-events: none;
}

.am-sform > * { position: relative; }

.am-sform__title {
  margin: 0 0 20px;
  font-family: var(--am-font-d);
  font-size: 20px; font-weight: 800; line-height: 1.25;
  letter-spacing: -.01em; color: var(--am-teal-900);
}

.am-sform__req { color: var(--am-flame); margin-left: 2px; }

.am-sform .form__wrap { display: flex; flex-direction: column; gap: 14px; }

.am-sform .field { display: flex; flex-direction: column; gap: 6px; }

.am-sform .field__label {
  font-size: 13px; font-weight: 600; color: var(--am-ink-soft);
}

.am-sform .field__input {
  width: 100%; font: 400 15px/1.4 var(--am-font-b); color: var(--am-ink);
  background: var(--am-card);
  border: 1.5px solid var(--am-line); border-radius: 14px;
  padding: 13px 15px;
  transition: border-color .16s ease, box-shadow .16s ease;
  -webkit-appearance: none; appearance: none;
}

.am-sform .field__input::placeholder { color: var(--am-ink-soft); opacity: .6; }
.am-sform .field__input:hover { border-color: var(--am-teal-100); }

.am-sform .field__input:focus {
  outline: none; border-color: var(--am-teal-500);
  box-shadow: 0 0 0 4px rgba(46, 123, 129, .12);
}

/* Состояния ошибки от app.js — покрываем ходовые варианты классов */
.am-sform .field.error .field__input,
.am-sform .field.is-error .field__input,
.am-sform .field_error .field__input,
.am-sform .field__input.error,
.am-sform .field__input:invalid:not(:placeholder-shown) { border-color: #C0392B; }

.am-sform .field__error,
.am-sform .field__message,
.am-sform .field__note { font-size: 13px; color: #C0392B; }

.am-sform .form__btns { margin-top: 18px; }

.am-sform__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%;
  font: 700 15px/1 var(--am-font-b); color: #fff; font-family: var(--am-font-b);
  background: var(--am-flame); border: 0; border-radius: 14px;
  padding: 16px 24px; cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.am-sform__btn svg { width: 15px; height: 15px; transition: transform .16s ease; }
.am-sform__btn:hover { background: var(--am-flame-dark); }
.am-sform__btn:hover svg { transform: translateX(3px); }
.am-sform__btn:active { transform: translateY(1px); }
.am-sform__btn[disabled] { opacity: .7; cursor: default; }

/* Блок ответа. Показ/скрытие остаётся за app.js — здесь только оформление. */

.am-sform .form__res {
  align-items: center; gap: 10px;
  margin-top: 16px; padding: 14px 16px;
  background: var(--am-teal-050); border-radius: var(--am-r-sm);
  font-size: 14px; color: var(--am-teal-800);
}

.am-sform .form__text { flex: 1; }
.am-sform .form__state { display: inline-flex; align-items: center; gap: 6px; }
.am-sform .form__state .icon { width: 22px; height: 22px; }
.am-sform .icon-success { color: #2E7D32; }
.am-sform .icon-error { color: #C0392B; }

.am-sform__policy {
  margin: 16px 0 0; font-size: 12px; line-height: 1.5; color: var(--am-ink-soft);
}
.am-sform__policy a { color: var(--am-teal-500); }
.am-sform__policy a:hover { color: var(--am-flame); }

@media (max-width: 720px) {
  .am-sform { padding: 22px 18px 20px; border-radius: var(--am-r-md); }
}

/* Перекрытие старых правил app.css внутри .am-sform.
   В старой теме .field__label спозиционирован абсолютно (плавающая подпись),
   и селекторы вида .form .field .field__label специфичнее простых.
   Поэтому здесь селекторы намеренно длиннее — подпись возвращается
   в обычный поток над полем. Правила действуют только внутри .am-sform. */

.am-sform .form__field.field,
.am-sform .form .form__field.field {
  position: static;
  display: flex; flex-direction: column; gap: 6px;
  margin: 0; padding: 0; min-height: 0; border: 0; background: none;
}

.am-sform .form__field.field .field__label,
.am-sform .form .form__field.field .field__label {
  position: static;
  top: auto; right: auto; bottom: auto; left: auto;
  transform: none;
  margin: 0; padding: 0;
  width: auto; height: auto; min-height: 0;
  font-size: 13px; font-weight: 600; line-height: 1.3;
  letter-spacing: normal; text-transform: none; white-space: normal;
  color: var(--am-ink-soft); background: none; pointer-events: auto;
  opacity: 1; visibility: visible;
}

.am-sform .form__field.field .field__wrap,
.am-sform .form .form__field.field .field__wrap {
  position: static;
  margin: 0; padding: 0; min-height: 0; border: 0; background: none;
}

.am-sform .form__field.field .field__wrap .field__input,
.am-sform .form .form__field.field .field__wrap .field__input {
  height: auto; min-height: 0; line-height: 1.4;
  margin: 0; padding: 13px 15px;
  font-size: 15px; font-family: var(--am-font-b); color: var(--am-ink);
  background: var(--am-card); box-shadow: none;
  border: 1.5px solid var(--am-line); border-radius: 14px;
}

.am-sform .form__field.field .field__wrap .field__input:focus {
  border-color: var(--am-teal-500);
  box-shadow: 0 0 0 4px rgba(46, 123, 129, .12);
}

.am-sform .form .form__wrap { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; }
.am-sform .form .form__container { margin: 0; padding: 0; }
.am-sform .form .form__btns { margin: 18px 0 0; padding: 0; }

/* ── КОМПОНЕНТ: врачи (слайдер) ───────────────────────────── */
/* Owl Carousel не используется: прокрутка нативная, на scroll-snap.
   Без JS блок остаётся листаемым пальцем и колесом. */

.am-doctors { --am-doc-visible: 4; --am-doc-gap: 20px; padding: 8px 0; }
.am-doctors__inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.am-doctors__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 26px;
}

.am-doctors__headings { max-width: 720px; }

.am-doctors__title {
  margin: 0; font-family: var(--am-font-d);
  font-size: clamp(24px, 3vw, 34px); font-weight: 800;
  line-height: 1.18; letter-spacing: -.01em; color: var(--am-teal-900);
}

.am-doctors__desc { margin: 12px 0 0; color: var(--am-ink-soft); font-size: 16px; }

.am-doctors__nav { display: flex; gap: 8px; flex: none; }

.am-doctors__arrow {
  width: 46px; height: 46px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--am-card); border: 1.5px solid var(--am-line);
  color: var(--am-teal-800); cursor: pointer;
  transition: border-color .16s ease, color .16s ease, opacity .16s ease;
}
.am-doctors__arrow svg { width: 19px; height: 19px; }
.am-doctors__arrow:hover { border-color: var(--am-teal-500); color: var(--am-teal-500); }
.am-doctors__arrow[disabled] { opacity: .35; cursor: default; border-color: var(--am-line); color: var(--am-ink-soft); }

/* Лента */

.am-doctors__track {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--am-doc-visible) - 1) * var(--am-doc-gap)) / var(--am-doc-visible));
  gap: var(--am-doc-gap);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding-bottom: 4px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.am-doctors__track::-webkit-scrollbar { display: none; }

.am-doc {
  scroll-snap-align: start;
  display: flex; flex-direction: column;
  background: var(--am-card);
  border: 1px solid var(--am-line);
  border-radius: var(--am-r-lg);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.am-doc:hover { border-color: var(--am-teal-100); box-shadow: var(--am-shadow-md); transform: translateY(-2px); }

.am-doc__ava {
  display: block; position: relative;
  aspect-ratio: 4 / 5; background: var(--am-teal-050); overflow: hidden;
}

.am-doc__photo {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  transition: transform .35s ease;
}
.am-doc:hover .am-doc__photo { transform: scale(1.03); }

.am-doc__ava--empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--am-teal-500);
}
.am-doc__ava--empty svg { width: 56px; height: 56px; opacity: .5; }

.am-doc__info { padding: 18px 20px 0; flex: 1; }

.am-doc__name {
  margin: 0 0 6px; font-family: var(--am-font-d);
  font-size: 17px; font-weight: 800; line-height: 1.3; letter-spacing: -.01em;
}
.am-doc__name a { color: var(--am-teal-900); text-decoration: none; transition: color .16s ease; }
.am-doc:hover .am-doc__name a { color: var(--am-teal-500); }

.am-doc__post { margin: 0; font-size: 14px; line-height: 1.45; color: var(--am-ink-soft); }

.am-doc__btns { display: flex; gap: 8px; padding: 16px 20px 20px; }

.am-doc__btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 12px; border-radius: var(--am-r-sm);
  font: 700 14px/1 var(--am-font-b); text-decoration: none; white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.am-doc__btn--main { background: var(--am-flame); color: #fff; }
.am-doc__btn--main:hover { background: var(--am-flame-dark); }

.am-doc__btn--ghost { background: var(--am-card); border: 1.5px solid var(--am-line); color: var(--am-teal-800); }
.am-doc__btn--ghost:hover { border-color: var(--am-teal-500); color: var(--am-teal-500); }

/* Низ секции */

.am-doctors__foot { display: flex; justify-content: center; margin-top: 28px; }

.am-doctors__all {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 16px 30px; border-radius: 14px;
  background: var(--am-teal-800); color: #fff;
  font: 700 15px/1 var(--am-font-b); text-decoration: none;
  transition: background .16s ease;
}
.am-doctors__all svg { width: 16px; height: 16px; transition: transform .16s ease; }
.am-doctors__all:hover { background: var(--am-teal-900); }
.am-doctors__all:hover svg { transform: translateX(3px); }

@media (max-width: 1100px) { .am-doctors { --am-doc-visible: 3; } }

@media (max-width: 860px) {
  .am-doctors { --am-doc-visible: var(--am-doc-mobile, 2); --am-doc-gap: 14px; }
  .am-doctors__inner { padding: 0 16px; }
  .am-doctors__head { align-items: flex-start; }
  .am-doctors__nav { display: none; }
  .am-doc__info { padding: 14px 14px 0; }
  .am-doc__name { font-size: 15px; }
  .am-doc__post { font-size: 13px; }
  .am-doc__btns { flex-direction: column; padding: 12px 14px 16px; }
}

@media (max-width: 480px) {
  .am-doctors__all { width: 100%; justify-content: center; }
}

/* Вариант с центрированной шапкой — блок врачей на главной */

.am-doctors--center .am-doctors__head {
  flex-direction: column; align-items: center; text-align: center;
}

.am-doctors--center .am-doctors__headings { max-width: 760px; margin: 0 auto; }
.am-doctors--center .am-doctors__desc { margin-left: auto; margin-right: auto; }
.am-doctors--center .am-doctors__desc p { margin: 0 0 8px; }
.am-doctors--center .am-doctors__desc p:last-child { margin-bottom: 0; }
.am-doctors--center .am-doctors__nav { margin-top: 4px; }

@media (max-width: 860px) {
  .am-doctors--center .am-doctors__head { align-items: center; }
}

/* Вариант без шапки — только лента и стрелки */

.am-doctors--bare .am-doctors__head { justify-content: flex-end; margin-bottom: 14px; }
.am-doctors--bare .am-doctors__nav[hidden] { display: none; }
.am-doctors--bare .am-doctors__nav[hidden] + * { margin-top: 0; }

/* если стрелки скрыты, пустая шапка не должна давать отступ */
.am-doctors--bare .am-doctors__head:not(:has(.am-doctors__nav:not([hidden]))) { margin-bottom: 0; }

/* Вариант сеткой — все врачи на странице, с переносом строк.
   Лента и scroll-snap отключены, стрелки не нужны. */

.am-doctors--grid .am-doctors__track {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(var(--am-doc-visible), minmax(0, 1fr));
  grid-auto-columns: auto;
  gap: var(--am-doc-gap);
  overflow: visible;
  scroll-snap-type: none;
  padding-bottom: 0;
}

.am-doctors--grid .am-doctors__nav { display: none; }
.am-doctors--grid .am-doctors__head:empty { margin-bottom: 0; }

@media (max-width: 480px) {
  .am-doctors--grid { --am-doc-visible: 1; }
  .am-doctors--grid .am-doc__btns { flex-direction: row; }
}

/* ── КОМПОНЕНТ: страница врача, шапка ─────────────────────── */
/* Блок вставляется внутрь контейнера .center сайта и ширину берёт
   у него — за сетку не выходит. Отрицательных отступов нет. */

.am-dhero {
  --am-dhero-photo: 260px;
  padding-top: 32px;   /* отступ от шапки сайта */
}

.am-dhero__card {
  position: relative; overflow: hidden;
  max-width: 100%;
  background: var(--am-card);
  border: 1px solid var(--am-line);
  border-radius: var(--am-r-lg);
  box-shadow: var(--am-shadow-sm);
  padding: 28px 32px 32px;
  color: var(--am-ink);
}

/* мягкие акценты вместо фоновой картинки */
.am-dhero__card::before,
.am-dhero__card::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.am-dhero__card::before { top: -110px; right: -70px; width: 300px; height: 300px; background: var(--am-flame-050); }
.am-dhero__card::after  { bottom: -130px; right: 150px; width: 220px; height: 220px; background: var(--am-teal-050); }

.am-dhero__card > * { position: relative; }

/* Хлебные крошки */

.am-dhero__crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 22px; }

.am-dhero__crumb {
  font-size: 13px; color: var(--am-ink-soft);
  text-decoration: none; transition: color .16s ease;
}
.am-dhero__crumb:hover { color: var(--am-flame); }
.am-dhero__crumb + .am-dhero__crumb::before { content: "/"; margin-right: 6px; color: var(--am-line); }
.am-dhero__crumb:last-child { color: var(--am-teal-800); }

/* Сетка: фото + текст */

.am-dhero__grid { display: grid; grid-template-columns: var(--am-dhero-photo) 1fr; gap: 30px; align-items: start; }

.am-dhero__media {
  border-radius: var(--am-r-md); overflow: hidden;
  background: var(--am-teal-050);
  aspect-ratio: 4 / 5; max-width: 100%;
}

.am-dhero__pic { display: block; width: 100%; height: 100%; max-width: 100%; object-fit: cover; object-position: top center; }

.am-dhero__main { min-width: 0; }

.am-dhero__name {
  margin: 0 0 10px;
  font-family: var(--am-font-d);
  font-size: clamp(24px, 3.2vw, 36px); font-weight: 800;
  line-height: 1.15; letter-spacing: -.015em; color: var(--am-teal-900);
}

.am-dhero__post {
  margin: 0 0 16px; font-size: 16px; font-weight: 600; line-height: 1.45;
  color: var(--am-flame);
}

.am-dhero__lead {
  margin: 0 0 20px; font-size: 15px; line-height: 1.65;
  color: var(--am-ink-soft); max-width: 700px;
}

/* Факты */

.am-dhero__facts { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 9px; }
.am-dhero__facts:empty { display: none; }

.am-dhero__fact {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 15px; border-radius: 999px;
  background: var(--am-teal-050); color: var(--am-teal-800);
  font-size: 14px; line-height: 1.3;
}

.am-dhero__fact-ic { flex: none; display: inline-flex; color: var(--am-flame); }
.am-dhero__fact-ic svg { width: 17px; height: 17px; }

/* Кнопка */

.am-dhero__cta {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 16px 28px; border-radius: 14px;
  background: var(--am-flame); color: #fff;
  font: 700 15px/1 var(--am-font-b); text-decoration: none;
  transition: background .16s ease;
}
.am-dhero__cta svg { width: 15px; height: 15px; transition: transform .16s ease; }
.am-dhero__cta:hover { background: var(--am-flame-dark); }
.am-dhero__cta:hover svg { transform: translateX(3px); }

.am-dhero a:focus-visible { outline: 2px solid var(--am-teal-500); outline-offset: 3px; }

@media (max-width: 860px) {
  .am-dhero { --am-dhero-photo: 200px; }
  .am-dhero__card { padding: 24px 22px 26px; }
  .am-dhero__grid { gap: 22px; }
}

@media (max-width: 620px) {
  .am-dhero { padding-top: 18px; }
  .am-dhero__card { padding: 20px 18px 24px; border-radius: var(--am-r-md); }
  .am-dhero__grid { grid-template-columns: 1fr; gap: 18px; }
  .am-dhero__media { max-width: 200px; }
  .am-dhero__facts { flex-direction: column; align-items: flex-start; }
  .am-dhero__cta { width: 100%; justify-content: center; }
}

/* ── КОМПОНЕНТ: контакты в три колонки ────────────────────── */

.am-cg__row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; align-items: start; }

.am-cg__card {
  background: var(--am-card);
  border: 1px solid var(--am-line);
  border-radius: var(--am-r-lg);
  padding: 26px 26px 24px;
  height: 100%;
}

.am-cg__label {
  margin: 0 0 12px;
  font: 600 12px/1 var(--am-font-b);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--am-teal-500);
}

.am-cg__item { display: flex; gap: 12px; align-items: flex-start; }
.am-cg__item + .am-cg__label { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--am-line); }

.am-cg__ic {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--am-teal-050);
}

.am-cg__ic i { font-size: 17px; color: var(--am-teal-500); line-height: 1; }
.am-cg__ic-img { width: 19px; height: 19px; object-fit: contain; display: block; }

.am-cg__body { min-width: 0; padding-top: 2px; }

.am-cg__metro {
  margin: 0 0 3px; font-size: 14px; font-weight: 600; color: var(--am-teal-800);
  display: flex; align-items: center; gap: 7px;
}
.am-cg__metro::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--am-flame); flex: none; }

.am-cg__text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--am-ink-soft); }

/* Телефон и почта */

.am-cg__phone, .am-cg__mail {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--am-teal-900);
}

.am-cg__phone-value {
  font-family: var(--am-font-d);
  font-size: 20px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap;
}

.am-cg__mail-value { font-size: 15px; color: var(--am-teal-800); word-break: break-all; }

.am-cg__phone:hover .am-cg__ic,
.am-cg__mail:hover .am-cg__ic { background: var(--am-flame-050); }
.am-cg__mail:hover .am-cg__mail-value { color: var(--am-flame); }

/* Режим работы */

.am-cg__schedule { list-style: none; margin: 0; padding: 2px 0 0; flex: 1; min-width: 0; }

.am-cg__day { display: flex; align-items: baseline; gap: 8px; font-size: 15px; padding: 3px 0; }
.am-cg__day-name { color: var(--am-ink-soft); white-space: nowrap; }

.am-cg__day-dots {
  flex: 1; min-width: 10px; height: 1px; align-self: flex-end; margin-bottom: 5px;
  background-image: radial-gradient(circle, var(--am-line) 1px, transparent 1px);
  background-size: 6px 2px; background-repeat: repeat-x;
}

.am-cg__day-time { font-weight: 600; color: var(--am-teal-900); white-space: nowrap; }

/* Соцсети */

.am-cg__social { display: flex; flex-wrap: wrap; gap: 10px; }

.am-cg__soc {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 9px; border-radius: 999px;
  background: var(--am-teal-050); color: var(--am-teal-800);
  font: 600 14px/1 var(--am-font-b); text-decoration: none;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.am-cg__soc:hover { transform: translateY(-1px); background: var(--am-teal-100); }

.am-cg__soc-ic {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--am-card); overflow: hidden;
}

.am-cg__soc-ic img, .am-cg__soc-ic svg { width: 19px; height: 19px; object-fit: contain; display: block; }
.am-cg__soc-ic i { font-size: 18px; line-height: 1; }

/* Цвета кружков: правятся здесь, в одном месте */
.am-cg__soc--vk  .am-cg__soc-ic { background: #2787F5; color: #fff; }
.am-cg__soc--tw  .am-cg__soc-ic { background: #14171A; color: #fff; }
.am-cg__soc--tg  .am-cg__soc-ic { background: #29A9EB; color: #fff; }
.am-cg__soc--max .am-cg__soc-ic { background: #6C4EF2; color: #fff; }
.am-cg__soc--yt  .am-cg__soc-ic { background: #FF0033; color: #fff; }

.am-cg__soc--vk:hover  { background: #E3EEF9; color: #22568F; }
.am-cg__soc--tw:hover  { background: #ECEFF1; color: #14171A; }
.am-cg__soc--tg:hover  { background: #E1EFF4; color: #0E5C70; }
.am-cg__soc--max:hover { background: #EDEAFD; color: #4B33C7; }
.am-cg__soc--yt:hover  { background: #FDE8EC; color: #C2001F; }

@media (max-width: 1000px) {
  .am-cg__row { grid-template-columns: 1fr 1fr; }
  .am-cg__card--wide { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .am-cg__row { grid-template-columns: 1fr; gap: 14px; }
  .am-cg__card { padding: 20px 18px; border-radius: var(--am-r-md); }
  .am-cg__phone-value { font-size: 18px; }
  .am-cg__soc { flex: 1 1 100%; }
}

/* ── КОМПОНЕНТ: галерея (сертификаты, дипломы) ────────────── */
/* Одна лента на все ширины: сколько кадров видно, решает CSS.
   Прокрутка нативная, стрелки добавляет общий модуль слайдера. */

.section_galery { margin-bottom: 30px; }

.am-gal {
  --am-gal-visible: 3;
  --am-gal-gap: 16px;
  --am-gal-ratio: 16 / 9;   /* пропорция кадра: сертификаты чаще горизонтальные */
}

.am-gal__head { display: flex; justify-content: flex-end; margin-bottom: 12px; }

.am-gal__nav { display: flex; gap: 8px; }

.am-gal__arrow {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--am-card); border: 1.5px solid var(--am-line);
  color: var(--am-teal-800); cursor: pointer;
  transition: border-color .16s ease, color .16s ease, opacity .16s ease;
}
.am-gal__arrow svg { width: 18px; height: 18px; }
.am-gal__arrow:hover { border-color: var(--am-teal-500); color: var(--am-teal-500); }
.am-gal__arrow[disabled] { opacity: .35; cursor: default; border-color: var(--am-line); color: var(--am-ink-soft); }

.am-gal__track {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--am-gal-visible) - 1) * var(--am-gal-gap)) / var(--am-gal-visible));
  gap: var(--am-gal-gap);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding-bottom: 4px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.am-gal__track::-webkit-scrollbar { display: none; }

.am-gal__item {
  position: relative; scroll-snap-align: start;
  display: block; text-decoration: none;
  background: var(--am-card);
  border: 1px solid var(--am-line);
  border-radius: var(--am-r-md);
  padding: 14px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.am-gal__item:hover {
  border-color: var(--am-teal-100);
  box-shadow: var(--am-shadow-md);
  transform: translateY(-2px);
}

.am-gal__frame {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: var(--am-gal-ratio); overflow: hidden;
}

/* сертификаты вписываем целиком, без обрезки */
.am-gal__img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain; display: block;
  image-orientation: from-image;
}

.am-gal__zoom {
  position: absolute; right: 14px; bottom: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--am-flame); color: #fff;
  opacity: 0; transform: scale(.9);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.am-gal__zoom svg { width: 16px; height: 16px; }
.am-gal__item:hover .am-gal__zoom { opacity: 1; transform: scale(1); }

.am-gal a:focus-visible { outline: 2px solid var(--am-teal-500); outline-offset: 3px; }

@media (max-width: 900px) { .am-gal { --am-gal-visible: 3; } }

@media (max-width: 575px) {
  .am-gal { --am-gal-visible: 2; --am-gal-gap: 12px; }
  .am-gal__nav { display: none; }
  .am-gal__head { display: none; }
  .am-gal__item { padding: 10px; }
  .am-gal__zoom { display: none; }
}

/* ── КОМПОНЕНТ: фильтр по категориям ──────────────────────── */
/* Классы filter, js-filter-body, filter__overlay и filter__close
   не переименованы — за них цепляется app.js. Стили навешаны
   параллельными классами am-filter__*, чтобы не задеть старые фильтры. */

.am-filter { display: block; margin: 0 0 28px; }

.am-filter__body {
  display: flex; align-items: center; gap: 10px;
  max-width: 640px; margin: 0 auto;
  background: var(--am-card);
  border: 1px solid var(--am-line);
  border-radius: var(--am-r-md);
  padding: 10px;
}

.am-filter__select { position: relative; flex: 1; min-width: 0; }

.am-filter__control {
  width: 100%; font: 500 15px/1.3 var(--am-font-b); color: var(--am-ink);
  background: transparent; border: 0; border-radius: var(--am-r-sm);
  padding: 12px 40px 12px 14px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  transition: background .16s ease;
}

.am-filter__control:hover { background: var(--am-teal-050); }
.am-filter__control:focus { outline: none; background: var(--am-teal-050); }
.am-filter__control:invalid { color: var(--am-ink-soft); }

.am-filter__chevron {
  position: absolute; right: 14px; top: 50%; margin-top: -9px;
  width: 18px; height: 18px; color: var(--am-teal-500); pointer-events: none;
}

.am-filter__btns { display: flex; align-items: center; gap: 8px; flex: none; }

.am-filter__show {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border: 0; border-radius: var(--am-r-sm);
  background: var(--am-flame); color: #fff;
  font: 700 14px/1 var(--am-font-b); font-family: var(--am-font-b);
  cursor: pointer; white-space: nowrap;
  transition: background .16s ease;
}
.am-filter__show svg { width: 15px; height: 15px; transition: transform .16s ease; }
.am-filter__show:hover { background: var(--am-flame-dark); }
.am-filter__show:hover svg { transform: translateX(3px); }

.am-filter__close {
  display: none;
  width: 44px; height: 44px; flex: none;
  align-items: center; justify-content: center;
  background: var(--am-teal-050); border: 0; border-radius: var(--am-r-sm);
  color: var(--am-teal-800); cursor: pointer;
}
.am-filter__close svg { width: 18px; height: 18px; }
.am-filter__close:hover { background: var(--am-teal-100); }

.am-filter button:focus-visible,
.am-filter select:focus-visible { outline: 2px solid var(--am-teal-500); outline-offset: 2px; }

@media (max-width: 640px) {
  .am-filter__body { flex-wrap: wrap; padding: 12px; gap: 10px; }
  .am-filter__select { flex: 1 1 100%; }
  .am-filter__control { background: var(--am-teal-050); }
  .am-filter__btns { flex: 1 1 100%; }
  .am-filter__show { flex: 1; justify-content: center; padding: 15px 20px; }
  .am-filter__close { display: inline-flex; }   /* кнопка закрытия — только на мобильном окне */
}

/* ── КОМПОНЕНТ: последние материалы (сайдбар) ─────────────── */

.am-recent {
  background: var(--am-card);
  border: 1px solid var(--am-line);
  border-radius: var(--am-r-lg);
  padding: 24px 24px 12px;
}

.am-recent__title {
  margin: 0 0 14px;
  font-family: var(--am-font-d);
  font-size: 20px; font-weight: 800; line-height: 1.25;
  letter-spacing: -.01em; color: var(--am-teal-900);
}

.am-recent__list { list-style: none; margin: 0; padding: 0; }

.am-recent__item + .am-recent__item { border-top: 1px solid var(--am-line); }

.am-recent__link {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; text-decoration: none;
}

.am-recent__pic {
  flex: none; width: 84px; height: 64px;
  border-radius: var(--am-r-sm); overflow: hidden;
  background: var(--am-teal-050);
}

.am-recent__img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; transition: transform .3s ease;
}
.am-recent__link:hover .am-recent__img { transform: scale(1.05); }

.am-recent__name {
  font-size: 15px; font-weight: 500; line-height: 1.4;
  color: var(--am-teal-900);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .16s ease;
}
.am-recent__link:hover .am-recent__name { color: var(--am-flame); }

.am-recent a:focus-visible { outline: 2px solid var(--am-teal-500); outline-offset: 3px; border-radius: 6px; }

@media (max-width: 720px) {
  .am-recent { padding: 20px 18px 8px; border-radius: var(--am-r-md); }
  .am-recent__pic { width: 72px; height: 56px; }
}