/* Batutynas.lt AI Chat Widget — Production */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

:root {
  --chat-primary: #6C3CE1;
  --chat-primary-hover: #5A2DC7;
  --chat-gradient: linear-gradient(135deg, #6C3CE1, #8B5CF6);
  --chat-gradient-dark: linear-gradient(135deg, #4C1D95, #6C3CE1);
  --chat-bg: #ffffff;
  --chat-messages-bg: #f8f6fd;
  --chat-msg-customer: #EDE5FF;
  --chat-msg-agent: #f4f5f7;
  --chat-text: #1a1a2e;
  --chat-text-light: #596578;
  --chat-border: #e8eaef;
  --chat-shadow: 0 8px 40px rgba(20, 20, 40, 0.18);
  --chat-radius: 18px;
  --chat-width: 390px;
  --chat-height: 560px;
}

#woo-ai-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2147483646;
  isolation: isolate;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--chat-text);
}

/* Toggle Button */
.woo-chat-toggle {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--chat-gradient);
  border: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(108, 60, 225, 0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
}

.woo-chat-toggle::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--chat-gradient);
  opacity: 0.3;
  animation: woo-pulseRing 2.5s ease-in-out infinite;
  z-index: -1;
}

.woo-chat-toggle.open::before {
  display: none;
}

@keyframes woo-pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.15); opacity: 0; }
}

.woo-chat-toggle:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 28px rgba(108, 60, 225, 0.5);
}

.woo-chat-toggle svg {
  width: 26px;
  height: 26px;
  fill: white;
}

.woo-chat-toggle .chat-close-icon {
  display: none;
}

.woo-chat-toggle.open .chat-open-icon {
  display: none;
}

.woo-chat-toggle.open .chat-close-icon {
  display: block;
}

/* Notification badge — only shown when .has-unread is set */
.woo-chat-toggle::after {
  content: '1';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e94560;
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(233, 69, 96, 0.4);
  animation: woo-notifPulse 2s ease-in-out infinite;
}

.woo-chat-toggle.has-unread::after {
  display: flex;
}

.woo-chat-toggle.open::after {
  display: none;
}

@keyframes woo-notifPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Chat Window */
.woo-chat-window {
  display: none;
  position: absolute;
  bottom: 74px;
  right: 0;
  width: var(--chat-width);
  height: var(--chat-height);
  background: var(--chat-bg);
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.woo-chat-window.open {
  display: flex;
}

.woo-chat-window.woo-animate-in {
  animation: woo-chatIn 0.4s cubic-bezier(0.34, 1.8, 0.64, 1);
}

@keyframes woo-chatIn {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.woo-chat-window.woo-animate-out {
  animation: woo-chatOut 0.2s ease forwards;
}

@keyframes woo-chatOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(12px) scale(0.95); }
}

/* Header */
.woo-chat-header {
  background: var(--chat-gradient-dark);
  color: white;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.woo-chat-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 14px 14px;
  pointer-events: none;
}

.woo-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.woo-chat-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.woo-chat-header-text h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.woo-chat-header-text p {
  margin: 0;
  font-size: 11px;
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 5px;
}

.online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}

.woo-chat-lang-select {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 11px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  font-weight: 500;
}

.woo-chat-lang-select:hover {
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.woo-chat-lang-select option {
  color: #333;
  background: white;
}

/* Messages Area */
.woo-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--chat-messages-bg);
}

.woo-chat-messages::-webkit-scrollbar {
  width: 3px;
}

.woo-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.woo-chat-messages::-webkit-scrollbar-thumb {
  background: #d0d4db;
  border-radius: 3px;
}

/* Message Bubbles */
.woo-chat-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  word-wrap: break-word;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.55;
  animation: woo-msgIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes woo-msgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.woo-chat-msg.agent {
  background: white;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(108, 60, 225, 0.1);
  border: 1px solid #e8e0f0;
}

