/* ==========================================================================
   H&M AI Assistant — chat widget
   Free, scripted lead-capture assistant that hands off to WhatsApp.
   ========================================================================== */

.hmchat, .hmchat * { box-sizing: border-box; }
.hmchat svg { display: block; }            /* kill inline baseline gap on icons */

/* Launcher button */
.hmchat-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: 95;
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--gold-400, #c41230); color: #fff; border: 0; cursor: pointer;
  font-family: var(--font-head, sans-serif); font-weight: 700; font-size: 1rem;
  padding: 14px 22px 14px 18px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.hmchat-launch:hover { transform: translateY(-2px) scale(1.04); background: var(--gold-500, #a62330); box-shadow: 0 10px 26px rgba(0,0,0,.24); }
.hmchat-launch .ic { display: grid; place-items: center; color: #fff; flex: none; width: 20px; height: 20px; line-height: 0; }
.hmchat-launch[hidden] { display: none; }

/* Panel */
.hmchat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 96;
  width: 380px; max-width: calc(100vw - 32px); height: 600px; max-height: calc(100vh - 40px);
  background: #fff; border-radius: 20px; overflow: hidden; display: none; flex-direction: column;
  box-shadow: 0 30px 70px rgba(10,10,12,.4); border: 1px solid rgba(10,10,12,.1);
  font-family: var(--font, sans-serif);
}
.hmchat-panel.is-open { display: flex; animation: hmchat-in .22s ease; }
@keyframes hmchat-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* Header */
.hmchat-head {
  background: linear-gradient(135deg, var(--navy-700, #2a2a2c), var(--navy-900, #141414));
  color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 12px;
}
.hmchat-head .av { width: 46px; height: 46px; border-radius: 50%; display: block; flex: none; }
.hmchat-head h4 { margin: 0; font-family: var(--font-head, sans-serif); font-size: 1.02rem; color: #fff; line-height: 1.2; }
.hmchat-head p { margin: 2px 0 0; font-size: .8rem; color: #bcd; display: flex; align-items: center; gap: 6px; }
.hmchat-head .online { width: 8px; height: 8px; border-radius: 50%; background: #ffffff; display: inline-block; }
.hmchat-head .close { margin-left: auto; background: rgba(255,255,255,.14); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 1.1rem; line-height: 1; display: grid; place-items: center; padding: 0; }
.hmchat-head .close:hover { background: rgba(255,255,255,.26); }

/* Messages */
.hmchat-body { flex: 1; overflow-y: auto; padding: 18px; background: #f7f6f6; display: flex; flex-direction: column; gap: 12px; }
.hmchat-msg { max-width: 82%; padding: 11px 14px; border-radius: 15px; font-size: .95rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.hmchat-msg.bot { background: #fff; color: #1a1a1a; border: 1px solid #e6e6e6; border-bottom-left-radius: 5px; align-self: flex-start; }
.hmchat-msg.user { background: var(--navy-800, #1d1d1f); color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; }
.hmchat-typing { align-self: flex-start; background: #fff; border: 1px solid #e6e6e6; border-radius: 15px; border-bottom-left-radius: 5px; padding: 13px 16px; display: inline-flex; gap: 4px; }
.hmchat-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9a9a9c; animation: hmchat-bounce 1.2s infinite ease-in-out; }
.hmchat-typing span:nth-child(2) { animation-delay: .15s; }
.hmchat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes hmchat-bounce { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Quick-reply chips */
.hmchat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 4px; }
.hmchat-chip { background: #fff; border: 1.5px solid var(--navy-600, #3a3a3d); color: var(--navy-700, #2a2a2c); font-family: var(--font-head, sans-serif); font-weight: 600; font-size: .9rem; padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: .12s; }
.hmchat-chip:hover { background: var(--navy-800, #1d1d1f); color: #fff; border-color: var(--navy-800, #1d1d1f); }
.hmchat-chip.go { background: #25d366; border-color: #25d366; color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.hmchat-chip.go:hover { background: #1db957; border-color: #1db957; }
.hmchat-chip.call { background: var(--red-500, #e63946); border-color: var(--red-500, #e63946); color: #fff; }
.hmchat-chip.call:hover { background: var(--red-600, #cc2f3c); }

/* Input */
.hmchat-input { border-top: none; background: #fff; padding: 12px; display: flex; gap: 8px; align-items: center; }
.hmchat-input input { flex: 1; border: 1.5px solid #e6e6e6; border-radius: 999px; padding: 11px 16px; font: inherit; font-size: .95rem; outline: 0; }
.hmchat-input input:focus { border-color: var(--gold-400, #c62f39); box-shadow: 0 0 0 3px rgba(242,177,52,.18); }
.hmchat-input button { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; padding: 0; background: var(--gold-400, #c62f39); color: var(--navy-900, #141414); cursor: pointer; display: grid; place-items: center; }
.hmchat-input button:hover { background: var(--gold-300, #f6c85a); }
.hmchat-input[hidden] { display: none; }

.hmchat-foot { text-align: center; font-size: .72rem; color: #8f8f91; padding: 0 0 10px; background: #fff; }

@media (max-width: 480px) {
  .hmchat-panel { right: 8px; bottom: 8px; height: calc(100vh - 16px); max-height: none; width: calc(100vw - 16px); }
  .hmchat-launch { right: 14px; bottom: 14px; padding: 13px 18px 13px 14px; }
  .hmchat-launch .label-sm { display: none; }
}

/* ---- Proactive greeting teaser ---- */
.hmchat-teaser {
  position: fixed; right: 20px; bottom: 88px; z-index: 94; max-width: 270px;
  background: #fff; color: #1a1a1a; border: 1px solid #e6e6e6;
  border-radius: 16px; border-bottom-right-radius: 5px;
  padding: 14px 16px; box-shadow: 0 16px 36px rgba(10,10,12,.24);
  font-size: .92rem; line-height: 1.5; cursor: pointer;
  opacity: 0; transform: translateY(12px); transition: opacity .25s ease, transform .25s ease;
}
.hmchat-teaser.in { opacity: 1; transform: none; }
.hmchat-teaser p { margin: 0; padding-right: 8px; }
.hmchat-teaser strong { color: #a62330; }
.hmchat-teaser-x {
  position: absolute; top: 6px; right: 9px; background: none; border: 0;
  font-size: 1.15rem; line-height: 1; color: #9a9a9c; cursor: pointer; padding: 2px;
}
.hmchat-teaser-x:hover { color: #1a1a1a; }
@media (max-width: 480px) {
  .hmchat-teaser { right: 14px; bottom: 82px; max-width: calc(100vw - 90px); }
}

/* Hide the auto-greeting teaser bubble on phones/tablets — it overlaps page content; launcher remains. */
@media (max-width: 768px) {
  .hmchat-teaser { display: none !important; }
}
