/* ==========================================================================
   SanepidemDez extras (2026-10-03): preparation checklist, scroll-to-top,
   site search, cookie notice, footer legal line, touch targets.
   Loaded after sd-design.css and reuses its tokens.
   ========================================================================== */

/* ---------- preparation checklist ---------- */
.sd-prep__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.sd-prep-card {
  position: relative;
  padding: 22px 20px 20px;
  border: 1px solid var(--sd-line);
  border-radius: var(--sd-radius);
  background: #fff;
  box-shadow: var(--sd-shadow-sm);
}
.sd-prep-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(6, 60, 112, .08);
  font-size: 24px;
  line-height: 1;
}
.sd-prep-card h3 {
  margin: 0 0 6px;
  color: var(--sd-ink);
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
}
.sd-prep-card p {
  margin: 0;
  color: var(--sd-text);
  font-size: 15px;
  line-height: 1.5;
}
.sd-prep-card--no { border-color: #f3c6c6; background: #fff8f8; }
.sd-prep-card--no .sd-prep-card__icon { background: rgba(200, 40, 40, .08); }
.sd-prep-card--after { border-color: rgba(8, 123, 115, .35); background: #f2faf9; }
.sd-prep-card--after .sd-prep-card__icon { background: rgba(8, 123, 115, .12); }
.sd-prep__note {
  max-width: 760px;
  margin: 24px auto 0;
  color: var(--sd-muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}
.sd-prep__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}
@media (max-width: 991px) {
  .sd-prep__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 479px) {
  .sd-prep__grid { grid-template-columns: 1fr; gap: 12px; }
  .sd-prep-card { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; padding: 16px; }
  .sd-prep-card__icon { grid-row: span 2; margin: 0; }
}

/* ---------- scroll to top ---------- */
.sd-scroll-top {
  position: fixed;
  right: 27px;
  bottom: 176px; /* above the call button and the AI chat launcher */
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sd-navy);
  color: #fff;
  box-shadow: 0 6px 20px rgba(6, 60, 112, .35);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s, visibility .25s, transform .25s, background .2s;
}
.sd-scroll-top:hover, .sd-scroll-top:focus-visible { background: var(--sd-navy-deep); }
.sd-scroll-top:focus-visible { outline: 3px solid var(--sd-gold); outline-offset: 2px; }
.sd-scroll-top.is-visible { opacity: 1; visibility: visible; transform: none; }
@media (max-width: 767px) {
  /* the right edge is taken by the call button and the AI chat */
  .sd-scroll-top { right: auto; left: 14px; bottom: 18px; width: 44px; height: 44px; }
}

/* ---------- search ---------- */
.sd-search-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid var(--sd-line);
  border-radius: 50%;
  background: #fff;
  color: var(--sd-navy);
  cursor: pointer;
  flex-shrink: 0;
}
.sd-search-trigger:hover, .sd-search-trigger:focus-visible { border-color: var(--sd-navy); }
.sd-search {
  position: fixed;
  inset: 0;
  z-index: 2147483000; /* above third-party chat widgets */
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 16px 16px;
  background: rgba(5, 43, 82, .55);
}
.sd-search.is-open { display: flex; }
.sd-search__box {
  box-sizing: border-box;
  width: min(640px, 100%);
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--sd-radius);
  background: #fff;
  box-shadow: var(--sd-shadow);
  overflow: hidden;
}
.sd-search__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 12px 18px;
  border-bottom: 1px solid var(--sd-line);
}
.sd-search__input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--sd-ink);
  font: 18px/1.3 var(--sd-font);
  background: transparent;
}
.sd-search__close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--sd-mist);
  color: var(--sd-ink);
  font-size: 20px;
  cursor: pointer;
}
.sd-search__results { margin: 0; padding: 8px; list-style: none; overflow-y: auto; }
.sd-search__results a {
  display: block;
  padding: 12px 14px;
  border-radius: var(--sd-radius-sm);
  color: var(--sd-ink);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.35;
}
.sd-search__results a:hover, .sd-search__results a:focus, .sd-search__results a.is-active { background: var(--sd-mist); outline: 0; }
.sd-search__results small { display: block; margin-top: 2px; color: var(--sd-muted); font-size: 13px; }
.sd-search__empty { padding: 18px 14px; color: var(--sd-muted); font-size: 15px; }
.sd-search__empty a { color: var(--sd-navy); font-weight: 700; }

