/* Chat bubble (helper robot + live chat). Colors follow the shop's orange/green brand. */
.hd { --hd-orange: #e8731f; --hd-green: #2f6b4a; --hd-bg: #fffaf3; --hd-line: #f0dfc4; --hd-ink: #2f2a24; position: fixed; right: 18px; bottom: 18px; z-index: 950; font-family: inherit; }
.hd .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hd-launcher { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--hd-orange); color: #fff; border: 0; border-radius: 999px; padding: 0.75rem 1.1rem; font-size: 0.95rem; font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22); position: relative; }
.hd-launcher:hover { background: #d4660f; }
.hd-launcher:focus-visible, .hd button:focus-visible, .hd a:focus-visible, .hd input:focus-visible, .hd textarea:focus-visible { outline: 3px solid var(--hd-green); outline-offset: 2px; }
.hd-launcher.is-open { display: none; }
.hd-badge { position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: #c0392b; color: #fff; font-size: 0.75rem; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.hd-badge[hidden] { display: none; }

.hd-panel { width: 372px; max-width: calc(100vw - 24px); height: 560px; max-height: calc(100vh - 36px); background: var(--hd-bg); border: 1px solid var(--hd-line); border-radius: 18px; box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28); display: flex; flex-direction: column; overflow: hidden; color: var(--hd-ink); }
.hd-panel[hidden] { display: none; }
.hd-head { background: linear-gradient(135deg, var(--hd-green), #3d8460); color: #fff; padding: 0.8rem 0.9rem; display: flex; align-items: center; gap: 0.4rem; }
.hd-head-text { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.hd-head-text strong { font-size: 1.02rem; }
.hd-status { font-size: 0.78rem; opacity: 0.92; }
.hd-status::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #7ee2a8; margin-right: 6px; }
.hd-status.is-away::before { background: #f3c26b; }
.hd-icon-btn { background: transparent; border: 0; color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0.2rem 0.45rem; border-radius: 8px; }
.hd-icon-btn:hover { background: rgba(255, 255, 255, 0.18); }

.hd-log { flex: 1; overflow-y: auto; padding: 0.9rem 0.8rem 0.4rem; display: flex; flex-direction: column; gap: 0.5rem; scroll-behavior: smooth; }
.hd-msg { display: flex; flex-direction: column; max-width: 88%; }
.hd-msg.hd-me { align-self: flex-end; align-items: flex-end; }
.hd-msg.hd-bot, .hd-msg.hd-staff { align-self: flex-start; }
.hd-who { font-size: 0.72rem; color: #7a6f60; margin: 0 0 2px 6px; }
.hd-bubble { padding: 0.55rem 0.8rem; border-radius: 16px; line-height: 1.4; font-size: 0.93rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.hd-bot .hd-bubble { background: #fff; border: 1px solid var(--hd-line); border-bottom-left-radius: 4px; }
.hd-staff .hd-bubble { background: #e6f2ea; border: 1px solid #c6e0cf; border-bottom-left-radius: 4px; }
.hd-me .hd-bubble { background: var(--hd-orange); color: #fff; border-bottom-right-radius: 4px; }
.hd-typing { display: inline-flex; gap: 4px; padding: 0.7rem 0.9rem; }
.hd-typing span { width: 7px; height: 7px; border-radius: 50%; background: #b9ab94; animation: hd-bounce 1s infinite ease-in-out; }
.hd-typing span:nth-child(2) { animation-delay: 0.15s; }
.hd-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes hd-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hd-typing span { animation: none; } .hd-log { scroll-behavior: auto; } }

.hd-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.15rem 0 0.4rem; }
.hd-chip { background: #fff; border: 1.5px solid var(--hd-orange); color: #b3560e; border-radius: 999px; padding: 0.38rem 0.8rem; font-size: 0.86rem; cursor: pointer; text-decoration: none; font-family: inherit; line-height: 1.2; }
.hd-chip:hover { background: var(--hd-orange); color: #fff; }
.hd-chip-link { border-color: var(--hd-green); color: var(--hd-green); }
.hd-chip-link:hover { background: var(--hd-green); color: #fff; }

.hd-cards { display: flex; gap: 0.6rem; overflow-x: auto; padding: 0.1rem 0.1rem 0.5rem; scroll-snap-type: x proximity; margin: 0 -0.2rem; }
.hd-card { flex: 0 0 148px; scroll-snap-align: start; background: #fff; border: 1px solid var(--hd-line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.hd-card:hover { border-color: var(--hd-orange); box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12); }
.hd-card img { width: 100%; height: 118px; object-fit: cover; background: #f3ead9; }
.hd-card-name { font-size: 0.84rem; padding: 0.45rem 0.55rem 0; line-height: 1.25; }
.hd-card-price { padding: 0.1rem 0.55rem; font-size: 0.86rem; color: var(--hd-orange); font-weight: 700; }
.hd-card-note { padding: 0 0.55rem 0.5rem; font-size: 0.72rem; color: #7a6f60; }

.hd-handoff { background: #fff; border: 1px solid var(--hd-line); border-radius: 14px; padding: 0.6rem; display: flex; flex-direction: column; gap: 0.45rem; }
.hd-handoff input, .hd-handoff textarea { width: 100%; box-sizing: border-box; border: 1px solid #d9c9aa; border-radius: 10px; padding: 0.5rem 0.65rem; font: inherit; font-size: 0.9rem; }
.hd-send-team { background: var(--hd-green); color: #fff; border: 0; border-radius: 10px; padding: 0.55rem; font-weight: 600; cursor: pointer; }
.hd-send-team:disabled { opacity: 0.6; }
.hd-error { margin: 0; color: #a52a1f; font-size: 0.85rem; }

.hd-form { display: flex; gap: 0.4rem; padding: 0.6rem; border-top: 1px solid var(--hd-line); background: #fff; }
.hd-form input { flex: 1; border: 1px solid #d9c9aa; border-radius: 999px; padding: 0.55rem 0.9rem; font: inherit; font-size: 0.93rem; min-width: 0; }
.hd-send { background: var(--hd-orange); color: #fff; border: 0; border-radius: 50%; width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer; flex: none; }
.hd-send:hover { background: #d4660f; }

@media (max-width: 520px) {
  .hd { right: 12px; bottom: 12px; }
  .hd-launcher-text { display: none; }
  .hd-launcher { padding: 0.85rem; }
  .hd-panel { position: fixed; inset: 0; width: auto; max-width: none; height: 100dvh; max-height: none; border-radius: 0; border: 0; }
}