.woo-chat-msg.customer {
  background: var(--chat-gradient);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.woo-chat-msg.customer a {
  color: #c4b5fd;
}

.woo-chat-msg.system {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  align-self: center;
  text-align: center;
  font-size: 12px;
  color: #9a3412;
  border-radius: 8px;
  max-width: 90%;
}

.woo-chat-retry {
  display: inline-block;
  margin-top: 6px;
  padding: 5px 14px;
  background: #c2410c;
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.woo-chat-retry:hover {
  background: #9a3412;
}

.woo-chat-msg.html-content {
  white-space: normal;
  max-width: 92%;
}

/* Timestamp Separator */
.woo-chat-time {
  align-self: center;
  font-size: 10px;
  color: #4a4560;
  padding: 4px 0;
  user-select: none;
}

/* Typing Indicator */
.woo-chat-typing {
  display: none;
  align-self: flex-start;
  padding: 12px 16px;
  background: white;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.woo-chat-typing.visible {
  display: flex;
  gap: 5px;
  align-items: center;
}

.woo-chat-typing span {
  width: 7px;
  height: 7px;
  background: #a78bfa;
  border-radius: 50%;
  animation: woo-chat-bounce 1.4s infinite;
}

.woo-chat-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.woo-chat-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes woo-chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30% { transform: translateY(-8px); opacity: 1; }
}

/* Input Area */
.woo-chat-input-area {
  padding: 14px;
  border-top: 1px solid var(--chat-border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
  background: white;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}

.woo-chat-input {
  flex: 1;
  border: 1px solid var(--chat-border);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  resize: none;
  max-height: 80px;
  min-height: 40px;
  line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f8f9fb;
}

.woo-chat-input:focus {
  border-color: var(--chat-primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(108, 60, 225, 0.1);
}

.woo-chat-input::placeholder {
  color: #7a7590;
}

.woo-chat-send {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: var(--chat-gradient);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.woo-chat-send:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(108, 60, 225, 0.3);
}

.woo-chat-send:disabled {
  background: #d0d4db;
  cursor: not-allowed;
  transform: none;
}

.woo-chat-send svg {
  width: 16px;
  height: 16px;
  fill: white;
}

/* Escalation Button */
.woo-chat-escalate {
  display: block;
  width: 100%;
  padding: 10px;
  background: white;
  border: none;
  border-top: 1px solid var(--chat-border);
  color: var(--chat-text-light);
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-family: inherit;
  font-weight: 500;
}

.woo-chat-escalate:hover {
  background: #fff7ed;
  color: #c2410c;
}

/* --- Welcome Screen --- */
.woo-chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  gap: 0;
}
.welcome-hero {
  width: 100%;
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 50%, #c4b5fd 100%);
  border-radius: 0 0 24px 24px;
  padding: 32px 20px 24px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}
.welcome-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}
.welcome-emoji-row {
  font-size: 32px;
  letter-spacing: 10px;
  margin-bottom: 12px;
  animation: woo-float 3s ease-in-out infinite;
  position: relative;
}
@keyframes woo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.welcome-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
  color: white;
  letter-spacing: -0.3px;
}
.welcome-subtitle {
  font-size: 13px;
  opacity: 0.9;
  color: rgba(255,255,255,0.9);
}
.welcome-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 16px 16px 0;
}
.welcome-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f5f0ff;
  color: #7c3aed;
  font-weight: 700;
  border: 1px solid #e9e0ff;
}
.welcome-divider {
  font-size: 13px;
  color: #8b95a5;
  padding: 14px 0 8px;
  text-align: center;
  width: 100%;
}
.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 16px;
  width: 100%;
}
.welcome-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  color: white;
  text-align: left;
}
.welcome-action-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.welcome-action-btn:active {
  transform: translateY(0) scale(0.98);
}
.welcome-action-btn.wa-birthday {
  background: linear-gradient(135deg, #f472b6, #ec4899);
}
.welcome-action-btn.wa-event {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
}
.welcome-action-btn.wa-buy {
  background: linear-gradient(135deg, #34d399, #10b981);
}
.welcome-action-btn.wa-party {
  background: linear-gradient(135deg, #fb923c, #f97316);
}
.welcome-action-btn.wa-info {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
}
.welcome-action-emoji {
  font-size: 22px;
  flex-shrink: 0;
}

/* Quick Prompt Buttons */
.woo-chat-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.woo-chat-quick-btn {
  background: white;
  border: 1px solid var(--chat-border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--chat-text);
  font-family: inherit;
}

.woo-chat-quick-btn:hover {
  border-color: var(--chat-primary);
  color: var(--chat-primary);
  background: #f5f0ff;
}

/* Option Buttons (interactive HTML from n8n) */
.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chat-option-btn {
  background: #f5f0ff;
  border: 1px solid #d8ccf5;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--chat-primary);
  font-family: inherit;
}

.chat-option-btn:hover {
  background: var(--chat-primary);
  color: white;
  border-color: var(--chat-primary);
}

.chat-option-btn:hover:not([disabled]) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 60, 225, 0.18);
}

.chat-option-btn.selected {
  background: var(--chat-primary);
  color: white;
  border-color: var(--chat-primary);
}

.chat-option-btn:disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.chat-option-btn:disabled.selected {
  opacity: 1;
}

/* Date Input (interactive HTML) */
.chat-date-input {
  box-sizing: border-box;
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid #d8ccf5;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--chat-text);
  background: white;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.chat-date-input:focus {
  border-color: var(--chat-primary);
}

.chat-date-input:hover:not(:disabled) {
  border-color: var(--chat-primary);
}

/* Markdown-like formatting in messages */
.woo-chat-msg strong {
  font-weight: 600;
}

.woo-chat-msg a {
  color: var(--chat-primary);
  text-decoration: underline;
}

/* Trampoline Catalog Grid */
.chat-products > p {
  margin: 0 0 4px 0;
  font-size: 13px;
  line-height: 1.55;
}

/* === Trampoline Card Grid === */
.chat-trampoline-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* Compact 2-col grid for "others" section */
.chat-trampoline-grid.t-grid-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* === Card Base === */
.chat-trampoline-select {
  background: white;
  border: 2px solid var(--chat-border);
  border-radius: 16px;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: left;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Popular choice badge */
.chat-popular-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
  z-index: 3;
  letter-spacing: 0.3px;
}

.chat-trampoline-select:hover {
  border-color: var(--chat-primary);
  box-shadow: 0 6px 20px rgba(108, 60, 225, 0.18);
  transform: translateY(-3px);
}

.chat-trampoline-select:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(108, 60, 225, 0.2);
}

.chat-trampoline-select.selected {
  border-color: var(--chat-primary);
  background: #faf5ff;
  box-shadow: 0 2px 12px rgba(108, 60, 225, 0.25);
  transform: scale(1.02);
}

.chat-trampoline-select.selected::after {
  content: '\2713';
  position: absolute;
  top: 6px; left: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--chat-primary);
  color: white;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  z-index: 4;
}