/* ---------- cookie notice ---------- */
.sd-cookie {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 99990;
  box-sizing: border-box;
  max-width: 440px;
  padding: 16px 18px;
  border: 1px solid var(--sd-line);
  border-radius: var(--sd-radius);
  background: #fff;
  box-shadow: var(--sd-shadow);
  color: var(--sd-text);
  font-size: 14px;
  line-height: 1.45;
}
.sd-cookie p { margin: 0 0 12px; }
.sd-cookie a { color: var(--sd-navy); text-decoration: underline; }
.sd-cookie__ok {
  min-height: 44px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--sd-navy);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.sd-cookie__short { display: none; }
@media (max-width: 767px) {
  .sd-cookie { display: flex; align-items: center; gap: 10px; left: 10px; right: 92px; bottom: 10px; max-width: none; padding: 10px 12px; font-size: 13px; }
  .sd-cookie p { margin: 0; flex: 1; }
  .sd-cookie__long { display: none; }
  .sd-cookie__short { display: inline; }
  .sd-cookie__ok { min-height: 40px; padding: 8px 14px; font-size: 14px; flex-shrink: 0; }
}

/* ---------- footer legal line ---------- */
.sd-footer__legal {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: 13px;
  line-height: 1.6;
  opacity: .85;
}
.sd-footer__legal p { margin: 0 0 4px; }
.sd-footer__legal a { color: inherit; text-decoration: underline; }

/* LiveInternet counter link at the top of <body> left a 31px empty strip above the header.
   Keep it rendered (so the hit image still loads) but out of the layout. */
body > a[href*="liveinternet.ru/click"] {
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
}

/* reviews block: external platform scores were removed (unverifiable) — drop the empty slot and its divider */
.mr-ratings-platforms:empty { display: none; }
.mr-ratings-bar:has(.mr-ratings-platforms:empty) .mr-ratings-main { border-right: 0; padding-right: 0; }

/* consent link inside form checkboxes */
.sitedoctor-consent a { color: inherit; text-decoration: underline; }

/* ---------- touch targets (mobile) ---------- */
@media (max-width: 991px) {
  .sd-btn, .submit-btn, .w-button, .button, .callback-btn, .conversion-call-btn { min-height: 48px; }
  .sd-footer__links a, .sd-footer__bottom a { display: inline-block; padding: 8px 0; }
  .dropdown-link { min-height: 44px; display: flex; align-items: center; }
  .wrapper-radio { min-height: 52px; }
}

/* smooth same-origin page transitions where supported (no JS needed) */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .sd-scroll-top { transition: none; }
}

/* sd-menu-chat 2026-10-17 */
/* footer has two columns now */
@media (min-width: 768px) { .sd-footer__grid { grid-template-columns: 1fr auto; } }
#otzyvy { scroll-margin-top: 96px; }

