/* ============================================================
   MedSpravki Irkutsk – Enhancements layer
   Плавные анимации, улучшенная отзывчивость, мобильное удобство.
   Подключается ПОСЛЕ assets/css/style.css и переопределяет
   только то, что нужно. Стиль и палитра сохранены.
   ============================================================ */

/* ----- 1. Базовые токены и сглаживание ----- */
:root {
  --ms-primary: #1977cc;
  --ms-primary-dark: #166ab5;
  --ms-primary-light: #d6e9fa;
  --ms-text: #2c4964;
  --ms-muted: #4b7dab;
  --ms-bg-soft: #f1f7fd;
  --ms-radius: 14px;
  --ms-shadow-sm: 0 4px 14px rgba(25,119,204,.08);
  --ms-shadow-md: 0 10px 30px rgba(25,119,204,.12);
  --ms-shadow-lg: 0 20px 50px rgba(25,119,204,.18);
  --ms-trans: cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

img { max-width: 100%; height: auto; }

/* ----- 2. Доступность фокуса ----- */
a:focus-visible, button:focus-visible, .nav-link:focus-visible,
.btn-get-started:focus-visible, .appointment-btn:focus-visible {
  outline: 3px solid rgba(25,119,204,.45);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ----- 3. Hero: плавная адаптация под мобильные ----- */
#hero { position: relative; }
#hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,.92) 0%, rgba(241,247,253,.55) 60%, rgba(241,247,253,0) 100%);
  pointer-events: none;
}
#hero .container { z-index: 2; }
#hero h1 { animation: ms-fadeUp .8s var(--ms-trans) both; }
#hero h2 { animation: ms-fadeUp .8s .15s var(--ms-trans) both; }
#hero .btn-get-started {
  animation: ms-fadeUp .8s .3s var(--ms-trans) both;
  box-shadow: 0 10px 25px rgba(25,119,204,.35);
}
#hero .btn-get-started:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(25,119,204,.45); }

@media (max-width: 575px) {
  #hero h1 { font-size: 26px !important; line-height: 1.25 !important; }
  #hero h2 { font-size: 16px !important; line-height: 1.45 !important; }
  #hero .btn-get-started { padding: 12px 26px; font-size: 14px; }
}

/* ----- 4. Header / Top bar ----- */
#topbar { backdrop-filter: saturate(140%) blur(6px); }
#header { transition: all .35s var(--ms-trans); }
#header.header-scrolled { box-shadow: 0 6px 20px rgba(25,119,204,.12); }

@media (max-width: 575px) {
  #topbar { font-size: 12px; }
  #topbar .contact-info a { padding: 0 4px; }
  #header .logo { font-size: 18px !important; line-height: 1.2; }
  .appointment-btn { padding: 7px 14px !important; font-size: 12px !important; margin-left: 8px !important; }
}

