/* Czat Gidlanka — samodzielny widget (działa na site-v2 i legacy) */

.chatbot-widget {
  --chat-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --chat-bg: var(--brand-surface, #ffffff);
  --chat-bg-muted: var(--brand-surface-variant, #f8fafc);
  --chat-text: var(--brand-text, #0c1222);
  --chat-muted: var(--brand-muted, #5b6478);
  --chat-border: var(--brand-border-strong, #e2e8f0);
  --chat-primary: var(--brand-blue, #4f46e5);
  --chat-primary-dark: var(--brand-blue-hover, #4338ca);
  --chat-violet: var(--brand-violet, #7c3aed);
  --chat-primary-soft: var(--brand-blue-soft, #eef2ff);
  --chat-radius: var(--brand-radius, 14px);
  --chat-radius-lg: var(--brand-radius-lg, 18px);
  --chat-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
  --chat-header-bg: var(--brand-gradient, linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%));

  position: fixed;
  bottom: 5.5rem;
  right: 1rem;
  z-index: 2000;
  font-family: var(--chat-font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--chat-text);
}

.chatbot-widget *,
.chatbot-widget *::before,
.chatbot-widget *::after {
  box-sizing: border-box;
}

.chatbot-toggle {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: var(--brand-gradient, var(--chat-header-bg));
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.45);
}

.chatbot-panel {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  right: 0;
  width: min(400px, calc(100vw - 2rem));
  max-height: min(72vh, 560px);
  flex-direction: column;
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  border-radius: var(--chat-radius-lg);
  box-shadow: var(--chat-shadow);
  overflow: hidden;
}

.chatbot-panel[hidden] {
  display: none !important;
}

.chatbot-panel:not([hidden]) {
  display: flex;
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--chat-header-bg);
  color: #fff;
  flex-shrink: 0;
}

.chatbot-header-text {
  min-width: 0;
  flex: 1;
}

.chatbot-header-text strong,
.chatbot-header #chatbotTitle {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.3;
}

.chatbot-header-status,
.chatbot-status {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
}

.chatbot-header-status.is-waiting,
.chatbot-status.is-waiting {
  color: #fde68a;
}

.chatbot-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.55);
}

.chatbot-close-icon {
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  margin-top: -2px;
}

.chatbot-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg-muted);
}

.chatbot-system {
  flex-shrink: 0;
  padding: 0.5rem 0.85rem 0;
  font-size: 0.8125rem;
  color: var(--chat-muted);
}

.chatbot-system p {
  margin: 0;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.chatbot-msg {
  max-width: 88%;
  font-size: 0.875rem;
  line-height: 1.45;
}

.chatbot-msg-bubble {
  padding: 0.55rem 0.8rem;
  border-radius: 14px;
}

.chatbot-msg--user {
  align-self: flex-end;
}

.chatbot-msg--user .chatbot-msg-bubble {
  background: var(--chat-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chatbot-msg--bot,
.chatbot-msg--staff {
  align-self: flex-start;
}

.chatbot-msg--bot .chatbot-msg-bubble,
.chatbot-msg--staff .chatbot-msg-bubble {
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  color: var(--chat-text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.chatbot-msg-who {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--chat-primary);
  margin-bottom: 0.25rem;
}

.chatbot-msg a {
  color: inherit;
  text-decoration: underline;
}

.chatbot-msg--typing .chatbot-msg-bubble {
  padding: 0.65rem 0.9rem;
}

.chatbot-typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.chatbot-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chat-muted);
  animation: chatbot-typing 1.2s ease-in-out infinite;
}

.chatbot-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.chatbot-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chatbot-typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.chatbot-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--chat-border);
  padding: 0.75rem 0.85rem 0.95rem;
  background: var(--chat-bg);
}

.chatbot-quick-wrap,
.chatbot-contact-wrap {
  margin-bottom: 0.5rem;
}

.chatbot-quick-wrap summary,
.chatbot-contact-wrap summary {
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--chat-muted);
  padding: 0.15rem 0 0.35rem;
  list-style: none;
  user-select: none;
}

