.products-page {
    padding: 120px 2rem 2rem;
    max-width: 1200;
    min-height: 100vh;
    margin: 0 auto;
}

.search-section {
    text-align: center;
    margin-top: 2rem;
}

.survey-prompt {
    max-width: 1200px;
    margin: 1.5rem auto 0; 
}

.survey-title {
    font-size: 16px;
}

.survey-subtitle {
    font-size: 16px;
    margin-bottom: 0;
}

.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.search-bar {
    padding: 0.75rem 1rem;
    width: 600px;
    border: 2px solid var(--ex);
    background: transparent;
    border-radius: 25px;
    font-size: 20px;
    box-shadow: 4px 5px 10px 1px rgba(0, 0, 0, 0.2);
}

.filter-btn {
    padding: 0.75rem 2rem;
    border: 2px solid var(--ex);
    border-radius: 25px;
    background: transparent;
    color: var(--d-text);
    font-size: 20px;
    cursor: pointer;
    transition: 0.2s ease;
    box-shadow: 4px 5px 10px 1px rgba(0, 0, 0, 0.2);
}

.filter-btn:hover {
    background: var(--ex);
    color: var(--d-text);
}

.filter-form {
    position: relative;
    display: inline-block;
}

.filter-dropdown {
    display: none;
    position: absolute;
    top: 100%; /* Keep it below the button */
    left: 50%; /* Position the left edge at 50% of the button's width */
    transform: translateX(-50%); /* Shift it left by 50% of its own width to center it */
    background: var(--background);
    border: 2px solid #89aac7;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 100;
    width: 200px;
    overflow: hidden;
}

.filter-option {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--d-text);
}

.filter-option:hover {
    background-color: #f0f0f0;
}

.filter-option.selected {
    background-color: #89aac7;
    color: #fff;
    font-weight: bold;
}

.clear-filter {
    background-color: #f0f0f0;
    font-weight: bold;
    color: var(--d-text);
}

.clear-filter:hover {
    background-color: #e0e0e0;
}

.survey-btn {
    padding: 0.75rem 1rem;
    background: transparent;
    color: var(--d-text);
    border: 2px solid var(--ex);
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s ease;
    box-shadow: 4px 5px 10px 1px rgba(0, 0, 0, 0.2);
}

.survey-btn:hover {
    background: var(--ex);
}

.product-grid {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
    max-width: 85%;
    margin: 2rem auto 0;
}

.product-card {
    border: 2px solid var(--ex);
    border-radius: 8px;
    padding: 1rem 3rem;
    text-align: center;
    box-shadow: 2px 1px 4px 0px rgba(0, 0, 0, 0.2);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.product-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.product-description {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
  .products-page {
    padding: 50px 1rem 1rem;
  }

  .search-container {
    flex-direction: row;        /* Keep in a row */
    flex-wrap: nowrap;          /* Prevent wrapping */
    justify-content: center;    
    gap: 0.5rem;
    flex-wrap: wrap;            /* fallback if space is tight */
  }

  .search-bar {
  flex: 2;
  max-width: none;
  padding: 0.5rem 0.5rem;
  font-size: 0.8rem;
  box-sizing: border-box;
  min-width: 90px;
  width: 100%;
  }
  
  .filter-btn {
  flex: 1;
  max-width: 100px;
  padding: 0.5rem 0.1rem; /* less padding on sides */
  font-size: 0.8rem;
  box-sizing: border-box;
  min-width: 70px;
  width: 100%;
  }
  
  .survey-btn {
    flex: 1;
    max-width: 100px;
    padding: 0.5rem 0.5rem; /* original padding or more */
    font-size: 0.8rem;
    box-sizing: border-box;
    min-width: 90px;
    width: 100%;
  }


  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-card img {
    height: 150px;
  }
}