.chat-trampoline-select[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.chat-trampoline-select[disabled].selected {
  opacity: 1;
}

/* === Featured card image (full-width, large) === */
.chat-trampoline-thumb {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, #f8f9fb 0%, #eef0f4 100%);
  position: relative;
  overflow: hidden;
}

.chat-trampoline-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.chat-trampoline-select:hover .chat-trampoline-thumb img {
  transform: scale(1.03);
}

/* Note: img::after removed — pseudo-elements don't work on replaced elements (img) */

/* === Card Info Section === */
.chat-trampoline-info {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.t-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--chat-text);
  line-height: 1.3;
}

.t-meta {
  font-size: 12px;
  color: var(--chat-text-light);
  margin-top: 1px;
  line-height: 1.4;
}

.t-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--chat-primary);
  margin-top: 3px;
}

/* === Detail Expand === */
.t-detail-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--chat-text-light);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 3;
  line-height: 1;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.t-detail-btn:hover {
  background: var(--chat-primary);
  color: white;
  transform: scale(1.1);
}

.t-detail {
  display: none;
  font-size: 11px;
  color: var(--chat-text-light);
  line-height: 1.6;
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fafbfc;
}

.t-detail.open {
  display: block;
}

/* Auto-show details on recommended cards */
.chat-trampoline-select.t-recommended .t-detail {
  display: block;
}

/* Compact grid card overrides — smaller for "others" section */
.t-grid-compact .chat-trampoline-thumb {
  height: 90px;
  font-size: 36px;
}

.t-grid-compact .chat-trampoline-info {
  padding: 6px 8px 8px;
}

.t-grid-compact .t-name {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.t-grid-compact .t-meta {
  font-size: 10px;
}

.t-grid-compact .t-price {
  font-size: 11px;
}

.t-grid-compact .t-detail {
  font-size: 10px;
  padding: 5px 8px 6px;
}

.t-grid-compact .t-detail-btn {
  width: 44px;
  height: 44px;
  font-size: 11px;
  top: 0;
  left: 0;
}

.t-grid-compact .chat-popular-badge {
  font-size: 9px;
  padding: 2px 7px;
  top: 6px;
  right: 6px;
}

/* Image zoom overlay */
.t-zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: t-zoom-in 0.2s ease;
  backdrop-filter: blur(4px);
}

