/* =========================================================
   ReadyChat – Chat Widget Styles (Ultra-Modern Glassmorphism)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Curated Premium HSL Colors */
  --omnibot-primary:      hsl(262, 65%, 58%);
  --omnibot-primary-dk:   hsl(262, 70%, 48%);
  --omnibot-primary-lt:   hsl(262, 75%, 96%);
  
  --omnibot-bg:          rgba(244, 246, 252, 0.72);
  --omnibot-border:      rgba(224, 228, 239, 0.5);
  --omnibot-user-bg:     linear-gradient(135deg, hsl(262, 65%, 58%) 0%, hsl(282, 60%, 50%) 100%);
  --omnibot-bot-bg:      rgba(255, 255, 255, 0.85);
  
  --omnibot-text:        hsl(240, 20%, 15%);
  --omnibot-text-light:  hsl(240, 10%, 45%);
  --omnibot-radius:      22px;
  
  /* High-end soft deep shadows */
  --omnibot-shadow:      0 12px 40px -10px rgba(108, 63, 197, 0.25), 
                         0 4px 12px -5px rgba(108, 63, 197, 0.1);
  --omnibot-font:        'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Glassmorphism settings */
  --omnibot-glass-blur:   blur(18px) saturate(180%);
  --omnibot-glass-border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Dark mode preferences support */
@media (prefers-color-scheme: dark) {
  :root {
    --omnibot-bg:          rgba(18, 18, 28, 0.82);
    --omnibot-border:      rgba(255, 255, 255, 0.08);
    --omnibot-bot-bg:      rgba(28, 28, 44, 0.88);
    --omnibot-text:        hsl(240, 15%, 90%);
    --omnibot-text-light:  hsl(240, 10%, 65%);
    --omnibot-shadow:      0 16px 48px -12px rgba(0, 0, 0, 0.5);
    --omnibot-glass-border: 1px solid rgba(255, 255, 255, 0.06);
  }
}

/* ── Inline wrapper ───────────────────────────────────── */
.omnibot-wrap.omnibot-inline {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  height: 540px;
  border: var(--omnibot-glass-border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--omnibot-shadow);
  font-family: var(--omnibot-font);
  background: var(--omnibot-bg);
  backdrop-filter: var(--omnibot-glass-blur);
  -webkit-backdrop-filter: var(--omnibot-glass-blur);
  margin: 0 auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ── Floating wrapper ─────────────────────────────────── */
.omnibot-wrap.omnibot-floating {
  position: fixed;
  bottom: 5px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  width: 380px;
  height: 550px;
  border: var(--omnibot-glass-border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--omnibot-shadow);
  font-family: var(--omnibot-font);
  background: var(--omnibot-bg);
  backdrop-filter: var(--omnibot-glass-blur);
  -webkit-backdrop-filter: var(--omnibot-glass-blur);
  animation: omnibot-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

@keyframes omnibot-slide-up {
  from { opacity: 0; transform: scale(0.92) translateY(24px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Floating action button ───────────────────────────── */
.omnibot-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--omnibot-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(108, 63, 197, 0.35),
              0 2px 6px rgba(108, 63, 197, 0.15);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              box-shadow 0.25s ease, 
              background-color 0.25s ease;
}

.omnibot-fab:hover {
  transform: scale(1.08) rotate(5deg);
  box-shadow: 0 12px 32px rgba(108, 63, 197, 0.50),
              0 3px 8px rgba(108, 63, 197, 0.2);
  background: var(--omnibot-primary-dk);
}

.omnibot-fab:active {
  transform: scale(0.95);
}

/* ── Header ───────────────────────────────────────────── */
.omnibot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--omnibot-primary) 0%, hsl(282, 55%, 52%) 100%);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.omnibot-header-icon {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px;
  border-radius: 12px;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.2);
}

.omnibot-header-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  flex: 1;
}

.omnibot-close,
.omnibot-clear-btn,
.omnibot-tts-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1;
}

