
/* Restaurant-branded chatbot */
.menu-chatbot {
  position: fixed;
  z-index: 1300;
  inset-inline-end: 22px;
  bottom: 22px;
  font-family: inherit;
  color: var(--menu-text, #172018);
  direction: rtl;
  transition: bottom .25s ease;
}
.menu-chatbot[dir="ltr"] {
  inset-inline-end: auto;
  inset-inline-start: 22px;
  direction: ltr;
}
.menu-chat-toggle {
  width: 58px;
  height: 58px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--menu-text, #172018) 15%, transparent);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--menu-primary, #6d5dfc), var(--menu-secondary, #20c7b8));
  color: #fff;
  box-shadow: 0 10px 28px #0004;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.menu-chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 13px 32px #0005;
}
.menu-chat-toggle [data-chat-toggle-label] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.menu-chat-toggle > [aria-hidden="true"] {
  font-size: 0;
  display: grid;
  place-items: center;
}
.menu-chat-toggle > [aria-hidden="true"]::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='7' width='16' height='13' rx='4'/%3E%3Cpath d='M12 3v4M9 13h.01M15 13h.01M9 17h6M2 12v3M22 12v3'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='7' width='16' height='13' rx='4'/%3E%3Cpath d='M12 3v4M9 13h.01M15 13h.01M9 17h6M2 12v3M22 12v3'/%3E%3C/svg%3E") center/contain no-repeat;
}
.menu-chat-panel {
  display: none;
  position: absolute;
  bottom: 72px;
  inset-inline-end: 0;
  width: min(370px, calc(100vw - 32px));
  height: min(540px, calc(100dvh - 110px));
  box-sizing: border-box;
  background: var(--menu-bg, #fff);
  color: var(--menu-text, #172018);
  border: 1px solid color-mix(in srgb, var(--menu-primary, #6d5dfc) 28%, transparent);
  border-radius: 20px;
  box-shadow: 0 18px 60px #0004;
  overflow: hidden;
  flex-direction: column;
}
.menu-chatbot.is-open .menu-chat-panel {
  display: flex;
}
.menu-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--menu-primary, #6d5dfc), var(--menu-secondary, #20c7b8));
}
.menu-chat-header strong {
  display: block;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.menu-chat-header small {
  display: block;
  opacity: .9;
  margin-top: 3px;
}
.menu-chat-header button {
  flex: 0 0 34px;
  border: 0;
  background: #ffffff24;
  color: #fff;
  border-radius: 9px;
  width: 34px;
  height: 34px;
  font-size: 22px;
  cursor: pointer;
}
.menu-chat-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: color-mix(in srgb, var(--menu-bg, #fff) 92%, var(--menu-primary, #6d5dfc) 8%);
}
.menu-chat-message {
  max-width: 90%;
  padding: 10px 12px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.65;
}
.menu-chat-message.assistant {
  align-self: flex-start;
  background: var(--menu-bg, #fff);
  color: var(--menu-text, #172018);
  border: 1px solid color-mix(in srgb, var(--menu-text, #172018) 13%, transparent);
  border-bottom-inline-start-radius: 4px;
}
.menu-chat-message.user {
  align-self: flex-end;
  background: var(--menu-primary, #6d5dfc);
  color: #fff;
  border-bottom-inline-end-radius: 4px;
}
.menu-chat-message.pending,
.menu-chat-message.error {
  align-self: flex-start;
  color: var(--menu-text, #172018);
  background: var(--menu-bg, #fff);
  border: 1px solid color-mix(in srgb, var(--menu-text, #172018) 13%, transparent);
}
.menu-chat-message.error {
  color: #b42318;
}
.menu-chat-form {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid color-mix(in srgb, var(--menu-text, #172018) 14%, transparent);
  background: var(--menu-bg, #fff);
}
.menu-chat-form input {
  flex: 1;
  min-width: 0;
  width: 0;
  border: 1px solid color-mix(in srgb, var(--menu-text, #172018) 22%, transparent);
  background: var(--menu-bg, #fff);
  color: var(--menu-text, #172018);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  outline: none;
}
.menu-chat-form input:focus {
  border-color: var(--menu-primary, #6d5dfc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--menu-primary, #6d5dfc) 18%, transparent);
}
.menu-chat-form button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  padding: 0 15px;
  background: var(--menu-primary, #6d5dfc);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.menu-chat-form button:disabled {
  opacity: .55;
  cursor: wait;
}
/* Calculated by JS from the visible social banner's real position and size. */
.menu-chatbot.is-above-social {
  bottom: var(--chat-social-clearance, 230px);
}
@media (max-width: 520px) {
  .menu-chatbot {
    inset-inline-end: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .menu-chatbot[dir="ltr"] {
    inset-inline-end: auto;
    inset-inline-start: 12px;
  }
  .menu-chat-toggle {
    width: 54px;
    height: 54px;
    border-radius: 16px;
  }
  .menu-chat-panel {
    position: fixed;
    inset-inline: 10px;
    inset-inline-end: 10px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    width: auto;
    height: min(68dvh, 560px);
    max-height: calc(100dvh - 100px);
    border-radius: 18px;
  }
  .menu-chatbot.is-above-social .menu-chat-panel {
    bottom: calc(var(--chat-social-clearance, 230px) + 62px);
    height: min(58dvh, 480px);
    max-height: calc(100dvh - var(--chat-social-clearance, 230px) - 82px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .menu-chat-panel, .menu-chat-toggle, .menu-chatbot {
    transition: none;
  }
}

/* Shared floating icon alignment */
.menu-chatbot {
  bottom: calc(16px + 64px + 14px + env(safe-area-inset-bottom));
}
.menu-chatbot.is-above-social {
  bottom: calc(var(--chat-social-clearance, 220px) + 64px + 14px);
}
@media (max-width: 520px) {
  .menu-chatbot {
    bottom: calc(16px + 54px + 8px + env(safe-area-inset-bottom));
  }
  .menu-chatbot.is-above-social {
    bottom: calc(var(--chat-social-clearance, 220px) + 54px + 8px);
  }
}
