/* =============================================
   Tech Shop – Cart Live Search CSS
   ============================================= */

:root {
  --ts-green:    #2bd34f;
  --ts-green-2:  #18b43a;
  --ts-ink:      #0f172a;
  --ts-muted:    #475569;
  --ts-muted-2:  #64748b;
  --ts-line:     #e6e8ef;
  --ts-bg-soft:  #f6f7fb;
  --ts-shadow-sm: 0 6px 18px rgba(15,23,42,.06);
  --ts-shadow-md: 0 14px 40px rgba(15,23,42,.10);
}

/* ── Search Bar Wrap ── */
.ts-cart-search-wrap {
  margin-bottom: 20px;
  font-family: Inter, system-ui, -apple-system, sans-serif;
}

.ts-cart-search-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Search Input Box ── */
.ts-cart-search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 520px;
}

.ts-cart-search-box input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 42px;
  border: 1.5px solid var(--ts-line);
  border-radius: 999px;
  background: #fff;
  font-size: .95rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--ts-ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--ts-shadow-sm);
}

.ts-cart-search-box input:focus {
  border-color: rgba(43,211,79,.55);
  box-shadow: 0 0 0 4px rgba(43,211,79,.12), var(--ts-shadow-sm);
}

.ts-cart-search-box input::placeholder {
  color: var(--ts-muted-2);
  font-weight: 400;
}

.ts-cart-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ts-muted-2);
  pointer-events: none;
}

.ts-cart-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: 0;
  background: var(--ts-bg-soft);
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--ts-muted);
  transition: .15s;
}

.ts-cart-search-clear:hover {
  background: var(--ts-line);
  color: var(--ts-ink);
}

.ts-cart-search-clear.is-visible {
  display: flex;
}

/* ── Meta (X of Y results) ── */
.ts-cart-search-meta {
  font-size: .875rem;
  font-weight: 600;
  color: var(--ts-muted);
  white-space: nowrap;
}

.ts-cart-search-meta span {
  color: var(--ts-ink);
  font-weight: 800;
}

/* ── Hidden cart rows ── */
.cart tr.ts-cart-row-hidden {
  display: none !important;
}

/* ── Highlight matched text ── */
.ts-highlight {
  background: rgba(43,211,79,.18);
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 700;
}

/* ── No results message ── */
.ts-cart-no-results {
  display: none;
  text-align: center;
  padding: 32px 20px;
  color: var(--ts-muted);
  font-size: .95rem;
  font-weight: 600;
  font-family: Inter, system-ui, sans-serif;
}

.ts-cart-no-results.is-visible {
  display: block;
}

/* ── Inline qty update feedback ── */
.ts-qty-saving {
  opacity: .5;
  pointer-events: none;
}

.ts-qty-saved {
  color: var(--ts-green-2) !important;
}

.ts-qty-error {
  color: #ef4444 !important;
}

/* ── Row remove feedback ── */
tr.ts-removing {
  opacity: .4;
  transition: opacity .3s;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .ts-cart-search-box {
    max-width: 100%;
  }
  .ts-cart-search-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
}
