/* WEDDI UI */
:root{--aive-panel-bg: rgba(255,255,255,0.92); --aive-panel-blur: 10px; --aive-accent: #f4b000;}
#aive-root.aive-root { position: fixed; z-index: 2147483647; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
#aive-root .aive-toggle { background:#111; color:#fff; border:none; border-radius:999px; padding:12px 16px; cursor:pointer; box-shadow:0 6px 20px rgba(0,0,0,.2); }
#aive-root .aive-panel { position: fixed; width:min(380px, calc(100vw - 32px)); background: var(--aive-panel-bg, #fff); backdrop-filter: blur(var(--aive-panel-blur, 0px)); -webkit-backdrop-filter: blur(var(--aive-panel-blur, 0px)); border-radius:14px; box-shadow:0 12px 28px rgba(0,0,0,.2); display:flex; flex-direction:column; overflow:hidden; }
#aive-root .aive-header { padding:10px 14px; background: rgba(245,245,247,0.85); border-bottom:1px solid #e5e5e7; display:flex; align-items:center; justify-content:space-between; }
#aive-root .aive-close { background:transparent; border:none; font-size:20px; line-height:1; cursor:pointer; }
#aive-root .aive-messages { padding:12px; overflow:auto; flex:1; display:flex; flex-direction:column; gap:8px; }
#aive-root .aive-msg { display:flex; }
#aive-root .aive-user { justify-content:flex-end; }
#aive-root .aive-assistant { justify-content:flex-start; }
#aive-root .aive-bubble { max-width:85%; padding:10px 12px; border-radius:14px; white-space:pre-wrap; word-wrap:break-word; }
#aive-root .aive-user .aive-bubble { background:#111; color:#fff; border-bottom-right-radius:4px; }
#aive-root .aive-assistant .aive-bubble { background: rgba(241,243,245,0.85); color:#111; border-bottom-left-radius:4px; }
#aive-root .aive-form { display:flex; gap:8px; border-top:1px solid #eee; padding:10px; }
#aive-root .aive-input { flex:1; resize:vertical; min-height:44px; max-height:120px; padding:10px; }
#aive-root .aive-send { background:#2b6cb0; color:#fff; border:none; border-radius:10px; padding:10px 14px; cursor:pointer; }
#aive-root .aive-powered { font-size:10px; color:#6b7280; padding:4px 10px 6px; text-align:left; }
#aive-root .aive-panel[hidden] { display:none !important; pointer-events:none !important; }
#aive-root .aive-panel { right: 16px; bottom: 70px; max-height:85vh; }
#aive-root.aive-root { right: 16px; bottom: 16px; }
@media (max-width:480px){
  #aive-root .aive-panel { right:8px; left:8px; width:auto; }
  #aive-root.aive-root { right:8px; bottom:8px; }
}

.aive-msg.bot.typing .bubble{opacity:0.8}
.aive-msg.bot.typing .dots{animation:aiveblink 1s infinite; display:inline-block}
@keyframes aiveblink{0%{opacity:.2}50%{opacity:1}100%{opacity:.2}}

#aive-root .aive-avatar-wrap{display:flex;align-items:flex-end;}
#aive-root .aive-avatar{width:28px;height:28px;border-radius:50%;object-fit:cover;margin:0 4px;}

#aive-root .aive-footer{border-top:1px solid #eee;padding:8px 10px 4px;display:flex;flex-direction:column;gap:6px;}
#aive-root .aive-quick-chips{display:flex;flex-wrap:nowrap;gap:6px;overflow-x:auto;padding-bottom:2px;scrollbar-width:thin;}
#aive-root .aive-chip{flex:0 0 auto;border:1px solid rgba(0,0,0,.1);border-radius:999px;padding:3px 10px;font-size:12px;background: var(--aive-panel-bg, #fff); backdrop-filter: blur(var(--aive-panel-blur, 0px)); -webkit-backdrop-filter: blur(var(--aive-panel-blur, 0px));cursor:pointer;transition:background .15s ease,border-color .15s ease;}
#aive-root .aive-chip:hover{border-color:#0b3954;background:#0b3954;color:#ffffff;}

/* Quick chips soft pulse (used when assistant hints: delivery/payment/etc.) */
@keyframes aiveQuickPulse{
  0%{transform:translateZ(0) scale(1); box-shadow:0 0 0 0 rgba(244,176,0,0.35);} 
  70%{transform:translateZ(0) scale(1.03); box-shadow:0 0 0 10px rgba(244,176,0,0);} 
  100%{transform:translateZ(0) scale(1); box-shadow:0 0 0 0 rgba(244,176,0,0);} 
}
#aive-root .aive-chip.aive-pulse{animation:aiveQuickPulse 1.25s ease-out 1; border-color: var(--aive-accent); background: rgba(244,176,0,0.10);animation:aiveQuickPulse 1.25s ease-out 1;}
@media (prefers-reduced-motion: reduce){
  #aive-root .aive-chip.aive-pulse{animation:none !important;}
}


#aive-root .aive-header-main{display:flex;align-items:center;gap:6px;}
#aive-root .aive-header-actions{display:flex;align-items:center;gap:4px;}
#aive-root .aive-menu-toggle{background:transparent;border:none;font-size:18px;line-height:1;cursor:pointer;padding:4px 6px;}
#aive-root .aive-header-menu{border-top:1px solid #eee;padding:4px 10px 6px;display:flex;flex-direction:column;gap:4px;background:#fafafa;}
#aive-root .aive-header-menu[hidden]{display:none;}
#aive-root .aive-menu-item{background:transparent;border:none;text-align:left;padding:4px 6px;border-radius:6px;font-size:13px;cursor:pointer;}
#aive-root .aive-menu-item:hover{background:rgba(0,0,0,.04);}

@keyframes weddyPulse{0%{transform:scale(1);box-shadow:0 0 0 0 rgba(0,0,0,.18);}70%{transform:scale(1.03);box-shadow:0 0 0 12px rgba(244,176,0,0);}100%{transform:scale(1);box-shadow:0 0 0 0 rgba(244,176,0,0);}}
#aive-root .aive-toggle.weddi-attn{animation: weddyPulse 1.4s ease-out 1;}
@media (prefers-reduced-motion: reduce){#aive-root .aive-toggle.weddi-attn{animation:none;}}


@keyframes aivePulse{
  0%{transform:scale(1);box-shadow:0 6px 20px rgba(0,0,0,.20);} 
  70%{transform:scale(1.03);box-shadow:0 0 0 14px rgba(244,176,0,0);} 
  100%{transform:scale(1);box-shadow:0 6px 20px rgba(0,0,0,.20);} 
}
#aive-root .aive-toggle.aive-attn{animation:aivePulse 1.4s ease-out 1;}
@media (prefers-reduced-motion: reduce){
  #aive-root .aive-toggle.aive-attn{animation:none !important;}
}

/* --- Product cards in chat --- */
#aive-root .aive-bubble.aive-bubble-cards{padding:8px;}
#aive-root .aive-cards{display:grid;grid-template-columns:repeat(2, minmax(0,1fr));gap:10px;}
#aive-root .aive-card{display:flex;flex-direction:column;text-decoration:none;color:inherit;border:1px solid rgba(0,0,0,0.08);border-radius:14px;overflow:hidden;background:rgba(255,255,255,0.72);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);}
#aive-root .aive-card-img{width:100%;background:rgba(0,0,0,0.03);}
#aive-root .aive-card-img img{width:100%;height:120px;object-fit:cover;display:block;}
#aive-root .aive-card-body{padding:10px;display:flex;flex-direction:column;gap:6px;}
#aive-root .aive-card-title{font-weight:700;font-size:13px;line-height:1.25;}
#aive-root .aive-card-price{font-size:12px;opacity:0.85;}
#aive-root .aive-card-stock{font-size:12px;opacity:0.7;}

@media (max-width:420px){
  #aive-root .aive-cards{grid-template-columns:1fr;}
  #aive-root .aive-card-img img{height:140px;}
}

/* Selection panel (below chat/products) */
.aive-selection{margin-top:18px;}
.aive-selection-panel{background:#fff;border-radius:14px;box-shadow:0 4px 18px rgba(0,0,0,0.10);padding:18px;}
.aive-selection-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;}
.aive-selection-title{font-weight:700;color:#0b3650;}
.aive-selection-actions{display:flex;gap:10px;}
.aive-selection-actions button{padding:8px 12px;border-radius:10px;border:1px solid #d9d9d9;background:#fff;cursor:pointer;}
.aive-selection-actions button:hover{filter:brightness(0.98);}
.aive-selection-items{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.aive-selection-item{border:1px solid #eee;border-radius:12px;padding:10px;display:flex;gap:10px;align-items:center;}
.aive-selection-item img{width:48px;height:48px;object-fit:contain;border-radius:8px;background:#f6f7f8;}
.aive-selection-item-title{font-size:13px;line-height:1.25;}
.aive-selection-item-meta{font-size:12px;color:#666;margin-top:2px;}
.aive-selection-empty{color:#666;font-size:13px;}

@media(max-width:1024px){
  .aive-selection-items{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:640px){
  .aive-selection-items{grid-template-columns:1fr;}
}

/* Backward-compatible selectors for current markup */
#aive-selection{background:#fff;border-radius:14px;box-shadow:0 4px 18px rgba(0,0,0,0.10);padding:18px;}
#aive-selection .aive-selection-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;}
#aive-selection .aive-selection-title{font-weight:700;color:#0b3650;}
#aive-selection .aive-selection-head-actions{display:flex;gap:10px;}
#aive-selection .aive-selection-head-actions button{padding:8px 12px;border-radius:10px;border:1px solid #d9d9d9;background:#fff;cursor:pointer;}
#aive-selection .aive-selection-head-actions button:hover{filter:brightness(0.98);}
#aive-selection .aive-selection-body{margin-top:6px;}
