/* Smart Search Dropdown */
.ss-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  overflow: hidden;
}

.ss-dropdown-inner {
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* When dropdown is open: remove bottom rounding from search bar */
.ss-dropdown-open .is-input-wrap {
  border-radius: 8px 0 0 0 !important;
}

.ss-dropdown-open .sAll button[type="submit"] {
  border-radius: 0 8px 0 0 !important;
}

/* Chips */
.ss-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid #eee;
}

.ss-chip {
  display: inline-block;
  padding: 4px 12px;
  background: #f0f0f0;
  border-radius: 16px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
}

.ss-chip:hover {
  background: #e0e0e0;
}

/* Sections */
.ss-section {
  padding: 4px 0;
}

.ss-section-border {
  border-top: 1px solid #eee;
}

/* Items */
.ss-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.1s;
}

.ss-item:hover,
.ss-item-active {
  background: #f5f5f5;
}

/* Search icon for terms */
.ss-icon-search {
  flex-shrink: 0;
  color: #999;
}

.ss-item-term span {
  font-size: 14px;
  color: #222;
}

.ss-item-term span b {
  font-weight: 400;
  color: #999;
}

/* Two-column layout: categories left, brands right */
.ss-columns {
  display: flex;
  border-top: 1px solid #eee;
}

.ss-col {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
}

.ss-col + .ss-col {
  border-left: 1px solid #eee;
}

.ss-col-label {
  padding: 6px 14px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ss-col .ss-item {
  padding: 5px 14px;
  gap: 8px;
}

/* Inline icon for categories/brands */
.ss-icon-inline {
  flex-shrink: 0;
  color: #bbb;
}

/* Text block */
.ss-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ss-item-name {
  font-size: 13px;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-item-sub {
  font-size: 11px;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hide old autocomplete globally */
.ac_results.search {
  display: none !important;
}

/* Hide old typeahead dropdown inside mobile search */
#search > ul > ul.nav {
  display: none !important;
}

/* Mobile: hide old suggestions when smart search is active */
.ss-dropdown-open ~ #searchSuggests {
  display: none !important;
}

/* Mobile styles */
@media (max-width: 768px) {
  .ss-dropdown {
    position: fixed;
    bottom: 0;
    border-radius: 0 0 10px 10px;
    box-shadow: none;
    z-index: 10000;
  }

  .ss-dropdown-inner {
    max-height: 100%;
    overflow-y: auto;
  }

  /* Single column for categories/brands on mobile */
  .ss-columns {
    flex-direction: column;
  }

  .ss-col + .ss-col {
    border-left: none;
    border-top: 1px solid #eee;
  }

  .ss-chip {
    font-size: 14px;
    padding: 6px 14px;
  }

  .ss-item {
    padding: 10px 16px;
  }

  .ss-item-name {
    font-size: 14px;
  }

  .ss-col .ss-item {
    padding: 8px 14px;
  }
}

/* Dark theme (mobile only) */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
  .ss-dropdown {
    background: #1D1B26;
  }

  .ss-chips {
    border-bottom-color: #333;
  }

  .ss-chip {
    background: #2a2838;
    color: #ddd;
  }

  .ss-chip:hover {
    background: #3a3848;
  }

  .ss-item:hover,
  .ss-item-active {
    background: #2a2838;
  }

  .ss-icon-search {
    color: #666;
  }

  .ss-item-term span {
    color: #ddd;
  }

  .ss-item-term span b {
    color: #666;
  }

  .ss-columns {
    border-top-color: #333;
  }

  .ss-col + .ss-col {
    border-left-color: #333;
  }

  .ss-col-label {
    color: #777;
  }

  .ss-icon-inline {
    color: #555;
  }

  .ss-item-name {
    color: #ddd;
  }

  .ss-item-sub {
    color: #777;
  }
}
