/* ════════════════════════════════════════════════════════
   PREMIUM SEARCH STYLES
   ════════════════════════════════════════════════════════ */

/* Search Container wrapper adjustments */
.cs-search-wrap form, .cs-drawer-search-wrap form {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}

/* Hide native webkit clear button */
.cs-search-input::-webkit-search-cancel-button,
.cs-drawer-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}

/* Clear icon and mic icon */
.cs-search-clear, .cs-search-mic {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #b0b0c0;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
  display: none;
  transition: color 0.2s ease;
}
.cs-search-clear:hover, .cs-search-mic:hover {
  color: var(--primary);
}
.cs-search-clear {
  right: 50px;
}
.cs-search-mic {
  right: 15px;
  display: block; /* show by default */
}
.cs-search-wrap:focus-within .cs-search-clear,
.cs-drawer-search-wrap:focus-within .cs-search-clear {
  display: block;
}
.cs-search-wrap:focus-within .cs-search-mic,
.cs-drawer-search-wrap:focus-within .cs-search-mic {
  right: 80px; /* shift mic when clear is visible */
}

/* Loading Spinner */
.cs-search-loader {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 63, 108, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: cs-spin 0.8s linear infinite;
  display: none;
}
@keyframes cs-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Search Dropdown / Suggestions */
.cs-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  padding: 15px;
  display: none;
  flex-direction: column;
  gap: 15px;
  z-index: 1100;
  max-height: 70vh;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cs-search-dropdown.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.cs-search-dropdown::-webkit-scrollbar {
  width: 6px;
}
.cs-search-dropdown::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
}

/* Dropdown Sections */
.cs-sd-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-sd-title {
  font-size: 12px;
  font-weight: 700;
  color: #7a7a8c;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cs-sd-clear-btn {
  font-size: 10px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  text-transform: none;
  font-weight: 600;
}

/* Items List */
.cs-sd-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cs-sd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #1a1a2e;
  transition: background 0.2s;
  cursor: pointer;
}
.cs-sd-item:hover {
  background: rgba(255, 63, 108, 0.05);
}
.cs-sd-item i {
  color: #b0b0c0;
  font-size: 14px;
  width: 16px;
  text-align: center;
}

/* Product Item specific */
.cs-sd-product {
  padding: 10px;
  align-items: flex-start;
}
.cs-sd-prod-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #f4f4f4;
  flex-shrink: 0;
}
.cs-sd-prod-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.cs-sd-prod-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}
.cs-sd-prod-meta {
  font-size: 12px;
  color: #7a7a8c;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cs-sd-prod-price {
  font-weight: 700;
  color: #14958f;
}

/* Highlight Match */
.cs-match-hl {
  font-weight: 800;
  color: var(--primary);
}

/* Trending tags */
.cs-trend-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cs-trend-tag {
  background: #f4f4f9;
  border: 1px solid #eaeaf2;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #1a1a2e;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}
.cs-trend-tag i {
  color: #ff3f6c;
}
.cs-trend-tag:hover {
  background: #fff0f3;
  border-color: #ffb8c6;
  color: #ff3f6c;
}

/* Popular categories grid */
.cs-pop-cats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.cs-pop-cat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fafafa;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #1a1a2e;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.cs-pop-cat-card img, .cs-pop-cat-card .cat-icon-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #eaeaf2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7a7a8c;
}
.cs-pop-cat-card:hover {
  border-color: #ffb8c6;
  background: #fff;
  box-shadow: 0 4px 12px rgba(255, 63, 108, 0.08);
}

/* View all results btn */
.cs-sd-view-all {
  display: block;
  text-align: center;
  padding: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}
.cs-sd-view-all:hover {
  background: #c0294f;
  color: #fff;
}

/* Fallback/No results */
.cs-sd-no-results {
  text-align: center;
  padding: 30px 10px;
  color: #7a7a8c;
}
.cs-sd-no-results i {
  font-size: 32px;
  color: #eaeaf2;
  margin-bottom: 10px;
}
.cs-sd-no-results h5 {
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 5px;
}
.cs-sd-no-results p {
  font-size: 13px;
  margin: 0;
}
