/* v2.5: final layout authority — must load after theme-facing widget styles. */
.hwsa {
  left: 24px !important;
  right: auto !important;
  top: 50% !important;
  bottom: auto !important;
  margin-top: -27px;
  transform: none !important;
  z-index: 2147483000 !important;
  isolation: isolate;
}

.hwsa-panel {
  z-index: 2147483001 !important;
  font-family: Inter, Arial, sans-serif;
  color: var(--hwsa-ink);
  line-height: 1.4;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  position: fixed !important;
  left: 94px !important;
  right: auto !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  transform-origin: 0 50% !important;
}

/* This must override the flex layout above: hidden is the single source of truth. */
.hwsa-panel[hidden] {
  display: none !important;
}

.hwsa-panel.opening { animation: hwsa-in-left .28s cubic-bezier(.22,.61,.36,1); }
@keyframes hwsa-in-left {
  from { opacity: 0; transform: translateY(calc(-50% + 16px)); }
  to { opacity: 1; transform: translateY(-50%); }
}

.hwsa-header {
  flex: 0 0 72px !important;
  min-height: 72px !important;
}

.hwsa-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  box-sizing: border-box !important;
}

.hwsa-view,
#hwsa-flow-content,
.hwsa-search,
.hwsa-compare-list,
.hwsa-sticky-action,
.hwsa-product-card,
.hwsa-product-main { min-width: 0; max-width: 100%; }

.hwsa-view[data-view="flow"],
#hwsa-flow-content { overflow-x: hidden !important; }

.hwsa-search,
.hwsa-search input,
.hwsa-composer,
.hwsa-composer textarea { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; }

.hwsa-search { display: block; overflow: hidden; }
.hwsa-search input {
  display: block;
  height: 44px;
  padding: 0 15px;
  border-radius: 999px;
}

