/* ==========================================================================
   PetHelp — мобильная версия (v1). Подключается ПОСЛЕДНИМ на всех страницах.
   Только телефоны и узкие планшеты (до 900px). Десктоп не затрагивается.
   ========================================================================== */

/* --- страница никогда не «ползёт» вбок ------------------------------------ */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media(max-width:900px){
  html,body{max-width:100%;overflow-x:clip}
  img,video,svg,iframe{max-width:100%}
  /* iOS увеличивает страницу при фокусе в поле с шрифтом < 16px */
  input,select,textarea{font-size:16px!important}
  /* внизу — нижняя панель «Позвонить / Viber», оставляем под неё место */
  .footer{padding-bottom:calc(28px + env(safe-area-inset-bottom))!important}
}

/* --- шапка ---------------------------------------------------------------- */
@media(max-width:900px){
  .ph-header{padding:8px 10px 6px!important}
  .ph-bar{gap:8px!important;padding:7px 10px!important;border-radius:18px!important;min-width:0}
  .ph-header.is-scrolled .ph-bar{padding:6px 10px!important}
  .ph-logo{flex:1 1 auto;min-width:0}
  .ph-logo .ph-lockup{gap:8px;min-width:0;max-width:100%}
  .ph-logo .ph-lockup .ph-paw{height:40px!important;width:auto;flex:none}
  .ph-logo .ph-name{font-size:clamp(21px,7.4vw,31px)!important;letter-spacing:.06em!important}
  .ph-logo .ph-tag{display:none!important}
  .ph-logo .ph-lt{gap:0}
  .ph-call-mobile{width:46px!important;height:46px!important;flex:none;border-radius:50%!important}
  .ph-burger{display:grid!important;place-items:center;width:46px!important;height:46px!important;flex:none;padding:0;font-size:23px;line-height:1;border-radius:14px!important}
  /* выезжающее меню: помещается в экран и прокручивается */
  .ph-mobile{margin:8px 0 0!important;max-height:calc(100vh - 92px);max-height:calc(100dvh - 92px);overflow-y:auto;-webkit-overflow-scrolling:touch}
  .ph-mobile-nav a{padding:15px 2px!important;font-size:17px!important}
  .ph-mobile-head .ph-m-msg a{min-height:48px;font-size:15px!important}
  .ph-mobile-head .ph-m-tel b{font-size:19px!important}
  .ph-mobile-head .ph-m-meta span{font-size:13px!important}
}
@media(max-width:360px){
  .ph-logo .ph-lockup .ph-paw{height:34px!important}
  .ph-call-mobile,.ph-burger{width:42px!important;height:42px!important}
}

