/* LOWEELUXURY — LOWEE AI chat widget */
.lwl-chat {
  --lwl-chat-bg: #0a0908;
  --lwl-chat-panel: linear-gradient(
    165deg,
    rgba(22, 20, 18, 0.98) 0%,
    rgba(8, 8, 8, 0.99) 55%,
    rgba(14, 12, 10, 0.98) 100%
  );
  --lwl-chat-gold: #c9a84c;
  --lwl-chat-gold-soft: #f2e6a8;
  --lwl-chat-line: rgba(201, 168, 76, 0.28);
  --lwl-chat-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 10000;
  font-family: Montserrat, system-ui, sans-serif;
  pointer-events: none;
}

.lwl-chat *,
.lwl-chat *::before,
.lwl-chat *::after {
  box-sizing: border-box;
}

.lwl-chat__launcher,
.lwl-chat__panel {
  pointer-events: auto;
}

.lwl-chat__launcher {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 1px solid rgba(201, 168, 76, 0.45);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(201, 168, 76, 0.18), transparent 55%),
    linear-gradient(155deg, #141210 0%, #050505 100%);
  color: var(--lwl-chat-gold-soft);
  cursor: pointer;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 24px rgba(201, 168, 76, 0.12);
  transition:
    transform 0.35s var(--lwl-chat-ease),
    box-shadow 0.35s var(--lwl-chat-ease),
    border-color 0.35s var(--lwl-chat-ease),
    opacity 0.35s var(--lwl-chat-ease);
}

.lwl-chat__launcher:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(214, 179, 106, 0.65);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.6),
    0 0 32px rgba(201, 168, 76, 0.18);
}

.lwl-chat__launcher:focus-visible {
  outline: 2px solid var(--lwl-chat-gold);
  outline-offset: 3px;
}

.lwl-chat__launcher-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.35s var(--lwl-chat-ease), opacity 0.25s ease;
}

.lwl-chat__launcher-icon--close {
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
}

.lwl-chat.is-open .lwl-chat__launcher-icon--open {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}

.lwl-chat.is-open .lwl-chat__launcher-icon--close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.lwl-chat__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 120px));
  border: 1px solid var(--lwl-chat-line);
  border-radius: 14px;
  background: var(--lwl-chat-panel);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 1px 0 rgba(201, 168, 76, 0.12) inset;
  transition:
    opacity 0.4s var(--lwl-chat-ease),
    transform 0.45s var(--lwl-chat-ease),
    visibility 0.4s;
}

.lwl-chat.is-open .lwl-chat__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.lwl-chat__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.16);
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.08), transparent);
}

.lwl-chat__avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(201, 168, 76, 0.35);
  background: radial-gradient(circle at 30% 20%, rgba(201, 168, 76, 0.22), rgba(5, 5, 5, 0.95));
  color: var(--lwl-chat-gold-soft);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.lwl-chat__brand {
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(201, 168, 76, 0.75);
}

.lwl-chat__title {
  margin: 4px 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #f4f4f4;
}

.lwl-chat__status {
  margin: 2px 0 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7ecf8a;
}

.lwl-chat__status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #7ecf8a;
  box-shadow: 0 0 8px rgba(126, 207, 138, 0.65);
  vertical-align: middle;
}

.lwl-chat__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 12px;
  scroll-behavior: smooth;
}

.lwl-chat__body::-webkit-scrollbar {
  width: 5px;
}

.lwl-chat__body::-webkit-scrollbar-thumb {
  background: rgba(201, 168, 76, 0.25);
  border-radius: 999px;
}

.lwl-chat__message {
  max-width: 92%;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: #ececec;
  animation: lwlChatFadeIn 0.45s var(--lwl-chat-ease) both;
}

.lwl-chat__message--bot {
  border: 1px solid rgba(201, 168, 76, 0.14);
  background: rgba(255, 255, 255, 0.03);
  border-bottom-left-radius: 4px;
}

.lwl-chat__message--user {
  margin-left: auto;
  border: 1px solid rgba(201, 168, 76, 0.22);
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.16), rgba(201, 168, 76, 0.06));
  border-bottom-right-radius: 4px;
  text-align: right;
}

.lwl-chat__message p {
  margin: 0 0 8px;
}

.lwl-chat__message p:last-child {
  margin-bottom: 0;
}

.lwl-chat__message-label {
  display: block;
  margin-bottom: 6px;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(201, 168, 76, 0.72);
}

.lwl-chat__typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid rgba(201, 168, 76, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.lwl-chat__typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.65);
  animation: lwlChatTyping 1.2s infinite ease-in-out;
}

.lwl-chat__typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.lwl-chat__typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.lwl-chat__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 16px;
}

.lwl-chat__action {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(201, 168, 76, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: #f2e6a8;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s var(--lwl-chat-ease);
}

.lwl-chat__action:hover {
  background: rgba(201, 168, 76, 0.1);
  border-color: rgba(214, 179, 106, 0.48);
  transform: translateX(2px);
}

.lwl-chat__action:focus-visible {
  outline: 2px solid var(--lwl-chat-gold);
  outline-offset: 2px;
}

.lwl-chat__action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.lwl-chat__footer {
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(201, 168, 76, 0.12);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(154, 154, 154, 0.85);
}

@keyframes lwlChatFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lwlChatTyping {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 480px) {
  .lwl-chat {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .lwl-chat__launcher {
    width: 54px;
    height: 54px;
  }

  .lwl-chat__panel {
    width: calc(100vw - 24px);
    max-height: min(72vh, 520px);
    right: -4px;
  }

  .lwl-chat__action {
    font-size: 10px;
    padding: 10px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lwl-chat__panel,
  .lwl-chat__launcher,
  .lwl-chat__launcher-icon,
  .lwl-chat__message,
  .lwl-chat__action {
    transition: none;
    animation: none;
  }

  .lwl-chat__typing span {
    animation: none;
    opacity: 0.65;
  }
}