/* ----- 5. Анимации появления при скролле (см. enhancements.js) ----- */
.ms-reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ms-trans), transform .8s var(--ms-trans); will-change: transform, opacity; }
.ms-reveal.is-visible { opacity: 1; transform: none; }
.ms-reveal.delay-1 { transition-delay: .12s; }
.ms-reveal.delay-2 { transition-delay: .24s; }
.ms-reveal.delay-3 { transition-delay: .36s; }
.ms-reveal.from-left  { transform: translateX(-30px); }
.ms-reveal.from-right { transform: translateX(30px); }
.ms-reveal.from-left.is-visible,
.ms-reveal.from-right.is-visible { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .ms-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ----- 6. Карточки преимуществ ----- */
.why-us .icon-boxes .icon-box {
  border-radius: var(--ms-radius);
  box-shadow: var(--ms-shadow-sm);
  transition: transform .35s var(--ms-trans), box-shadow .35s var(--ms-trans);
}
.why-us .icon-boxes .icon-box:hover { transform: translateY(-6px); box-shadow: var(--ms-shadow-md); }
.why-us .icon-boxes .icon-box i { transition: transform .4s var(--ms-trans); }
.why-us .icon-boxes .icon-box:hover i { transform: scale(1.15) rotate(-4deg); }

.why-us .content { box-shadow: var(--ms-shadow-md); border-radius: var(--ms-radius); z-index: 2;}

/* ----- 7. Секция услуг (табы) ----- */
.services .section-bg { border-radius: var(--ms-radius); box-shadow: var(--ms-shadow-sm); }
.services .nav-pills .nav-link {
  border-radius: 10px;   
  margin-bottom: 6px;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
  transition: all .25s var(--ms-trans);
}
.services .nav-pills .nav-link:hover { background: rgba(25,119,204,.08); color: var(--ms-primary); }
.services .nav-pills .nav-link.active { background: var(--ms-primary); color: #fff; box-shadow: 0 6px 16px rgba(25,119,204,.35); }
.services .tab-pane { animation: ms-fadeIn .45s var(--ms-trans); }
.services .list-group-item { border: 1px solid #e6eef7; transition: background .25s, transform .25s; border-radius: 8px !important; margin-bottom: 6px; }
.services .list-group-item:hover { background: #f6fbff; transform: translateX(4px); }

@media (max-width: 768px) {
  .services .col-lg-4 { margin-bottom: 18px; }
  .services .nav-pills .nav-link { padding: 12px 14px; font-size: 14px; }
}

/* ----- 8. Карточки внутри табов / страниц услуг ----- */
.card { border: 0; border-radius: var(--ms-radius); box-shadow: var(--ms-shadow-sm); transition: transform .3s var(--ms-trans), box-shadow .3s var(--ms-trans); }
.card:hover { transform: translateY(-3px); box-shadow: var(--ms-shadow-md); }
.alert { border: 0; border-radius: 12px; }

/* ----- 9. FAQ ----- */
.faq .faq-list li { box-shadow: var(--ms-shadow-sm); border-radius: 12px; transition: box-shadow .3s; }
.faq .faq-list li:hover { box-shadow: var(--ms-shadow-md); }
.faq .faq-list a { transition: color .25s; }

/* ----- 10. Контакты ----- */
.contact .info { border-radius: var(--ms-radius); padding: 24px; box-shadow: var(--ms-shadow-sm); }
.contact .info > div { margin-bottom: 14px; }
.contact .info i { transition: transform .3s var(--ms-trans), background .3s; }
.contact .info > div:hover i { transform: scale(1.1); }

@media (max-width: 768px) {
  .contact .info { padding: 16px; }
  .contact .info h4 { font-size: 18px; padding-left: 56px; }
  .contact .info p, .contact .info a { padding-left: 56px; font-size: 14px; }
}

/* ----- 11. Footer ----- */
#footer .footer-top { padding: 40px 0 25px; }
#footer a { transition: color .25s; }
@media (max-width: 768px) {
  #footer .text-md-end { text-align: left !important; margin-top: 18px; }
}

/* ----- 12. Кнопки ----- */
.btn, .appointment-btn, .btn-get-started { transition: all .3s var(--ms-trans); }
.btn-primary { background: var(--ms-primary); border-color: var(--ms-primary); }
.btn-primary:hover { background: var(--ms-primary-dark); border-color: var(--ms-primary-dark); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(25,119,204,.35); }
.appointment-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(25,119,204,.35); }

/* ----- 13. Back to top ----- */
.back-to-top { box-shadow: 0 10px 24px rgba(25,119,204,.35); transition: all .3s var(--ms-trans); }
.back-to-top:hover { transform: translateY(-3px) scale(1.05); }

/* ----- 14. Плавающая кнопка WhatsApp/Telegram (мобильно) ----- */
.ms-float-cta {
  position: fixed; right: 18px; bottom: 70px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25d366; color: #fff !important; font-size: 28px;
  box-shadow: 0 12px 28px rgba(37,211,102,.45);
  z-index: 995; transition: transform .3s var(--ms-trans);
  text-decoration: none;
}
.ms-float-cta.telegram { background: #2aabee; box-shadow: 0 12px 28px rgba(42,171,238,.45); bottom: 135px; }
.ms-float-cta:hover { transform: scale(1.08); color: #fff; }
.ms-float-cta i { line-height: 1; }
@media (max-width: 575px) {
  .ms-float-cta { width: 50px; height: 50px; font-size: 24px; right: 12px; bottom: 75px; }
  .ms-float-cta.telegram { bottom: 135px; }
}

/* ----- 15. Хлебные крошки ----- */
.ms-breadcrumbs { background: var(--ms-bg-soft); padding: 14px 0; margin-top: 130px; font-size: 14px; }
.ms-breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; }
.ms-breadcrumbs li + li::before { content: "›"; padding: 0 8px; color: #8aa6c2; }
.ms-breadcrumbs a { color: var(--ms-muted); }
.ms-breadcrumbs a:hover { color: var(--ms-primary); }
@media (max-width: 992px) { .ms-breadcrumbs { margin-top: 110px; } }

/* ----- 16. Заголовки страниц-услуг ----- */
.page-hero {
  background: linear-gradient(120deg, var(--ms-primary) 0%, #2aa1f0 100%);
  color: #fff; padding: 70px 0 50px; margin-top: 130px; position: relative; overflow: hidden;
}
.page-hero::after {
  content: ""; position: absolute; right: -80px; bottom: -80px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.15) 0%, transparent 70%);
}
.page-hero h1 { color: #fff; font-weight: 700; margin: 0 0 12px; }
.page-hero p { color: rgba(255,255,255,.9); margin: 0; font-size: 18px; }
@media (max-width: 768px) { .page-hero { padding: 50px 0 35px; margin-top: 110px; } .page-hero h1 { font-size: 26px; } .page-hero p { font-size: 15px; } }

/* ----- 17. Сетка услуг (карточки в WP-теме / архивах) ----- */
.ms-cards { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ms-card {
  background: #fff; border-radius: var(--ms-radius); padding: 26px;
  box-shadow: var(--ms-shadow-sm); transition: transform .35s var(--ms-trans), box-shadow .35s var(--ms-trans);
  display: flex; flex-direction: column;
}
.ms-card:hover { transform: translateY(-6px); box-shadow: var(--ms-shadow-md); }
.ms-card .ms-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--ms-primary-light); color: var(--ms-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 16px; transition: all .3s; }
.ms-card:hover .ms-icon { background: var(--ms-primary); color: #fff; }
.ms-card h3 { font-size: 18px; color: var(--ms-text); margin: 0 0 10px; }
.ms-card p { color: #677a91; font-size: 14px; line-height: 1.55; margin: 0 0 14px; }
.ms-card .ms-card-link { margin-top: auto; color: var(--ms-primary); font-weight: 600; font-size: 14px; }

/* ----- 18. Article (single post) ----- */
.ms-article { background: #fff; border-radius: var(--ms-radius); box-shadow: var(--ms-shadow-sm); padding: 36px; }
.ms-article h2 { color: var(--ms-text); margin-top: 32px; }
.ms-article h3 { color: var(--ms-text); margin-top: 24px; }
.ms-article ul, .ms-article ol { padding-left: 22px; }
.ms-article li { margin-bottom: 8px; }
.ms-article blockquote { border-left: 4px solid var(--ms-primary); background: var(--ms-bg-soft); padding: 16px 20px; margin: 18px 0; border-radius: 0 10px 10px 0; }
.ms-article a { color: var(--ms-primary); text-decoration: underline; }
.ms-article a:hover { color: var(--ms-primary-dark); }
.ms-article .ms-toc { background: var(--ms-bg-soft); padding: 18px 22px; border-radius: 10px; margin-bottom: 24px; }
.ms-article .ms-toc h4 { margin: 0 0 10px; font-size: 16px; }
.ms-article .ms-toc ol { margin: 0; }
@media (max-width: 768px) { .ms-article { padding: 22px; } }

/* ----- 19. Список постов (archive) ----- */
.ms-post-list { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.ms-post-card { background: #fff; border-radius: var(--ms-radius); overflow: hidden; box-shadow: var(--ms-shadow-sm); transition: all .35s var(--ms-trans); display: flex; flex-direction: column; }
.ms-post-card:hover { transform: translateY(-5px); box-shadow: var(--ms-shadow-md); }
.ms-post-card .ms-thumb { aspect-ratio: 16/9; background: var(--ms-bg-soft) center/cover; }
.ms-post-card .ms-body { padding: 18px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.ms-post-card h3 { font-size: 18px; margin: 0 0 10px; }
.ms-post-card h3 a { color: var(--ms-text); }
.ms-post-card h3 a:hover { color: var(--ms-primary); }
.ms-post-card .ms-excerpt { color: #677a91; font-size: 14px; line-height: 1.55; flex: 1; }
.ms-post-card .ms-meta { color: #98a8bc; font-size: 12px; margin-bottom: 6px; }

/* ----- 20. Пагинация ----- */
.ms-pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 28px; }
.ms-pagination a, .ms-pagination span { padding: 8px 14px; border-radius: 8px; background: #fff; color: var(--ms-text); box-shadow: var(--ms-shadow-sm); transition: all .25s; text-decoration: none; }
.ms-pagination a:hover, .ms-pagination .current { background: var(--ms-primary); color: #fff; }

/* ----- 21. Форма заявки (CF7 / native) ----- */
.ms-form { background: #fff; border-radius: var(--ms-radius); padding: 28px; box-shadow: var(--ms-shadow-sm); }
.ms-form .form-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 575px) { .ms-form .form-row { grid-template-columns: 1fr; } }
.ms-form input, .ms-form select, .ms-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid #d8e3ef; border-radius: 10px;
  font-size: 14px; transition: border-color .25s, box-shadow .25s; background: #fbfdff;
}
.ms-form input:focus, .ms-form select:focus, .ms-form textarea:focus {
  outline: none; border-color: var(--ms-primary); box-shadow: 0 0 0 4px rgba(25,119,204,.12); background: #fff;
}
.ms-form button[type="submit"] {
  background: var(--ms-primary); color: #fff; border: 0; border-radius: 50px;
  padding: 12px 30px; font-weight: 600; cursor: pointer; transition: all .3s;
}
.ms-form button[type="submit"]:hover { background: var(--ms-primary-dark); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(25,119,204,.35); }

/* ----- 22. Таблицы цен ----- */
.ms-price-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.ms-price-table th, .ms-price-table td { padding: 14px 16px; text-align: left; }
.ms-price-table thead th { background: var(--ms-primary); color: #fff; font-weight: 600; }
.ms-price-table thead th:first-child { border-radius: 10px 0 0 10px; }
.ms-price-table thead th:last-child { border-radius: 0 10px 10px 0; text-align: right; }
.ms-price-table tbody tr { background: #fff; transition: background .25s; }
.ms-price-table tbody tr:hover { background: #f6fbff; }
.ms-price-table tbody td { box-shadow: 0 1px 0 #ebf3fb inset; }
.ms-price-table tbody td:last-child { text-align: right; font-weight: 700; color: var(--ms-primary); }

/* ----- 23. Мелочи: списки ссылок в табах кликабельны крупнее ----- */
.list-group-item a { display: inline-block; min-height: 32px; }

/* ----- 24. Скелетон/preloader fade-out ----- */
#preloader.is-hiding { opacity: 0; transition: opacity .4s; pointer-events: none; }
