/* AI Shopping Concierge — storefront styles.
   Refined "concierge" aesthetic: warm cream, one strong accent, a display serif
   for the name and a clean sans for body. Self-contained, prefixed to avoid clashes. */

#aisc-root, #aisc-overlay { --aisc-accent: #b8763e; }
#aisc-root, #aisc-root *, #aisc-overlay, #aisc-overlay * { box-sizing: border-box; }
#aisc-root {
  position: fixed; right: 22px; bottom: 22px; z-index: 2147483000;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* launcher */
.aisc-launcher {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 20px 13px 16px; border: none; cursor: pointer;
  background: var(--aisc-accent); color: #fff; border-radius: 999px;
  font: 600 15px 'Outfit', sans-serif; letter-spacing: .2px;
  box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--aisc-accent) 60%, #000);
  transition: transform .2s ease, box-shadow .2s ease;
  animation: aisc-float 4s ease-in-out infinite;
}
.aisc-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -8px color-mix(in srgb, var(--aisc-accent) 65%, #000); }
.aisc-launcher svg { flex: none; }
#aisc-root.aisc-on .aisc-launcher { display: none; }
@keyframes aisc-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* panel — display controlled by the .aisc-on class, NOT [hidden] */
.aisc-panel {
  display: none;
  width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 44px);
  flex-direction: column; overflow: hidden;
  background: #fbf7f1; border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--aisc-accent) 22%, #e7ddd0);
  box-shadow: 0 30px 70px -20px rgba(40,25,10,.45);
}
#aisc-root.aisc-on .aisc-panel { display: flex; animation: aisc-rise .26s cubic-bezier(.2,.8,.2,1); }
@keyframes aisc-rise { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

.aisc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; background: var(--aisc-accent); color: #fff; flex: none;
}
.aisc-id { display: flex; align-items: center; gap: 9px; }
.aisc-id .aisc-name { font-family: 'Fraunces', Georgia, serif; font-size: 19px; font-weight: 600; }
.aisc-id em { font-style: normal; font-size: 11px; opacity: .8; letter-spacing: .4px; }
.aisc-dot { width: 8px; height: 8px; border-radius: 50%; background: #7be38a; animation: aisc-pulse 2s infinite; }
@keyframes aisc-pulse { 0% { box-shadow: 0 0 0 0 rgba(123,227,138,.6); } 70% { box-shadow: 0 0 0 7px rgba(123,227,138,0); } 100% { box-shadow: 0 0 0 0 rgba(123,227,138,0); } }
.aisc-close { background: none; border: none; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; opacity: .85; padding: 0 4px; }
.aisc-close:hover { opacity: 1; }

/* messages — min-height:0 lets this flex child actually scroll instead of overflowing */
.aisc-msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.aisc-row { display: flex; gap: 9px; max-width: 100%; }
.aisc-row.aisc-user { justify-content: flex-end; }
.aisc-b {
  padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; max-width: 78%;
  background: #fff; color: #3a2e22; border: 1px solid #efe6d8; word-wrap: break-word;
}
.aisc-user .aisc-b { background: var(--aisc-accent); color: #fff; border: none; border-bottom-right-radius: 5px; }
.aisc-bot .aisc-b { border-bottom-left-radius: 5px; }
.aisc-av {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font: 600 14px 'Fraunces', serif;
  background: color-mix(in srgb, var(--aisc-accent) 85%, #000);
}
.aisc-typing { display: flex; gap: 4px; align-items: center; }
.aisc-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--aisc-accent); opacity: .5; animation: aisc-blink 1.2s infinite; }
.aisc-typing span:nth-child(2) { animation-delay: .2s; } .aisc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes aisc-blink { 0%,80%,100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* product cards in chat */
.aisc-cards { display: flex; flex-direction: column; gap: 9px; width: 100%; }
.aisc-card { display: flex; gap: 11px; padding: 9px; background: #fff; border: 1px solid #efe6d8; border-radius: 14px; }
.aisc-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: none; background: #f1ece3; }
.aisc-card-body { flex: 1; min-width: 0; }
.aisc-card-title { font-size: 14px; font-weight: 600; color: #3a2e22; line-height: 1.25; }
.aisc-card-price { font-size: 13px; color: var(--aisc-accent); font-weight: 600; margin: 2px 0 5px; }
.aisc-card-price em { color: #b00; font-style: normal; font-weight: 500; }
.aisc-card-reason { font-size: 12px; color: #6b5a45; line-height: 1.4; margin-bottom: 7px; }
.aisc-card-actions { display: flex; gap: 7px; }
.aisc-card-view, .aisc-card-point { font: 600 12.5px 'Outfit', sans-serif; padding: 6px 11px; border-radius: 8px; cursor: pointer; text-decoration: none; }
.aisc-card-view { background: #f1ece3; color: #5a4a38; border: 1px solid #e7ddd0; }
.aisc-card-point { background: var(--aisc-accent); color: #fff; border: none; }
.aisc-card-point:hover { filter: brightness(1.05); }

/* input */
.aisc-form { display: flex; gap: 8px; padding: 13px; border-top: 1px solid #efe6d8; background: #fbf7f1; flex: none; }
.aisc-text { flex: 1; padding: 11px 14px; border: 1px solid #e3d8c8; border-radius: 12px; font: 400 14.5px 'Outfit', sans-serif; outline: none; background: #fff; color: #3a2e22; }
.aisc-text:focus { border-color: var(--aisc-accent); }
.aisc-send { flex: none; width: 42px; border: none; border-radius: 12px; background: var(--aisc-accent); color: #fff; cursor: pointer; display: grid; place-items: center; }
.aisc-send:hover { filter: brightness(1.05); }
.aisc-foot { text-align: center; font-size: 10.5px; color: #a89579; padding: 0 0 9px; letter-spacing: .3px; flex: none; }

/* ---------- overlay: cursor, ring, bubble ---------- */
#aisc-overlay { position: fixed; inset: 0; z-index: 2147482000; pointer-events: none; }
.aisc-ring {
  position: fixed; border: 2.5px solid var(--aisc-accent); border-radius: 12px;
  box-shadow: 0 0 22px 2px color-mix(in srgb, var(--aisc-accent) 55%, transparent);
  transition: all .45s cubic-bezier(.2,.8,.2,1);
}
/* full-screen dim only when pointing at an on-page product (not at an in-chat card) */
#aisc-overlay.aisc-spot .aisc-ring {
  box-shadow: 0 0 0 9999px rgba(30,20,8,.30), 0 0 22px 2px color-mix(in srgb, var(--aisc-accent) 55%, transparent);
}
.aisc-ring::after {
  content: ''; position: absolute; inset: -4px; border: 2px solid var(--aisc-accent);
  border-radius: 14px; opacity: .6; animation: aisc-pulsering 1.6s ease-out infinite;
}
@keyframes aisc-pulsering { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.1); opacity: 0; } }

.aisc-cursor { position: fixed; left: 0; top: 0; transition: transform .55s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); animation: aisc-tap 1.1s ease-in-out infinite; }
@keyframes aisc-tap { 0%,100% { margin-top: 0; } 50% { margin-top: 4px; } }

.aisc-bubble {
  position: fixed; width: 240px; max-width: calc(100vw - 24px); pointer-events: auto;
  background: #fff; border: 1px solid color-mix(in srgb, var(--aisc-accent) 30%, #e7ddd0);
  border-radius: 14px; padding: 12px 13px; box-shadow: 0 18px 40px -14px rgba(40,25,10,.5);
  font-family: 'Outfit', sans-serif; transition: top .45s ease, left .45s ease;
}
.aisc-bubble-text { margin: 0 0 9px; font-size: 13.5px; line-height: 1.45; color: #3a2e22; }
.aisc-bubble-nav { display: flex; align-items: center; gap: 6px; }
.aisc-bubble-nav button { border: 1px solid #e7ddd0; background: #f7f1e8; color: #5a4a38; border-radius: 8px; cursor: pointer; font: 600 14px 'Outfit', sans-serif; padding: 4px 9px; }
.aisc-prev, .aisc-next { display: none; }
#aisc-overlay.aisc-multi .aisc-prev, #aisc-overlay.aisc-multi .aisc-next { display: inline-block; }
.aisc-count { font-size: 11.5px; color: #a89579; min-width: 30px; }
.aisc-dismiss { margin-left: auto; background: var(--aisc-accent) !important; color: #fff !important; border: none !important; }

@media (max-width: 480px) {
  .aisc-panel { width: calc(100vw - 24px); height: calc(100vh - 96px); }
  #aisc-root { right: 12px; bottom: 12px; }
}
