/* Live support chat widget */

.btn-whatsapp {
  background: linear-gradient(180deg, #2fe07a, #128C7E) !important;
  border-color: #0e7a6d !important;
  color: #fff !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 9px 0 #0b5f55,
    0 16px 0 rgba(11, 95, 85, 0.35),
    0 24px 28px rgba(18, 140, 126, 0.35) !important;
}
.btn-whatsapp:hover { filter: brightness(1.04); color: #fff !important; }
.btn-whatsapp:active, .btn-whatsapp.is-pressed {
  transform: translateY(6px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 3px 0 #0b5f55,
    0 10px 16px rgba(18, 140, 126, 0.28) !important;
}

.contact-tile.wa-tile {
  background: linear-gradient(145deg, #e8fff6, #d1fae5);
  border-color: #6ee7b7;
}
.contact-tile.wa-tile .contact-label { color: #047857; }
.contact-tile.wa-tile strong { color: #065f46; }

.live-chat {
  position: fixed;
  inset-inline-end: 1.15rem;
  bottom: 1.15rem;
  z-index: 80;
  font-family: var(--font);
}
.live-chat-fab {
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background:
    radial-gradient(circle at 30% 28%, #ffb06a, transparent 42%),
    linear-gradient(160deg, #ff8a3d, #c2410c 58%, #3d4751);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.35) inset,
    0 14px 0 #7c2d12,
    0 22px 0 rgba(124, 45, 18, 0.35),
    0 28px 40px rgba(47, 54, 61, 0.35);
  transform: translateZ(0);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}
.live-chat-fab:hover {
  transform: translateY(-4px);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.4) inset,
    0 18px 0 #7c2d12,
    0 26px 0 rgba(124, 45, 18, 0.3),
    0 34px 48px rgba(47, 54, 61, 0.38);
}
.live-chat-fab:active {
  transform: translateY(8px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 4px 0 #7c2d12,
    0 12px 18px rgba(47, 54, 61, 0.28);
}
.live-chat-fab svg { width: 30px; height: 30px; display: block; margin: 0 auto; }
.live-chat-fab .fab-pulse {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(249, 115, 22, 0.45);
  animation: fabPulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes fabPulse {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.28); opacity: 0; }
}
.live-chat-badge {
  position: absolute;
  top: -2px;
  inset-inline-start: -2px;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #0284c7;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
}
.live-chat-badge[hidden] { display: none !important; }

.live-chat-panel {
  position: absolute;
  inset-inline-end: 0;
  bottom: calc(100% + 0.85rem);
  width: min(380px, calc(100vw - 1.5rem));
  height: min(560px, calc(100vh - 7rem));
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(74, 85, 96, 0.12);
  box-shadow:
    0 28px 60px rgba(31, 37, 43, 0.28),
    0 2px 0 rgba(255, 255, 255, 0.8) inset;
  transform-origin: bottom left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.live-chat.is-open .live-chat-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.live-chat-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  background: linear-gradient(135deg, #3d4751, #2f363d 60%, #9a3412);
  color: #fff;
}
.live-chat-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #fb923c, #ea580c);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  flex: 0 0 auto;
}
.live-chat-head strong { display: block; font-size: 0.98rem; }
.live-chat-head span { display: block; font-size: 0.78rem; opacity: 0.85; }
.live-chat-online {
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: #34d399; display: inline-block; margin-inline-end: 0.3rem;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}
.live-chat-close {
  margin-inline-start: auto;
  border: 0; background: rgba(255,255,255,0.12); color: #fff;
  width: 2rem; height: 2rem; border-radius: 10px; cursor: pointer;
}

.live-chat-intro {
  padding: 0.85rem 1rem 0.4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  background: #f8fafb;
  border-bottom: 1px solid rgba(74, 85, 96, 0.08);
}
.live-chat-intro label {
  display: grid; gap: 0.25rem; font-size: 0.75rem; font-weight: 700; color: #5c6975;
}
.live-chat-intro input {
  border: 1px solid rgba(74, 85, 96, 0.14);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
}

.live-chat-msgs {
  flex: 1;
  overflow: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background:
    radial-gradient(circle at 80% 0%, rgba(249, 115, 22, 0.08), transparent 35%),
    #eef1f4;
}
.lc-bubble {
  max-width: 82%;
  padding: 0.65rem 0.8rem 0.4rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(74, 85, 96, 0.1);
  box-shadow: 0 8px 18px rgba(47, 54, 61, 0.06);
}
.lc-bubble p { margin: 0; white-space: pre-wrap; line-height: 1.7; font-size: 0.9rem; color: #243038; }
.lc-bubble .lc-meta {
  display: flex; justify-content: flex-end; gap: 0.35rem; align-items: center; margin-top: 0.3rem;
}
.lc-bubble .lc-meta time { font-size: 0.7rem; color: #7a8793; }
.lc-bubble.mine {
  margin-inline-start: auto;
  background: linear-gradient(180deg, #fff7ed, #ffedd5);
  border-color: #fdba74;
}
.lc-bubble.theirs { margin-inline-end: auto; }
.lc-bubble.system {
  margin-inline: auto;
  max-width: 92%;
  text-align: center;
  background: rgba(255, 255, 255, 0.75);
  color: #5c6975;
}
.lc-ticks { font-size: 0.78rem; letter-spacing: -0.08em; color: #9aa5af; font-weight: 700; }
.lc-ticks.delivered { color: #6b7280; }
.lc-ticks.seen { color: #0284c7; }

.live-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(74, 85, 96, 0.1);
  background: #fff;
}
.live-chat-form textarea {
  resize: none;
  min-height: 2.8rem;
  max-height: 7rem;
  border: 1px solid rgba(74, 85, 96, 0.14);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  font: inherit;
}
.live-chat-form button {
  border: 0;
  border-radius: 14px;
  min-width: 3.1rem;
  background: linear-gradient(180deg, #fb923c, #ea580c);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 0 #9a3412, 0 14px 18px rgba(234, 88, 12, 0.28);
}
.live-chat-form button:active { transform: translateY(5px); box-shadow: 0 3px 0 #9a3412; }

@media (max-width: 640px) {
  .live-chat { inset-inline-end: 0.85rem; bottom: 0.85rem; }
  .live-chat-fab { width: 62px; height: 62px; }
  .live-chat-panel { height: min(70vh, 560px); }
}
@media (prefers-reduced-motion: reduce) {
  .live-chat-fab .fab-pulse { animation: none; }
  .live-chat-panel, .live-chat-fab { transition: none; }
}
