/* Muse Authentic 24/7 Livechat Concierge Widget */
:root {
  --mlc-ink: #141210;
  --mlc-ink-soft: #2C2723;
  --mlc-gold: #9A7B4F;
  --mlc-gold-light: #C5A572;
  --mlc-ivory: #FAF8F5;
  --mlc-paper: #FFFFFF;
  --mlc-muted: #6E665E;
  --mlc-border: #E5DFD6;
  --mlc-green: #1F8A5B;
}

.mlc-launcher {
  position: fixed;
  right: 20px;
  bottom: 128px;
  z-index: 9995;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 18px 0 14px;
  border: 1px solid rgba(197, 165, 114, 0.55);
  border-radius: 999px;
  background: linear-gradient(135deg, #191613 0%, #2A241E 100%);
  color: #FAF8F5;
  font-family: var(--font-sans, 'Be Vietnam Pro', -apple-system, sans-serif);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 34px rgba(20, 18, 16, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  touch-action: manipulation;
}

.mlc-launcher:hover {
  transform: translateY(-2px);
  border-color: var(--mlc-gold-light);
  box-shadow: 0 18px 40px rgba(20, 18, 16, 0.36);
}

.mlc-launcher:focus-visible {
  outline: 2px solid var(--mlc-gold);
  outline-offset: 3px;
}

.mlc-launcher__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(197, 165, 114, 0.18);
  color: #E7CFA1;
  flex-shrink: 0;
}

.mlc-launcher__icon svg {
  width: 16px;
  height: 16px;
}

.mlc-launcher__dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #28B473;
  border: 2px solid #191613;
}

.mlc-launcher__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.18;
}

.mlc-launcher__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #FFFFFF;
}

.mlc-launcher__sub {
  font-size: 0.68rem;
  font-weight: 400;
  color: #D8CBB8;
}

.mlc-launcher__badge {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #B8332A;
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
}

.mlc-launcher__badge.is-visible {
  display: inline-flex;
}

/* Chat Window */
.mlc-window {
  position: fixed;
  right: 20px;
  bottom: calc(var(--mlc-vbottom, 0px) + 188px);
  width: 392px;
  max-width: calc(100vw - 28px);
  height: min(590px, calc(var(--mlc-vh, 100dvh) - 208px));
  min-height: 400px;
  z-index: 10020;
  display: none;
  flex-direction: column;
  background: var(--mlc-paper);
  border: 1px solid rgba(20, 18, 16, 0.14);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(20, 18, 16, 0.28), 0 4px 14px rgba(20, 18, 16, 0.08);
  overflow: hidden;
  font-family: var(--font-sans, 'Be Vietnam Pro', -apple-system, sans-serif);
  color: var(--mlc-ink);
}

.mlc-window.is-open {
  display: flex;
  animation: mlcSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mlcSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.mlc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 14px 18px;
  background: linear-gradient(135deg, #161412 0%, #26201B 100%);
  color: #FAF8F5;
  border-bottom: 1px solid rgba(197, 165, 114, 0.28);
  flex-shrink: 0;
}

.mlc-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.mlc-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(197, 165, 114, 0.16);
  border: 1px solid rgba(197, 165, 114, 0.45);
  color: #E7CFA1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.mlc-avatar__online {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #28B473;
  border: 2px solid #161412;
}

.mlc-brand__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mlc-brand__copy strong {
  font-size: 0.94rem;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.25;
}

.mlc-brand__copy span {
  font-size: 0.73rem;
  color: #D5C8B4;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mlc-header__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mlc-icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #D5C8B4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mlc-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.mlc-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Current product contextual bar */
.mlc-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  background: #F4EFE7;
  border-bottom: 1px solid var(--mlc-border);
  font-size: 0.75rem;
  color: var(--mlc-ink-soft);
  flex-shrink: 0;
}

.mlc-context-bar__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mlc-context-bar__btn {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--mlc-gold);
  background: #FFFFFF;
  color: var(--mlc-ink);
  font-size: 0.71rem;
  font-weight: 600;
  cursor: pointer;
}

.mlc-context-bar__btn:hover {
  background: var(--mlc-ink);
  color: #FFFFFF;
  border-color: var(--mlc-ink);
}

/* Messages Stream */
.mlc-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 15px 12px;
  background: var(--mlc-ivory);
  overscroll-behavior: contain;
}

.mlc-intro {
  margin-bottom: 14px;
}

.mlc-intro h3 {
  margin: 0 0 6px;
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--mlc-ink);
}

.mlc-intro p {
  margin: 0 0 12px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--mlc-muted);
}

