/*!
 * Віджет Асі для сайтів МЦ «Асклепій».
 * Усі класи з префіксом asya-. Картинки лежать поруч із цим файлом.
 */

.asya-root,
.asya-modal,
.asya-block,
.asya-inline {
  --asya-blue: #2b5c8e;
  --asya-cloud: #e4eef3;
}

.asya-root *,
.asya-root *::before,
.asya-root *::after,
.asya-modal *,
.asya-modal *::before,
.asya-modal *::after,
.asya-block,
.asya-block *,
.asya-block *::before,
.asya-block *::after,
.asya-inline,
.asya-inline * {
  box-sizing: border-box;
}

/* ---------- Плаваюча кнопка ---------- */

.asya-root {
  --asya-size: 68px;
  --asya-base: 88px;  /* вище за кнопку «вгору» теми (45 px на 20 px від низу) */
  position: fixed;
  right: 20px;
  bottom: calc(max(var(--asya-base), var(--asya-lift, 0px)) + env(safe-area-inset-bottom, 0px));
  z-index: 9990;      /* під затемненням вікон теми (9999), над шапкою (100) */
  width: var(--asya-size);
  height: var(--asya-size);
  font-family: inherit;
  line-height: 1.35;
  transition: opacity .25s ease, transform .25s ease, bottom .25s ease;
}

.asya-root.asya-root--left {
  right: auto;
  left: 20px;
}

.asya-root.asya-root--away {
  visibility: hidden;
  opacity: 0;
  transform: translateY(16px) scale(.8);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s, bottom .25s ease;
}

.asya-root .asya-fab {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e3eaf0;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .65), 0 6px 18px rgba(16, 42, 72, .3);
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s ease;
}

.asya-root .asya-fab:hover {
  transform: scale(1.06);
}

.asya-root .asya-fab:focus {
  outline: none;
}

.asya-root .asya-fab:focus-visible {
  outline: 3px solid var(--asya-blue);
  outline-offset: 7px;
}

/* Коло портрета збігається з колом кнопки, бульбашка виступає праворуч */
.asya-root .asya-fab__face {
  position: absolute;
  left: -.7%;
  top: -.7%;
  width: 110.9%;
  height: 101.7%;
  background: url(asya.png) 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}

/* «24/7» лягає на бульбашку з трьома крапками */
.asya-root .asya-fab__badge {
  position: absolute;
  left: 94.1%;
  top: 54.6%;
  padding: 2px 5px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 42, 72, .2);
  color: var(--asya-blue);
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* ---------- Хмарина ---------- */

.asya-root .asya-cloud {
  position: absolute;
  right: -6px;
  bottom: calc(100% + 18px);
  width: 290px;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 16px 18px;
  border: 2px solid var(--asya-blue);
  border-radius: 22px;
  background: var(--asya-cloud);
  box-shadow: 0 12px 32px rgba(16, 42, 72, .18);
  color: var(--asya-blue);
  text-align: center;
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px) scale(.96);
  transform-origin: calc(100% - 40px) 100%;
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.asya-root.asya-root--open .asya-cloud {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity .18s ease, transform .18s ease;
}

.asya-root.asya-root--left .asya-cloud {
  right: auto;
  left: -6px;
  transform-origin: 40px 100%;
}

.asya-root .asya-cloud__text {
  margin: 0;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.38;
}

/* Хвостик хмарини вказує на кнопку */
.asya-root .asya-cloud__tail {
  position: absolute;
  right: 22px;
  bottom: -26px;
  width: 40px;
  height: 26px;
  overflow: visible;
}

.asya-root .asya-cloud__tail path {
  fill: var(--asya-cloud);
  stroke: var(--asya-blue);
  stroke-width: 2px;
  stroke-linejoin: round;
}

.asya-root.asya-root--left .asya-cloud__tail {
  right: auto;
  left: 22px;
  transform: scaleX(-1);
}

/* ---------- Круглі кнопки Telegram і Viber ---------- */

.asya-root .asya-links,
.asya-modal .asya-links,
.asya-inline .asya-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 12px 0 0;
  padding: 0;
}

.asya-root .asya-link,
.asya-modal .asya-link,
.asya-inline .asya-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--asya-blue);
  border-radius: 50%;
  background: #fff;
  color: var(--asya-blue);
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.asya-root .asya-link svg,
.asya-modal .asya-link svg,
.asya-inline .asya-link svg {
  display: block;
  width: 100%;
  height: 100%;
}