.omnibot-close {
  font-size: 14px;
}

.omnibot-close:hover,
.omnibot-clear-btn:hover,
.omnibot-tts-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.omnibot-tts-btn--active {
  color: #fff;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.omnibot-close:active,
.omnibot-clear-btn:active,
.omnibot-tts-btn:active {
  transform: translateY(0) scale(0.95);
}

.omnibot-clear-btn svg,
.omnibot-tts-btn svg {
  display: block !important;
  width: 15px !important;
  height: 15px !important;
  fill: #ffffff !important;
  color: #ffffff !important;
  pointer-events: none;
}

/* ── Quick links bar ──────────────────────────────────── */
.omnibot-quicklinks {
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid var(--omnibot-border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

@media (prefers-color-scheme: dark) {
  .omnibot-quicklinks {
    background: rgba(28, 28, 44, 0.45);
  }
}

.omnibot-quicklinks::-webkit-scrollbar { display: none; }

.omnibot-ql {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  text-decoration: none !important;
  color: var(--omnibot-text-light) !important;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--omnibot-font);
  white-space: nowrap;
  position: relative;
  border-right: 1px solid var(--omnibot-border);
  transition: all 0.2s ease;
  min-width: 62px;
}

.omnibot-ql:last-child { border-right: none; }

.omnibot-ql:hover {
  background: rgba(108, 63, 197, 0.06);
  color: var(--omnibot-primary) !important;
}

.omnibot-ql svg {
  display: block;
  fill: currentColor;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.omnibot-ql:hover svg {
  transform: translateY(-1px) scale(1.05);
}

/* Cart item count badge */
.omnibot-cart-badge {
  position: absolute;
  top: 6px;
  right: 10px;
  background: var(--omnibot-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  pointer-events: none;
  animation: omnibot-badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes omnibot-badge-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.omnibot-cart-badge--empty { display: none; }

/* ── Messages area ────────────────────────────────────── */
.omnibot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.omnibot-messages::-webkit-scrollbar { width: 4px; }
.omnibot-messages::-webkit-scrollbar-track { background: transparent; }
.omnibot-messages::-webkit-scrollbar-thumb { background: rgba(108, 63, 197, 0.25); border-radius: 99px; }
.omnibot-messages::-webkit-scrollbar-thumb:hover { background: rgba(108, 63, 197, 0.4); }

/* ── Individual message ───────────────────────────────── */
.omnibot-message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: omnibot-fade-in 0.25s ease-out;
}

@keyframes omnibot-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.omnibot-message.omnibot-user {
  flex-direction: row-reverse;
}

.omnibot-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: var(--omnibot-radius);
  font-size: 14.5px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.omnibot-message.omnibot-bot .omnibot-bubble {
  background: var(--omnibot-bot-bg);
  color: var(--omnibot-text);
  border-bottom-left-radius: 6px;
  border: var(--omnibot-glass-border);
}

.omnibot-message.omnibot-user .omnibot-bubble {
  background: var(--omnibot-user-bg);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 16px rgba(108, 63, 197, 0.15);
}

/* Auto-linked URLs inside bot replies */
.omnibot-reply-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--omnibot-primary);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  vertical-align: middle;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(108, 63, 197, 0.2);
}

.omnibot-reply-link:hover {
  background: var(--omnibot-primary-dk);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 63, 197, 0.3);
}

/* Typing indicator dot bounce */
.omnibot-typing .omnibot-bubble {
  padding: 14px 20px;
}

.omnibot-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.omnibot-dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--omnibot-text-light);
  animation: omnibot-bounce 1s infinite;
}

.omnibot-dots span:nth-child(2) { animation-delay: .15s; }
.omnibot-dots span:nth-child(3) { animation-delay: .30s; }

@keyframes omnibot-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%            { transform: translateY(-7px); }
}

/* ── Input area ───────────────────────────────────────── */
.omnibot-input-area {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.85);
  border-top: 1px solid var(--omnibot-border);
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

