/* ===== UrbanCompany Style Search Suggestions ===== */
#search-suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.2s ease-out;
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid #eaeaea;
  padding: 0px 0px 8px 0px;
  margin: 0;
}

#search-suggestions.active {
  opacity: 1;
  transform: translateY(0);
}

.suggestion-group-title {
  /* Layout */
  padding: 14px 20px 12px; /* Better vertical rhythm */
  margin: 0;
  position: sticky;
  top: -1px; /* Prevents 1px gap during scrolling */
  
  /* Visual Treatment */
  background: linear-gradient(to bottom, #fcfcfc 0%, #f6f6f6 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  
  /* Typography */
  color: #5a5a5a;
  font: 
    600 13px/1.25 'Inter', -apple-system, BlinkMacSystemFont, 
    'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
   
  /* Interaction */
  transition: all 0.18s ease-out;
  z-index: 3; /* Higher than content */
  
  /* Decorative Element */
  position: relative;
}

/* Subtle hover effect for better affordance */
.suggestion-group-title:hover {
  background: linear-gradient(to bottom, #f8f8f8 0%, #f2f2f2 100%);
}

/* Micro-border animation */
.suggestion-group-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 1.5px;
  background: #4a6ee0;
  transform: scaleX(0);
  transition: transform 0.22s ease;
}

.suggestion-group:hover .suggestion-group-title::after {
  transform: scaleX(0.3); /* Subtle animation */
}

/* For dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .suggestion-group-title {
    background: linear-gradient(to bottom, #2a2a2a 0%, #222 100%);
    color: #aaa;
    border-bottom-color: rgba(0, 0, 0, 0.3);
    border-top-color: rgba(255, 255, 255, 0.05);
  }
}
/* Service Items */
.suggestion-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.suggestion-item {
  padding: 0 16px;
}

.suggestion-link {
  display: flex;
  align-items: center;
  padding: 12px 0;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #f5f5f5;
  transition: all 0.1s ease;
}

.suggestion-item:last-child .suggestion-link {
  border-bottom: none;
}

.suggestion-item:hover .suggestion-link {
  background: #fafafa;
}

/* Service Icons */
.suggestion-link i {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 4px;
  margin-right: 16px;
  color: #666;
  font-size: 12px;
  flex-shrink: 0;
}

/* Service Images */
.suggestion-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 16px;
  border: 1px solid #f0f0f0;
  flex-shrink: 0;
}

/* Service Details */
.suggestion-details {
  flex: 1;
  min-width: 0;
}

.suggestion-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #222;
}

.suggestion-price {
  font-size: 12px;
  color: #4a6ee0;
  font-weight: 600;
}

/* Highlight Matching Text */
.highlight {
  color: #4a6ee0;
  font-weight: 600;
  background-color: transparent;
}

/* Loading State */
.search-suggestion-loader {
  padding: 24px;
  text-align: center;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(74, 110, 224, 0.1);
  border-radius: 50%;
  border-top-color: #4a6ee0;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* No Results State */
.no-suggestions {
  padding: 24px 16px;
  text-align: center;
  color: #888;
}

.no-suggestions i {
  font-size: 32px;
  color: #e0e0e0;
  margin-bottom: 12px;
  display: block;
}

.no-suggestions p {
  font-size: 14px;
  margin: 0;
  color: #666;
}

/* Scrollbar Styling */
#search-suggestions::-webkit-scrollbar {
  width: 4px;
}

#search-suggestions::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.1);
  border-radius: 2px;
}

/* No Results State */
.no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

.no-results i {
    font-size: 2.5rem;
    color: #ddd;
    margin-bottom: 15px;
    display: block;
}

.no-results p {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
}

.no-results p strong {
    color: #333;
    font-weight: 600;
}

.no-results .suggestion-text {
    font-size: 0.85rem;
    color: #999;
}

/* Error State */
.search-error {
    padding: 15px;
    color: #d32f2f;
    background: #ffebee;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-error i {
    font-size: 1.2rem;
}

/* ===== Mobile-Specific Styles ===== */
@media only screen and (max-width: 767px) {
  #search-suggestions {
    /* Positioning */
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100vw;
    margin-left: -16px; /* Full-bleed edge-to-edge */
    border-radius: 0 0 16px 16px;
    
    /* Visual */
    box-shadow: 
      0 8px 24px rgba(0, 0, 0, 0.15),
      0 2px 6px rgba(0, 0, 0, 0.1);
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    
    /* Sizing */
    max-height: 70vh;
    padding: 12px 0;
  }

  /* Category Headers */
  .suggestion-group-title {
    padding: 16px 24px 12px;
    font-size: 13px;
    letter-spacing: 0.5px;
    background: #f8f8f8;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  /* List Items */
  .suggestion-item {
    padding: 0 16px;
  }

  .suggestion-link {
    padding: 18px 12px;
    min-height: 64px; /* Minimum touch target */
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  }

  /* Icons & Thumbnails */
  .suggestion-link i,
  .suggestion-thumb {
    width: 40px !important;
    height: 40px !important;
    margin-right: 18px;
    border-radius: 8px;
  }

  /* Text Content */
  .suggestion-title {
    font-size: 16px !important;
    letter-spacing: -0.15px;
    margin-bottom: 4px;
  }

  .suggestion-price {
    font-size: 14px !important;
  }
  
  

  /* Loading State */
  .search-suggestion-loader {
    padding: 32px 24px;
  }

  .spinner {
    width: 28px;
    height: 28px;
    border-width: 3.5px;
  }

  /* No Results */
  .no-suggestions {
    padding: 32px 24px;
  }

  .no-suggestions i {
    font-size: 48px;
    margin-bottom: 16px;
  }

  .no-suggestions p {
    font-size: 15px;
    line-height: 1.5;
  }

  /* Scrollbar */
  #search-suggestions::-webkit-scrollbar {
    width: 5px;
  }

  /* iPhone Notch Safe Area */
  @supports (padding: max(0px)) {
    #search-suggestions {
      padding-left: max(16px, env(safe-area-inset-left));
      padding-right: max(16px, env(safe-area-inset-right));
      margin-left: calc(-16px - env(safe-area-inset-left));
      width: calc(100vw + env(safe-area-inset-left) + env(safe-area-inset-right));
    }
  }
}

/* === Ultra-Mobile (Small Devices) === */
@media only screen and (max-width: 374px) {
  #search-suggestions {
    border-radius: 0 0 12px 12px;
  }
  
  .suggestion-link {
    padding: 16px 10px;
    min-height: 56px;
  }
  
  .suggestion-link i,
  .suggestion-thumb {
    width: 36px !important;
    height: 36px !important;
  }
}