.dn-search-field {
  text-align: left !important;
  outline: none !important;
}

/* 1) Outer container styling */
.suggestions-container {
  position: absolute;
  left: 0;
  width: 100%;
  background: #fff;
  z-index: 10000;
  box-sizing: border-box;
  padding: 0;
  margin: 0;

  /* shadow + rounded corners */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-bottom-right-radius: 8px;
  border-bottom-left-radius: 8px;
  /* single 1px border around the whole thing */
  border: 1px solid #ccc;
}

/* 2) Recent-searches bar at top (no outer border) */
.recent-searches {
  width: 80vw;
  max-width: 1000px;
  margin: 0 auto;
  
  /* remove its own border, use the container’s instead */
  background: transparent;
  box-shadow: none;
  border: none;
  
  /* layout */
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
}

/* 3) Separator between recent and suggestions */
.recent-searches {
  border-bottom: 1px solid #eee;
}

/* 4) Suggestions grid */
.suggestions-dropdown {
  width: 80vw;
  max-width: 1000px;
  margin: 0 auto;
  background: transparent;
  box-shadow: none;
  border: none;

  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 16px;
}

/* 5) Cards */
.search-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.search-card:hover {
  background: #f9f9f9;
  transform: translateY(-2px);
}
.search-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  margin-bottom: 8px;
  border-radius: 4px;
}
.product-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: #333; }
.price { font-size: 13px; color: #555; }

/* 6) Show more link */
.show-more {
  grid-column: 1 / -1;
  text-align: center;
  padding: 12px 0;
  font-weight: 600;
  cursor: pointer;
  color: #007bff;
}
.show-more:hover { text-decoration: underline; }

/* 7) Dropdown title */
.dropdown-title {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
  margin-bottom: 8px;
}

/* 8) Recent items & clear button */
.recent-item {
  padding: 4px 8px;
  background: #f0f0f0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}
.recent-item:hover { background: #e0e0e0; }

.clear-all {
  margin-left: auto;
  padding: 4px 8px;
  background: #f0f0f0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #000;
}
.clear-all:hover { background: #e0e0e0; }

/* Tablet / small desktop */
@media screen and (max-width: 768px) {
  .recent-searches,
  .suggestions-dropdown {
    width: 90vw;
    max-width: none;
    margin: 0 auto;

    /* limit its height and enable internal scrolling */
    max-height: calc(100vh - 150px);
    overflow-y: auto;

    /* prevent scroll from “bleeding” into the page behind */
    overscroll-behavior: contain;

  }

  .suggestions-dropdown {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 12px;
  }

  .recent-searches {
    padding: 10px 12px;
    gap: 4px;
  }

  .search-card {
    padding: 10px;
  }

  .product-name {
    font-size: 13px;
  }
  .price {
    font-size: 12px;
  }
}

/* Mobile phones */
@media screen and (max-width: 480px) {
  .recent-searches,
  .suggestions-dropdown {
    width: 100%;
    margin: 0;
    padding: 8px 0;
  }

  .suggestions-dropdown {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 8px;
  }

  .recent-searches {
    padding: 8px 12px;
    gap: 4px;
  }

  .search-card {
    padding: 8px;
  }

  .search-card img {
    height: 100px;
  }

  .product-name {
    font-size: 12px;
  }
  .price {
    font-size: 11px;
  }

  .show-more,
  .dropdown-title {
    font-size: 13px;
  }
}

.voice-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  color: #555;
}
.voice-search-btn.listening {
  color: #d00;             /* indicate “listening” */
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.5; }
}
.dn-search-field-container input {
  padding-right: 36px;     /* make room for the button */
}

@media screen and (max-width: 768px) {
  .voice-search-btn {
    right: 148px;
  }
}
