/**
 * Мобильная плашка связи (+ legacy div.fab из старого кэша 10Web).
 * Подключается на всех страницах в <head>.
 */

@media (min-width: 769px) {
  #st-mobile-contact,
  div.fab {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }
}

@media (max-width: 768px) {
  #st-mobile-contact,
  div.fab {
    display: block !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    pointer-events: none;
    box-sizing: border-box;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  #st-mobile-contact .st-mobile-contact__panel,
  div.fab .fab__panel {
    pointer-events: auto;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 0.625rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 4, 34, 0.16);
    border: 1px solid #e5e7ef;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.5rem;
    box-sizing: border-box;
  }

  #st-mobile-contact .st-mobile-contact__phone,
  div.fab .fab__phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 0 0 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 4px;
    background: #e65644;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.125rem;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    text-decoration: none;
    box-sizing: border-box;
  }

  #st-mobile-contact .st-mobile-contact__phone:hover,
  div.fab .fab__phone:hover {
    background: #d14a3a;
  }

  #st-mobile-contact .st-mobile-contact__phone span,
  div.fab .fab__phone span {
    display: none !important;
  }

  #st-mobile-contact .st-mobile-contact__messengers,
  div.fab .fab__messengers {
    display: flex;
    flex: 1;
    min-width: 0;
    align-items: stretch;
    justify-content: center;
    gap: 0.5rem;
  }

  #st-mobile-contact .st-mobile-contact__messenger,
  div.fab .fab__messenger {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 48px;
    padding: 0.375rem;
    border: 1px solid #e5e7ef;
    border-radius: 4px;
    background: #f8f9fc;
    text-decoration: none;
    box-sizing: border-box;
  }

  #st-mobile-contact .st-mobile-contact__messenger img,
  div.fab .fab__messenger img {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: contain;
  }

  body.has-mobile-contact,
  body:has(#st-mobile-contact),
  body:has(div.fab) {
    padding-bottom: 5.5rem;
  }

  body.has-mobile-contact .scroll-top,
  body:has(#st-mobile-contact) .scroll-top,
  body:has(div.fab) .scroll-top {
    bottom: 5.25rem;
  }
}