@media (prefers-color-scheme: dark) {
  .omnibot-input-area {
    background: rgba(28, 28, 44, 0.80);
  }
}

.omnibot-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--omnibot-border);
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 14.5px;
  font-family: var(--omnibot-font);
  color: var(--omnibot-text);
  outline: none;
  transition: all 0.25s ease;
  max-height: 100px;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

@media (prefers-color-scheme: dark) {
  .omnibot-input {
    background: rgba(18, 18, 28, 0.5);
  }
}

.omnibot-input:focus {
  border-color: var(--omnibot-primary);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 12px rgba(108, 63, 197, 0.1),
              inset 0 1px 2px rgba(0, 0, 0, 0.01);
}

@media (prefers-color-scheme: dark) {
  .omnibot-input:focus {
    background: rgba(18, 18, 28, 0.85);
  }
}

.omnibot-send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 14px;
  background: var(--omnibot-primary);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(108, 63, 197, 0.25);
}

.omnibot-send svg {
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  fill: #ffffff !important;
  color: #ffffff !important;
  pointer-events: none;
  flex-shrink: 0;
}

.omnibot-send:hover:not(:disabled) {
  background: var(--omnibot-primary-dk);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(108, 63, 197, 0.35);
}

.omnibot-send:active:not(:disabled) {
  transform: translateY(0) scale(.93);
}

.omnibot-send:disabled {
  opacity: .4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Mic button ───────────────────────────────────────── */
.omnibot-mic {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--omnibot-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--omnibot-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  .omnibot-mic {
    background: rgba(28, 28, 44, 0.5);
  }
}

.omnibot-mic svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  fill: currentColor !important;
  pointer-events: none;
  flex-shrink: 0;
}

.omnibot-mic:hover {
  background: rgba(108, 63, 197, 0.05);
  color: var(--omnibot-primary);
  border-color: var(--omnibot-primary);
  transform: translateY(-1px);
}

.omnibot-mic:active {
  transform: translateY(0) scale(.93);
}

.omnibot-mic--recording {
  background: #fee2e2;
  color: #dc2626;
  border-color: #dc2626;
  animation: omnibot-mic-pulse 1.4s ease-in-out infinite;
}

@keyframes omnibot-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.4); }
  50%       { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
}

.omnibot-mic--unsupported {
  display: none;
}

/* ── Product cards ────────────────────────────────────── */
.omnibot-bubble--suggest {
  background: var(--omnibot-bot-bg);
  padding: 12px 14px;
}

.omnibot-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.omnibot-product-card {
  display: flex;
  flex-direction: column;
  border: var(--omnibot-glass-border);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  .omnibot-product-card {
    background: rgba(18, 18, 28, 0.4);
  }
}

.omnibot-product-card:hover {
  box-shadow: 0 8px 24px -6px rgba(108,63,197,0.18);
  border-color: var(--omnibot-primary);
  transform: translateY(-2px);
}

.omnibot-product-img-wrap {
  display: block;
  text-decoration: none;
  overflow: hidden;
  background: rgba(108, 63, 197, 0.03);
}

.omnibot-product-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.omnibot-product-card:hover .omnibot-product-img {
  transform: scale(1.05);
}

.omnibot-product-img--placeholder {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--omnibot-text-light);
  font-size: 24px;
}

.omnibot-product-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 10px 12px 12px;
  gap: 6px;
}

.omnibot-product-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--omnibot-text);
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.omnibot-product-name:hover {
  color: var(--omnibot-primary);
}

.omnibot-product-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--omnibot-primary);
}

.omnibot-product-price--sale {
  color: hsl(0, 75%, 55%);
}

.omnibot-product-price--was {
  font-size: 11px;
  font-weight: 500;
  color: var(--omnibot-text-light);
  text-decoration: line-through;
}

.omnibot-product-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.omnibot-product-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 4px;
  border-radius: 10px;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1.3;
  white-space: nowrap;
}

.omnibot-product-btn svg { flex-shrink: 0; pointer-events: none; }