@keyframes t-zoom-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.t-zoom-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.t-zoom-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 20px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.t-zoom-close:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}

.t-zoom-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  text-align: center;
}

/* Addon Multi-Select */
.chat-trampoline-select[data-chat-addon] {
  transition: all 0.2s;
}

.chat-trampoline-select[data-chat-addon].addon-selected {
  border-color: var(--chat-primary);
  box-shadow: 0 0 0 2px rgba(108, 60, 225, 0.2);
}

.chat-trampoline-select[data-chat-addon].addon-selected::after {
  content: '✓';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--chat-primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.chat-addon-continue {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px 20px;
  background: var(--chat-primary);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.chat-addon-continue:hover {
  background: var(--chat-primary-hover);
}

.chat-addon-continue:disabled {
  background: #d0d4db;
  cursor: default;
}

.chat-addon-continue.shake {
  animation: shake-hint 0.4s ease;
  background: #ef4444;
}

@keyframes shake-hint {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* Booking Progress Bar */
.booking-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}

.booking-progress .bp-step {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: var(--chat-border);
  transition: background 0.3s;
}

.booking-progress .bp-step.done {
  background: var(--chat-primary);
}

.booking-progress .bp-step.current {
  background: var(--chat-primary);
  opacity: 0.5;
}

/* Booking Confirmation Card */
.booking-confirm {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
}

.booking-confirm h4 {
  margin: 0 0 6px 0;
  font-size: 13px;
  font-weight: 700;
  color: #166534;
}

.booking-confirm p {
  margin: 2px 0;
  font-size: 12px;
  color: #15803d;
  line-height: 1.5;
}

/* Main Menu (5 use-case groups) */
.chat-main-menu {
  margin-top: 10px;
}

.chat-menu-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-menu-btn {
  text-align: left;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
}

/* Email Input Form (purchase catalog flow) */
.chat-email-form {
  margin-top: 10px;
  padding: 12px;
  background: #fafbfc;
  border: 1px solid var(--chat-border);
  border-radius: 10px;
}

/* Shared input styles (email / address / custom) */
.chat-email-input,
.chat-address-input,
.chat-custom-input,
.chat-custom-textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d8ccf5;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--chat-text);
  background: white;
  outline: none;
  transition: border-color 0.2s;
}

.chat-email-input:focus,
.chat-address-input:focus,
.chat-custom-input:focus,
.chat-custom-textarea:focus {
  border-color: var(--chat-primary);
}

/* Textarea-specific overrides */
.chat-custom-textarea {
  resize: vertical;
  min-height: 60px;
}

/* Shared confirm button styles (date / email / address) */
.chat-date-confirm,
.chat-email-confirm,
.chat-address-confirm {
  margin-top: 6px;
  padding: 8px 18px;
  background: var(--chat-primary);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.chat-date-confirm:hover,
.chat-email-confirm:hover,
.chat-address-confirm:hover {
  background: var(--chat-primary-hover);
}

.chat-date-confirm:disabled,
.chat-email-confirm:disabled,
.chat-address-confirm:disabled {
  background: #d0d4db;
  cursor: default;
}

/* email-confirm / address-confirm individual margin override */
.chat-email-confirm,
.chat-address-confirm {
  margin-top: 8px;
}

.chat-address-hint {
  font-size: 11px;
  color: #4a4560;
  margin-top: 4px;
  padding-left: 2px;
}

/* Address Input Form (location step) */
.chat-address-form {
  margin-top: 10px;
  padding: 12px;
  background: #fafbfc;
  border: 1px solid var(--chat-border);
  border-radius: 10px;
}

/* Custom Manufacturing Form (purchase flow) */
.chat-custom-form {
  margin-top: 10px;
  padding: 12px;
  background: #fafbfc;
  border: 1px solid var(--chat-border);
  border-radius: 10px;
}

.chat-custom-submit {
  margin-top: 10px;
  padding: 10px 20px;
  background: var(--chat-primary);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  transition: background 0.2s;
}

.chat-custom-submit:hover {
  background: var(--chat-primary-hover);
}

.chat-custom-submit:disabled {
  background: #d0d4db;
  cursor: default;
}

/* FR-5.7: Focus Visible Styles */
.woo-chat-toggle:focus-visible,
.woo-chat-send:focus-visible,
.woo-chat-quick-btn:focus-visible,
.chat-option-btn:focus-visible,
.chat-date-confirm:focus-visible,
.woo-chat-escalate:focus-visible,
.chat-addon-continue:focus-visible,
.woo-chat-lang-select:focus-visible,
.chat-email-confirm:focus-visible,
.chat-address-confirm:focus-visible,
.chat-custom-submit:focus-visible,
.chat-trampoline-select:focus-visible,
.welcome-action-btn:focus-visible {
  outline: 2px solid var(--chat-primary);
  outline-offset: 2px;
}

.woo-chat-input:focus-visible,
.chat-date-input:focus-visible,
.chat-email-input:focus-visible,
.chat-address-input:focus-visible,
.chat-custom-input:focus-visible,
.chat-custom-textarea:focus-visible {
  outline: 2px solid var(--chat-primary);
  outline-offset: 1px;
}

/* FR-6.2: Enricher CSS classes (replacing inline styles) */
.chat-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--chat-primary);
  margin-bottom: 10px;
  padding: 6px 10px;
  background: linear-gradient(90deg, #f5f0ff 0%, transparent 100%);
  border-left: 3px solid var(--chat-primary);
  border-radius: 0 8px 8px 0;
}

