/* Shared fixed bottom contact bar */
body.has-bottom-contact-bar {
  padding-bottom: 64px;
}

.bottom-contact-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  display: flex;
  justify-content: center;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: rgba(16, 21, 40, 0.78);
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px);
}

.bottom-contact-btn-wrap {
  position: relative;
}

.bottom-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 12px);
  background: rgba(7, 11, 31, 0.68);
  color: var(--text-main, #f5f7ff);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--transition-fast, 0.2s ease-out), border-color var(--transition-fast, 0.2s ease-out), transform var(--transition-fast, 0.2s ease-out);
}

.bottom-contact-btn:hover,
.bottom-contact-btn:focus-visible {
  background: rgba(79, 140, 255, 0.12);
  border-color: var(--accent-soft, rgba(79, 140, 255, 0.2));
  outline: none;
}

.bottom-contact-btn:active {
  transform: translateY(1px);
}

.bottom-contact-btn .btn-icon,
.bottom-contact-btn .btn-arrow {
  flex-shrink: 0;
  line-height: 1;
}

.bottom-contact-btn .btn-arrow {
  font-size: 0.78rem;
  opacity: 0.68;
  transition: transform var(--transition-fast, 0.2s ease-out);
}

.bottom-contact-btn[aria-expanded="true"] .btn-arrow {
  transform: rotate(180deg);
}

.contact-dropdown {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  z-index: 91;
  min-width: 174px;
  padding: 6px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 12px);
  background: rgba(16, 21, 40, 0.98);
  box-shadow: var(--shadow-soft, 0 18px 45px rgba(0, 0, 0, 0.65));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px);
  transition: opacity var(--transition-fast, 0.2s ease-out), transform var(--transition-fast, 0.2s ease-out), visibility var(--transition-fast, 0.2s ease-out);
}

.contact-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.contact-dropdown a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--text-main, #f5f7ff);
  font-size: 0.9rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background var(--transition-fast, 0.2s ease-out), color var(--transition-fast, 0.2s ease-out);
}

.contact-dropdown a:hover,
.contact-dropdown a:focus-visible {
  background: rgba(79, 140, 255, 0.12);
  color: #fff;
  outline: none;
}

.contact-dropdown .menu-icon {
  width: 1.2em;
  flex-shrink: 0;
  text-align: center;
  line-height: 1;
  opacity: 0.9;
}

body.has-bottom-contact-bar .contact-toast {
  bottom: 76px;
}

body.has-bottom-contact-bar .to-top,
body.has-bottom-contact-bar .to-back {
  bottom: 74px;
}

html[data-theme="light"] .bottom-contact-bar {
  background: rgba(255, 255, 255, 0.76);
  border-top-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .bottom-contact-btn,
html[data-theme="light"] .contact-dropdown {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .bottom-contact-btn:hover,
html[data-theme="light"] .bottom-contact-btn:focus-visible,
html[data-theme="light"] .contact-dropdown a:hover,
html[data-theme="light"] .contact-dropdown a:focus-visible {
  background: rgba(37, 99, 235, 0.08);
  color: #0f172a;
}

@media (max-width: 768px) {
  body.has-bottom-contact-bar {
    padding-bottom: 68px;
  }

  .bottom-contact-bar {
    justify-content: center;
    padding-right: 14px;
    padding-left: 14px;
  }

  .bottom-contact-btn-wrap {
    display: flex;
    justify-content: center;
  }

  .bottom-contact-btn {
    min-height: 40px;
    padding: 8px 16px;
    font-size: 0.92rem;
  }

  .contact-dropdown {
    left: 50%;
    right: auto;
    min-width: min(220px, calc(100vw - 28px));
    transform: translateX(-50%) translateY(6px);
  }

  .contact-dropdown.is-open {
    transform: translateX(-50%) translateY(0);
  }
}

@media print {
  body.has-bottom-contact-bar {
    padding-bottom: 0 !important;
  }

  .bottom-contact-bar {
    display: none !important;
  }
}
