.header-search {
  position: relative;
  width: 100%;
  max-width: 680px;
  justify-self: center;
}

.header-search.is-searching {
  z-index: 70;
}

.live-search-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 80;
  overflow: hidden;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 18px 40px rgba(23, 23, 23, 0.12);
}

.live-search-panel[hidden] {
  display: none !important;
}

.live-search-panel-inner {
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  padding: 0.65rem;
}

.live-search-section + .live-search-section {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
}

.live-search-section-title {
  margin: 0 0 0.45rem;
  padding: 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted, #6b7280);
}

.live-search-list,
.live-search-cats {
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.5rem;
  border-radius: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 160ms ease;
}

.live-search-item:hover,
.live-search-item:focus-visible {
  background: var(--color-primary-soft, #edf7f1);
  outline: none;
}

.live-search-thumb {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  overflow: hidden;
  border-radius: 0.65rem;
  background: #f7f8f5;
  flex-shrink: 0;
}

.live-search-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-search-meta {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 0.15rem;
}

.live-search-cat-label {
  font-size: 0.6875rem;
  color: var(--color-text-muted, #6b7280);
}

.live-search-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text, #171717);
  line-height: 1.3;
}

.live-search-price {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-primary, #007237);
}

.live-search-price-old {
  color: var(--color-text-muted, #6b7280);
  font-weight: 500;
  text-decoration: line-through;
}

.live-search-price-current {
  color: var(--color-primary, #007237);
  font-weight: 700;
}

.live-search-price del {
  margin-right: 0.35rem;
  color: var(--color-text-muted, #6b7280);
  font-weight: 500;
}

.live-search-price ins {
  text-decoration: none;
}

.live-search-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.5rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text, #171717);
  text-decoration: none;
  transition: background-color 160ms ease;
}

.live-search-cat:hover,
.live-search-cat:focus-visible {
  background: var(--color-primary-soft, #edf7f1);
  color: var(--color-primary, #007237);
  outline: none;
}

.live-search-cat-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
}

.live-search-empty {
  padding: 1.25rem 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted, #6b7280);
}

.live-search-footer {
  border-top: 1px solid var(--color-border, #e5e7eb);
  padding: 0.55rem 0.65rem;
}

.live-search-footer a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-primary, #007237);
  text-decoration: none;
  transition: background-color 160ms ease;
}

.live-search-footer a:hover,
.live-search-footer a:focus-visible {
  background: var(--color-primary-soft, #edf7f1);
  outline: none;
}

.live-search-skeleton {
  display: grid;
  gap: 0.45rem;
  padding: 0.15rem;
}

.live-search-skeleton-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.35rem;
}

.live-search-skeleton-thumb,
.live-search-skeleton-line {
  position: relative;
  overflow: hidden;
  background: #eef0eb;
  border-radius: 0.55rem;
}

.live-search-skeleton-thumb {
  width: 3.25rem;
  height: 3.25rem;
  flex-shrink: 0;
}

.live-search-skeleton-lines {
  display: grid;
  flex: 1;
  gap: 0.4rem;
}

.live-search-skeleton-line {
  height: 0.65rem;
}

.live-search-skeleton-line.is-short {
  width: 42%;
}

.live-search-skeleton-line.is-mid {
  width: 72%;
}

.live-search-skeleton-thumb::after,
.live-search-skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.7),
    transparent
  );
  animation: live-search-shimmer 1.1s ease-in-out infinite;
}

@keyframes live-search-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-search-skeleton-thumb::after,
  .live-search-skeleton-line::after {
    animation: none;
  }
}

@media (max-width: 1023px) {
  .header-search {
    max-width: none;
  }

  .live-search-panel {
    top: calc(100% + 0.35rem);
  }
}
