
/* === Final Unified Filter Dropdown CSS === */

/* Base container for filters */
#bike-grid-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4em;
  margin: 0.5em auto;
  max-width: 820px;
  padding: 0 4px;
  box-sizing: border-box;
}

#bike-grid-filters select {
  appearance: menulist;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  font-size: 0.85em;
  font-family:  'Inter','Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  padding: 2px 3px; /* tighter padding */
  width: auto;
  min-width: 0;
  max-width: fit-content;
  white-space: nowrap; /* ensure no wrapping */
  background-color: #f9f9f9;
  color: #1c1c1e;
  border: 1px solid #c7c7cc;
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  transition: border 0.2s ease, box-shadow 0.2s ease;
  background-image: none;       /* remove arrow */
  background-position: right 6px center;
  padding-right: 6px;           /* slightly more room if arrow returns */
  flex: 0 0 auto;               /* prevent it from stretching in flex rows */
}


/* Focus state */
#bike-grid-filters select:focus {
  border-color: #007aff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0,122,255,0.2);
}

/* No-match fallback message */
.no-match-message {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 1rem;
  text-align: center;
  padding: 2em 1em;
  color: #333;
  max-width: 90%;
  margin: auto;
  background: #f8f8f8;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  line-height: 1.4;
  margin-top: 2vh;
}

/* iPhone 12 and narrow viewport optimizations */
@media screen and (max-width: 430px) {
  .filter-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.4em;
    padding: 0 2vw;
  font-family:  'Inter','Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  }

.filter-row select {
  font-size: 0.8em;
  width: auto;
  min-width: 0;
  max-width: fit-content;
  white-space: nowrap;
  padding: 2px 4px;
  margin: 4px;
  flex: 0 0 auto;
font-family:  'Inter','Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

}



  .filter-label {
    font-size: 0.75em;
    margin-right: 0.4em;
    white-space: nowrap;
  }

  #bike-grid-sort {
    width: 100%;
    text-align: center;
    margin-top: 6px;
  }

#bike-grid-sort select {
  font-size: 0.75em;
  width: 68vw;
  max-width: 72vw;
  min-width: 150px;
  margin: 4px auto;
  display: block;
}
}

@media screen and (min-width: 768px) {
  #bike-grid-sort select {
    font-size: 0.7em; /* smaller text */
    width: auto;
    min-width: 150px;  /* narrower min width */
    max-width: 210px;  /* narrower max width */
    display: inline-block;
    margin-left: 0.35em;
    padding: 2px 4px;  /* tighter padding to match smaller font */
  }
}


/* Desktop tuning */
@media screen and (min-width: 768px) {
  .filter-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0.4em;
  }

  .filter-label {
    font-size: 0.85em;
    margin-right: 0.4em;
    white-space: nowrap;
  }

.filter-row select {
  width: auto;
  min-width: 0;
  max-width: fit-content;
  white-space: nowrap;
  font-size: 0.75em;
  padding: 2px 4px;
  flex: 0 0 auto;
}

 /* old code  #bike-grid-sort select {
    font-size: 0.85em;
    width: auto;
    min-width: 190px;
    max-width: 260px;
    display: inline-block;
    margin-left: 0.35em;
  }
 */   
    
     #bike-grid-sort select {
    font-size: 0.75em; /* smaller text */
    width: auto;
    min-width: 150px;  /* narrower min width */
    max-width: 210px;  /* narrower max width */
    display: inline-block;
    margin-left: 0.35em;
    padding: 2px 4px;  /* tighter padding to match smaller font */
  }
}

/* === Filter Button Container Row === */
.filter-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5em;
  margin-top: 0.4em;
  padding: 0 4vw;
}

/* Label "Filter by:" */
.filter-label {
  font-size: 0.75em;
  font-weight: 500;
  margin-right: 0.4em;
  white-space: nowrap;
}

/* === Toggle Button Styles === */
.filter-btn {
  font-size: 0.7em;
  font-family: 'Jost', 'Roboto', sans-serif;
  padding: 4px 10px;
  border: 1px solid #c7c7cc;
  border-radius: 12px;
  background-color: #f9f9f9;
  color: #1c1c1e;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  width: auto;             /* ← Important */
  flex: 0 0 auto;          /* ← Prevent stretching */
}

.filter-btn:hover {
  background-color: #eaeaea;
  border-color: #a5a5aa;
}

.filter-btn.active {
  background-color: #007aff;
  color: #fff;
  border-color: #007aff;
}

.filter-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3);
}

/* === Responsive tweaks for iPhone 12 and similar === */
@media screen and (max-width: 430px) {
  .filter-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5em;
    padding: 0 3vw;
  }

  .filter-btn {
    font-size: 0.85em;
    color: #1c1c1e;
    padding: 5px 12px;
    min-width: 100px;
    text-align: center;
   font-family:  'Inter','Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
   width: auto;             /* ← Important */
  flex: 0 0 auto;          /* ← Prevent stretching */

  }
}

