/**
 * Live search — header and blog archive.
 *
 * @package LicensesWP_Core_Demo
 */

.lwcd-header-search {
  position: relative;
}

.lwcd-header-search__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(11, 91, 211, 0.12);
  border-radius: 999px;
  background: rgba(11, 91, 211, 0.08);
  color: var(--navy, #041833);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lwcd-header-search__toggle:hover,
.lwcd-header-search__toggle:focus-visible,
.lwcd-header-search__toggle[aria-expanded="true"] {
  background: rgba(11, 91, 211, 0.14);
  color: #0b5bd3;
  outline: none;
}

.lwcd-header-search__icon {
  display: grid;
  place-items: center;
  line-height: 0;
}

.lwcd-header-search__icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.lwcd-header-search__panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(22rem, calc(100vw - 2rem));
  padding: 0.75rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(4, 24, 51, 0.1);
  box-shadow: 0 22px 48px rgba(4, 24, 51, 0.16);
  z-index: 80;
}

html[dir="rtl"] .lwcd-header-search__panel,
body.rtl .lwcd-header-search__panel {
  right: auto;
  left: 0;
}

.lwcd-header-search__input {
  width: 100%;
  border: 1px solid rgba(4, 24, 51, 0.12);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  background: #f7fafc;
  color: #041833;
}

.lwcd-header-search__input:focus {
  outline: none;
  border-color: #0b5bd3;
  box-shadow: 0 0 0 3px rgba(11, 91, 211, 0.15);
}

.lwcd-header-search__results,
.lwcd-blog-search__results {
  margin-top: 0.55rem;
}

.lwcd-search-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 18rem;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(4, 24, 51, 0.08);
  background: #fff;
}

.lwcd-search-list__item + .lwcd-search-list__item {
  border-top: 1px solid rgba(4, 24, 51, 0.06);
}

.lwcd-search-list__link {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.75rem;
  text-decoration: none;
  color: inherit;
}

.lwcd-search-list__link:hover,
.lwcd-search-list__link:focus-visible {
  background: #f3f7fc;
  outline: none;
}

.lwcd-search-list__media img,
.lwcd-search-list__ph {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

.lwcd-search-list__ph {
  background: linear-gradient(145deg, #041833, #0b5bd3);
}

.lwcd-search-list__ph--product {
  background: linear-gradient(145deg, #063a8f, #3fd4e8);
}

.lwcd-search-list__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.lwcd-search-list__type {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0b5bd3;
  font-weight: 700;
}

.lwcd-search-list__title {
  font-weight: 700;
  color: #041833;
  line-height: 1.3;
}

.lwcd-search-list__excerpt {
  font-size: 0.8rem;
  color: #6b7c90;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lwcd-search-empty {
  margin: 0;
  padding: 0.75rem;
  color: #6b7c90;
  font-size: 0.9rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(4, 24, 51, 0.08);
}

@media (max-width: 899px) {
  .lwcd-header-search__toggle {
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
  }

  .lwcd-header-search__icon svg {
    width: 17px;
    height: 17px;
  }
}

@media (max-width: 599px) {
  .lwcd-header-search__toggle {
    width: 2.15rem;
    height: 2.15rem;
  }

  .lwcd-header-search__panel {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    top: 4.5rem;
    width: auto;
  }
}