.mlc-starters {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--mlc-border);
  border-radius: 12px;
  background: #FFFFFF;
  overflow: hidden;
}

.mlc-starter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid var(--mlc-border);
  background: #FFFFFF;
  color: var(--mlc-ink);
  font: inherit;
  font-size: 0.81rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mlc-starter:last-child {
  border-bottom: 0;
}

.mlc-starter:hover {
  background: #F8F4EC;
  color: #7B5E34;
}

.mlc-starter__arrow {
  color: var(--mlc-gold);
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Message Bubbles */
.mlc-msg {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  max-width: 89%;
}

.mlc-msg--visitor {
  margin-left: auto;
  align-items: flex-end;
}

.mlc-msg--ai,
.mlc-msg--staff {
  margin-right: auto;
  align-items: flex-start;
}

.mlc-msg__bubble {
  padding: 10px 13px;
  border-radius: 14px 14px 14px 4px;
  background: #FFFFFF;
  border: 1px solid var(--mlc-border);
  color: var(--mlc-ink);
  font-size: 0.85rem;
  line-height: 1.58;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.mlc-msg--visitor .mlc-msg__bubble {
  background: var(--mlc-ink);
  border-color: var(--mlc-ink);
  color: #FAF8F5;
  border-radius: 14px 14px 4px 14px;
}

.mlc-msg__bubble a {
  color: #7B5E34;
  text-decoration: underline;
  font-weight: 500;
}

.mlc-msg--visitor .mlc-msg__bubble a {
  color: #E7CFA1;
}

.mlc-msg__meta {
  margin-top: 4px;
  font-size: 0.68rem;
  color: var(--mlc-muted);
}

/* Rich Product Cards inside Chat */
.mlc-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.mlc-card {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  padding: 8px;
  background: #FFFFFF;
  border: 1px solid var(--mlc-border);
  border-radius: 11px;
  text-decoration: none !important;
  color: var(--mlc-ink) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mlc-card:hover {
  border-color: var(--mlc-gold);
  box-shadow: 0 6px 16px rgba(20, 18, 16, 0.08);
}

.mlc-card__img {
  width: 60px;
  height: 72px;
  object-fit: cover;
  border-radius: 7px;
  background: #F3EFEA;
}

.mlc-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.mlc-card__brand {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mlc-gold);
}

.mlc-card__title {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.32;
  color: var(--mlc-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mlc-card__price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 1px;
}

.mlc-card__price {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mlc-ink);
}

.mlc-card__stock {
  font-size: 0.68rem;
  color: var(--mlc-green);
  font-weight: 500;
}

/* Typing / Waiting Feedback */
.mlc-feedback {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: var(--mlc-ivory);
  border-top: 1px solid rgba(229, 223, 214, 0.55);
  font-size: 0.75rem;
  color: var(--mlc-muted);
  flex-shrink: 0;
}

.mlc-feedback.is-visible {
  display: flex;
}

.mlc-dots {
  display: inline-flex;
  gap: 3px;
}

.mlc-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mlc-gold);
  animation: mlcPulse 1.1s infinite ease-in-out;
}

.mlc-dots i:nth-child(2) { animation-delay: 0.18s; }
.mlc-dots i:nth-child(3) { animation-delay: 0.36s; }

@keyframes mlcPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1.15); }
}

/* Input Composer */
.mlc-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: #FFFFFF;
  border-top: 1px solid var(--mlc-border);
  flex-shrink: 0;
}

.mlc-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  max-height: 108px;
  padding: 9px 11px;
  border: 1px solid var(--mlc-border);
  border-radius: 11px;
  background: #FAF8F5;
  color: var(--mlc-ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.42;
  resize: none;
  outline: none;
}

.mlc-input:focus {
  background: #FFFFFF;
  border-color: var(--mlc-gold);
}

.mlc-send-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 11px;
  background: var(--mlc-ink);
  color: #FAF8F5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.mlc-send-btn:hover {
  background: var(--mlc-gold);
}

.mlc-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mlc-send-btn svg {
  width: 17px;
  height: 17px;
}

/* Responsive Mobile Layout: sits cleanly above bottom .concierge-dock bar */
@media (max-width: 600px) {
  .mlc-launcher {
    right: 12px;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    height: 46px;
    padding: 0 14px 0 11px;
  }
  .mlc-launcher__sub {
    display: none;
  }
  .mlc-window {
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    bottom: calc(var(--mlc-vbottom, 0px) + 68px + env(safe-area-inset-bottom, 0px));
    height: min(540px, calc(var(--mlc-vh, 100dvh) - 84px));
    min-height: 320px;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mlc-window.is-open, .mlc-dots i { animation: none !important; }
}
