/* =========================================================
   VELOURA CHAT ENGINE — Widget styles
   ---------------------------------------------------------
   Redesigned from a generic dark support-widget look to the
   site's own luxury language (assets/css/core.css tokens:
   --gold, --bg-2 ivory, --text charcoal, Playfair Display
   headings) — a private client advisor, not a SaaS chat bubble.
   Respects prefers-reduced-motion throughout.
========================================================= */

#veChatRoot { position: fixed; z-index: 9999; }

/* ── Launcher ────────────────────────────────────────────── */
.ve-chat-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg, #FFFFFF);
  border: 1px solid var(--gold, #C9A96E);
  color: var(--gold-2, #B8965A);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(17,17,17,.14);
  transition: transform .25s ease, box-shadow .25s ease;
  z-index: 9999;
  animation: veChatBreathe 4s ease-in-out infinite;
}
.ve-chat-bubble:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 32px rgba(17,17,17,.2);
  animation-play-state: paused;
}
.ve-chat-bubble:active { transform: translateY(0) scale(.98); }
.ve-chat-bubble svg { width: 24px; height: 24px; }
.ve-chat-bubble .ve-chat-dot {
  position: absolute; top: 4px; right: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--gold, #C9A96E); border: 2px solid var(--bg,#FFFFFF);
}
@keyframes veChatBreathe {
  0%, 100% { box-shadow: 0 8px 24px rgba(17,17,17,.14), 0 0 0 0 rgba(201,169,110,.35); }
  50%      { box-shadow: 0 8px 24px rgba(17,17,17,.14), 0 0 0 8px rgba(201,169,110,0); }
}

/* ── Panel ───────────────────────────────────────────────── */
.ve-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 388px;
  max-width: calc(100vw - 32px);
  height: 570px;
  max-height: calc(100vh - 140px);
  background: var(--bg-2, #F8F6F2);
  color: var(--text, #2C2C2C);
  border: 1px solid var(--border-2, rgba(201,169,110,.2));
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(17,17,17,.22);
  opacity: 0;
  transform: translateY(18px) scale(.97);
  filter: blur(2px);
  pointer-events: none;
  transition: opacity .32s cubic-bezier(.2,.7,.3,1), transform .32s cubic-bezier(.2,.7,.3,1), filter .32s ease;
}
.ve-chat-panel.open { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); pointer-events: auto; }

