/* AI Search by WALoops: the storefront overlay (ai-search.js), styled as an AI
   shopping assistant. The AI look (orb, shimmer, badges) uses a fixed
   violet/cyan gradient. */
.wais { --wais-ai: linear-gradient(135deg, #7c3aed 0%, #2563eb 50%, #06b6d4 100%); position: fixed; inset: 0; z-index: 2147482000; font-family: inherit; color: #0f172a; }
.wais[hidden] { display: none; }
/* display: block — some themes hide every empty div (div:empty { display: none }). */
.wais .wais-backdrop { display: block; position: absolute; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); }
.wais-panel { position: relative; margin: 5vh auto 0; width: min(780px, calc(100vw - 24px)); max-height: 88vh; display: flex; flex-direction: column; background: #fff; border-radius: 22px; box-shadow: 0 30px 80px rgba(15, 23, 42, .35); overflow: hidden; animation: wais-pop .22s ease-out; }
.wais-panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--wais-ai); }

/* Header: the assistant */
.wais-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 8px; }
.wais-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.wais-head-text strong { font-size: 15px; }
.wais-head-sub { font-size: 12.5px; color: #64748b; }
.wais-x { border: 0; background: #f1f5f9; color: #334155; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; flex: none; }

/* The AI orb */
.wais-orb { position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.wais-orb::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #7c3aed, #2563eb, #06b6d4, #ec4899, #7c3aed); animation: wais-spin 6s linear infinite; }
.wais-orb-core { position: relative; width: 30px; height: 30px; border-radius: 50%; background: #fff; display: inline-flex; align-items: center; justify-content: center; color: #7c3aed; }
.wais.is-thinking .wais-head .wais-orb::before { animation-duration: 1.1s; }
.wais.is-thinking .wais-head .wais-orb { animation: wais-glow 1.4s ease-in-out infinite; }

/* Prompt box */
.wais-bar { display: flex; align-items: center; gap: 10px; margin: 6px 18px 10px; padding: 6px 6px 6px 16px; border: 1.5px solid #e2e8f0; border-radius: 16px; color: #64748b; background: #f8fafc; transition: border-color .15s, box-shadow .15s; }
.wais-bar:focus-within { border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(124, 58, 237, .12); background: #fff; }
.wais-bar input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 16.5px; color: #0f172a; background: none; padding: 8px 0; box-shadow: none; }
.wais-bar input::-webkit-search-cancel-button { display: none; }
.wais-send { flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--wais-ai); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

/* Conversation */
.wais-body { overflow-y: auto; padding: 6px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.wais-msg { display: flex; gap: 10px; align-items: flex-start; animation: wais-up .25s ease-out both; }
.wais-me { justify-content: flex-end; }
.wais-me .wais-bubble { background: #0f172a; color: #fff; border-radius: 18px 18px 4px 18px; padding: 10px 14px; max-width: 80%; font-size: 14.5px; }
.wais-ai .wais-bubble { flex: 1; min-width: 0; background: #fff; border: 1px solid #ede9fe; border-radius: 4px 18px 18px 18px; padding: 12px 14px; }
.wais-avatar { flex: none; }
.wais-avatar .wais-orb { width: 30px; height: 30px; }
.wais-avatar .wais-orb-core { width: 24px; height: 24px; }
.wais-avatar .wais-orb-core svg { width: 14px; height: 14px; }
.wais-bubble p { margin: 0; font-size: 14.5px; line-height: 1.55; }

/* Thinking */
.wais-cooking { margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.wais-shimmer { background: linear-gradient(90deg, #64748b 0%, #64748b 35%, #a855f7 50%, #64748b 65%, #64748b 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: wais-shimmer 1.6s linear infinite; }
.wais-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.wais-steps li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: #334155; animation: wais-up .2s ease-out both; }
.wais-steps li.is-done { color: #64748b; }
.wais-step-ico { width: 20px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.is-done .wais-step-ico { background: #dcfce7; color: #16a34a; }
.wais .wais-spin { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #ddd6fe; border-top-color: #7c3aed; animation: wais-spin .7s linear infinite; }
.wais-skeleton { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.wais .wais-skeleton span { display: block; aspect-ratio: 1 / 1.25; border-radius: 12px; background: linear-gradient(90deg, #f1f5f9 25%, #e9e5fb 50%, #f1f5f9 75%); background-size: 200% 100%; animation: wais-shimmer 1.3s linear infinite; }

/* Answer */
.wais-thought { margin-bottom: 8px; }
.wais-thought summary { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #16a34a; cursor: pointer; list-style: none; }
.wais-thought summary::-webkit-details-marker { display: none; }
.wais-thought[open] .wais-steps { margin: 8px 0 4px; }
.wais .wais-answer { min-height: 1.5em; white-space: pre-line; }
.wais-answer.is-typing::after { content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: #7c3aed; animation: wais-blink .8s steps(1) infinite; }
.wais-answer strong { font-weight: 700; }
.wais-understood { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.wais-understood > span { font-size: 12px; color: #64748b; margin-right: 2px; }
.wais-understood button { border: 1px solid #ddd6fe; color: #6d28d9; background: #f5f3ff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }

/* Intro and quick matches */
.wais-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wais-examples button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e2e8f0; background: #fff; color: #334155; border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.wais-examples button svg { width: 14px; height: 14px; color: #7c3aed; }
.wais-examples button:hover { border-color: #a78bfa; background: #faf5ff; }
.wais-quick-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: #64748b; }
.wais-quick-head > span:first-child { font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px; }
.wais-enter kbd { font: inherit; font-size: 11px; padding: 1px 6px; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 5px; background: #fff; color: #334155; }
.wais-note { margin: 0; font-size: 14px; color: #64748b; }

/* Store pages and Q&A */
.wais-pages { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.wais .wais-page { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; color: inherit; text-decoration: none; animation: wais-up .3s ease-out both; animation-delay: calc(var(--i, 0) * 60ms); }
.wais a.wais-page:hover { border-color: #a78bfa; background: #faf5ff; color: inherit; text-decoration: none; }
.wais-page-title { font-size: 14px; font-weight: 600; }
.wais-page-snip { font-size: 13px; line-height: 1.45; color: #64748b; white-space: pre-line; }
.wais-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.wais-sources > span { font-size: 12px; color: #64748b; }
.wais .wais-sources a { border: 1px solid #ddd6fe; color: #6d28d9; background: #f5f3ff; border-radius: 999px; padding: 4px 11px; font-size: 12.5px; text-decoration: none; }
.wais .wais-sub-head { margin-top: 14px; font-size: 13px; color: #64748b; }
.wais .wais-hint { margin-top: 8px; font-size: 13px; color: #64748b; }

/* Product cards */
.wais .wais-results { margin-top: 12px; }
.wais-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.wais-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; animation: wais-up .35s ease-out both; animation-delay: calc(var(--i, 0) * 60ms); }
.wais-card:hover .wais-title { text-decoration: underline; }
.wais-img { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: #f1f5f9; }
.wais-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.wais-card:hover .wais-img img { transform: scale(1.04); }
.wais-badge { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; border-radius: 999px; background: var(--wais-ai); color: #fff; font-size: 11.5px; font-weight: 700; box-shadow: 0 4px 12px rgba(124, 58, 237, .35); }
.wais-badge svg { width: 12px; height: 12px; }
.wais-title { font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wais-price { font-size: 13.5px; font-weight: 600; }
.wais-price s { font-weight: 400; color: #94a3b8; margin-left: 4px; }
.wais-wa { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; padding: 12px; border-radius: 12px; background: #25d366; color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; }

/* Floating button */
.wais-fab { position: fixed; bottom: 20px; z-index: 2147481000; height: 50px; padding: 0 18px 0 14px; border-radius: 999px; border: 0; background: linear-gradient(135deg, #7c3aed 0%, #2563eb 50%, #06b6d4 100%); color: #fff; display: flex; align-items: center; gap: 8px; font: inherit; font-size: 15px; font-weight: 700; letter-spacing: .01em; box-shadow: 0 8px 24px rgba(124, 58, 237, .45); cursor: pointer; animation: wais-glow 3s ease-in-out infinite; }
.wais-fab-ico { position: relative; display: inline-flex; }
.wais-fab-ico > svg { width: 22px; height: 22px; }
.wais-fab-spark { position: absolute; top: -6px; right: -7px; display: inline-flex; color: #fde68a; }
.wais-fab-spark svg { width: 12px; height: 12px; }
.wais-fab-label { white-space: nowrap; }
.wais-fab-left { left: 20px; }
.wais-fab-right { right: 20px; }
.wais-fab-center { left: 50%; transform: translateX(-50%); }
html.wais-open { overflow: hidden; }

/* The [waloops_ai_search] search bar. */
.wais-block { padding: 12px 0; }
.wais-block .wais-block-heading { margin: 0 0 10px; text-align: center; }
.wais-block-bar { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 720px; margin: 0 auto; padding: 14px 18px; border: 1px solid rgba(15, 23, 42, .2); border-radius: 999px; background: #fff; color: #64748b; font: inherit; font-size: 16px; cursor: text; text-align: left; }
.wais-block-bar:hover { border-color: #a78bfa; }

/* WordPress themes style every button, input, link and image; keep the
   overlay's own look whatever the theme does. */
.wais button, .wais-fab, .wais-block-bar { text-transform: none; letter-spacing: normal; min-height: 0; min-width: 0; line-height: 1.2; text-shadow: none; margin: 0; }
.wais button:hover, .wais button:focus { text-decoration: none; }
.wais .wais-bar input[type="search"] { border: 0; box-shadow: none; background: none; width: auto; height: auto; margin: 0; border-radius: 0; -webkit-appearance: none; appearance: none; }
.wais a.wais-card, .wais a.wais-card:hover, .wais a.wais-card:focus { text-decoration: none; color: inherit; box-shadow: none; }
.wais a.wais-wa, .wais a.wais-wa:hover { color: #fff; text-decoration: none; }
.wais .wais-img img { max-width: none; height: 100%; margin: 0; border-radius: 0; }
.wais ol.wais-steps { margin-left: 0; }
.wais-x { padding: 0; }
.wais-send { padding: 0; }
.wais-block-bar:hover, .wais-block-bar:focus { background: #fff; color: #64748b; }

@keyframes wais-spin { to { transform: rotate(360deg); } }
@keyframes wais-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes wais-blink { 50% { opacity: 0; } }
@keyframes wais-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes wais-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes wais-glow { 0%, 100% { box-shadow: 0 8px 24px rgba(124, 58, 237, .35); } 50% { box-shadow: 0 8px 30px rgba(6, 182, 212, .55); } }

@media (max-width: 749px) {
  .wais-panel { margin: 0; width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; }
  .wais-grid, .wais-skeleton { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wais .wais-skeleton span:nth-child(n+3) { display: none; }
  .wais-me .wais-bubble { max-width: 88%; }
}
@media (prefers-reduced-motion: reduce) {
  .wais *, .wais *::before, .wais-fab { animation: none !important; transition: none !important; }
}
