/* === Floating UI: кнопка «FAQ» + модалка === */

:root {
  /* Prefer existing contact button tokens if present */
  --ec-faq-right: var(--ec-contact-right, 40px);
  --ec-faq-size: var(--ec-contact-size, 44px);
  --ec-faq-gap: var(--ec-contact-gap, 12px);

  /* Fallback if JS doesn't sync with scroll-top */
  --ec-faq-bottom: 152px;
}

/* Floating FAQ button */
#ec-faq-link {
  opacity: 0.75;
  position: fixed;
  right: var(--ec-faq-right);
  bottom: var(--ec-faq-bottom);
  z-index: 9999;
  cursor: pointer;

  width: var(--ec-faq-size);
  height: var(--ec-faq-size);
  line-height: var(--ec-faq-size);

  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;

  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  border-radius: 4px;

  /* Fallback visuals (JS will copy from Enfold scroll-top when available) */
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
}

#ec-faq-link:hover { opacity: 1; }

#ec-faq-link .ec-faq-link-icon {
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}

/* Modal root */
#ec-faq-modal[aria-hidden="true"] { display: none; }

#ec-faq-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
}

.ec-faq-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}

.ec-faq-modal__window {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: min(420px, calc(100vw - 36px));
  max-height: min(75vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  padding: 14px 14px 12px;
  box-sizing: border-box;
}

.ec-faq-modal__close {
  position: absolute;
  top: 6px;
  right: 8px;
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 4px 6px;
}

.ec-faq-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ec-faq-modal__title {
  font-weight: 800;
  font-size: 14px;
  margin: 0;
  padding-right: 22px;
}

.ec-faq-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
}

.ec-faq-tab {
  appearance: none;
  border: 1px solid rgba(0,0,0,.15);
  background: rgba(0,0,0,.03);
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.ec-faq-tab.is-active {
  background: rgba(0,0,0,.08);
}

.ec-faq-accordion { margin: 0; padding: 0; }

.ec-faq-item {
  border-top: 1px solid rgba(0,0,0,.08);
  padding-top: 2px;
}
.ec-faq-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.ec-faq-q {
  width: 100%;
  text-align: left;
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 10px 2px;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* UX: make questions obviously clickable */
#ec-faq-modal .ec-faq-q {
  cursor: pointer !important;
}

#ec-faq-modal .ec-faq-q:hover,
#ec-faq-modal .ec-faq-q:focus-visible {
  text-decoration: underline;
}

.ec-faq-a {
  padding: 0 2px 10px;
  font-size: 13px;
  line-height: 1.45;
}

.ec-faq-more {
  padding: 0 2px 10px;
  margin-top: -6px;
}

.ec-faq-more a {
  font-weight: 700;
  font-size: 13px;
  text-decoration: underline;
}

.ec-faq-panel__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  justify-content: flex-end;
  margin-top: 10px;
}

.ec-faq-panel__more {
  font-weight: 800;
  font-size: 13px;
  text-decoration: underline;
}

body.ec-faq-modal-open { overflow: hidden; }

