/* Smart WooCommerce Search v1.5 */

/* ── Wrapper ── */
.sws-wrap {
  position: relative;
  width: 100%;
  max-width: 640px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-sizing: border-box;
}

/* ── Desktop bar ── */
.sws-bar {
  display: flex;
  align-items: center;
  height: 50px;
  background: #fff;
  border: 1.5px solid #d0d0d0;
  border-radius: 999px;
  padding: 0 6px 0 16px;
  gap: 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
.sws-bar:focus-within {
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(0,0,0,.08);
}
.sws-bar-icon { color:#bbb; display:flex; align-items:center; flex-shrink:0; }
.sws-bar-input {
  flex:1; min-width:0;
  border:none!important; outline:none!important; box-shadow:none!important;
  background:transparent!important;
  font-size:15px; color:#111; padding:0!important; margin:0!important;
  font-family:inherit;
}
.sws-bar-input::placeholder { color:#aaa; }
.sws-bar-clear {
  background:#e8e8e8; border:none; border-radius:50%;
  width:22px; height:22px;
  display:none; align-items:center; justify-content:center;
  cursor:pointer; font-size:11px; color:#555; flex-shrink:0; padding:0;
}
.sws-bar-clear.sws-on { display:flex; }
.sws-bar-submit {
  width:36px; height:36px; border-radius:50%;
  background:#111; border:none;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; color:#fff; flex-shrink:0; padding:0;
}
.sws-bar-submit:hover { background:#333; }

/* ── Desktop dropdown ── */
.sws-drop {
  display:none;
  position:absolute;
  top:calc(100% + 8px); left:0; right:0;
  background:#fff;
  border:1px solid #e0e0e0;
  border-radius:14px;
  box-shadow:0 10px 36px rgba(0,0,0,.13);
  z-index:999999;
  max-height:520px;
  overflow-y:auto;
}
.sws-drop.sws-on { display:block; }

/* ── Mobile icon button ── */
.sws-mob-btn {
  display:none;
  background:none; border:none;
  cursor:pointer; padding:4px;
  color:#111;
  align-items:center; justify-content:center;
}
/* JS sets display:flex when mobile */

/* ── Mobile overlay (injected into body) ── */
#sws-ov {
  display:none;
  position:fixed!important;
  top:0!important; left:0!important; right:0!important; bottom:0!important;
  width:100%!important; height:100%!important;
  z-index:2147483647!important;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
#sws-ov.sws-on { display:block!important; }

#sws-ov-bg {
  position:absolute;
  top:0;left:0;right:0;bottom:0;
  background:rgba(0,0,0,.5);
}

#sws-ov-box {
  position:absolute;
  top:0; left:0; right:0;
  background:#fff;
  box-shadow:0 4px 20px rgba(0,0,0,.2);
  display:flex;
  flex-direction:column;
  max-height:90vh;
}

#sws-ov-top {
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-bottom:1px solid #eee;
  flex-shrink:0;
}

#sws-ov-field {
  flex:1;
  display:flex;
  align-items:center;
  background:#f2f2f2;
  border-radius:999px;
  padding:0 12px;
  height:42px;
  gap:8px;
}
#sws-ov-field svg { color:#999; flex-shrink:0; display:block; }
#sws-ov-in {
  flex:1; min-width:0;
  border:none!important; outline:none!important; box-shadow:none!important;
  background:transparent!important;
  font-size:16px; color:#111;
  padding:0!important; margin:0!important;
  font-family:inherit;
}
#sws-ov-in::placeholder { color:#aaa; }
#sws-ov-clr {
  background:#bbb; border:none; border-radius:50%;
  width:18px; height:18px;
  display:none; align-items:center; justify-content:center;
  cursor:pointer; font-size:10px; color:#fff;
  flex-shrink:0; padding:0;
}
#sws-ov-clr.sws-on { display:flex; }
#sws-ov-cancel {
  background:none; border:none;
  cursor:pointer; font-size:15px;
  font-weight:600; color:#111;
  white-space:nowrap; padding:6px 0;
  font-family:inherit;
}

#sws-ov-res {
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  flex:1;
  background:#fff;
}

/* ── Shared result UI ── */
.sws-sec {
  font-size:10px; font-weight:700;
  letter-spacing:.08em; text-transform:uppercase;
  color:#999; padding:12px 16px 5px;
  background:#fafafa; border-bottom:1px solid #f0f0f0;
}
.sws-row {
  display:flex; align-items:center; gap:12px;
  padding:10px 16px;
  text-decoration:none!important; color:#111!important;
  border-bottom:1px solid #f5f5f5;
  transition:background .1s; cursor:pointer;
}
.sws-row:hover, .sws-row.sws-hi { background:#f7f7f7; }
.sws-row-img {
  width:50px; height:50px; border-radius:8px;
  object-fit:cover; border:1px solid #eee;
  flex-shrink:0; background:#f5f5f5;
}
.sws-row-ph {
  width:50px; height:50px; border-radius:8px;
  background:#f0f0f0; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:20px; border:1px solid #eee;
}
.sws-row-icon {
  width:36px; height:36px; background:#f0f0f0;
  border-radius:8px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size:16px;
}
.sws-row-info { flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.sws-row-name {
  font-size:14px; font-weight:600; line-height:1.4; white-space:normal; word-break:break-word;
  
}
.sws-row-meta { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.sws-sku { font-size:11px; color:#999; }
.sws-badge {
  font-size:10px; font-weight:700; text-transform:uppercase;
  padding:2px 6px; border-radius:999px;
  background:#eee; color:#666; white-space:nowrap;
}
.sws-badge.variable { background:#fff0e0; color:#b35a00; }
.sws-badge.simple   { background:#e8f0ff; color:#1a5fb4; }
.sws-badge.grouped  { background:#e8f5e9; color:#2e7d32; }
.sws-row-price { flex-shrink:0; padding-left:8px; font-size:14px; font-weight:700; color:#111; white-space:nowrap; }
.sws-hl { color:#e00000; font-weight:700; }

.sws-all {
  display:flex; align-items:center; justify-content:center; gap:6px;
  padding:13px 16px; font-size:13px; font-weight:600;
  color:#111!important; text-decoration:none!important;
  border-top:1px solid #eee; background:#fafafa;
  cursor:pointer; transition:background .1s;
}
.sws-all:hover { background:#f0f0f0; }

.sws-spin-wrap {
  display:flex; align-items:center; justify-content:center;
  gap:10px; padding:24px 16px;
  color:#999; font-size:13px; font-family:inherit;
}
.sws-spin {
  width:18px; height:18px;
  border:2px solid #ddd; border-top-color:#555;
  border-radius:50%; animation:swSpin .65s linear infinite; flex-shrink:0;
}
@keyframes swSpin { to { transform:rotate(360deg); } }

.sws-empty {
  display:flex; flex-direction:column; align-items:center;
  padding:30px 16px; gap:8px;
  color:#999; font-size:14px; text-align:center; font-family:inherit;
}
.sws-empty-ico { font-size:30px; }

.sws-drop::-webkit-scrollbar,
#sws-ov-res::-webkit-scrollbar { width:4px; }
.sws-drop::-webkit-scrollbar-thumb,
#sws-ov-res::-webkit-scrollbar-thumb { background:#ddd; border-radius:4px; }
