/* XL Search – ô tìm kiếm + dropdown autocomplete */
.xl-sform { position: relative; }

/* Màu chủ đạo của linhkienthuduc.com: xanh dương #1e73be (topbar/nav/link) */
.xl-search input { border-color: #1e73be; }
.xl-search input:focus { border-color: #1e73be; box-shadow: 0 0 0 2px rgba(30, 115, 190, .18); }
.xl-search button,
body:not(.xl-home) .xl-search button { background: #1e73be; }
.xl-search button:hover,
body:not(.xl-home) .xl-search button:hover { background: #175a96; }

.xl-sdrop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  background: #fff;
  border: 1px solid var(--xl-line, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .16);
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 6px 0;
  font-size: 16px;
  color: var(--xl-ink, #2d3748);
}
.xl-sdrop[hidden] { display: none; }

.xl-sgroup + .xl-sgroup { border-top: 1px solid var(--xl-line, #eef1f5); margin-top: 6px; padding-top: 6px; }
.xl-sgroup-h {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: #64748b;
}
.xl-sgroup-h em { font-style: normal; font-weight: 600; color: #94a3b8; }

.xl-sitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  color: inherit;
  text-decoration: none;
}
.xl-sitem:hover, .xl-sitem.is-active { background: #f2f7ff; }
.xl-sitem img {
  width: 40px; height: 40px; flex: 0 0 auto;
  object-fit: contain; border: 1px solid var(--xl-line, #e5e7eb);
  border-radius: 5px; background: #fff;
}
.xl-sitem-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.xl-sitem-name {
  font-size: 16px; font-weight: 500; color: #1f2937; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.xl-sitem-meta { font-size: 14px; color: #64748b; }
.xl-sitem-price { font-size: 16px; font-weight: 700; color: var(--xl-red, #e11d48); white-space: nowrap; }

/* Cột phải: giá + tình trạng kho */
.xl-sitem-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  flex: 0 0 auto; margin-left: auto;
}
.xl-sitem-stock {
  display: inline-flex; align-items: center;
  padding: 1px 7px; border-radius: 4px;
  font-size: 14px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.xl-sitem-stock.is-in { color: #15803d; background: #ecfdf3; border: 1px solid #bbf7d0; }
.xl-sitem-stock.is-out { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }

.xl-scats { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 12px 8px; }
.xl-scat {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border: 1px solid var(--xl-line, #e5e7eb); border-radius: 999px;
  font-size: 15.5px; color: #334155; text-decoration: none; background: #fff;
}
.xl-scat:hover, .xl-scat.is-active { border-color: var(--xl-blue, #1a5fb4); color: var(--xl-blue, #1a5fb4); background: #f2f7ff; }
.xl-scat em { font-style: normal; color: #64748b; font-size: 14px; }

.xl-sempty { padding: 14px 12px; font-size: 16px; color: #64748b; text-align: center; }

.xl-sall {
  display: block; margin: 6px 8px 2px; padding: 9px 12px;
  background: #f7f9fc; border-radius: 6px;
  font-size: 16px; font-weight: 600; color: var(--xl-blue, #1a5fb4); text-decoration: none;
  text-align: center;
}
.xl-sall:hover, .xl-sall.is-active { background: var(--xl-blue, #1a5fb4); color: #fff; }

/* bo tròn ô search khi dropdown mở */
.xl-sform.is-open .xl-search,
.xl-sform.is-open input { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

@media (max-width: 767px) {
  .xl-sdrop { position: fixed; left: 8px; right: 8px; top: auto; max-height: 60vh; }
  .xl-sitem img { width: 34px; height: 34px; }
}

/* ---- Ô search khi nằm trong header Flatsome (không phải trang clone) ---- */
body:not(.xl-home) .xl-search {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 560px;
  min-width: 220px;
}
body:not(.xl-home) .xl-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 16px;
  color: #1f2937;
  background: #fff;
  border: 1px solid var(--xl-blue, #1a5fb4);
  border-right: 0;
  border-radius: 4px 0 0 4px;
  outline: none;
}
body:not(.xl-home) .xl-search input:focus { box-shadow: inset 0 0 0 1px var(--xl-blue, #1a5fb4); }
body:not(.xl-home) .xl-search button {
  flex: 0 0 auto;
  width: 46px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0 4px 4px 0;
  background: #1e73be;
  color: #fff;
  cursor: pointer;
}
body:not(.xl-home) .xl-search button:hover { background: #175a96; }
body:not(.xl-home) .xl-search .xl-ico { width: 16px; height: 16px; }
body:not(.xl-home) .xl-sdrop { max-width: 560px; }

/* ---------- Ô search header: input và nút phải cao bằng nhau, kính lúp cân giữa (2.0.42) ----------
   Nút là <button> nên Flatsome chèn padding dọc → cao 42,4px trong khi input 38px, lệch tâm 2,2px
   (đo: input.cy 64,8 vs button.cy 67). Ép border-box + cùng height 40px + icon 18px. */
body:not(.xl-home) .xl-search { align-items: center; }
body:not(.xl-home) .xl-search input {
  height: 40px;
  box-sizing: border-box;
  line-height: 38px;
  border-radius: 4px 0 0 4px;
}
body:not(.xl-home) .xl-search button {
  flex: 0 0 48px;
  width: 48px;
  height: 40px;
  min-height: 0;
  max-height: 40px;
  padding: 0;
  box-sizing: border-box;
  line-height: 1;
  border-radius: 0 4px 4px 0;
}
body:not(.xl-home) .xl-search .xl-ico,
body:not(.xl-home) .xl-search button svg {
  width: 18px;
  height: 18px;
  display: block;
}
