/* =========================================================================
   Executive Live Concierge Widget (Mobile-First & Clean)
   ========================================================================= */

.concierge-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  font-family: var(--sans);
}

/* Floating Trigger Button */
.concierge-trigger {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid #fff;
  box-shadow: 0 10px 28px -8px rgba(17, 17, 20, .35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.concierge-trigger:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 14px 32px -8px rgba(17, 17, 20, .4);
}

.concierge-trigger:active {
  transform: scale(0.95);
}

.concierge-trigger .trigger-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
}

.concierge-trigger .trigger-photo svg,
.concierge-avatar svg {
  width: 55%;
  height: 55%;
}

.concierge-avatar { color: #fff; background: var(--ink) !important; }
.c-msg a { color: var(--accent); text-decoration: underline; }

.concierge-trigger .trigger-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 6px rgba(17, 17, 20, .08);
}

.concierge-trigger .trigger-icon svg {
  width: 12px;
  height: 12px;
  fill: var(--bg);
}

.concierge-trigger.open .trigger-icon svg.icon-chat { display: none; }
.concierge-trigger:not(.open) .trigger-icon svg.icon-close { display: none; }

.concierge-trigger .online-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 13px;
  height: 13px;
  background: #0f7a55;
  border: 2px solid var(--bg);
  border-radius: 50%;
  z-index: 2;
}

.c-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  background: #c62828;
  color: #fff;
  border: 2px solid var(--bg);
  font-size: .65rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  animation: pulseBadge 1.5s infinite;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Chat Popup Window */
.concierge-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 384px;              /* fits the seven shortcuts in two rows */
  max-width: calc(100vw - 28px);
  height: 520px;
  max-height: calc(100vh - 100px);
  max-height: calc(100dvh - 100px);
  background: rgba(255, 255, 255, .98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px -18px rgba(17, 17, 20, .3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.concierge-window.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Header */
.concierge-head {
  padding: 12px 14px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.concierge-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.concierge-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.concierge-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.concierge-info h4 {
  margin: 0;
  font-size: .88rem;
  font-family: var(--display);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
}

.concierge-info p {
  margin: 2px 0 0;
  font-size: .68rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

.concierge-info p span.pulse {
  width: 5px;
  height: 5px;
  background: #0f7a55;
  border-radius: 50%;
  display: inline-block;
}

.concierge-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.15s;
}

.concierge-close-btn:hover {
  color: var(--ink);
}

/* Messages Area */
.concierge-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.c-msg {
  max-width: 88%;
  padding: 9px 12px;
  font-size: .84rem;
  line-height: 1.4;
  border-radius: 12px;
  word-wrap: break-word;
  animation: fadeInMsg 0.18s ease forwards;
}

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

.c-sender-tag {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
  display: block;
}

.c-msg.bot {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 3px;
}

.c-msg.admin-reply {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(138, 100, 32, 0.18), var(--surface-2));
  border: 1px solid var(--accent);
  color: var(--ink);
  border-bottom-left-radius: 3px;
  box-shadow: 0 4px 12px rgba(138, 100, 32, 0.15);
}

.c-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
  border-bottom-right-radius: 3px;
}

.c-msg-card {
  background: rgba(17, 17, 20, .04);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 6px;
  font-size: .78rem;
}

/* Quick Action Chips */
/* Every shortcut has to be visible. This was a nowrap scroll strip with no
   affordance, so four of the seven chips sat off-screen and nobody knew. */
.concierge-chips {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-top: 1px solid rgba(17, 17, 20, .05);
}

.c-chip {
  flex: 0 0 auto;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--muted);
  padding: 5px 9px;
  border-radius: var(--r-pill);
  font-size: .68rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

/* Reaching a person is the point of the widget — it leads and it stands out. */
.c-chip[data-ask="human"] {
  border-color: rgba(138, 100, 32, .55);
  color: var(--accent);
  background: rgba(138, 100, 32, .1);
  font-weight: 600;
}

.c-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(138, 100, 32, 0.08);
}

.c-chip:active {
  transform: scale(0.96);
}

/* Input Area */
.concierge-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  gap: 6px;
  align-items: center;
}

.concierge-input {
  flex: 1;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0 12px;
  color: var(--ink);
  font-size: .82rem;
  font-family: inherit;
}

.concierge-input:focus {
  outline: none;
  border-color: var(--accent);
}

.concierge-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s;
  flex: 0 0 auto;
}

.concierge-send-btn:hover {
  transform: scale(1.06);
}

.concierge-send-btn:active {
  transform: scale(0.94);
}

.concierge-send-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* =========================================================================
   Mobile Optimization (< 600px)
   ========================================================================= */
@media (max-width: 600px) {
  .concierge-widget {
    bottom: 16px;
    right: 16px;
  }

  .concierge-trigger {
    width: 52px;
    height: 52px;
  }

  .concierge-trigger .trigger-icon {
    width: 20px;
    height: 20px;
  }

  .concierge-trigger .trigger-icon svg {
    width: 10px;
    height: 10px;
  }

  .concierge-window {
    position: fixed;
    bottom: 76px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    height: min(520px, calc(100dvh - 90px));
    border-radius: 16px;
  }
}

.c-badge[hidden] { display: none; }
