#dropdownMenu{
    max-height: 120px !important; 
    overflow-y: auto !important;
}


#dropdownMenu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;  /* lower than suggested-products */
}

/* Keep original search container styles */
.search-container {
  display: flex;
  flex-direction: column;
  position: relative; /* ensures absolute child is positioned correctly */
}

#suggested-products {
  position: absolute;
  top: calc(100% + 120px); /* push it down by dropdown height */
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ddd;
  max-height: 240px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 1100; /* higher than dropdownMenu */
}

/* Individual product card */
.suggested-products .card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 8px;
    height: 150px;
    overflow: hidden;
}

.suggested-products img {
    width: 75%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #eee;
    border-radius: 4px;
}

.suggested-products .card-body {
    width: 100%;
    padding-top: 6px;
}

.suggested-products .card-title {
    font-size: x-small;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    line-height: 1.2;
    height: 2.4em;
}

.suggested-products .card-title:hover::after {
    content: attr(data-full);
    position: absolute;
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: normal;
    max-width: 220px;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    font-size: 0.75rem;
}

.suggested-products .card-text {
    font-size: x-small;
    color: #000000;
    margin: 0;
}

/* Force the heading to span the full width and center it */
#suggested-products .suggested-products-title {
  grid-column: 1 / -1;  /* take all columns in the grid */
  text-align: center;
  font-weight: 600;
  padding: 8px 0;
  background: #fff;     /* match background */
  position: sticky;     /* optional: stick to top when scrolling */
  top: 0;               /* only if you want sticky */
  z-index: 1200;
}

/* Create a proper grid for products below the heading */
#suggested-products .suggested-products-grid {
  display: contents; /* allows grid children to inherit the main grid layout */
}

/* Make sure product cards stay centered inside each cell */
#suggested-products .card {
  margin: 0 auto;
}




/* The dropdown menu itself */
.dropdown-menu {
  padding: 4px 0;                
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
  background-color: #fff;
  max-height: 250px;                
  overflow-y: auto;                 
}

/* Dropdown items */
.dropdown-menu .dropdown-item {
  padding-left: 6px;              
  font-size: 16px;
  color: #333;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

/* Hover/active effect */
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background-color: #f5f5f5;  
  color: #000;
}

/* Back arrow item styling */
.dropdown-menu .dropdown-item.back-arrow {
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;                       
  border-bottom: 1px solid #eaeaea;
  background-color: #fafafa;       
}

/* Optional hover for back arrow */
.dropdown-menu .dropdown-item.back-arrow:hover {
  background-color: #f0f0f0;
}



/* For Chrome, Edge, Safari */
.dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background-color: #c1c1c1;
  border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background-color: #999;
}

/* For Firefox */
.dropdown-menu {
  scrollbar-width: thin;             /* slim */
  scrollbar-color: #c1c1c1 #f1f1f1; /* thumb color / track color */
}