.asya-root .asya-link:hover,
.asya-modal .asya-link:hover,
.asya-inline .asya-link:hover,
.asya-root .asya-link:focus-visible,
.asya-modal .asya-link:focus-visible,
.asya-inline .asya-link:focus-visible {
  background: var(--asya-blue);
  color: #fff;
  transform: translateY(-1px);
}

.asya-root .asya-link:focus,
.asya-modal .asya-link:focus,
.asya-inline .asya-link:focus {
  outline: none;
}

.asya-root .asya-link:focus-visible,
.asya-modal .asya-link:focus-visible,
.asya-inline .asya-link:focus-visible {
  outline: 3px solid rgba(43, 92, 142, .35);
  outline-offset: 2px;
}

/* ---------- Вікно для кнопок сайту ---------- */

.asya-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  font-family: inherit;
  line-height: 1.35;
  visibility: hidden;
  opacity: 0;
  transition: opacity .2s ease, visibility 0s linear .2s;
}

.asya-modal.asya-modal--open {
  visibility: visible;
  opacity: 1;
  transition: opacity .2s ease;
}

.asya-modal .asya-modal__backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(18, 30, 46, .42);
}

.asya-modal .asya-modal__dialog {
  --asya-d: 150px;   /* діаметр портрета */
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 560px;
  margin: 0;
  padding: 22px 30px 22px 20px;
  border: 5px solid var(--asya-blue);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(16, 42, 72, .35);
  color: var(--asya-blue);
  outline: none;
  transform: translateY(12px) scale(.97);
  transition: transform .2s ease;
}

.asya-modal.asya-modal--open .asya-modal__dialog {
  transform: none;
}

.asya-modal .asya-modal__face {
  flex: 0 0 auto;
  width: calc(var(--asya-d) * 1.109);
  height: calc(var(--asya-d) * 1.017);
  margin: calc(var(--asya-d) * -.007) 0 0 calc(var(--asya-d) * -.007);
  background: url(asya@2x.png) 0 0 / 100% 100% no-repeat;
  background-image: -webkit-image-set(url(asya.png) 1x, url(asya@2x.png) 2x);
  background-image: image-set(url(asya.png) 1x, url(asya@2x.png) 2x);
}

.asya-modal .asya-modal__body {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
}

.asya-modal .asya-modal__text {
  margin: 0;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: 21px;
  font-weight: 400;
  line-height: 1.32;
}

.asya-modal .asya-modal__body .asya-links {
  justify-content: flex-end;
  gap: 16px;
  margin-top: 20px;
}

.asya-modal .asya-modal__body .asya-link {
  width: 56px;
  height: 56px;
}

.asya-modal .asya-modal__close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 7px;
  border: 0;
  border-radius: 50%;
  background: var(--asya-blue);
  box-shadow: 0 4px 12px rgba(16, 42, 72, .3);
  color: #fff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.asya-modal .asya-modal__close svg {
  display: block;
  width: 100%;
  height: 100%;
}

.asya-modal .asya-modal__close:focus {
  outline: none;
}

.asya-modal .asya-modal__close:focus-visible {
  outline: 3px solid rgba(43, 92, 142, .45);
  outline-offset: 2px;
}

/* ---------- Блок «Напишіть Асі в месенджер» ---------- */

.asya-block[data-asya-ready="1"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 28px 56px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 52px 56px;
  border-radius: 28px;
  background: #f4f6f5;
  color: #0c2722;
  font-family: Inter, Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}

.asya-block p,
.asya-block h2,
.asya-block ul,
.asya-block li {
  margin: 0;
  padding: 0;
}

.asya-block .asya-block__label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #687875;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.asya-block .asya-block__dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22a55a;
  box-shadow: 0 0 0 4px rgba(34, 165, 90, .15);
}

.asya-block .asya-block__title {
  margin: 14px 0 18px;
  color: #0c2722;
  font-family: inherit;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.01em;
  text-transform: none;
}

.asya-block .asya-block__lead {
  color: #5f706c;
  font-size: 16px;
  line-height: 1.55;
}

.asya-block .asya-block__list {
  margin-top: 20px;
  list-style: none;
}

.asya-block .asya-block__item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: #3f4d4a;
  font-size: 14.5px;
  line-height: 1.4;
}

.asya-block .asya-block__item::before,
.asya-block .asya-block__item::after {
  content: none;
  display: none;
}