/* --- нижняя панель «Позвонить / Viber» ----------------------------------- */
@media(max-width:900px){
  .sticky{
    background:rgba(253,246,238,.97)!important;
    -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
    border-top:1px solid rgba(184,111,51,.28)!important;
    box-shadow:0 -8px 24px rgba(43,24,16,.10);
    gap:10px!important;padding:9px 12px calc(9px + env(safe-area-inset-bottom))!important;
  }
  .sticky .btn{min-height:50px!important;font-size:16px!important;border:0!important;border-radius:999px;padding:0 10px!important;color:#fff!important}
  .sticky .btn.primary{background:linear-gradient(135deg,#E27018,#B86F33)!important;box-shadow:0 6px 16px rgba(184,111,51,.35)}
  .sticky .btn.secondary{background:#7360f2!important;color:#fff!important;border:0!important}
  /* Рэкс не перекрывает нижнюю панель */
  .rex-launcher{bottom:calc(18px + env(safe-area-inset-bottom))!important;right:14px!important;width:60px!important;height:60px!important}
  .rex-greeting-bubble{bottom:calc(86px + env(safe-area-inset-bottom))!important;right:14px!important}
}

/* --- хлебные крошки и мелкие подписи -------------------------------------- */
@media(max-width:900px){
  .sp-crumbs{font-size:14px!important;display:flex;flex-wrap:wrap;gap:2px 8px;align-items:center}
  .sp-crumbs a{display:inline-flex;align-items:center;min-height:36px}
  .kicker,.eyebrow{font-size:12.5px!important}
  .f-soc-label{font-size:12.5px!important}
}

/* --- подвал --------------------------------------------------------------- */
@media(max-width:900px){
  .footer-grid{gap:26px!important}
  .footer a{font-size:15px!important;padding:6px 0;margin:2px 0!important}
  .footer h3{font-size:15px!important}
  .footer .footer-contact{font-size:15px!important}
  .footer .footer-contact a{padding:8px 0}
  .footer .copyright{flex-direction:column;gap:6px!important;font-size:12.5px!important;align-items:flex-start}
  .footer .copyright span{font-size:12.5px!important}
  .footer .f-legal{font-size:13px!important}
  .footer .f-soc a{width:46px!important;height:46px!important}
  /* строка со ссылками внизу не должна рваться на отдельные строки */
  .footer p.f-seo{font-size:13.5px!important;line-height:1.65!important}
  .footer p.f-seo a{display:inline!important;margin:0!important;padding:0!important;font-size:inherit!important;white-space:normal}
}

/* --- блоки страниц: кнопки и связки ссылок -------------------------------- */
@media(max-width:700px){
  .tr-live-link{display:flex;flex-direction:column;align-items:flex-start;gap:14px}
  .tr-live-link .ph-btn{width:100%;justify-content:center}
  .sp-cta .ph-btn,.sp-cta .btn,.ph-final-in .ph-btn{width:100%;justify-content:center;min-height:52px}
  .ph-btn{min-height:50px}
  .car-features-row .feature p{font-size:15px!important}
  .car-features-row .feature b{font-size:17px!important}
}

/* --- таблицы и калькулятор цен -------------------------------------------- */
@media(max-width:900px){
  .pm-reset{min-height:44px;padding:0 14px}
}

/* --- заголовки: на телефоне чуть компактнее, чтобы не занимали полэкрана --- */
@media(max-width:600px){
  h1{font-size:clamp(32px,9.4vw,40px)!important;line-height:1.08!important}
  .ph-copy h1{font-size:clamp(34px,10.4vw,44px)!important}
  h2{font-size:clamp(26px,7.6vw,31px)!important;line-height:1.12!important}
  .sp-lead{font-size:16.5px!important;line-height:1.6!important}
}

/* --- мелкий текст: не меньше 13px, абзацы — не меньше 15px ------------------ */
@media(max-width:900px){
  .section-label,.m-panel-label,.stem,.role,.news-date,.media-card-date,.media-card-badge,.media-card-more,
  .pt-tag,.rv-src,.ll-new,.rx-badge,.pm-legend,.rx-vid-note,.rx-h-touch,time{font-size:13px!important}
  .media-card-excerpt,.pm-legal,.pm-hint,.pt-note,.m-footnote,.price-card p,.price-note,.rv-card small{font-size:15px!important;line-height:1.6!important}
  .sp-table caption,.sp-table th,.sp-table td{font-size:14.5px!important}
  .breadcrumbs a,.sp-crumbs a{min-height:40px}
}
/* --- поля и кнопки калькулятора: удобно попадать пальцем --------------------- */
@media(max-width:900px){
  .pm input[type=text],.pm input[type=search],.pm input:not([type]),.pm-search input,.price-map input{min-height:48px;padding:0 14px}
  .pm button,.pm-search button,.price-map button{min-height:48px;padding:0 18px;font-size:15px!important}
  .pm-reset{min-height:46px}
  .mission-link{display:inline-flex;align-items:center;min-height:44px}
  .rv-chip,.rv-foot a,.ph-review-foot a{display:inline-flex;align-items:center;min-height:44px}
}

/* --- таблицы цен: на телефоне превращаются в карточки (без боковой прокрутки) --- */
@media(max-width:700px){
  .sp-table-wrap{overflow:visible!important;margin-top:14px}
  .sp-table{min-width:0!important;display:block;border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0!important}
  .sp-table caption{display:block;padding:0 2px 12px!important;font-size:13.5px!important}
  .sp-table thead{display:none}
  .sp-table tbody,.sp-table tr{display:block}
  .sp-table tr{background:#fff;border:1px solid rgba(184,111,51,.24);border-radius:18px;margin:0 0 12px;padding:14px 16px 10px;box-shadow:0 6px 18px rgba(43,24,16,.05)}
  .sp-table tbody th{display:block;padding:0 0 10px!important;border:0!important;font-size:17px!important;line-height:1.35}
  .sp-table td{display:block;padding:9px 0!important;border:0!important;border-top:1px dashed rgba(184,111,51,.28)!important;font-size:15.5px!important}
  .sp-table td::before{display:block;margin-bottom:2px;font:800 12px Mulish,system-ui,sans-serif;letter-spacing:.07em;text-transform:uppercase;color:#8F4A17}
  .sp-table td:nth-of-type(1)::before{content:"В одну сторону"}
  .sp-table td:nth-of-type(2)::before{content:"Туда и обратно"}
  .sp-table td[colspan]::before{content:none}
}

/* --- фото в отзывах: на всю ширину карточки --- */
@media(max-width:900px){
  .rv-pic{max-width:none!important;width:100%;aspect-ratio:4/3!important}
  .rv-pic img{object-position:center 30%}
}

/* --- страница трансляции: сначала поле для кода, потом пояснения --------------- */
@media(max-width:900px){
  .lv-section>.inner{display:flex;flex-direction:column}
  .lv-section>.inner>.lv-bar{order:1}
  .lv-section>.inner>.lv-frame{order:2}
  .lv-section>.inner>.lv-foot{order:3}
  .lv-section>.inner>.lv-notices{order:4;margin:22px 0 0}
  .lv-gate input{min-height:54px;font-size:20px!important;letter-spacing:.2em;text-align:center}
  .lv-btn{min-height:54px;font-size:17px!important}
  .lv-help{font-size:14.5px!important}
}
/* --- новость о трансляции: кнопки и ссылки --------------------------------- */
@media(max-width:700px){
  .ll-cta{flex-direction:column}
  .ll-btn{width:100%;padding:0 12px;font-size:15px}
  .ll-related{line-height:2.1}
}
@media(max-width:600px){
  /* на странице трансляции поле кода должно оказаться на первом экране */
  main .m-hero{padding:20px 18px 16px!important}
  main .m-hero .m-meta{font-size:15px!important;line-height:1.55!important;margin-top:8px}
  .lv-section{padding-top:16px!important}
}
@media(max-width:600px){
  .lv-gate .lv-paw{display:none}
  .lv-gate{padding:30px 16px 22px!important}
  .lv-frame.is-gate{min-height:345px!important}
}
/* пока открыто меню — плавающие элементы не мешают */
@media(max-width:900px){
  body:has(.ph-mobile:not([hidden])) .rex-launcher,
  body:has(.ph-mobile:not([hidden])) .rex-greeting-bubble,
  body:has(.ph-mobile:not([hidden])) .sticky{display:none!important}
}
/* пока открыт чат с Рэксом — нижняя панель не торчит из-под окна */
@media(max-width:900px){
  body:has(.rex-window--open) .sticky{display:none!important}
}

/* нижняя панель «Позвонить / Viber» убрана: кнопки остаются в шапке и первом экране */
.sticky{display:none!important}

/* ===== v3: мобильное меню, нажатия, подсказка свайпа ===== */
@media(max-width:900px){
  /* плавное открытие/закрытие: меню остаётся в потоке, меняется только прозрачность */
  .ph-mobile[hidden]{display:block!important;visibility:hidden;opacity:0;transform:translateY(-8px);pointer-events:none;max-height:0;margin:0!important;padding-top:0!important;padding-bottom:0!important;border-width:0!important;overflow:hidden;transition:opacity .22s ease,transform .22s ease,max-height 0s linear .22s,visibility 0s linear .22s}
  .ph-mobile:not([hidden]){opacity:1;transform:none;transition:opacity .22s ease,transform .22s ease}
  /* затемнение фона */
  body::before{content:"";position:fixed;inset:0;z-index:999;background:rgba(43,29,20,.46);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .22s ease,visibility 0s linear .22s}
  body:has(.ph-mobile:not([hidden]))::before{opacity:1;visibility:visible;pointer-events:auto;transition:opacity .22s ease}
  /* шапка меню */
  .ph-mobile-head .ph-m-tel small{font-size:10px!important;letter-spacing:.12em!important;white-space:nowrap}
  .ph-mobile-head{padding-bottom:12px!important}
  /* пункты */
  .ph-mobile-nav a{display:flex!important;align-items:center;gap:14px;padding:13px 4px!important;font-size:17px!important;line-height:1.2;transition:background-color .15s ease,color .15s ease}
  .ph-mobile-nav a .mi{flex:none;display:grid;place-items:center;width:34px;height:34px;border-radius:11px;background:rgba(184,111,51,.10);color:#B86F33}
  .ph-mobile-nav a .mi svg{width:19px;height:19px}
  .ph-mobile-nav a.is-main{font-weight:800;color:#2b1d14}
  .ph-mobile-nav a.is-main .mi{background:#B86F33;color:#fff}
  .ph-mobile-nav a.is-soft{font-size:15px!important;font-weight:500;color:#8a6a52}
  .ph-mobile-nav a.is-soft .mi{background:transparent;color:#a88f7a}
  .ph-mobile-nav a.is-soft .mi svg{width:17px;height:17px}
  .ph-mobile-nav a:active{background:rgba(184,111,51,.10)}
  .ph-mobile-nav a[aria-current="page"] span{text-decoration:underline;text-decoration-color:#B86F33;text-decoration-thickness:2px;text-underline-offset:6px}
  .ph-mobile-nav a[aria-current="page"]{text-decoration:none}
  /* лёгкое нажатие на основные кнопки */
  .ph-btn,.btn,.ph-m-msg a,.ph-call-mobile,.ph-burger{transition:transform .12s ease,box-shadow .12s ease,filter .12s ease}
  .ph-btn:active,.btn:active,.ph-m-msg a:active,.ph-call-mobile:active,.ph-burger:active{transform:scale(.97);filter:brightness(.96)}
  /* подсказка свайпа у ленты отзывов */
  .rvw-rail-wrap::after{content:"";position:absolute;top:0;right:0;bottom:18px;width:34px;pointer-events:none;background:linear-gradient(90deg,rgba(247,240,229,0),rgba(247,240,229,.9))}
  body:has(.ph-mobile:not([hidden])) #pethelp-cookie-notice{display:none!important}
}
@media(max-width:380px){
  .ph-mobile-nav a{gap:12px;padding:11px 4px!important;font-size:16px!important}
  .ph-mobile-nav a.is-soft{font-size:14px!important}
  .ph-mobile-head .ph-m-tel small{font-size:9px!important;letter-spacing:.08em!important}
}
@media(prefers-reduced-motion:reduce){
  .ph-mobile,.ph-mobile[hidden],body::before{transition:none!important}
}

/* ===== v4: спокойное премиальное меню ===== */
@media(max-width:900px){
  .ph-mobile .ph-mobile-head{padding:16px 16px 14px!important;display:flex;flex-direction:column;gap:12px}
  /* телефон: главный элемент */
  .ph-mobile .ph-mobile-head .ph-m-tel{display:flex!important;align-items:center;gap:14px;width:100%;box-sizing:border-box;padding:14px 18px!important;border-radius:18px!important;background:linear-gradient(145deg,#C98445,#A9622B)!important;color:#fff!important;box-shadow:0 8px 20px rgba(169,98,43,.28)}
  .ph-mobile .ph-mobile-head .ph-m-tel .ic{width:46px!important;height:46px!important;background:rgba(255,255,255,.18)!important;color:#fff!important;box-shadow:none!important}
  .ph-mobile .ph-mobile-head .ph-m-tel .ic svg{width:22px!important;height:22px!important}
  .ph-mobile .ph-mobile-head .ph-m-tel small{color:rgba(255,255,255,.88)!important;font-size:10px!important;letter-spacing:.12em!important}
  .ph-mobile .ph-mobile-head .ph-m-tel b{color:#fff!important;font-size:30px!important;font-weight:600!important;letter-spacing:.02em;line-height:1.05;white-space:nowrap}
  .ph-mobile .ph-mobile-head .ph-m-tel .dot{background:#fff;box-shadow:none;animation:none}
  /* Viber и WhatsApp: тише и мельче */
  .ph-mobile .ph-mobile-head .ph-m-msg{display:flex;gap:10px}
  .ph-mobile .ph-mobile-head .ph-m-msg a{flex:1;min-height:40px!important;font-size:13.5px!important;font-weight:600;border-radius:12px!important;background:#fff!important;border:1px solid rgba(184,111,51,.28);color:#5b4636!important;box-shadow:none!important}
  .ph-mobile .ph-mobile-head .ph-m-msg a.vb svg{color:#7360f2}
  .ph-mobile .ph-mobile-head .ph-m-msg a.wa svg{color:#25a85a}
  /* пункты: тонкие линии, лёгкий шрифт, без жирного */
  .ph-mobile .ph-mobile-nav{padding:6px 18px 10px!important}
  .ph-mobile .ph-mobile-nav a{gap:16px;padding:14px 0!important;font-family:"Cormorant Garamond",Georgia,serif!important;font-size:23px!important;font-weight:500!important;letter-spacing:.01em;color:#2b1d14;border-bottom:1px solid rgba(184,111,51,.18)!important}
  .ph-mobile .ph-mobile-nav a:last-child{border-bottom:0!important}
  .ph-mobile .ph-mobile-nav a .mi{width:28px;height:28px;border-radius:0;background:transparent!important;color:#B86F33!important}
  .ph-mobile .ph-mobile-nav a .mi svg{width:24px;height:24px;stroke-width:1.3}
  .ph-mobile .ph-mobile-nav a .mi-byn{font:600 10px/1 Mulish,sans-serif;letter-spacing:.04em;border:1.2px solid #B86F33;border-radius:8px;width:30px;height:22px;display:grid;place-items:center}
  .ph-mobile .ph-mobile-nav a.is-soft{font-size:19px!important;font-weight:400!important;color:#9a8271}
  .ph-mobile .ph-mobile-nav a.is-soft .mi{color:#b8a594!important}
  .ph-mobile .ph-mobile-nav a.is-soft .mi svg{width:21px;height:21px}
}
@media(max-width:380px){
  .ph-mobile .ph-mobile-head .ph-m-tel b{font-size:26px!important}
  .ph-mobile .ph-mobile-nav a{font-size:21px!important;padding:12px 0!important}
  .ph-mobile .ph-mobile-nav a.is-soft{font-size:17px!important}
}

/* ===== v5: глубокий коричневый и мягкое золото (меню и кнопка звонка) ===== */
@media(max-width:900px){
  .ph-header .ph-call-mobile{background:linear-gradient(145deg,#4a2f20,#2f1d13)!important;color:#E6CC96!important;box-shadow:0 6px 14px rgba(47,29,19,.28)!important}
  .ph-mobile .ph-mobile-head{background:#faf5ec!important}
  .ph-mobile .ph-mobile-head .ph-m-tel{background:linear-gradient(145deg,#4a2f20,#2f1d13)!important;box-shadow:0 8px 20px rgba(47,29,19,.30)!important;border:1px solid rgba(214,181,115,.35)}
  .ph-mobile .ph-mobile-head .ph-m-tel .ic{background:rgba(214,181,115,.16)!important;color:#E6CC96!important}
  .ph-mobile .ph-mobile-head .ph-m-tel small{color:#D6B573!important}
  .ph-mobile .ph-mobile-head .ph-m-tel b{color:#F3E3BE!important}
  .ph-mobile .ph-mobile-head .ph-m-tel .dot{background:#D6B573}
  .ph-mobile .ph-mobile-head .ph-m-msg a{border-color:rgba(168,134,73,.35)!important;color:#4a2f20!important}
  .ph-mobile .ph-mobile-nav a{color:#2f1d13;border-bottom-color:rgba(168,134,73,.25)!important}
  .ph-mobile .ph-mobile-nav a .mi{color:#A88649!important}
  .ph-mobile .ph-mobile-nav a .mi-byn{border-color:#A88649}
  .ph-mobile .ph-mobile-nav a.is-soft{color:#9a8878}
  .ph-mobile .ph-mobile-nav a.is-soft .mi{color:#bcab8f!important}
  .ph-mobile .ph-mobile-nav a[aria-current="page"] span{text-decoration-color:#C9A66B}
  .ph-mobile-nav a:active{background:rgba(168,134,73,.12)}
  body::before{background:rgba(32,20,13,.5)}
}


/* ===== v6: выпадающее меню «Миссия → О PetHelp» (компьютер) и вложенный пункт (телефон) ===== */
.ph-nav .ph-dd{position:relative;display:flex;align-items:center}
.ph-nav .ph-dd-top{display:inline-flex;align-items:center;gap:6px}
.ph-nav .ph-caret{width:6px;height:6px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(45deg) translateY(-2px);transition:transform .18s}
.ph-nav .ph-dd:hover .ph-caret,.ph-nav .ph-dd:focus-within .ph-caret{transform:rotate(225deg) translateY(-1px)}
.ph-nav .ph-dd-menu{position:absolute;top:100%;left:50%;z-index:1001;min-width:190px;margin-top:6px;padding:8px;display:flex;flex-direction:column;gap:2px;background:#fff;border:1px solid rgba(184,111,51,.25);border-radius:14px;box-shadow:0 18px 40px -16px rgba(43,24,16,.35);opacity:0;visibility:hidden;transform:translate(-50%,6px);transition:opacity .16s ease,transform .16s ease,visibility 0s linear .16s}
.ph-nav .ph-dd-menu::before{content:"";position:absolute;left:0;right:0;top:-12px;height:12px}
.ph-nav .ph-dd:hover .ph-dd-menu,.ph-nav .ph-dd:focus-within .ph-dd-menu{opacity:1;visibility:visible;transform:translate(-50%,0);transition:opacity .16s ease,transform .16s ease}
.ph-nav .ph-dd-menu a{display:block;padding:10px 14px!important;border:0!important;border-radius:9px;font-size:15px!important;font-weight:600!important;color:#2a2420!important;white-space:nowrap}
.ph-nav .ph-dd-menu a:hover,.ph-nav .ph-dd-menu a:focus-visible{background:#fff1e5;color:#ff6a00!important}
.ph-nav .ph-dd-menu a[aria-current="page"]{color:#B86F33!important;background:rgba(184,111,51,.08)}
@media(max-width:1350px){
  .ph-mobile-nav a.is-sub{margin-left:26px;padding-top:9px!important;padding-bottom:9px!important;font-size:15px!important;border-left:1px solid rgba(184,111,51,.28);padding-left:12px!important}
  .ph-mobile-nav a.is-sub .mi{width:28px;height:28px}
}
