/**
 * @file
 * Floating actions: Chatbase chatbot + back to top.
 */

.mc-floating-actions {
  --mc-chatbot-icon-size: 6.875rem;
  --mc-back-to-top-size: 2.75rem;
  --mc-floating-actions-gap: 0.75rem;
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1060;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--mc-floating-actions-gap);
}

.mc-chatbot {
  position: relative;
}

.mc-chatbot__toggle {
  display: block;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.mc-chatbot__toggle:hover,
.mc-chatbot__toggle:focus {
  transform: scale(1.03);
}

.mc-chatbot__toggle-icon {
  width: var(--mc-chatbot-icon-size);
  height: var(--mc-chatbot-icon-size);
  background: url("/themes/custom/i2_theme/images/chatbot-circle-bg.png") no-repeat center / contain;
  display: flex;
  justify-content: center;
}

.mc-chatbot__toggle-gif {
  display: block;
  width: 90px;
  height: fit-content;
  margin: -25px;
}

.mc-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: calc(var(--mc-chatbot-icon-size) + var(--mc-floating-actions-gap));
  width: min(420px, calc(100vw - 2.5rem));
  max-height: calc(100vh - var(--mc-chatbot-icon-size) - var(--mc-back-to-top-size) - 4rem);
  overflow: hidden;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
}

.mc-chatbot__panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--i2-color-border, #d8dee8);
  background: #fff;
}

.mc-chatbot__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--mc-green, #007440);
}

.mc-chatbot__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #64748b;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.mc-chatbot__close:hover,
.mc-chatbot__close:focus {
  background: rgba(0, 116, 64, 0.08);
  color: var(--mc-green, #007440);
}

.mc-chatbot__iframe-wrap {
  height: min(700px, calc(100vh - 10rem));
  min-height: 420px;
}

.mc-chatbot__iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 700px;
  border: 0;
}

.mc-back-to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--mc-back-to-top-size);
  height: var(--mc-back-to-top-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e8f5ef;
  box-shadow: 0 4px 12px rgba(0, 116, 64, 0.12);
  color: var(--mc-green, #007440);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.mc-back-to-top:hover,
.mc-back-to-top:focus {
  transform: scale(1.05);
  background: #d9efe4;
}

.mc-back-to-top[hidden] {
  display: none;
}

.mc-back-to-top__icon {
  width: 1.25rem;
  height: 1.25rem;
}

@media (max-width: 767.98px) {
  .mc-floating-actions {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .mc-chatbot__panel {
    position: fixed;
    inset: 0.75rem;
    width: auto;
    max-height: none;
    bottom: 0.75rem;
  }

  .mc-chatbot__iframe-wrap {
    height: calc(100% - 3.25rem);
    min-height: 0;
  }

  .mc-chatbot__iframe {
    min-height: 100%;
  }
}
