/* Launcher/hint rules are moved from chat-custom.css. Only the vendor :root spacing/right defaults needed by the pre-mount wrapper are copied from chat.css; base layout is consolidated into the owned wrapper/toggle rules. Bump the shared startup token in footer.twig and chat-custom.css when this file changes. */
:root {
  --chat--spacing: 1rem;
  --chat--window--right: var(--chat--spacing);
}
.n8n-chat {
  --mm-black: #113025;
  --mm-white: #ffffff;

  --mm-radius: 2px;
  --chat--window--z-index: 120001;
  --mm-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --mm-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.12);

  font-family: "Noto Sans", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--mm-black);

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.n8n-chat .chat-window-toggle {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: var(--mm-black) !important;
  color: var(--mm-white) !important;
  border: none;
  box-shadow: var(--mm-shadow-lg);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    opacity 0.2s ease,
    visibility 0.2s ease;
  display: inline-flex;
  flex: none;
  justify-content: center;
  align-items: center;
  margin-left: auto;
}
.n8n-chat .chat-window-toggle:focus {
  transform: scale(1.05);
}
.n8n-chat .chat-window-toggle:hover {
  transform: scale(1.05);
  background: #1a4435 !important;
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.22), 0 6px 14px rgba(0, 0, 0, 0.15);
}
.n8n-chat .chat-window-toggle:active {
  transform: scale(0.98);
}
.n8n-chat .chat-window-toggle svg {
  width: 26px;
  height: 26px;
  transition: transform 0.3s ease;
}
.n8n-chat .mm-chat-bubble {
  position: absolute;
  right: 0;
  bottom: 76px;
  max-width: 320px;

  background: var(--mm-white);
  border: 1px solid rgba(17, 48, 37, 0.10);
  border-radius: 2px;
  box-shadow: var(--mm-shadow-md);

  padding: 14px 16px;
  cursor: pointer;
  user-select: none;

  z-index: 30;
  animation: mmBubbleIn 0.35s ease-out;
}
.n8n-chat .mm-chat-bubble__content {
  padding-right: 30px;
}
.n8n-chat .mm-chat-bubble__icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.n8n-chat .mm-chat-bubble__text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--mm-black);
}
.n8n-chat .mm-chat-bubble__close {
  position: absolute;
  top: 10px;
  right: 10px;

  width: 26px;
  height: 26px;
  border-radius: var(--mm-radius) !important;

  border: 1px solid rgba(17, 48, 37, 0.12);
  background: rgba(249, 248, 245, 0.98);
  color: rgba(17, 48, 37, 0.75);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 18px;
  line-height: 1;

  cursor: pointer;
}
.n8n-chat .mm-chat-bubble__close:hover {
  background: rgba(249, 248, 245, 1);
  color: rgba(17, 48, 37, 0.9);
}
@keyframes mmBubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 480px) {

.n8n-chat .mm-chat-bubble {
  position: absolute;
  right: 0;
  bottom: 76px;
  max-width: 320px;

  background: var(--mm-white);
  border: 1px solid rgba(17, 48, 37, 0.10);
  border-radius: var(--mm-radius) !important;

  box-shadow: var(--mm-shadow-md);

  padding: 14px 16px;
  cursor: pointer;
  user-select: none;

  z-index: 5;
}

  .n8n-chat .mm-chat-bubble__text {
    font-size: 13px;
  }

  #n8n-chat .mm-chat-bubble__text {
    white-space: normal !important;
  }
}
@media (max-width: 320px) {

  .n8n-chat .mm-chat-bubble {
    max-width: 230px;
  }

  .n8n-chat .mm-chat-bubble__text {
    font-size: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .n8n-chat *,
  .n8n-chat *::before,
  .n8n-chat *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.n8n-chat .chat-window-toggle {
  position: relative;
  z-index: 10;
  display: inline-flex;
  flex: none;
  justify-content: center;
  align-items: center;
  margin-left: auto;
}
.n8n-chat .chat-window-toggle:focus {
  transform: scale(1.05);
}
#n8n-chat .mm-chat-bubble {
  border-radius: 2px !important;
  overflow: hidden !important;
  max-width: none !important;
  width: auto !important;
}
.n8n-chat {
  --chat--window--bottom: 20px;
}
@media (max-width: 600px), (max-height: 600px) and (hover: none) and (pointer: coarse) {
  .n8n-chat {
    --chat--window--bottom: max(8px, env(safe-area-inset-bottom, 0px));
    --chat--window--right: max(8px, env(safe-area-inset-right, 0px));
  }
}
#n8n-chat .mm-chat-bubble__content {
  display: flex !important;
  align-items: center !important;
  padding-right: 30px !important;
}
#n8n-chat .mm-chat-bubble__text {
  white-space: nowrap !important;
}
#n8n-chat .mm-chat-bubble__close {
  border-radius: 2px !important;
  top: 10px !important;
  right: 10px !important;
}
body.no-scroll,      /* mobile menu, drawers, desktop catalog menu */
body.modal-open {
  --mm-chat-launcher-opacity: 0;
  --mm-chat-launcher-visibility: hidden;
  --mm-chat-launcher-events: none;
}
body:has(#overlay.active),                    /* shared storefront backdrop */
body:has(.ds-header-search.active),           /* mobile search overlay */
body:has(.ds-ff-dropdown.ocf-open),           /* category filter bottom sheet */
body:has(.ocf-container.ocf-mobile-active) {
  --mm-chat-launcher-opacity: 0;
  --mm-chat-launcher-visibility: hidden;
  --mm-chat-launcher-events: none;
}
.n8n-chat .chat-window-toggle,
.n8n-chat .mm-chat-bubble {
  opacity: var(--mm-chat-launcher-opacity, 1);
  visibility: var(--mm-chat-launcher-visibility, visible);
  pointer-events: var(--mm-chat-launcher-events, auto);
}
:where(.n8n-chat).chat-window-wrapper {
  display: flex;
  flex-direction: column;
  max-height: calc(100% - var(--chat--window--bottom, var(--chat--spacing)) * 2);
  max-width: calc(100% - var(--chat--window--right, var(--chat--spacing)) * 2);
  z-index: var(--chat--window--z-index);
  right: var(--chat--window--right);
  position: fixed;
  bottom: calc(var(--chat--window--bottom, 1rem) + var(--mm-chat-viewport-gap, 0px));
}
