/**
 * Commerce Search Connector - Query Auto-Completion (QAC) Stylesheet
 * WAI-ARIA 1.2 Combobox with mobile iOS zoom prevention.
 */
:root {
  --csp-qac-bg: #ffffff;
  --csp-qac-text: #1f2937;
  --csp-qac-text-highlight: #2563eb;
  --csp-qac-border: #e5e7eb;
  --csp-qac-hover-bg: #f3f4f6;
  --csp-qac-selected-bg: #eff6ff;
  --csp-qac-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --csp-qac-radius: 8px;
  --csp-qac-font-size: 14px;
  --csp-qac-item-padding: 10px 14px;
  --csp-qac-z-index: 999999;
}

#csp-qac-portal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
  z-index: var(--csp-qac-z-index, 999999);
}

.csp-qac-dropdown {
  position: fixed;
  box-sizing: border-box;
  margin: 0;
  padding: 6px 0;
  background: var(--csp-qac-bg, #ffffff);
  color: var(--csp-qac-text, #1f2937);
  border: 1px solid var(--csp-qac-border, #e5e7eb);
  border-radius: var(--csp-qac-radius, 8px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  list-style: none;
  max-height: 380px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
  min-width: var(--csp-qac-min-width, 240px);
  z-index: var(--csp-qac-z-index, 999999);
}

.csp-qac-dropdown[hidden] {
  display: none !important;
}

.csp-qac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--csp-qac-item-padding, 10px 14px);
  font-size: var(--csp-qac-font-size, 14px);
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s ease;
  outline: none;
}

.csp-qac-item:hover,
.csp-qac-item[data-hover="true"] {
  background-color: var(--csp-qac-hover-bg, #f3f4f6);
}

.csp-qac-item[aria-selected="true"] {
  background-color: var(--csp-qac-selected-bg, #eff6ff);
  color: var(--csp-qac-text, #1f2937);
}

.csp-qac-item mark,
.csp-qac-item b,
.csp-qac-item strong {
  color: var(--csp-qac-text-highlight, #2563eb);
  background: transparent;
  font-weight: 600;
}

.csp-qac-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #9ca3af;
  fill: currentColor;
}

.csp-qac-text-wrap {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.csp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

@media (max-width: 640px) {
  .csp-qac-dropdown {
    border-radius: 6px;
  }
  .csp-qac-item {
    font-size: 16px;
    padding: 12px 14px;
  }
}
