:root{ --csss-purple:#5b2be0; }

.csss-search-root{ position:relative; width:100%; }

/* background overlay */
.csss-overlay{
  position:fixed; inset:0;
  background:rgba(20,20,25,.55);
  opacity:0; pointer-events:none;
  transition:opacity .15s ease;
  z-index:99990;
}
.csss-overlay.is-open{ opacity:1; pointer-events:auto; }

/* panel */
.csss-panel{
  position:relative;
  max-width:860px;
  margin:0 auto;
  z-index:99999;
}

/* pill */
.csss-search-pill{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  border:2px solid #d8d8de;
  border-radius:9999px;
  background:#fff;
  padding:8px 8px 8px 18px;
  box-shadow:0 2px 10px rgba(0,0,0,.08);
  transition:border-color .12s ease;
}
.csss-search-root.is-open .csss-search-pill,
.csss-search-pill:focus-within{ border-color:var(--csss-purple); }

/* IMPORTANT: remove black border */
.csss-search-input{
  flex:1 1 auto;
  width:100%;
  border:0 !important;
  outline:none !important;
  box-shadow:none !important;
  background:transparent;
  font-size:18px;
  line-height:1.2;
  padding:0;
  min-height:44px;
}

/* clear X */
.csss-clear-btn{
  width:34px; height:34px;
  border:0; border-radius:9999px;
  background:transparent;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  opacity:0; pointer-events:none;
  transition:opacity .12s ease;
}
.csss-clear-btn svg{ width:18px; height:18px; stroke:#444; stroke-width:2; fill:none; }
.csss-clear-btn.is-visible{ opacity:.75; pointer-events:auto; }
.csss-clear-btn:hover{ opacity:1; }

/* search button */
.csss-search-btn{
  width:46px; height:46px;
  border:0; border-radius:9999px;
  background:var(--csss-purple);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  position:relative;
}
.csss-search-btn:active{ transform:scale(.98); }
.csss-icon{ width:20px; height:20px; stroke:#fff; }

.csss-loader{
  position:absolute;
  width:18px; height:18px;
  border:2px solid rgba(255,255,255,.55);
  border-top-color:#fff;
  border-radius:50%;
  opacity:0;
  animation:csssSpin .8s linear infinite;
}
@keyframes csssSpin{ to{ transform:rotate(360deg); } }
.csss-search-btn.is-loading .csss-loader{ opacity:1; }
.csss-search-btn.is-loading .csss-icon{ opacity:0; }

/* results box */
.csss-results{
  margin-top:10px;
  background:#fff;
  border-radius:16px;
  box-shadow:0 14px 34px rgba(0,0,0,.16);
  overflow:hidden;
}
.csss-section-header{
  padding:14px 18px;
  font-weight:700;
  font-size:13px;
  letter-spacing:.3px;
  color:#2b2b2f;
  background:#fff;
  border-bottom:1px solid #efeff3;
}
.csss-hl{
  background:rgba(91,43,224,.12);
  color:#1f1f22;
  border-radius:6px;
  padding:0 4px;
}

/* category items */
.csss-suggestion{
  display:block;
  padding:14px 18px;
  text-decoration:none;
  color:inherit;
  border-bottom:1px solid #f1f1f4;
}
.csss-suggestion:hover{ background:#fafaff; }
.csss-suggestion-title{ font-weight:700; font-size:16px; }

/* product items */
.csss-product{
  display:grid;
  grid-template-columns:64px 1fr auto;
  gap:14px;
  padding:14px 18px;
  text-decoration:none;
  color:inherit;
  border-bottom:1px solid #f1f1f4;
  align-items:center;
}
.csss-product:hover{ background:#fafaff; }
.csss-product-img{
  width:64px; height:64px;
  border-radius:12px;
  overflow:hidden;
  background:#f4f4f7;
  display:flex;
  align-items:center;
  justify-content:center;
}
.csss-product-img img{ width:100%; height:100%; object-fit:cover; display:block; }
.csss-product-name{ font-weight:700; font-size:14px; color:#222; margin-bottom:6px; }
.csss-product-meta{ display:flex; gap:10px; align-items:center; font-size:13px; color:#666; }
.csss-reviews{ text-decoration:underline; }
.csss-product-price{ font-weight:800; font-size:14px; color:#111; white-space:nowrap; }

.csss-empty{ padding:18px; color:#666; font-size:14px; }
