.header-search-trigger {
  position: relative;
  z-index: 10;
}

.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: inherit;
  padding: 0 !important;
  color: var( --e-global-color-primary );
  background-color: transparent !important;
}

.search-toggle:focus {
    background-color: transparent !important;
    text-decoration: none;
      color: var( --e-global-color-primary );
}

/* Search bar container - should wrap both trigger and search bar */
.m2m-search-container {
  position: relative;
  display: inline-block;
}

/* Search bar - fixed to viewport with sticky header support */
.header-search-bar {
  position: fixed;
  top: var(--header-height, 80px); /* Will be updated by JS */
  left: 0;
  width: 100%;
  z-index: 9999;
  background: #fff;
  transform-origin: top;
  transform: scaleY(0);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.3s ease;
  will-change: transform, opacity, top;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 20px 0;
  max-height: calc(100vh - var(--header-height, 80px));
  overflow-y: auto;
}

/* Adjust for admin bar when logged in */
.admin-bar .header-search-bar {
  top: calc(var(--header-height, 80px) + 32px);
}

/* For mobile admin bar */
@media screen and (max-width: 782px) {
  .admin-bar .header-search-bar {
    top: calc(var(--header-height, 80px) + 46px);
  }
}

.header-search-bar.active {
  transform: scaleY(1);
  opacity: 1;
}

/* Ensure search form is properly centered and constrained */
.header-search-bar .search-form {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.header-search-bar.active button:hover {
  background-color: var(--e-global-color-primary) !important;
  text-decoration: none;
}

.search-form {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-field {
  flex: 1;
  padding: 12px 18px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 40px;
  outline: none;
}

.search-submit {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #333;
}

.header-search-trigger .search-toggle .e-font-icon-svg {
  width: 1.2em;           /* or 20px, if you prefer fixed size */
  height: 1.2em;
  fill: currentColor;     /* ensures icon inherits text color */
  vertical-align: middle; /* keeps it aligned nicely */
  transition: transform 0.2s ease;
}

.header-search-trigger .search-toggle:hover .e-font-icon-svg {
  transform: scale(1.1);
  color: var(--e-global-color-primary, #d7a959);
}