/* Huzaifa Tech floating widgets: WhatsApp (bottom-left) + AI chat (bottom-right).
   Salt & Pepper: white, greys and charcoal. WhatsApp keeps its own green so visitors recognise it. */
.htcw { --ink: #2B2B2B; --ink-hover: #444444; --bg: #FFFFFF; --alt: #F5F5F5; --line: #D4D4D4; --muted: #555555; --gray: #B3B3B3;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; color: var(--ink); }
.htcw *, .htcw *::before, .htcw *::after { box-sizing: border-box; }
.htcw [hidden] { display: none !important; }
.htcw button { font: inherit; cursor: pointer; }

/* Shared floating button */
/* Above the theme header (z 200–251); the mobile menu hides the buttons via the rule further down. */
.htcw-fab { position: fixed; z-index: 900; bottom: calc(env(safe-area-inset-bottom, 0px) + var(--y, 20px)); display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 0; box-shadow: 0 10px 28px rgba(43, 43, 43, .22); transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s; }
.htcw-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(43, 43, 43, .26); }
.htcw-fab:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.htcw-fab svg { width: 28px; height: 28px; }

/* WhatsApp (left) */
.htcw-wa { left: calc(env(safe-area-inset-left, 0px) + var(--x, 20px)); background: #25D366; color: #fff; text-decoration: none; }
.htcw-wa::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); animation: htcw-pulse 2.6s infinite; }
@keyframes htcw-pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .45); } 70%, 100% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); } }
.htcw-tip { position: absolute; left: calc(100% + 12px); top: 50%; transform: translate(-6px, -50%); white-space: nowrap; padding: 7px 12px; border-radius: 10px; background: var(--ink); color: #FFFFFF; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s; }
.htcw-wa:hover .htcw-tip, .htcw-wa:focus-visible .htcw-tip { opacity: 1; transform: translate(0, -50%); }
@media (max-width: 767px) { .htcw-wa.no-mobile { display: none; } .htcw-tip { display: none; } }
@media (min-width: 768px) { .htcw-wa.no-desktop { display: none; } }

/* Chat launcher (right) */
.htcw-launch { right: calc(env(safe-area-inset-right, 0px) + 20px); background: var(--ink); color: #fff; }
.htcw-launch::before { content: ""; position: absolute; inset: -2px; border-radius: 50%; padding: 2px; background: var(--gray); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.htcw-launch .ico-close { display: none; }
.htcw-launch[aria-expanded="true"] .ico-chat { display: none; }
.htcw-launch[aria-expanded="true"] .ico-close { display: block; }

/* Chat window */
.htcw-panel { position: fixed; z-index: 901; right: calc(env(safe-area-inset-right, 0px) + 20px); bottom: calc(env(safe-area-inset-bottom, 0px) + 88px); display: flex; flex-direction: column; width: min(380px, calc(100vw - 40px)); height: min(600px, calc(100vh - 120px)); border-radius: 20px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(43, 43, 43, .22); overflow: hidden; transform-origin: 100% 100%; animation: htcw-in .32s cubic-bezier(.22,1,.36,1); }
.htcw-panel.is-closing { animation: htcw-out .2s ease-in forwards; }
@keyframes htcw-in { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes htcw-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }
.htcw-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--ink); color: #FFFFFF; }
.htcw-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(255, 255, 255, .14); }
.htcw-av { width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover; background: #FFFFFF; color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.htcw-title { display: grid; flex: 1; min-width: 0; }
.htcw-title strong { font-size: 15px; }
.htcw-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255, 255, 255, .7); }
.htcw-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--gray); }
.htcw-status.is-online i { background: #22C55E; }
.htcw-x { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: #FFFFFF; }
.htcw-x:hover { background: rgba(255, 255, 255, .1); }
.htcw-x svg { width: 18px; height: 18px; }

.htcw-consent { margin: 0; padding: 8px 16px; font-size: 12px; color: var(--muted); background: var(--alt); border-bottom: 1px solid var(--line); }
.htcw-consent a { color: var(--ink); }
.htcw-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.htcw-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.htcw-msg a { color: inherit; text-decoration: underline; }
.htcw-bot { align-self: flex-start; background: var(--alt); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.htcw-user { align-self: flex-end; background: var(--ink); color: #FFFFFF; border-bottom-right-radius: 4px; }
.htcw-err { align-self: center; max-width: 100%; font-size: 13px; color: #9a3412; background: #FFF7ED; border: 1px solid #FED7AA; }
.htcw-note { align-self: center; font-size: 12px; color: var(--muted); text-align: center; }
.htcw-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 16px; background: var(--alt); border: 1px solid var(--line); }
.htcw-typing i { width: 6px; height: 6px; border-radius: 50%; background: rgba(43, 43, 43, .4); animation: htcw-dot 1.2s infinite; }
.htcw-typing i:nth-child(2) { animation-delay: .15s; } .htcw-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes htcw-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.htcw-wa-cta { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 999px; background: #25D366; color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; }

.htcw-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.htcw-chip { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 13px; }
.htcw-chip:hover { border-color: var(--ink); }

.htcw-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--bg); }
.htcw-input { flex: 1; min-height: 44px; max-height: 120px; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--gray); font: inherit; resize: none; color: var(--ink); background: #fff; }
.htcw-input:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(43, 43, 43, .16); }
.htcw-send { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--ink); color: #fff; }
.htcw-send:disabled { opacity: .5; cursor: default; }
.htcw-send svg { width: 18px; height: 18px; }
.htcw-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.htcw .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Mobile: full-screen chat; launcher hidden while open */
@media (max-width: 600px) {
  .htcw-panel { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top, 0px); }
  .htcw.is-open .htcw-launch, .htcw.is-open .htcw-wa { display: none; }
}
/* Never cover the theme's mobile menu */
html[style*="overflow: hidden"] .htcw-fab { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .htcw-panel, .htcw-panel.is-closing, .htcw-wa::after, .htcw-typing i { animation: none; }
  .htcw-fab, .htcw-tip { transition: none; }
}