/* AI chat: the right edge belongs to the call button, the chat sits on the left as a labelled button */
html body .aichat-launch {
  left: 24px !important; right: auto !important; bottom: 24px !important;
  width: auto !important; height: auto !important; min-height: 62px !important;
  padding: 8px 24px 8px 9px !important; gap: 12px !important; justify-content: flex-start !important;
  border-radius: 999px !important; background: #0b7a3b !important; color: #fff !important; text-align: left;
  box-shadow: 0 10px 28px rgba(11, 122, 59, .45) !important;
}
html body .aichat-launch:hover, html body .aichat-launch:focus-visible { background: #08602e !important; }
html body .aichat-launch:focus-visible { outline: 3px solid var(--sd-gold, #ffbc17); outline-offset: 3px; }
html body .aichat-launch::before {
  content: ""; position: absolute; inset: -2px; border: 3px solid rgba(11, 122, 59, .6); border-radius: inherit; pointer-events: none;
  animation: sd-chat-ring 2.6s ease-out infinite;
}
@keyframes sd-chat-ring { 0% { transform: scale(1); opacity: 1; } 70%, 100% { transform: scale(1.12, 1.35); opacity: 0; } }
html body .aichat-launch svg {
  width: 44px !important; height: 44px !important; padding: 10px; box-sizing: border-box; flex: none;
  border-radius: 50%; background: #fff; color: #0b7a3b !important;
}
html body .aichat-launch .aichat-launch__dot { top: 6px !important; left: 42px !important; right: auto !important; z-index: 1; }
html body .aichat-launch span:not(.aichat-launch__dot) {
  position: static !important; width: auto !important; height: auto !important; clip: auto !important; overflow: visible !important;
  padding: 0 !important; border-radius: 0 !important; background: none !important; color: #fff !important;
  font-size: 17px !important; font-weight: 700 !important; line-height: 1.15 !important; white-space: nowrap;
}
html body .aichat-launch span:not(.aichat-launch__dot)::after {
  content: "\041E \043D \043B \0430 \0439 \043D -\043A \043E \043D \0441 \0443 \043B \044C \0442 \0430 \0446 \0438 \044F , \0431 \0435 \0441 \043F \043B \0430 \0442 \043D \043E "; display: block; margin-top: 3px; font-size: 12.5px; font-weight: 500; opacity: .92;
}
html body .aichat-teaser {
  left: 24px !important; right: auto !important; bottom: 100px !important;
  border-radius: 14px 14px 14px 4px !important; border-left: 4px solid #0b7a3b;
}
html body .aichat { left: 24px !important; right: auto !important; bottom: 100px !important; }
/* while the cookie notice is on screen (bottom left) the chat button stands above it */
body:has(.sd-cookie) .aichat-launch { bottom: 204px !important; }
body:has(.sd-cookie) .aichat-teaser { bottom: 280px !important; }
@media (min-width: 768px) { .sd-scroll-top { bottom: 112px !important; } }
@media (max-width: 767px) {
  html body .aichat-launch { left: 12px !important; bottom: 14px !important; min-height: 58px !important; padding: 6px 18px 6px 7px !important; gap: 10px !important; }
  html body .aichat-launch svg { width: 42px !important; height: 42px !important; }
  html body .aichat-launch .aichat-launch__dot { left: 38px !important; top: 4px !important; }
  html body .aichat-launch span:not(.aichat-launch__dot) { font-size: 16px !important; }
  html body .aichat-launch span:not(.aichat-launch__dot)::after { font-size: 12px; }
  html body .aichat-teaser { left: 12px !important; bottom: 84px !important; max-width: calc(100vw - 100px) !important; }
  html body .aichat { left: 8px !important; right: 8px !important; bottom: 12px !important; height: min(560px, calc(100vh - 24px)) !important; }
  body:has(.sd-cookie) .aichat-launch { bottom: 100px !important; }
  body:has(.sd-cookie) .aichat-teaser { bottom: 170px !important; }
  /* the left corner is the chat now: scroll-to-top goes above the call button */
  .sd-scroll-top { left: auto !important; right: 22px !important; bottom: 88px !important; }
}
@media (prefers-reduced-motion: reduce) { html body .aichat-launch::before { animation: none; } }
/* mobile menu: "Все услуги" row */
@media (max-width: 991px) { .nav-menu .sitedoctor-direct-services { width: 100%; } .nav-menu .sitedoctor-direct-services .nav-link { flex: 1; } }

/* cookie: равнозначные кнопки 2026-10-20 */
.sd-cookie__btns{display:flex;gap:10px}
.sd-cookie__no{min-height:44px;padding:10px 22px;border:2px solid var(--sd-navy);border-radius:999px;background:#fff;color:var(--sd-navy);font-weight:700;font-size:15px;cursor:pointer}
.sd-cookie__ok{border:2px solid var(--sd-navy)!important}
.sd-cookie__ok,.sd-cookie__no{flex:1 1 0}
@media (max-width:767px){
  .sd-cookie{flex-wrap:wrap}
  .sd-cookie p{flex:1 1 100%}
  .sd-cookie__btns{flex:1 1 100%}
  .sd-cookie__ok,.sd-cookie__no{min-height:44px;padding:8px 10px;font-size:14px}
  body:has(.sd-cookie) .aichat-launch{bottom:190px!important}
  body:has(.sd-cookie) .aichat-teaser{bottom:260px!important}
}
.sd-cookie-reset{cursor:pointer}
