/*
 * YCLOUD: мобильная версия поверх экспорта Tilda.
 * Подключается на всех страницах ycloud.kz инструментом tools/mobile_enhance.py.
 *  - светлая мобильная шапка с логотипом (как на компьютере);
 *  - первый экран главной для телефонов (.yc-mhero) вместо мелкого zero-блока;
 *  - нижняя панель «WhatsApp | Позвонить» (.yc-bar) — как в мобильном приложении.
 * Цвета подобраны с контрастом текста не ниже 4.5:1 (WCAG AA).
 */
:root {
  --yc-orange: #ff5000;      /* фирменный, для крупных элементов и логотипа */
  --yc-orange-text: #c84b00; /* для кнопок с белым текстом: контраст 4.7:1 */
  --yc-ink: #1a1a1a;
  --yc-muted: #444;
  --yc-wa: #0e7a6e;          /* WhatsApp, затемнённый до контраста 5.2:1 */
  --yc-bar-h: 64px;
}

/* ---------- Мобильная шапка (T228): белая, логотип слева, тёмный бургер ---------- */
.tmenu-mobile {
  background-color: #fff !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}
.tmenu-mobile .t-menuburger span { background-color: var(--yc-ink) !important; }
.tmenu-mobile__text.t-name { line-height: 0; }
.yc-mlogo { display: inline-block; padding: 4px 0; }
.yc-mlogo img { display: block; height: 32px; width: auto; }

/* ---------- Шапка на ноутбуках 981–1199px: меню в одну строку (переносилось «База знаний») ---------- */
@media (min-width: 981px) and (max-width: 1199px) {
  .t228__list_item { padding-left: 10px !important; padding-right: 10px !important; }
  .t228__list_item .t-menu__link-item { font-size: 14px !important; }
}

/* ---------- Бегущая строка «УСТАНОВКА · НАСТРОЙКА · …» на CSS (вместо T1003 со скриптом) ---------- */
#rec820819090 .t1003 { display: none !important; }
.yc-marquee { overflow: hidden; height: 80px; background: #ef6806; display: flex; align-items: center; }
.yc-marquee__track {
  display: flex; align-items: center; flex: none; white-space: nowrap; will-change: transform;
  animation: yc-marquee 45s linear infinite;
}
.yc-marquee span {
  padding: 0 10px; color: #fff; font-family: 'Montserrat-black', Arial, sans-serif; font-weight: 700;
  font-size: 24px; line-height: 1;
}
.yc-marquee i { display: block; width: 6px; height: 6px; border-radius: 50%; background: #fff; flex: none; }
@keyframes yc-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (max-width: 639px) { .yc-marquee { height: 64px; } .yc-marquee span { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { .yc-marquee__track { animation: none; } }

/* ---------- Первый экран главной (все экраны) ---------- */
/* Zero-блок Tilda заменён обычной вёрсткой: на телефоне в нём был текст 10px и кнопки 24px,
   на планшете заголовок наезжал на картинки, на компьютере подзаголовок висел в углу,
   ноутбук и «Y» обрезались краями экрана, а заголовка h1 не было совсем. */
#rec759847478 { display: none !important; }
.yc-mhero {
  display: block; padding: 28px 20px 8px; background: #fff;
  color: var(--yc-ink); font-family: 'Open Sans', Arial, sans-serif;
}
.yc-mhero__title {
  margin: 0 0 14px; font-family: 'Montserrat-black', Arial, sans-serif; font-weight: 700;
  font-size: clamp(30px, 9.2vw, 44px); line-height: 1.04; text-transform: uppercase;
  color: var(--yc-orange); letter-spacing: -.01em;
}
.yc-mhero__lead { margin: 0 0 18px; font-size: 17px; line-height: 1.5; color: var(--yc-muted); }
.yc-mhero__list { list-style: none; margin: 0 0 22px; padding: 0; }
.yc-mhero__list li { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: 16px; line-height: 1.35; font-weight: 600; }
.yc-mhero__list img { width: 28px; height: 28px; flex: none; }
.yc-mhero__actions { display: grid; gap: 10px; }
.yc-mhero__img { display: block; width: 86%; max-width: 360px; height: auto; margin: 18px auto 0; }

/* Планшет: текст слева, ноутбук справа */
@media (min-width: 640px) and (max-width: 959px) {
  .yc-mhero {
    display: grid; grid-template-columns: 1.15fr .85fr; column-gap: 32px; align-items: start;
    max-width: 900px; margin: 0 auto; padding: 48px 40px 32px;
  }
  .yc-mhero > * { grid-column: 1; }
  .yc-mhero__title { font-size: 40px; }
  .yc-mhero .yc-mhero__img { grid-column: 2; grid-row: 1 / span 4; align-self: center; width: 100%; margin: 0; }
}

/* Компьютер: крупный заголовок, кнопки в ряд, ноутбук справа */
@media (min-width: 960px) {
  .yc-mhero {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); column-gap: 48px; align-items: center;
    max-width: 1200px; margin: 0 auto; padding: 136px 40px 72px; box-sizing: border-box;
  }
  .yc-mhero > * { grid-column: 1; }
  .yc-mhero__title { font-size: clamp(44px, 3.9vw, 58px); margin-bottom: 20px; }
  .yc-mhero__lead { font-size: 19px; max-width: 34em; margin-bottom: 22px; }
  .yc-mhero__list { margin-bottom: 30px; }
  .yc-mhero__list li { font-size: 17px; padding: 6px 0; }
  .yc-mhero__actions { grid-auto-flow: column; justify-content: start; gap: 14px; }
  .yc-mhero__actions .yc-btn { min-height: 56px; padding: 0 28px; font-size: 17px; }
  .yc-mhero .yc-mhero__img { grid-column: 2; grid-row: 1 / span 4; }
  .yc-mhero .yc-mhero__img { width: 100%; max-width: 540px; margin: 0; justify-self: center; align-self: center; }
}

/* ---------- Кнопки ---------- */
.yc-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px;
  border-radius: 14px;
  font-family: 'Montserrat-black', Arial, sans-serif;
  font-weight: 600; font-size: 16px; line-height: 1.2;
  text-decoration: none; text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, filter .15s ease;
}
.yc-btn:active { transform: scale(.98); filter: brightness(.95); }
.yc-btn:focus-visible, .yc-bar__btn:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; }
.yc-btn_primary { background: var(--yc-orange-text); color: #fff !important; }
.yc-btn_ghost { background: #fff; color: var(--yc-orange-text) !important; box-shadow: inset 0 0 0 2px var(--yc-orange-text); }
.yc-btn svg, .yc-bar__btn svg { width: 22px; height: 22px; flex: none; fill: currentColor; }

/* ---------- Нижняя панель связи (телефоны и планшеты) ---------- */
.yc-bar { display: none; }

@media (max-width: 959px) {
  .yc-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990;
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    box-shadow: 0 -1px 0 rgba(0, 0, 0, .08), 0 -6px 20px rgba(0, 0, 0, .06);
  }
  .yc-bar__btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 48px; border-radius: 12px;
    font-family: 'Montserrat-black', Arial, sans-serif;
    font-weight: 600; font-size: 16px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .yc-bar__btn:active { filter: brightness(.92); }
  .yc-bar__btn_wa { background: var(--yc-wa); color: #fff !important; }
  .yc-bar__btn_tel { background: #fff; color: var(--yc-ink) !important; box-shadow: inset 0 0 0 1.5px #c9c9c9; }
  /* Панель не закрывает конец страницы */
  body { padding-bottom: calc(var(--yc-bar-h) + env(safe-area-inset-bottom, 0px)); }
}

@media print { .yc-bar { display: none !important; } }

/* ---------- Документы (публичная оферта): удобное чтение на телефоне и компьютере ---------- */
.yc-doc {
  max-width: 760px; margin: 0 auto; padding: 32px 20px 48px;
  font-family: 'Open Sans', Arial, sans-serif; font-size: 17px; line-height: 1.65;
  color: var(--yc-ink); overflow-wrap: anywhere;
}
.yc-doc__title {
  margin: 0 0 6px; font-family: 'Montserrat-black', Arial, sans-serif; font-weight: 600;
  font-size: clamp(24px, 6vw, 34px); line-height: 1.2;
}
.yc-doc__subtitle { margin: 0 0 24px; color: var(--yc-muted); font-weight: 600; }
.yc-doc p { margin: 0 0 14px; }
.yc-doc h2 {
  margin: 36px 0 14px; padding-top: 8px; scroll-margin-top: 80px;
  font-family: 'Montserrat-black', Arial, sans-serif; font-weight: 600;
  font-size: 20px; line-height: 1.3;
}
.yc-doc .yc-doc__sub2 { padding-left: 16px; }
.yc-doc .yc-doc__sub3 { padding-left: 32px; }
.yc-doc ul { margin: 0 0 14px; padding-left: 22px; }
.yc-doc li { margin-bottom: 8px; }
.yc-doc a { color: var(--yc-orange-text) !important; text-decoration: underline; text-underline-offset: 2px; }
/* на компьютере меню Tilda закреплено сверху (высота ~80px) */
@media (min-width: 981px) { .yc-doc { padding-top: 120px; } .yc-doc h2 { scroll-margin-top: 110px; } }
.yc-doc__toc {
  margin: 8px 0 28px; padding: 16px 20px; border-radius: 14px; background: #f6f6f4;
}
.yc-doc__toc-title { margin: 0 0 8px !important; font-weight: 700; }
.yc-doc__toc ol { margin: 0; padding: 0; list-style: none; }
.yc-doc__toc li { margin: 0; }
.yc-doc__toc a { display: block; padding: 6px 0; text-decoration: none; color: var(--yc-ink) !important; }
.yc-doc__toc a:hover { color: var(--yc-orange-text) !important; }
.yc-doc__table { overflow-x: auto; margin: 0 0 16px; }
.yc-doc table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; }
.yc-doc th, .yc-doc td { border: 1px solid #d9d9d9; padding: 8px 10px; text-align: left; vertical-align: top; }
.yc-doc th { background: #f6f6f4; font-weight: 600; }
.yc-doc__top { margin-top: 32px !important; }
.yc-doc__top a { text-decoration: none; font-weight: 600; }

/* ---------- Подвал («Связаться с нами» на главной и подвал служебных страниц) ---------- */
.yc-footer {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 48px 20px 56px; background: #fff;
  font-family: 'Open Sans', Arial, sans-serif; color: var(--yc-ink); text-align: center;
}
.yc-footer__title {
  margin: 0; font-family: 'Montserrat-black', Arial, sans-serif; font-weight: 700;
  font-size: clamp(26px, 6vw, 36px); line-height: 1.2; color: #000;
}
.yc-footer__logo img { height: 32px; width: auto; display: block; }
.yc-footer__social { display: flex; gap: 24px; }
.yc-footer__social a { display: block; width: 44px; height: 44px; }
.yc-footer__social img { width: 44px; height: 44px; display: block; object-fit: contain; }
.yc-footer__contacts { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 20px; line-height: 1.4; }
.yc-footer a { color: var(--yc-ink) !important; text-decoration: none !important; }
.yc-footer a:hover { color: var(--yc-orange-text) !important; }
/* Документы: значок + текст, друг под другом, по центру */
.yc-footer__links { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 17px; }
.yc-footer__links a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
.yc-footer__links img { width: 28px; height: 28px; object-fit: contain; flex: none; }

/* ---------- Этап А6–А7: главная короче на телефоне, доступность ---------- */
/* «О нас»: цифры сеткой 2×3 вместо столбика из шести блоков (главная и /demo) */
@media (max-width: 639px) {
  .t1052 .t-section__container { margin-bottom: 8px; }
  #allrecords .t1052 .t1052__container {
    display: grid !important; grid-template-columns: 1fr 1fr; gap: 28px 12px; align-items: start;
    width: auto !important; max-width: none !important; margin: 0 16px !important; padding: 0 !important;
  }
  #allrecords .t1052 .t1052__col.t-list__item {
    width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; float: none !important;
  }
  #allrecords .t1052 .t1052__title { font-size: 34px !important; line-height: 1.1 !important; padding: 0 !important; }
  #allrecords .t1052 .t1052__line { width: 40px !important; margin: 10px auto !important; }
  #allrecords .t1052 .t1052__text, #allrecords .t1052 .t1052__text div { font-size: 15px !important; line-height: 1.35 !important; padding: 0 !important; }
  /* Отступы секций 135–150px на телефоне — лишние экраны прокрутки */
  .t-rec_pt_150 { padding-top: 56px !important; }
  .t-rec_pb_150, .t-rec_pb_135 { padding-bottom: 56px !important; }
}
/* Отзывы: логотип клиента целиком, а не обрезанный по краям */
.t728__bgimg { background-size: contain !important; background-color: #fff; inset: 16px !important; }
/* Точки слайдера: видимая точка 10px, область касания 24px (WCAG 2.5.8) */
.t-slds__bullet_body {
  width: 10px !important; height: 10px !important; box-sizing: content-box !important;
  border: 7px solid transparent !important; background-clip: padding-box !important;
}
/* Подписи тарифных кнопок /offer: без полупрозрачности (иначе контраст 2.5:1) */
.t993__btn-text-descr { opacity: 1 !important; }

@media print {
  .tmenu-mobile, .t228, .yc-footer, .yc-doc__toc, .yc-doc__top { display: none !important; }
  .yc-doc { max-width: none; padding: 0; font-size: 12pt; }
}

/* ---------- Кнопка WhatsApp на компьютере (от 960px) ---------- */
.yc-fab { display: none; }
@media (min-width: 960px) {
  .yc-fab {
    position: fixed; right: 24px; bottom: 24px; z-index: 9990;
    display: flex; align-items: center; gap: 0; height: 60px; min-width: 60px; padding: 0 15px;
    box-sizing: border-box; border-radius: 30px; background: var(--yc-wa); color: #fff !important;
    text-decoration: none !important; box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
    font-family: 'Montserrat-black', Arial, sans-serif; font-weight: 600; font-size: 16px; white-space: nowrap;
    transition: box-shadow .2s ease, transform .2s ease;
  }
  .yc-fab svg { width: 30px; height: 30px; flex: none; fill: currentColor; }
  .yc-fab__label { max-width: 0; overflow: hidden; opacity: 0; transition: max-width .25s ease, opacity .2s ease, margin .25s ease; }
  .yc-fab:hover, .yc-fab:focus-visible { box-shadow: 0 8px 26px rgba(0, 0, 0, .28); transform: translateY(-2px); }
  .yc-fab:hover .yc-fab__label, .yc-fab:focus-visible .yc-fab__label { max-width: 220px; opacity: 1; margin-left: 10px; }
  .yc-fab:focus-visible { outline: 3px solid #1f6feb; outline-offset: 3px; }
}
@media print { .yc-fab { display: none !important; } }
