/* ═══════════════════════════════════
   Smart Collection Search — Apple style
═══════════════════════════════════ */

/* ── Search bar ── */
.scs-root {
  position: relative;
  width: 100%;
  z-index: 9000;
  display: block;
  box-sizing: border-box;
}

.scs-bar {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 50px;
  height: 46px;
  padding: 0 14px;
  gap: 8px;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.scs-root:focus-within .scs-bar {
  border-color: #F97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,.1);
}

.scs-bar-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: #9CA3AF;
  transition: color .15s;
}
.scs-bar-icon svg {
  width: 17px;
  height: 17px;
}
.scs-root:focus-within .scs-bar-icon {
  color: #F97316;
}

.scs-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 15px;
  font-weight: 500;
  color: #111;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  min-width: 0;
}
.scs-input::placeholder { color: #9CA3AF; font-weight: 400; }
.scs-input::-webkit-search-decoration,
.scs-input::-webkit-search-cancel-button { display: none; }

.scs-bar-clear {
  flex-shrink: 0;
  background: #F3F4F6;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #9CA3AF;
  font-size: 12px;
  line-height: 1;
  transition: background .1s, color .1s;
  opacity: 0;
  padding: 0;
}
.scs-root:focus-within .scs-bar-clear { opacity: 1; }
.scs-bar-clear:hover { background: #F97316; color: #fff; }

/* ── Dropdown panel ── */
.scs-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 99999;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.03),
    0 4px 12px rgba(0,0,0,.06),
    0 20px 40px rgba(0,0,0,.10);
  display: none;
  overflow: hidden;
  max-height: 72vh;
  overflow-y: auto;
}
.scs-panel.open {
  display: block;
  animation: scs-in 130ms cubic-bezier(.16,1,.3,1) both;
}
@keyframes scs-in {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Section header ── */
.scs-section {
  padding: 14px 16px 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #C7C7CC;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.scs-clear-hist {
  font-size: 12px;
  font-weight: 500;
  color: #C7C7CC;
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0;
  text-transform: none;
  padding: 0;
}
.scs-clear-hist:hover { color: #F97316; }

.scs-divider {
  height: 1px;
  background: #F2F2F7;
  margin: 4px 0;
}

/* ── Row item ── */
.scs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  text-decoration: none !important;
  color: #1C1C1E !important;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: background .1s;
  white-space: nowrap;
  overflow: hidden;
}
.scs-item:hover,
.scs-item.active {
  background: #F5F5F7;
  text-decoration: none !important;
}
.scs-item:hover .scs-item-label,
.scs-item.active .scs-item-label {
  color: #F97316;
}

.scs-item-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #F5F5F7;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s;
}
.scs-item-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #8E8E93;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.scs-item:hover .scs-item-icon,
.scs-item.active .scs-item-icon {
  background: #FFF3E8;
}
.scs-item:hover .scs-item-icon svg,
.scs-item.active .scs-item-icon svg {
  stroke: #F97316;
}

/* Type colors */
.scs-item--cat  .scs-item-icon { background: #EEF2FF; }
.scs-item--cat  .scs-item-icon svg { stroke: #4F46E5; }
.scs-item--trending .scs-item-icon { background: #FFF3E8; }
.scs-item--trending .scs-item-icon svg { stroke: #F97316; }
.scs-item--popular  .scs-item-icon { background: #F0FDF4; }
.scs-item--popular  .scs-item-icon svg { stroke: #16A34A; }
.scs-item--history  .scs-item-icon { background: #F5F5F7; }
.scs-item--history  .scs-item-icon svg { stroke: #8E8E93; }

.scs-item-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1C1C1E;
  transition: color .1s;
}
.scs-item-label mark {
  background: transparent;
  color: #F97316;
  font-weight: 600;
  padding: 0;
}

.scs-item-del {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #C7C7CC;
  opacity: 0;
  font-size: 14px;
  line-height: 1;
  transition: opacity .1s, color .1s;
}
.scs-item:hover .scs-item-del { opacity: 1; }
.scs-item-del:hover { color: #F97316; }

/* ── States ── */
.scs-spinner {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scs-spin {
  width: 20px;
  height: 20px;
  border: 2px solid #F2F2F7;
  border-top-color: #F97316;
  border-radius: 50%;
  animation: scs-spin .4s linear infinite;
}
@keyframes scs-spin { to { transform: rotate(360deg); } }

.scs-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 14px;
  color: #8E8E93;
}

/* ── Scrollbar ── */
.scs-panel::-webkit-scrollbar { width: 3px; }
.scs-panel::-webkit-scrollbar-thumb { background: #E5E5EA; border-radius: 3px; }

/* ── Kill Woodmart dropdowns ── */
.woodmart-search-results, .xts-search-results-holder, .xts-search-results,
.woodmart-search-result,  .wd-search-results,          .woodmart-search-popup,
.woodmart-ajax-search-results, .xts-ajax-search-results,
.dgwt-wcas-suggestions-wraper, .autocomplete-suggestions,
.live-search-results, .ui-autocomplete {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  max-height: 0 !important;
  overflow: hidden !important;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .scs-panel {
    border-radius: 0 0 14px 14px;
    left: -4px;
    right: -4px;
    top: calc(100% + 4px);
  }
  .scs-item { font-size: 14px; padding: 10px 14px; }
  .scs-bar  { height: 42px; }
}