/* Keep the compare search inside the dialog even when the active theme styles inputs. */
.hwsa-panel .hwsa-view[data-view="flow"],
.hwsa-panel #hwsa-flow-content {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.hwsa-panel .hwsa-search,
.hwsa-panel .hwsa-search input {
  display: block !important;
  box-sizing: border-box !important;
  inline-size: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.hwsa-panel .hwsa-search { overflow: hidden !important; }

.hwsa-compare-item { grid-template-columns: 54px minmax(0, 1fr) 24px; gap: 8px; width: 100%; min-width: 0; max-width: 100%; min-height: 68px; overflow: hidden; justify-content: start; justify-items: start; }
.hwsa-compare-item img,
.hwsa-compare-item .hwsa-product-placeholder {
  display: block;
  width: 54px !important;
  height: 54px !important;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}
.hwsa-compare-item strong { display: -webkit-box; white-space: normal; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.hwsa-compare-item > span { width: 100%; text-align: left; align-items: flex-start; }
.hwsa-product-main img { flex: 0 0 68px; align-self: center; }
.hwsa-product-main > div,
.hwsa-product-main h4,
.hwsa-product-main p { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }

.hwsa-compare-list { overflow: hidden; }

/* Scheme C — graphite selection state: quiet catalogue, unmistakable choice. */
.hwsa-compare-list {
  display: grid;
  gap: 8px;
}

.hwsa-compare-item {
  padding: 7px !important;
  border: 1px solid #e4e6e7 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #111315 !important;
  box-shadow: none !important;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease !important;
}

.hwsa-compare-item:hover {
  border-color: #aeb4b8 !important;
  transform: translateY(-1px);
}

.hwsa-compare-item img,
.hwsa-compare-item .hwsa-product-placeholder {
  border: 1px solid #eff0f1;
  border-radius: 7px;
  background: #fff;
}

.hwsa-compare-item i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #687078;
  font-size: 17px;
  line-height: 1;
  transition: background-color .16s ease, color .16s ease;
}

.hwsa-compare-item.is-selected {
  border-color: #111315 !important;
  background: #111315 !important;
  color: #fff !important;
  box-shadow: none !important;
}

.hwsa-compare-item.is-selected strong { color: #fff !important; }
.hwsa-compare-item.is-selected img,
.hwsa-compare-item.is-selected .hwsa-product-placeholder { border-color: rgba(255,255,255,.16); }
.hwsa-compare-item.is-selected i { background: #f4c900; color: #111315; font-size: 12px; font-weight: 800; }

.hwsa-compare-item:focus-visible {
  outline: 2px solid #f4c900;
  outline-offset: 2px;
}
.hwsa-sticky-action {
  position: sticky;
  bottom: 0;
  z-index: 6;
  margin: 8px 0 0;
  padding: 12px 0 2px;
  background: #fff;
}

.hwsa-composer {
  flex: 0 0 auto !important;
  min-height: 62px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
  grid-template-columns: minmax(0, 1fr) 44px;
}

.hwsa-composer textarea {
  box-sizing: border-box !important;
  min-height: 42px !important;
  height: 42px !important;
  padding: 10px 16px !important;
  border-radius: 999px !important;
  line-height: 20px !important;
  overflow: hidden !important;
}

.hwsa-composer .hwsa-send {
  align-self: center;
  justify-self: end;
  flex: 0 0 44px;
}

.hwsa-icon,
.hwsa-icon svg {
  color: #111315 !important;
}

.hwsa-more svg,
.hwsa-more svg circle {
  fill: #111315 !important;
  stroke: none !important;
}

.hwsa-close svg,
.hwsa-close svg path {
  fill: none !important;
  stroke: #111315 !important;
}

.hwsa-header-actions .hwsa-icon {
  background: transparent !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: none !important;
}

.hwsa-header-actions .hwsa-icon:hover,
.hwsa-header-actions .hwsa-icon:focus-visible {
  background: transparent !important;
  color: #fff !important;
}

.hwsa-header-actions .hwsa-more svg,
.hwsa-header-actions .hwsa-more svg circle {
  fill: #fff !important;
}

.hwsa-header-actions .hwsa-close svg,
.hwsa-header-actions .hwsa-close svg path {
  stroke: #fff !important;
}

.hwsa-message-time {
  display: block;
  margin-top: 5px;
  font-size: 9px;
  line-height: 1;
  opacity: .58;
}

.hwsa-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.hwsa-new-chat-popover .hwsa-confirm-actions button {
  width: auto;
}

.hwsa-new-chat-popover .hwsa-confirm-actions .hwsa-secondary {
  border: 1px solid #d8dcde;
  background: #fff;
  color: #111315;
}

.hwsa-header {
  position: relative !important;
  padding-right: 82px !important;
}

.hwsa-header-actions {
  position: absolute !important;
  z-index: 40 !important;
  top: 50% !important;
  right: 10px !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: translateY(-50%) !important;
}

.hwsa-header-actions .hwsa-icon {
  display: grid !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

.hwsa-header-actions .hwsa-close { z-index: 41 !important; }

.hwsa-header-actions .hwsa-icon svg {
  display: block !important;
  width: 19px !important;
  height: 19px !important;
  overflow: visible !important;
}

.hwsa[data-state="open"] .hwsa-launcher,
.hwsa.is-open .hwsa-launcher {
  display: none !important;
}

/* Live WooCommerce result cards: calm, compact, and fully clickable. */
.hwsa-product-card-link {
  display: block !important;
  max-width: 100%;
  color: #111315 !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.hwsa-product-card-link:hover {
  border-color: #aeb4b8;
  box-shadow: 0 8px 18px rgba(17, 19, 21, .07);
  transform: translateY(-1px);
}

.hwsa-four-specs {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.hwsa-four-specs span {
  min-width: 0;
  overflow: hidden;
}

.hwsa-four-specs b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hwsa-product-link-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 12px 12px;
  padding: 9px 0 1px;
  border-top: 1px solid #e2e5e7;
  color: #111315;
  font-size: 11px;
  font-weight: 700;
}

.hwsa-product-link-cta b { font-size: 14px; line-height: 1; }
.hwsa-product-result-intro { margin: 0 0 8px; font-size: 12px; color: #687078; }
.hwsa-product-purpose { display: block; margin-top: 4px; color: #687078; font-size: 10px; line-height: 1.35; }
.hwsa-product-stock { display: block; margin-top: 5px; color: #8a5d00; font-size: 10px; font-weight: 700; }
.hwsa-product-stock.is-available { color: #47753a; }
.hwsa-support-link { display: inline-block; margin-top: 8px; font-weight: 700; }

.hwsa-fallback-copy { margin: 7px 0 0; }
.hwsa-fallback-actions { display: grid; gap: 7px; margin-top: 12px; }
.hwsa-fallback-actions button,
.hwsa-fallback-actions a {
  min-height: 34px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d8dcde;
  border-radius: 8px;
  background: #fff;
  color: #111315;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.hwsa-fallback-actions button::before,
.hwsa-fallback-actions a::before { color: #f4c900; margin-right: 6px; }
.hwsa-fallback-actions button[data-action="guide"]::before { content: '◆'; }
.hwsa-fallback-actions button[data-action="compare"]::before { content: '◆'; }
.hwsa-fallback-actions a[href*="wa.me"]::before { content: '●'; }
.hwsa-fallback-actions a:not([href*="wa.me"])::before { content: '■'; }
.hwsa-fallback-actions button:hover,
.hwsa-fallback-actions a:hover { border-color: #111315; }

.hwsa-support-footer {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #dfe2e4;
  color: #687078;
  font-size: 11px;
  line-height: 1.45;
}

.hwsa-support-footer strong { color: #111315; font-size: 11px; }

@media (max-width: 640px), (max-height: 500px) and (pointer: coarse) {
  .hwsa { left: 16px !important; }
  .hwsa-panel {
    top: calc(var(--hwsa-vv-top, 0px) + max(8px, env(safe-area-inset-top))) !important;
    right: auto !important;
    bottom: auto !important;
    left: calc(var(--hwsa-vv-left, 0px) + var(--hwsa-vv-width, 100vw) / 2) !important;
    width: calc(var(--hwsa-vv-width, 100vw) - 16px) !important;
    height: calc(var(--hwsa-vv-height, 100dvh) - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom))) !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    transform: translateX(-50%) !important;
    transform-origin: 50% 50% !important;
    border-radius: 18px !important;
  }

  .hwsa-panel.opening {
    animation: hwsa-mobile-fade-in .22s cubic-bezier(.22, .61, .36, 1) both !important;
  }

  .hwsa-header {
    flex-basis: 68px !important;
    min-height: 68px !important;
  }

  .hwsa-composer {
    min-height: 62px !important;
    padding: 9px 10px 10px !important;
  }

  .hwsa-four-specs { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .hwsa-four-specs span:nth-child(2) { border-right: 0; }
  .hwsa-four-specs span:nth-child(-n + 2) { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid #e2e5e7; }
}

@keyframes hwsa-mobile-fade-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hwsa-panel.opening { animation: none !important; }
}

/* 3.5.0: navigation and messages occupy separate views. */
.hwsa-site-menu-open, .hwsa-launcher[hidden],
.hwsa-panel [hidden] { display: none !important; }
html.hwsa-mobile-dialog-open, html.hwsa-mobile-dialog-open body { overflow: hidden !important; overscroll-behavior: none; }
.hwsa-navigation { display: flex; flex: 0 0 auto; padding: 4px 12px; border-bottom: 1px solid #e2e5e7; background: #fff; }
.hwsa-navigation button { min-height: 44px; padding: 8px 14px; border: 1px solid #d9dddf; border-radius: 10px; background: #fff; color: #111315; font: inherit; font-size: 14px; cursor: pointer; }
.hwsa-panel .hwsa-view[data-view="home"] { min-height: 0; }
.hwsa-panel .hwsa-live-conversation { padding-top: 16px; }
.hwsa-panel .hwsa-message, .hwsa-panel .hwsa-welcome p { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.hwsa-panel .hwsa-header { padding-right: 112px !important; }
.hwsa-panel .hwsa-header-actions .hwsa-icon { width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; }
.hwsa-panel .hwsa-header-actions .hwsa-more svg circle { fill: #111315 !important; }
.hwsa-panel .hwsa-header-actions .hwsa-close svg path { stroke: #111315 !important; }
.hwsa-panel .hwsa-new-chat-popover { top: 64px; width: min(250px, calc(100% - 24px)); }
.hwsa-panel .hwsa-new-chat-popover button, .hwsa-panel .hwsa-tasks > button { min-height: 44px; font-size: 14px; }
.hwsa-panel .hwsa-tasks > button strong { font-size: 14px; white-space: normal; }
.hwsa-panel .hwsa-composer textarea { overflow-y: auto !important; font-size: 16px; }
.hwsa-panel button:focus-visible { outline: 2px solid #111315; outline-offset: 2px; }
@media (max-width: 640px), (max-height: 500px) and (pointer: coarse) {
  .hwsa-panel .hwsa-header { flex-basis: 60px !important; min-height: 60px !important; }
  .hwsa-panel .hwsa-new-chat-popover { top: 58px; }
  .hwsa-panel .hwsa-avatar { width: 32px; height: 32px; }
  .hwsa-panel .hwsa-identity h2 { white-space: normal; font-size: 13px !important; }
  .hwsa-panel .hwsa-navigation { padding: 2px 10px; }
}

.hwsa-panel, .hwsa-panel * { box-sizing: border-box; }
.hwsa-panel button, .hwsa-panel input, .hwsa-panel textarea { font-family: inherit; }