.omnibot-product-btn:hover  { opacity: .88; transform: translateY(-0.5px); }
.omnibot-product-btn:active { transform: translateY(0) scale(.96); }

.omnibot-product-btn--view {
  background: var(--omnibot-primary-lt);
  color: var(--omnibot-primary);
}

@media (prefers-color-scheme: dark) {
  .omnibot-product-btn--view {
    background: rgba(108, 63, 197, 0.15);
  }
}

.omnibot-product-btn--add {
  background: var(--omnibot-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(108, 63, 197, 0.2);
}

/* ── Order history cards ──────────────────────────────── */
.omnibot-order-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.omnibot-order-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: var(--omnibot-glass-border);
  border-radius: 18px;
  padding: 12px 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  .omnibot-order-card {
    background: rgba(28, 28, 44, 0.4);
  }
}

.omnibot-order-card:hover {
  box-shadow: 0 6px 18px rgba(108, 63, 197, 0.1);
  border-color: var(--omnibot-primary);
  transform: translateY(-1.5px);
}

.omnibot-order-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.omnibot-order-number {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--omnibot-text);
}

.omnibot-order-status {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.omnibot-order-status--green  { background: hsl(150, 75%, 93%); color: hsl(150, 75%, 25%); }
.omnibot-order-status--blue   { background: hsl(215, 75%, 93%); color: hsl(215, 75%, 25%); }
.omnibot-order-status--orange { background: hsl(35, 75%, 93%); color: hsl(35, 75%, 25%); }
.omnibot-order-status--red    { background: hsl(0, 75%, 93%); color: hsl(0, 75%, 25%); }
.omnibot-order-status--gray   { background: hsl(240, 10%, 93%); color: hsl(240, 10%, 35%); }

.omnibot-order-card-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.omnibot-order-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--omnibot-text-light);
}

.omnibot-order-total {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--omnibot-primary);
}

.omnibot-order-items {
  font-size: 11.5px;
  color: var(--omnibot-text-light);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.omnibot-order-btn {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 12px;
  background: var(--omnibot-primary-lt);
  color: var(--omnibot-primary);
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 4px;
}

@media (prefers-color-scheme: dark) {
  .omnibot-order-btn {
    background: rgba(108, 63, 197, 0.15);
  }
}

.omnibot-order-btn:hover {
  background: var(--omnibot-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(108, 63, 197, 0.2);
}

/* ── Single order detail card ──────────────────────────── */
.omnibot-order-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--omnibot-bot-bg);
  border: var(--omnibot-glass-border);
  border-radius: 20px;
  padding: 16px;
  margin-top: 12px;
}

.omnibot-order-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.omnibot-order-detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--omnibot-text-light);
}

.omnibot-order-detail-section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--omnibot-primary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

.omnibot-order-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.omnibot-order-items-table thead tr {
  background: var(--omnibot-primary-lt);
  border-bottom: 1px solid rgba(108, 63, 197, 0.1);
}

@media (prefers-color-scheme: dark) {
  .omnibot-order-items-table thead tr {
    background: rgba(108, 63, 197, 0.15);
  }
}

.omnibot-order-items-table th {
  padding: 6px 8px;
  text-align: left;
  font-weight: 700;
  color: var(--omnibot-primary);
  font-size: 11px;
}

.omnibot-order-items-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--omnibot-border);
  color: var(--omnibot-text);
}

.omnibot-order-items-table-center { text-align: center; }
.omnibot-order-items-table-bold   { font-weight: 700; }

.omnibot-order-detail-totals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 8px 0;
}

.omnibot-order-detail-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--omnibot-text-light);
}

.omnibot-order-detail-total-row--grand {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--omnibot-text);
  border-top: 1px dashed var(--omnibot-border);
  padding-top: 6px;
  margin-top: 4px;
}