.asya-block .asya-block__check {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: #2e8b6e;
}

.asya-block .asya-block__check svg,
.asya-block .asya-card__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.asya-block .asya-block__note {
  margin-top: 18px;
  color: #7e8c89;
  font-size: 12.5px;
  line-height: 1.5;
}

.asya-block .asya-block__cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.asya-block .asya-card {
  display: flex;
  flex-direction: column;
  padding: 20px 22px 22px;
  border: 1px solid #e6ecea;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(12, 39, 34, .06);
}

.asya-block .asya-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.asya-block .asya-card__icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1b7ab4;
  color: #fff;
}

.asya-block .asya-card--viber .asya-card__icon {
  background: #6a55d8;
}

.asya-block .asya-card__title {
  min-width: 0;
}

.asya-block .asya-card__name {
  display: block;
  color: #0c2722;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.asya-block .asya-card__sub {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #919d9b;
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* QR-коди: статичні SVG поруч із цим файлом */
.asya-block .asya-card__qr {
  display: block;
  width: 176px;
  max-width: 100%;
  height: 176px;
  margin: 18px auto 14px;
  border: 1px solid #e3e9e7;
  border-radius: 14px;
  background: #fff url(qr-telegram.svg) 50% 50% / 154px 154px no-repeat;
}

.asya-block .asya-card--viber .asya-card__qr {
  background-image: url(qr-viber.svg);
}

.asya-block .asya-card__hint {
  margin-bottom: 14px;
  color: #8d9896;
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
}

.asya-block .asya-card__btn {
  display: block;
  margin-top: auto;
  padding: 13px 14px;
  border-radius: 12px;
  background: #1b7ab4;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: filter .15s ease, transform .15s ease;
}

.asya-block .asya-card--viber .asya-card__btn {
  background: #6a55d8;
}

.asya-block .asya-card__btn:hover,
.asya-block .asya-card__btn:focus-visible {
  color: #fff;
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.asya-block .asya-block__phone {
  grid-column: 2;
  color: #808d8b;
  font-size: 13.5px;
  line-height: 1.4;
  text-align: center;
}

.asya-block .asya-block__phone a {
  color: #1f5c55;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

/* ---------- Кнопки для виклику лаборанта ---------- */

.asya-inline {
  text-align: center;
}

.asya-inline .asya-inline__text {
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.4;
}

/* ---------- Адаптив ---------- */

@media (max-width: 1099px) {
  .asya-block[data-asya-ready="1"] {
    grid-template-columns: minmax(0, 1fr);
    padding: 40px 32px;
  }

  .asya-block .asya-block__phone {
    grid-column: auto;
  }
}

@media (max-width: 767px) {
  .asya-root {
    --asya-size: 60px;
    --asya-base: 80px;  /* кнопка «вгору» теми тут 40 px */
  }

  .asya-root .asya-cloud {
    width: min(300px, calc(100vw - 40px));
    padding: 14px;
  }

  .asya-root .asya-cloud__text {
    font-size: 13.5px;
  }

  /* На телефоні в блоці лишаються тільки кнопки переходу */
  .asya-block[data-asya-ready="1"] {
    gap: 22px;
    padding: 28px 20px;
    border-radius: 22px;
  }

  .asya-block .asya-block__title {
    font-size: 28px;
  }

  .asya-block .asya-block__cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .asya-block .asya-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .asya-block .asya-card__head,
  .asya-block .asya-card__qr,
  .asya-block .asya-card__hint {
    display: none;
  }
}

@media (max-width: 520px) {
  .asya-modal .asya-modal__dialog {
    --asya-d: 96px;
    gap: 10px;
    padding: 16px 18px 16px 12px;
    border-width: 4px;
    border-radius: 22px;
  }

  .asya-modal .asya-modal__text {
    font-size: 16px;
  }

  .asya-modal .asya-modal__body .asya-links {
    gap: 12px;
    margin-top: 14px;
  }

  .asya-modal .asya-modal__body .asya-link {
    width: 48px;
    height: 48px;
  }

  .asya-modal .asya-modal__close {
    top: -14px;
    right: -10px;
    width: 34px;
    height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .asya-root,
  .asya-root *,
  .asya-modal,
  .asya-modal *,
  .asya-block *,
  .asya-inline * {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .asya-root,
  .asya-modal {
    display: none !important;
  }
}