.chatbot-quick-wrap summary::-webkit-details-marker,
.chatbot-contact-wrap summary::-webkit-details-marker {
  display: none;
}

.chatbot-quick-wrap summary::before,
.chatbot-contact-wrap summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 0;
}

.chatbot-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.chatbot-quick button,
.chatbot-quick-btn {
  margin: 0;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--chat-border);
  background: var(--chat-bg-muted);
  color: var(--chat-text);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.chatbot-quick button:hover,
.chatbot-quick-btn:hover {
  border-color: rgba(79, 70, 229, 0.45);
  background: var(--chat-primary-soft);
  color: var(--chat-primary-dark);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
}

.chatbot-live {
  margin: 0.55rem 0 0.65rem;
}

.chatbot-live-btn {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: none;
  border-radius: 12px;
  background: var(--brand-gradient, linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-violet) 100%));
  color: #fff;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.chatbot-live-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.42);
  transform: translateY(-1px);
}

.chatbot-live-btn.is-disabled,
.chatbot-live-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chatbot-new-session {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border-radius: 10px;
  background: var(--chat-bg-muted);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--chat-muted);
}

.chatbot-new-session-btn {
  margin-top: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--chat-border);
  border-radius: 10px;
  background: var(--chat-bg);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.chatbot-contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chatbot-contact-form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--chat-muted);
}

.chatbot-contact-form input {
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--chat-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  background: var(--chat-bg);
  color: var(--chat-text);
}

.chatbot-contact-save {
  padding: 0.45rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: var(--chat-primary);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.chatbot-contact-hint,
.chatbot-contact-saved {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--chat-muted);
}

.chatbot-form {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.chatbot-form label.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chatbot-form input,
.chatbot-form #chatbotInput {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--chat-border) !important;
  border-radius: 12px !important;
  background: var(--chat-bg-muted) !important;
  color: var(--chat-text) !important;
  font-family: inherit !important;
  font-size: 0.875rem !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.chatbot-form input:focus {
  border-color: var(--chat-primary) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
  background: var(--chat-bg) !important;
}

.chatbot-send {
  flex-shrink: 0;
  width: 2.625rem;
  height: 2.625rem;
  border: none;
  border-radius: 12px;
  background: var(--brand-gradient, var(--chat-header-bg));
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.chatbot-send-icon {
  display: block;
  margin-left: 1px;
}

.chatbot-send:hover:not(:disabled) {
  transform: scale(1.04);
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chatbot-footer.is-human-mode .chatbot-quick-wrap {
  display: none;
}

.chatbot-footer.is-closed .chatbot-form,
.chatbot-footer.is-closed .chatbot-live,
.chatbot-footer.is-closed .chatbot-quick-wrap {
  display: none;
}

/* Legacy strona (style.css) — zachowaj kompatybilność banera */
.dish-of-day-banner {
  background: linear-gradient(135deg, var(--color-primary-soft, #eef2ff), var(--color-accent-soft, #eef2ff));
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-lg, 16px);
  padding: 1.25rem 1.5rem;
  margin: 0 auto 2rem;
  max-width: 720px;
  text-align: center;
}

.dish-of-day-banner h2 {
  color: var(--color-text, #0f172a);
}

@media (max-width: 768px) {
  .chatbot-widget {
    bottom: 4.75rem;
    right: 0.75rem;
  }

  .chatbot-panel {
    width: min(380px, calc(100vw - 1.5rem));
    max-height: min(78vh, 560px);
  }
}

.site-v2.has-mobile-bar .chatbot-widget {
  bottom: calc(76px + 1rem);
}

@media (min-width: 961px) {
  .site-v2 .chatbot-widget {
    bottom: 1.5rem;
  }
}
