/* --- CSS Reset & Global Styles --- */
    * { 
      box-sizing: border-box; 
      margin: 0;
      padding: 0;
    }

    :root {
      --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
      --success-color: #10b981;
      --danger-color: #ef4444;
      --warning-color: #f59e0b;
      --info-color: #3b82f6;
      --text-primary: #1f2937;
      --text-secondary: #6b7280;
      --bg-primary: #ffffff;
      --bg-secondary: #f9fafb;
      --border-color: #e5e7eb;
      --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
      --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
      --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
      --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
      --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body {
      font-family: 'Inter', sans-serif;
      margin: 0;
      padding-top: 70px;
      background: linear-gradient(to bottom, #f0f4ff 0%, #f9fafb 100%);
      color: var(--text-primary);
      min-height: 100vh;
    }

    .container {
      max-width: 900px;
      margin: 0 auto;
      padding: 0 20px 40px 20px;
    }

    /* --- Stylish Fixed Header with Glassmorphism --- */
    .special-header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1000;
      background: rgba(102, 126, 234, 0.95);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      padding: 12px 25px;
      color: white;
      display: flex;
      align-items: center;
      justify-content: space-between;
      box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
      border-bottom: 1px solid rgba(255, 255, 255, 0.2);
      animation: slideDown 0.5s ease;
    }

    @keyframes slideDown {
      from {
        transform: translateY(-100%);
        opacity: 0;
      }
      to {
        transform: translateY(0);
        opacity: 1;
      }
    }
    
    .header-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .header-logo-small {
      height: 40px;
      width: 40px;
      object-fit: contain;
      border-radius: 12px;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
      transition: var(--transition);
    }

    .header-logo-small:hover {
      transform: scale(1.1) rotate(5deg);
    }

    .header-title-small {
      font-family: 'Poppins', sans-serif;
      font-size: 1.4em;
      font-weight: 700;
      margin: 0;
      text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .header-stats {
      display: flex;
      gap: 15px;
      font-size: 0.85em;
      font-weight: 500;
    }

    .stat-badge {
      background: rgba(255, 255, 255, 0.2);
      padding: 5px 12px;
      border-radius: 20px;
      display: flex;
      align-items: center;
      gap: 5px;
      backdrop-filter: blur(5px);
    }

    /* --- Enhanced Search Section --- */
    .search-section {
      margin-top: 25px;
      margin-bottom: 30px;
      animation: fadeInUp 0.6s ease;
    }

    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .search-wrapper {
      background: var(--bg-primary);
      border-radius: 20px;
      padding: 25px;
      box-shadow: var(--shadow-lg);
      border: 1px solid var(--border-color);
    }

    .search-header {
      display: flex;
      align-items: center;
      gap: 15px;
      margin-bottom: 20px;
    }

    .search-logo {
      height: 50px;
      width: 50px;
      object-fit: contain;
      border-radius: 15px;
      box-shadow: var(--shadow-md);
      animation: pulse 2s infinite;
    }

    @keyframes pulse {
      0%, 100% {
        transform: scale(1);
      }
      50% {
        transform: scale(1.05);
      }
    }

    .search-title {
      flex: 1;
    }

    .search-title h2 {
      font-family: 'Poppins', sans-serif;
      font-size: 1.5em;
      font-weight: 700;
      background: var(--primary-gradient);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      margin-bottom: 5px;
    }

    .search-title p {
      color: var(--text-secondary);
      font-size: 0.9em;
    }

    .search-box {
      position: relative;
      margin-bottom: 15px;
    }

    .search-box input {
      width: 100%;
      padding: 16px 55px 16px 50px;
      font-size: 16px;
      font-family: 'Inter', sans-serif;
      border-radius: 15px;
      border: 2px solid var(--border-color);
      outline: none;
      transition: var(--transition);
      background: var(--bg-secondary);
    }
    
    .search-box input:focus {
      border-color: #667eea;
      box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
      background: var(--bg-primary);
    }

    .search-icon {
      position: absolute;
      left: 18px;
      top: 50%;
      transform: translateY(-50%);
      color: #667eea;
      font-size: 20px;
      pointer-events: none;
    }

    .clear-icon {
      position: absolute;
      right: 18px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-secondary);
      font-size: 20px;
      cursor: pointer;
      transition: var(--transition);
      opacity: 0;
      pointer-events: none;
    }

    .clear-icon.show {
      opacity: 1;
      pointer-events: all;
    }

    .clear-icon:hover {
      color: var(--danger-color);
      transform: translateY(-50%) scale(1.2);
    }

    /* --- Search Suggestions Dropdown --- */
    .suggestions-dropdown {
      position: absolute;
      top: calc(100% + 10px);
      left: 0;
      right: 0;
      background: var(--bg-primary);
      border-radius: 15px;
      box-shadow: var(--shadow-xl);
      border: 1px solid var(--border-color);
      max-height: 400px;
      overflow-y: auto;
      z-index: 100;
      display: none;
      animation: slideDownFade 0.3s ease;
    }

    @keyframes slideDownFade {
      from {
        opacity: 0;
        transform: translateY(-10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .suggestions-dropdown.show {
      display: block;
    }

    .suggestion-section {
      padding: 15px;
      border-bottom: 1px solid var(--border-color);
    }

    .suggestion-section:last-child {
      border-bottom: none;
    }

    .suggestion-header {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 10px;
      font-size: 0.85em;
      font-weight: 600;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .suggestion-item {
      padding: 10px 12px;
      border-radius: 10px;
      cursor: pointer;
      transition: var(--transition);
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 5px;
    }

    .suggestion-item:hover {
      background: var(--bg-secondary);
      transform: translateX(5px);
    }

    .suggestion-icon {
      width: 35px;
      height: 35px;
      border-radius: 8px;
      background: var(--primary-gradient);
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 14px;
    }

    .suggestion-text {
      flex: 1;
    }

    .suggestion-text .main {
      font-weight: 500;
      color: var(--text-primary);
      margin-bottom: 2px;
    }

    .suggestion-text .sub {
      font-size: 0.85em;
      color: var(--text-secondary);
    }

    .suggestion-remove {
      color: var(--text-secondary);
      cursor: pointer;
      padding: 5px;
      border-radius: 5px;
      transition: var(--transition);
    }

    .suggestion-remove:hover {
      background: #fee2e2;
      color: var(--danger-color);
    }

    .clear-history-btn {
      display: block;
      width: 100%;
      padding: 10px;
      background: #fee2e2;
      color: var(--danger-color);
      border: none;
      border-radius: 10px;
      font-weight: 600;
      cursor: pointer;
      transition: var(--transition);
      margin-top: 10px;
    }

    .clear-history-btn:hover {
      background: #fecaca;
    }

    /* --- Trending Section --- */
    .trending-section {
      margin-bottom: 30px;
      animation: fadeInUp 0.7s ease;
    }

    .section-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 15px;
      padding: 0 5px;
    }

    .section-header h3 {
      font-family: 'Poppins', sans-serif;
      font-size: 1.3em;
      font-weight: 700;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .trending-badge {
      background: var(--secondary-gradient);
      color: white;
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 0.7em;
      font-weight: 600;
      animation: pulse 2s infinite;
    }

    .trending-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 12px;
    }

    .trending-item {
      background: var(--bg-primary);
      padding: 15px;
      border-radius: 15px;
      text-align: center;
      cursor: pointer;
      transition: var(--transition);
      border: 1px solid var(--border-color);
      box-shadow: var(--shadow-sm);
    }

    .trending-item:hover {
      transform: translateY(-5px);
      box-shadow: var(--shadow-lg);
      border-color: #667eea;
    }

    .trending-item .icon {
      font-size: 2em;
      margin-bottom: 10px;
      background: var(--primary-gradient);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .trending-item .label {
      font-weight: 600;
      color: var(--text-primary);
      font-size: 0.95em;
    }

    .trending-item .count {
      font-size: 0.8em;
      color: var(--text-secondary);
      margin-top: 5px;
    }

    /* --- Product Card Results (Enhanced) --- */
    #results-container {
      display: flex;
      flex-direction: column;
      gap: 15px;
    }

    .product-card {
      display: flex;
      gap: 18px;
      padding: 18px;
      background: var(--bg-primary);
      border-radius: 18px;
      text-decoration: none;
      color: var(--text-primary);
      box-shadow: var(--shadow-md);
      transition: var(--transition);
      border: 1px solid var(--border-color);
      position: relative;
      overflow: hidden;
      animation: fadeInScale 0.4s ease;
    }

    @keyframes fadeInScale {
      from {
        opacity: 0;
        transform: scale(0.95);
      }
      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    .product-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 4px;
      height: 100%;
      background: var(--primary-gradient);
      transform: scaleY(0);
      transition: var(--transition);
    }

    .product-card:hover::before {
      transform: scaleY(1);
    }

    .product-card:hover {
      transform: translateY(-5px);
      box-shadow: var(--shadow-xl);
      border-color: #667eea;
    }

    .product-image-container {
      position: relative;
      width: 120px;
      height: 120px;
      flex-shrink: 0;
      border-radius: 12px;
      overflow: hidden;
      background: var(--bg-secondary);
    }
    
    .product-image-container img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      transition: var(--transition);
    }

    .product-card:hover .product-image-container img {
      transform: scale(1.1);
    }
    
    .discount-badge {
      position: absolute;
      top: 4px;
      right: 8px;
      background: var(--secondary-gradient);
      color: white;
      padding: 6px 12px;
      border-radius: 10px;
      font-size: 0.15em;
      font-weight: 500;
      box-shadow: var(--shadow-md);
      display: flex;
      align-items: center;
      gap: 4px;
      animation: bounce 2s infinite;
    }

    @keyframes bounce {
      0%, 100% {
        transform: translateY(0);
      }
      50% {
        transform: translateY(-5px);
      }
    }

    .product-info {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      min-width: 0;
    }

    .product-name {
      font-size: 1.1em;
      font-weight: 600;
      color: var(--text-primary);
      margin: 0 0 10px 0;
      line-height: 1.4;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .product-card:hover .product-name {
      color: #667eea;
    }

    .price-section {
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    
    .sale-price {
      font-size: 1.4em;
      font-weight: 800;
      color: var(--success-color);
    }

    .regular-price {
      text-decoration: line-through;
      color: var(--text-secondary);
      font-size: 1em;
    }
    
    .meta-section {
      font-size: 0.85em;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-top: 10px;
      border-top: 1px solid var(--border-color);
      gap: 10px;
    }

    .stock {
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 5px 10px;
      border-radius: 8px;
      font-weight: 600;
    }

    .in-stock {
      background: #d1fae5;
      color: var(--success-color);
    }
    
    .out-of-stock {
      background: #fee2e2;
      color: var(--danger-color);
    }

    .seller-location {
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      gap: 5px;
    }
    
    .seller-location i {
      color: var(--danger-color);
    }

    /* --- Hint Messages (Enhanced) --- */
    .hint {
      text-align: center;
      font-size: 1em;
      color: var(--text-secondary);
      padding: 50px 20px;
      border: 2px dashed var(--border-color);
      border-radius: 15px;
      margin-top: 20px;
      background: var(--bg-primary);
      animation: fadeIn 0.5s ease;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
      }
      to {
        opacity: 1;
      }
    }

    .hint i {
      font-size: 3em;
      margin-bottom: 15px;
      display: block;
      opacity: 0.5;
    }
    
    .hint.error {
      color: var(--danger-color);
      border-color: var(--danger-color);
      background: #fef2f2;
    }

    /* --- Loading Animation --- */
    .loading-spinner {
      display: inline-block;
      width: 40px;
      height: 40px;
      border: 4px solid var(--border-color);
      border-top-color: #667eea;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    /* --- Scrollbar Styling --- */
    ::-webkit-scrollbar {
      width: 8px;
    }

    ::-webkit-scrollbar-track {
      background: var(--bg-secondary);
    }

    ::-webkit-scrollbar-thumb {
      background: #667eea;
      border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: #764ba2;
    }

    /* --- Responsive Adjustments --- */
    @media (max-width: 768px) {
      body {
        padding-top: 65px;
      }

      .container {
        padding: 0 15px 30px 15px;
      }

      .special-header {
        padding: 10px 15px;
      }

      .header-title-small {
        font-size: 1.1em;
      }

      .header-stats {
        display: none;
      }

      .search-wrapper {
        padding: 20px;
        border-radius: 15px;
      }

      .search-logo {
        height: 40px;
        width: 40px;
      }

      .search-title h2 {
        font-size: 1.2em;
      }

      .search-box input {
        padding: 14px 50px 14px 45px;
        font-size: 15px;
      }

      .trending-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
      }

      .trending-item {
        padding: 12px;
      }

      .product-card {
        gap: 12px;
        padding: 12px;
      }

      .product-image-container {
        width: 90px;
        height: 90px;
      }

      .product-name {
        font-size: 1em;
      }

      .sale-price {
        font-size: 1.2em;
      }

      .meta-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 0.8em;
      }

    }

    @media (max-width: 480px) {
      .header-logo-small {
        height: 35px;
        width: 35px;
      }

      .header-title-small {
        font-size: 1em;
      }

      .search-section {
        margin-top: 15px;
      }

      .search-wrapper {
        padding: 15px;
      }

      .search-logo {
        height: 35px;
        width: 35px;
      }

      .search-title h2 {
        font-size: 1.1em;
      }

      .search-title p {
        font-size: 0.8em;
      }

      .product-image-container {
        width: 70px;
        height: 70px;
      }

      .trending-item .icon {
        font-size: 1.5em;
      }
    }
 