.ve-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-2, rgba(201,169,110,.2));
  background: linear-gradient(180deg, rgba(201,169,110,.10), var(--bg-2, #F8F6F2) 90%);
}
.ve-chat-header h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  letter-spacing: .3px;
  color: var(--text, #2C2C2C);
  font-weight: 600;
  margin: 0;
}
.ve-chat-header button {
  background: none; border: none; color: var(--muted, #7A7A7A);
  opacity: .7; cursor: pointer; font-size: 19px; line-height: 1; padding: 4px;
  transition: opacity .15s ease, transform .15s ease;
}
.ve-chat-header button:hover { opacity: 1; transform: rotate(90deg); }

.ve-chat-body {
  flex: 1; overflow-y: auto; padding: 18px 16px 8px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin;
  background:
    radial-gradient(ellipse at top right, rgba(201,169,110,.06), transparent 55%),
    var(--bg-2, #F8F6F2);
}
.ve-chat-body::-webkit-scrollbar { width: 6px; }
.ve-chat-body::-webkit-scrollbar-thumb { background: var(--gold-line, rgba(201,169,110,.3)); border-radius: 6px; }

/* ── Messages ────────────────────────────────────────────── */
.ve-msg {
  max-width: 85%; font-size: 14px; line-height: 1.55; white-space: pre-line;
  animation: veMsgIn .32s cubic-bezier(.2,.7,.3,1) both;
}
.ve-msg-bot {
  align-self: flex-start;
  background: var(--card, #FFFFFF);
  border: 1px solid var(--border, rgba(17,17,17,.10));
  padding: 11px 15px; border-radius: 14px 14px 14px 3px;
  box-shadow: 0 2px 8px rgba(17,17,17,.04);
}
.ve-msg-user {
  align-self: flex-end;
  background: var(--gold, #C9A96E);
  color: #FFFFFF;
  padding: 11px 15px; border-radius: 14px 14px 3px 14px;
}
@keyframes veMsgIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Typing indicator ────────────────────────────────────── */
.ve-msg-typing { align-self: flex-start; padding: 0; background: none; border: none; box-shadow: none; }
.ve-typing-bubble {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--card, #FFFFFF);
  border: 1px solid var(--border, rgba(17,17,17,.10));
  padding: 12px 16px; border-radius: 14px 14px 14px 3px;
}
.ve-typing-bubble span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-2, #B8965A);
  opacity: .5;
  animation: veTypingDot 1.2s ease-in-out infinite;
}
.ve-typing-bubble span:nth-child(2) { animation-delay: .15s; }
.ve-typing-bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes veTypingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* ── Quick actions ───────────────────────────────────────── */
.ve-chat-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 14px; }
.ve-chat-actions button {
  background: var(--card, #FFFFFF);
  border: 1px solid var(--gold-line, rgba(201,169,110,.35));
  color: var(--gold-2, #B8965A);
  font-size: 12.5px;
  padding: 8px 13px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
  letter-spacing: .2px;
  animation: veMsgIn .3s cubic-bezier(.2,.7,.3,1) both;
}
.ve-chat-actions button:nth-child(1) { animation-delay: .03s; }
.ve-chat-actions button:nth-child(2) { animation-delay: .07s; }
.ve-chat-actions button:nth-child(3) { animation-delay: .11s; }
.ve-chat-actions button:nth-child(4) { animation-delay: .15s; }
.ve-chat-actions button:nth-child(5) { animation-delay: .19s; }
.ve-chat-actions button:nth-child(6) { animation-delay: .23s; }
.ve-chat-actions button:hover { background: var(--gold, #C9A96E); color: #fff; box-shadow: 0 4px 12px rgba(201,169,110,.3); }
.ve-chat-actions button:active { transform: scale(.97); }

/* ── Input ───────────────────────────────────────────────── */
.ve-chat-input {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 15px;
  border-top: 1px solid var(--border-2, rgba(201,169,110,.2));
  background: var(--bg, #FFFFFF);
}
.ve-chat-input input {
  flex: 1;
  background: var(--bg-2, #F8F6F2);
  border: 1px solid var(--border, rgba(17,17,17,.10));
  color: var(--text, #2C2C2C);
  font-size: 14px;
  padding: 11px 14px;
  border-radius: 22px;
  outline: none;
  transition: border-color .2s ease;
}
.ve-chat-input input::placeholder { color: var(--muted, #7A7A7A); }
.ve-chat-input input:focus { border-color: var(--gold, #C9A96E); }
.ve-chat-input button {
  background: var(--gold, #C9A96E);
  color: #FFFFFF;
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .15s ease, background .2s ease;
}
.ve-chat-input button:hover:not(:disabled) { transform: scale(1.06); background: var(--gold-2, #B8965A); }
.ve-chat-input button:active:not(:disabled) { transform: scale(.95); }
.ve-chat-input button:disabled { opacity: .45; cursor: default; }

/* ── Error state ─────────────────────────────────────────── */
.ve-chat-error {
  font-size: 12.5px; color: var(--text, #2C2C2C); padding: 10px 16px 14px;
  background: rgba(198,40,40,.06);
  border-top: 1px solid rgba(198,40,40,.14);
  animation: veMsgIn .25s ease both;
}
.ve-chat-error p { margin: 0 0 8px; }
.ve-chat-error-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ve-chat-error-actions button {
  font-size: 12px; padding: 7px 12px; border-radius: 18px; cursor: pointer;
  transition: transform .15s ease, background .2s ease;
  border: 1px solid var(--gold-line, rgba(201,169,110,.35));
}
.ve-chat-error-retry { background: var(--gold, #C9A96E); color: #fff; border-color: transparent; }
.ve-chat-error-retry:hover { background: var(--gold-2, #B8965A); }
.ve-chat-error-advisor { background: var(--card, #FFFFFF); color: var(--gold-2, #B8965A); }
.ve-chat-error-advisor:hover { background: var(--bg-3, #F0EDE8); }

/* ── Feedback ────────────────────────────────────────────── */
.ve-chat-feedback {
  display: flex; gap: 6px; align-self: flex-start; margin-top: -4px;
}
.ve-chat-feedback button {
  background: transparent; border: none; cursor: pointer;
  font-size: 13px; opacity: .55; padding: 2px 4px; border-radius: 6px;
  transition: opacity .15s ease, background .15s ease;
}
.ve-chat-feedback button:hover { opacity: 1; background: rgba(17,17,17,.05); }
.ve-chat-feedback-thanks { font-size: 11.5px; opacity: .55; padding: 2px 4px; }

/* ── Proactive prompt ────────────────────────────────────── */
.ve-chat-proactive {
  position: fixed;
  right: 24px;
  bottom: 96px;
  max-width: 260px;
  background: var(--card, #FFFFFF);
  border: 1px solid var(--gold-line, rgba(201,169,110,.3));
  color: var(--text, #2C2C2C);
  border-radius: 14px;
  padding: 13px 32px 13px 15px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 14px 34px rgba(17,17,17,.16);
  cursor: pointer;
  z-index: 9998;
  animation: veChatFadeIn .35s cubic-bezier(.2,.7,.3,1);
}
.ve-chat-proactive-dismiss {
  position: absolute; top: 7px; right: 9px;
  background: none; border: none; color: var(--muted,#7A7A7A);
  opacity: .6; cursor: pointer; font-size: 13px;
}
.ve-chat-proactive-dismiss:hover { opacity: 1; }
@keyframes veChatFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .ve-chat-panel {
    right: 8px; left: 8px; bottom: 88px; width: auto;
    height: calc(100vh - 120px);
  }
  .ve-chat-bubble { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ve-chat-bubble,
  .ve-chat-panel,
  .ve-msg,
  .ve-chat-actions button,
  .ve-typing-bubble span,
  .ve-chat-proactive,
  .ve-chat-error,
  .ve-product-card,
  .ve-product-carousel .ve-product-card {
    animation: none !important;
    transition: opacity .15s linear !important;
  }
  .ve-chat-panel { transform: none; filter: none; }
}

/* ==========================================================
   PRODUCT CARDS / CAROUSEL / COMPARISON
   Same luxury tokens as the rest of the widget — no separate
   "ecommerce widget" visual language.
========================================================== */
.ve-product-carousel {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  align-self: stretch;
}
.ve-product-carousel::-webkit-scrollbar { height: 5px; }
.ve-product-carousel::-webkit-scrollbar-thumb { background: var(--gold-line, rgba(201,169,110,.3)); border-radius: 6px; }

.ve-product-single { align-self: stretch; }

.ve-product-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 170px;
  background: var(--card, #FFFFFF);
  border: 1px solid var(--border, rgba(17,17,17,.10));
  border-radius: 13px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 2px 10px rgba(17,17,17,.05);
  animation: veCardIn .35s cubic-bezier(.2,.7,.3,1) both;
}
.ve-product-carousel .ve-product-card:nth-child(1) { animation-delay: .03s; }
.ve-product-carousel .ve-product-card:nth-child(2) { animation-delay: .09s; }
.ve-product-carousel .ve-product-card:nth-child(3) { animation-delay: .15s; }
.ve-product-carousel .ve-product-card:nth-child(4) { animation-delay: .21s; }
.ve-product-carousel .ve-product-card:nth-child(5) { animation-delay: .27s; }
@keyframes veCardIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ve-product-single .ve-product-card { width: 100%; }

.ve-product-card-img {
  width: 100%; height: 112px;
  background: var(--bg-3, #F0EDE8);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-2, #B8965A);
  font-family: 'Playfair Display', Georgia, serif; font-size: 26px;
  overflow: hidden;
}
.ve-product-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ve-product-card-info { padding: 11px 12px 4px; flex: 1; }
.ve-product-card-title {
  font-family: 'Playfair Display', Georgia, serif; font-size: 13px; color: var(--text,#2C2C2C);
  line-height: 1.3; margin-bottom: 3px;
}
.ve-product-card-price { font-size: 12px; color: var(--gold-2, #B8965A); font-weight: 600; margin-bottom: 4px; }
.ve-product-card-desc { font-size: 11px; color: var(--muted, #7A7A7A); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ve-product-card-stock { font-size: 10.5px; color: var(--danger, #C62828); margin-top: 4px; }

.ve-product-card-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px 12px 12px; }
.ve-product-btn {
  flex: 1; min-width: 0;
  text-align: center;
  font-size: 11px; letter-spacing: .2px;
  padding: 7px 8px;
  border-radius: 20px;
  border: 1px solid var(--gold-line, rgba(201,169,110,.35));
  background: transparent; color: var(--gold-2, #B8965A);
  cursor: pointer; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .2s ease, color .2s ease;
}
.ve-product-btn:hover { background: rgba(201,169,110,.12); }
.ve-product-btn-primary { background: var(--gold, #C9A96E); color: #fff; }
.ve-product-btn-primary:hover { background: var(--gold-2, #B8965A); }
.ve-product-btn-save:disabled { opacity: .6; cursor: default; }

/* ── Comparison table ───────────────────────────────────── */
.ve-compare {
  align-self: stretch;
  border: 1px solid var(--border, rgba(17,17,17,.10));
  border-radius: 13px;
  overflow: hidden;
  font-size: 12px;
  background: var(--card, #FFFFFF);
  animation: veMsgIn .3s cubic-bezier(.2,.7,.3,1) both;
}
.ve-compare-head, .ve-compare-row {
  display: grid;
  grid-template-columns: 92px repeat(2, 1fr);
}
.ve-compare-head {
  background: var(--bg-3, #F0EDE8);
  border-bottom: 1px solid var(--border, rgba(17,17,17,.10));
  padding: 10px 0 8px;
}
.ve-compare-label-col { padding: 8px 8px; color: var(--muted, #7A7A7A); font-size: 11px; align-self: center; }
.ve-compare-product-col { text-align: center; padding: 0 6px; }
.ve-compare-product-col img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; margin-bottom: 4px; }
.ve-compare-product-title { font-family: 'Playfair Display', Georgia, serif; font-size: 11.5px; color: var(--text,#2C2C2C); line-height: 1.25; }
.ve-compare-row { border-bottom: 1px solid var(--border, rgba(17,17,17,.06)); padding: 7px 0; }
.ve-compare-row:last-of-type { border-bottom: none; }
.ve-compare-value-col { text-align: center; padding: 0 6px; color: var(--text,#2C2C2C); align-self: center; font-size: 11.5px; }
.ve-compare-actions { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border, rgba(17,17,17,.08)); }

@media (max-width: 480px) {
  .ve-product-card { width: 148px; }
}