.chat-section-subtitle {
  font-size: 13px;
  color: #433e55;
  margin: 16px 0 8px;
  padding: 4px 10px;
  border-left: 2px solid #ddd;
  font-weight: 500;
}

.chat-birthday-cta {
  margin: 12px 0;
  padding: 10px 14px;
  background: #fff8e1;
  border-radius: 10px;
  border: 1px solid #ffe082;
  font-size: 13px;
}

.chat-cta-btn {
  margin-top: 8px;
  font-size: 13px;
  padding: 6px 14px;
  background: var(--chat-primary);
  color: #fff;
  border: none;
  border-radius: 16px;
  cursor: pointer;
}

.chat-cta-btn:hover {
  background: var(--chat-primary-hover);
}

.chat-form-text {
  font-size: 13px;
  margin-bottom: 8px;
}

.chat-form-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.chat-form-label {
  font-size: 12px;
  color: #555;
  display: block;
  margin: 8px 0 4px;
}

.chat-form-label:first-child {
  margin-top: 0;
}

.chat-quick-replies {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chat-quick-reply-menu {
  font-size: 13px;
  padding: 6px 14px;
  background: transparent;
  color: #534d66;
  border: 1px solid #ddd;
  border-radius: 16px;
  cursor: pointer;
}

.chat-quick-reply-menu:hover {
  background: #f5f5f5;
}

/* Trampoline card category backgrounds */
.t-bg-big-park { background-color: #f0f9ff; }
.t-bg-mega-trampoline { background-color: #ede7f6; }
.t-bg-standard-trampoline { background-color: #fdf0ff; }
.t-bg-addon { background-color: #fffff0; }
.t-bg-party-equipment { background-color: #f5f0ff; }

.chat-trampoline-select.t-recommended {
  border-color: var(--chat-primary);
  box-shadow: 0 4px 16px rgba(108, 60, 225, 0.2);
  background: linear-gradient(180deg, #fff 0%, #f5f0ff 100%);
}

.chat-trampoline-select.t-recommended .t-name {
  color: var(--chat-primary);
}

/* FR-6.1: Out-of-hours booking qualifier */
.booking-confirm-hours {
  font-size: 11px;
  color: #92400e;
  margin-top: 6px;
  font-style: italic;
}

/* FR-6.3: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .woo-chat-window.woo-animate-in,
  .woo-chat-window.woo-animate-out {
    animation: none;
  }

  .woo-chat-msg {
    animation: none;
  }

  .woo-chat-toggle {
    transition: none;
  }

  .woo-chat-toggle:hover {
    transform: none;
  }

  .woo-chat-toggle::before {
    animation: none;
  }

  .woo-chat-send:hover {
    transform: none;
  }

  .woo-chat-typing span {
    animation: none;
    opacity: 0.6;
  }

  .woo-chat-toggle::after {
    animation: none;
  }

  .woo-chat-welcome .welcome-emoji-row,
  .woo-chat-welcome .welcome-action-btn {
    transition: none;
  }

  .chat-option-btn,
  .chat-date-confirm,
  .chat-email-confirm,
  .chat-address-confirm,
  .chat-custom-submit,
  .chat-addon-continue,
  .woo-chat-escalate,
  .woo-chat-send,
  .chat-trampoline-select {
    transition: none;
  }
}

/* BUG-M3: Intermediate breakpoint for 481-600px devices */
@media (max-width: 600px) {
  .woo-chat-window {
    width: calc(100vw - 48px);
    max-width: 390px;
  }
  .woo-chat-input,
  .chat-date-input,
  .chat-email-input,
  .chat-address-input,
  .chat-custom-input {
    font-size: 16px;
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .woo-chat-window {
    width: auto;
    left: 8px;
    right: 8px;
    height: calc(100dvh - 100px - env(safe-area-inset-bottom, 0px));
    bottom: 70px;
    border-radius: 16px 16px 0 0;
  }

  #woo-ai-chat-widget {
    bottom: 12px;
    right: 0;
  }

  /* BUG-M1: iOS safe-area padding for input area */
  .woo-chat-input-area {
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  /* Mobile touch targets (Apple HIG 44px minimum) */
  .chat-option-btn,
  .chat-date-confirm,
  .woo-chat-quick-btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .chat-date-input {
    min-height: 44px;
    font-size: 16px; /* prevents iOS zoom */
  }

  .woo-chat-input {
    min-height: 44px;
    font-size: 16px; /* prevents iOS zoom */
  }

  .woo-chat-send {
    min-height: 44px;
    min-width: 44px;
  }

  .woo-chat-escalate {
    min-height: 44px;
  }

  .chat-options {
    gap: 8px;
  }

  .chat-trampoline-select {
    min-height: 44px;
  }

  .chat-trampoline-thumb {
    height: 120px;
    font-size: 36px;
  }

  .t-grid-compact .chat-trampoline-thumb {
    height: 70px;
    font-size: 28px;
  }

  .t-name {
    font-size: 13px;
  }

  .t-meta {
    font-size: 11px;
  }

  .t-price {
    font-size: 11px;
  }

  .t-grid-compact .t-name {
    font-size: 11px;
  }

  /* BUG-M4: Compact grid single column on narrow mobile */
  .chat-trampoline-grid.t-grid-compact {
    grid-template-columns: 1fr;
  }

  .t-grid-compact .t-meta {
    font-size: 11px;
  }

  .chat-address-input {
    min-height: 44px;
    font-size: 16px;
  }

  .chat-address-confirm {
    min-height: 44px;
    font-size: 13px;
  }

  .chat-email-input,
  .chat-custom-input {
    min-height: 44px;
    font-size: 16px;
  }

  .chat-custom-textarea {
    font-size: 16px;
  }

  .chat-email-confirm,
  .chat-custom-submit {
    min-height: 44px;
    font-size: 13px;
  }

  .chat-menu-btn {
    min-height: 44px;
    font-size: 13px;
  }

  .chat-addon-continue {
    min-height: 44px;
    font-size: 14px;
  }

  .t-detail-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 14px;
  }

  .woo-chat-messages {
    -webkit-overflow-scrolling: touch;
  }
}

/* ═══ Human Handoff Notice ═══ */
.chat-handoff-notice {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #9a3412;
}

/* No-addon confirm dialog */
.chat-no-addon-confirm { background: #fffbe6; border: 1px solid #ffe082; border-radius: 12px; padding: 14px 16px; margin-top: 10px; text-align: center; }
.chat-no-addon-confirm .confirm-text { font-size: 14px; margin-bottom: 10px; }
.chat-no-addon-confirm .confirm-actions { display: flex; gap: 8px; justify-content: center; }
.chat-no-addon-confirm .confirm-back { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--chat-primary); background: white; color: var(--chat-primary); font-size: 13px; font-weight: 600; cursor: pointer; }
.chat-no-addon-confirm .confirm-send { padding: 8px 16px; border-radius: 8px; border: none; background: var(--chat-primary); color: white; font-size: 13px; font-weight: 600; cursor: pointer; }

/* Form validation errors */
.form-error { color: #e74c3c; font-size: 11px; margin-top: 2px; }