.omnibot-order-detail-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ─────────────────────────────────────────────────────────
   RESPONSIVE — Floating Chat Widget
   ───────────────────────────────────────────────────────
   Three tiers:
     ① Desktop  > 768 px  — unchanged (380 × 550 px, fixed bottom-right)
     ② Tablet   481–768 px — fluid width, capped height
     ③ Mobile   ≤ 480 px  — full-screen bottom sheet
───────────────────────────────────────────────────────── */

/* ── ① Tablet / large phone landscape (481–768 px) ─────── */
@media (max-width: 768px) and (min-width: 481px) {
  .omnibot-wrap.omnibot-floating {
    width: calc(100vw - 48px);
    right: 24px;
    /* dvh shrinks when the keyboard opens; vh is the safe fallback */
    height: min(520px, calc(100dvh - 120px));
    height: min(520px, calc(100vh  - 120px)); /* fallback */
  }
}

/* ── ② Mobile phones ≤ 480 px — full-screen bottom sheet ── */
@media (max-width: 480px) {

  /* Stretch to the full visible viewport */
  .omnibot-wrap.omnibot-floating {
    position: fixed;
    left:   0;
    right:  0;
    bottom: 0;
    top:    0;
    width:  100%;
    /* dvh = dynamic viewport height — automatically shrinks when the
       on-screen keyboard appears so the input bar stays visible       */
    height: 100vh;   /* safe fallback for browsers without dvh support */
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    animation: omnibot-slide-up-mobile 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom center;
  }

  @keyframes omnibot-slide-up-mobile {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
  }

  /* FAB: tuck from edges, respect home-indicator safe area */
  .omnibot-fab {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 56px;
    height: 56px;
  }

  /* Header: compact but still thumb-friendly */
  .omnibot-header {
    padding: 12px 14px;
  }

  /* Messages: narrower side padding to gain horizontal space */
  .omnibot-messages {
    padding: 14px 10px;
  }

  /* Bubbles can reach closer to screen edges */
  .omnibot-bubble {
    max-width: 90%;
    font-size: 14px;
  }

  /* Input bar: pad for the home indicator on notched phones */
  .omnibot-input-area {
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  /* Touch-comfortable 46 px hit targets */
  .omnibot-send,
  .omnibot-mic {
    width: 46px;
    height: 46px;
  }

  /* Quick links: tighter for narrow screens */
  .omnibot-ql {
    padding: 8px 4px;
    font-size: 10px;
    min-width: 50px;
  }

  /* Product grid → single column so cards stay readable */
  .omnibot-product-grid {
    grid-template-columns: 1fr;
  }

  /* Product images: shorter to allow two cards in view without scroll */
  .omnibot-product-img,
  .omnibot-product-img--placeholder {
    height: 100px;
  }

  /* Order detail address/payment → stack vertically on narrow screens */
  .omnibot-order-detail-meta-grid {
    grid-template-columns: 1fr;
  }

  /* Inline widget on small screens */
  .omnibot-wrap.omnibot-inline {
    height: 460px;
    border-radius: 14px;
  }
}

/* ─────────────────────────────────────────────────────────
   Body scroll lock — applied via JS when the floating chat
   is open on mobile (prevents background rubber-band scroll
   on iOS and page movement on Android).
───────────────────────────────────────────────────────── */
body.omnibot-float-open {
  overflow: hidden;
  /* The JS pairs this with `top: -Xpx` so the page stays in place
     even though position changes to fixed on iOS.                  */
  position: fixed;
  width: 100%;
}

/* ─────────────────────────────────────────────────────────
   Opt-in form — shown inline inside a bot bubble when the
   guest opt-in feature is enabled and details are missing.
───────────────────────────────────────────────────────── */
.omnibot-optin-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.omnibot-optin-field {
  display: flex;
  flex-direction: column;
}

.omnibot-optin-input {
  padding: 9px 12px;
  border: 1.5px solid rgba(var(--omnibot-accent-rgb, 99,102,241), 0.35);
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: inherit;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s;
}

.omnibot-optin-input:focus {
  border-color: var(--omnibot-accent, #6366f1);
}

.omnibot-optin-input::placeholder {
  opacity: 0.55;
}

.omnibot-optin-submit {
  margin-top: 4px;
  padding: 9px 16px;
  border: none;
  border-radius: 10px;
  background: var(--omnibot-accent, #6366f1);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.18s;
  align-self: flex-start;
}

.omnibot-optin-submit:hover {
  opacity: 0.88;
}

.omnibot-optin-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════
   HANDS-FREE VOICE CALL
   Full-widget overlay: animated orb + status + live transcript.
═══════════════════════════════════════════════════════════════ */

/* The overlay is absolutely positioned inside the widget, so the
   inline wrapper needs to be a containing block (the floating one
   is already position:fixed). */
.omnibot-wrap.omnibot-inline { position: relative; }

/* ── Header call button ───────────────────────────────── */
.omnibot-call-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1;
  margin-left: auto;
}

.omnibot-call-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.omnibot-call-btn:active { transform: translateY(0) scale(0.95); }

.omnibot-call-btn svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  fill: #ffffff !important;
}

/* Active call — button turns red and pulses */
.omnibot-call-btn--active {
  background: #ef4444;
  animation: omnibot-call-btn-pulse 1.8s ease-in-out infinite;
}

@keyframes omnibot-call-btn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  50%      { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
}

/* ── Overlay ──────────────────────────────────────────── */
.omnibot-call {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1b1035 0%, #2a1758 55%, #160d2b 100%);
  border-radius: inherit;
  overflow: hidden;
}

.omnibot-call--open {
  display: flex;
  animation: omnibot-call-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes omnibot-call-in {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.omnibot-call-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 24px;
  width: 100%;
  text-align: center;
}

/* ── Orb ──────────────────────────────────────────────── */
.omnibot-call-orb {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.omnibot-call-core {
  position: relative;
  z-index: 2;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(140deg, var(--omnibot-primary, #814ede) 0%, #a855f7 100%);
  box-shadow: 0 8px 28px rgba(129, 78, 222, 0.55);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}

.omnibot-call-orb:active .omnibot-call-core { transform: scale(0.94); }

.omnibot-call-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(168, 85, 247, 0.55);
  opacity: 0;
}

/* Listening — expanding sonar rings */
.omnibot-call-orb[data-state="listening"] .omnibot-call-ring {
  animation: omnibot-call-sonar 2s ease-out infinite;
}
.omnibot-call-orb[data-state="listening"] .omnibot-call-ring:nth-child(2) {
  animation-delay: 1s;
}

@keyframes omnibot-call-sonar {
  0%   { opacity: 0.8; transform: scale(0.62); }
  100% { opacity: 0;   transform: scale(1.15); }
}

/* Thinking — slow spin, cooler colour */
.omnibot-call-orb[data-state="thinking"] .omnibot-call-core {
  background: linear-gradient(140deg, #6366f1 0%, #38bdf8 100%);
  animation: omnibot-call-think 1.4s ease-in-out infinite;
}

@keyframes omnibot-call-think {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.06); opacity: 1; }
}

/* Speaking — steady breathing glow */
.omnibot-call-orb[data-state="speaking"] .omnibot-call-core {
  background: linear-gradient(140deg, #10b981 0%, #34d399 100%);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.6);
  animation: omnibot-call-speak 1.1s ease-in-out infinite;
}

@keyframes omnibot-call-speak {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.09); }
}

.omnibot-call-orb[data-state="speaking"] .omnibot-call-ring {
  border-color: rgba(52, 211, 153, 0.5);
  animation: omnibot-call-sonar 1.6s ease-out infinite;
}

/* Idle / error — muted grey, no motion */
.omnibot-call-orb[data-state="idle"] .omnibot-call-core {
  background: linear-gradient(140deg, #64748b 0%, #475569 100%);
  box-shadow: none;
}

/* ── Text ─────────────────────────────────────────────── */
.omnibot-call-status {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
  min-height: 20px;
}

.omnibot-call-transcript {
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
  min-height: 40px;
  max-height: 78px;
  overflow-y: auto;
  padding: 0 6px;
  width: 100%;
  max-width: 320px;
  overflow-wrap: anywhere;
}

.omnibot-call-hint {
  margin: 0;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.4);
}

/* ── Controls ─────────────────────────────────────────── */
/* ── Caller identity + live duration ──────────────────── */
.omnibot-call-caller {
  text-align: center;
  margin-bottom: 2px;
}

.omnibot-call-name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.omnibot-call-timer {
  margin-top: 3px;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  /* Hidden until the microphone actually opens (call connected). */
  visibility: hidden;
}

.omnibot-call--connected .omnibot-call-timer {
  visibility: visible;
}

/* Small green "on call" dot next to the running timer */
.omnibot-call--connected .omnibot-call-timer::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #34d399;
  vertical-align: middle;
  animation: omnibot-call-live 2s ease-in-out infinite;
}

@keyframes omnibot-call-live {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

/* ── Controls ─────────────────────────────────────────── */
.omnibot-call-actions {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 26px;
}

.omnibot-call-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.omnibot-call-action-label {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.omnibot-call-ctl {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  /* Solid, not translucent — the icons must read on any background. */
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  transition: background 0.2s ease, transform 0.15s ease;
}

.omnibot-call-ctl:hover  { background: rgba(255, 255, 255, 0.26); }
.omnibot-call-ctl:active { transform: scale(0.93); }

/*
 * Force the control-button icon colour.
 *
 * The icons use fill="currentColor", which inherits the button's `color`.
 * Some WordPress themes set `svg { fill: <dark> !important }` or override
 * button `color`, which turned the mute and keyboard icons invisible on the
 * dark overlay. The high-specificity + !important rule below always wins, so
 * the icons render white no matter what the active theme does.
 */
.omnibot-wrap .omnibot-call-ctl svg {
  display: block;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px;
  min-height: 26px;
  max-width: none !important;
  fill: #fff !important;
  color: #fff !important;
  pointer-events: none;
}

.omnibot-wrap .omnibot-call-hangup svg {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px;
  min-height: 28px;
}

.omnibot-call-ctl--on {
  background: #f59e0b;
  color: #1b1035;
}

/* Muted state: dark icon on the amber button. */
.omnibot-wrap .omnibot-call-ctl--on svg {
  fill: #1b1035 !important;
  color: #1b1035 !important;
}

.omnibot-call-hangup {
  width: 66px;
  height: 66px;
  background: #ef4444;
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.5);
}

.omnibot-call-hangup:hover { background: #dc2626; }

/* Phone icon rotated to read as "hang up" */
.omnibot-call-hangup svg { transform: rotate(135deg); }

/* ── Compact widgets / small screens ──────────────────── */
@media (max-height: 560px), (max-width: 360px) {
  .omnibot-call-inner   { gap: 10px; padding: 14px; }
  .omnibot-call-orb     { width: 92px; height: 92px; }
  .omnibot-call-core    { width: 58px; height: 58px; }
  .omnibot-call-name    { font-size: 15.5px; }
  .omnibot-call-transcript { min-height: 26px; max-height: 50px; font-size: 12.5px; }
  .omnibot-call-actions { gap: 20px; }
  .omnibot-call-ctl     { width: 50px; height: 50px; }
  .omnibot-call-hangup  { width: 58px; height: 58px; }
  .omnibot-wrap .omnibot-call-ctl svg    { width: 23px !important; height: 23px !important; }
  .omnibot-wrap .omnibot-call-hangup svg { width: 25px !important; height: 25px !important; }
  .omnibot-call-hint    { display: none; }
}

/* ── Reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .omnibot-call--open,
  .omnibot-call-ring,
  .omnibot-call-core,
  .omnibot-call-btn--active {
    animation: none !important;
  }
  .omnibot-call-ring { opacity: 0.35; }
}
