/* ============================================
   FEILIKE — Header Search Box + Mega Menu refinements
   ============================================ */

/* ===== Mega menu polish — single column, products full label, arrow on category ===== */
.mega__inner { grid-template-columns: 1fr; padding: 28px 24px; }
.mega__aside { display: none; }

.mega-col__head {
  border-bottom: 2px solid var(--bg-light);
  padding-bottom: 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}
.mega-col__arrow {
  margin-left: auto;
  color: #063C7B;
  font-size: 16px;
  font-weight: 700;
  transition: transform 200ms ease;
}
.mega-col__head:hover { border-bottom-color: var(--brand); }
.mega-col__head:hover .mega-col__arrow { transform: translateX(4px); }

.mega-col__list a {
  white-space: normal;
  line-height: 1.45;
}
.mega-col__list a::before {
  content: '·';
  margin-right: 6px;
  color: var(--muted);
}
.mega-col__list a:hover::before { color: var(--accent); }

/* ===== Header Search ===== */
.header__search { position: relative; display: flex; align-items: center; }
.header__search-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--steel);
  border-radius: var(--radius);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--transition);
}
.header__search-toggle:hover { border-color: var(--brand); color: var(--brand); }
.header__search-toggle[aria-expanded="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }

.header__search-box {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 480px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(6, 60, 123, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
  z-index: 110;
  overflow: hidden;
}
.header__search.is-open .header__search-box {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header__search-input-wrap {
  position: relative;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}
.header__search-icon {
  position: absolute;
  left: 18px;
  color: var(--muted);
  pointer-events: none;
}
.header__search-box input[type="search"] {
  flex: 1;
  width: 100%;
  padding: 18px 48px;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--steel);
  background: transparent;
}
.header__search-box input[type="search"]::placeholder { color: var(--muted); }
.header__search-box input[type="search"]::-webkit-search-cancel-button { display: none; }
.header__search-clear {
  position: absolute;
  right: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-light);
  color: var(--steel);
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
}
.header__search.has-value .header__search-clear { display: flex; }
.header__search-clear:hover { background: var(--brand); color: #fff; }

.header__search-dropdown {
  max-height: min(560px, 70vh);
  overflow-y: auto;
}

/* Section heads inside dropdown */
.srh-section {
  padding: 10px 18px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  background: var(--bg-light);
  border-bottom: 1px solid var(--line);
}
.srh-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* Suggestion chips */
.srh-chips {
  padding: 14px 18px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.srh-chip {
  display: inline-block;
  padding: 6px 12px;
  background: var(--bg-light);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}
.srh-chip:hover, .srh-chip.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Suggestion text list */
.srh-suggest { list-style: none; padding: 0; margin: 0; }
.srh-suggest li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--steel);
  border-bottom: 1px solid var(--line);
}
.srh-suggest li a:hover, .srh-suggest li a.is-active {
  background: var(--bg-light);
  color: var(--brand);
}
.srh-suggest li a svg { color: var(--muted); flex-shrink: 0; }
.srh-suggest mark { background: rgba(255, 106, 19, 0.18); color: var(--accent); padding: 0 2px; border-radius: 2px; }

/* Product results */
.srh-products { padding: 4px 0; }
.srh-product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--steel);
  transition: var(--transition);
}
.srh-product:last-child { border-bottom: none; }
.srh-product:hover, .srh-product.is-active {
  background: var(--bg-light);
  color: var(--brand);
}
.srh-product__img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: var(--bg-light);
  border-radius: var(--radius);
  overflow: hidden;
}
.srh-product__img img { width: 100%; height: 100%; object-fit: cover; }
.srh-product__body { flex: 1; min-width: 0; }
.srh-product__name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.srh-product__meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.srh-product__arrow {
  color: var(--accent);
  font-size: 18px;
  margin-left: 8px;
}

/* View all results bar */
.srh-viewall {
  display: block;
  text-align: center;
  padding: 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: var(--brand);
  color: #fff;
}
.srh-viewall:hover { background: var(--accent); color: #fff; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .header__search-box {
    position: fixed;
    top: 70px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100dvh - 90px);
  }
}
