/* Hack until revamp nav rolls out: set boundaries for the box and keep the height when active */
body > [data-namespace="search-box-legacy"] {
  width: 100%;
  max-width: 90rem;
  height: 3.125rem;
  margin: 0 auto;
}

/* Wrapper */
[data-namespace="search-box-legacy"] .search-wrapper {
  position: relative;
}

[data-namespace="search-box-legacy"] .search-box__wrapper {
  position: absolute;
  top: 0.2rem;
  right: 1rem;
  bottom: 0;
  display: flex;
}

.search-box__wrapper.hide {
  display: none;
}

[data-namespace="search-box-legacy"] .search-box__buttons {
  display: flex;
}

[data-namespace="search-box-legacy"] .search-box__button {
  position: relative;
  display: flex;
  align-items: center;
}

[data-namespace="search-box-legacy"] .search-box__button + .search-box__button::before {
  position: absolute;
  top: 50%;
  left: 0;
  height: 1.5rem;
  content: "";
  border-left: 1px solid #ccc;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
}

[dir="rtl"] [data-namespace="search-box-legacy"] .search-box__button + .search-box__button::before {
  right: 0;
  left: auto;
}

[data-namespace="search-box-legacy"] .search-box__button--search,
[data-namespace="search-box-legacy"] .search-box__button--clear-field {
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: none;
  border: none;
}

[data-namespace="search-box-legacy"] .search-box__button--search::after {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  content: '';
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' fill='%23111'%3E%3Cpath d='M12.29 18.37l1.42 1.4 7.7-7.77-7.71-7.64-1.4 1.42L17.57 11H4v2h13.6l-5.31 5.37z'/%3E%3C/svg%3E") 50% no-repeat;
}

[dir="rtl"] [data-namespace="search-box-legacy"] .search-box__button--search::after {
  transform: rotateZ(180deg);
}

[data-namespace="search-box-legacy"] .search-box__button--clear-field::after {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  content: '';
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='transparent'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 10.6L15.6 7 17 8.4 13.4 12l3.6 3.6-1.4 1.4-3.6-3.6L8.4 17 7 15.6l3.6-3.6L7 8.4 8.4 7l3.6 3.6z' fill-rule='evenodd' clip-rule='evenodd' fill='%23111'/%3E%3C/svg%3E") 50% no-repeat;
}

[dir="rtl"] [data-namespace="search-box-legacy"] .search-box__wrapper {
  right: auto;
  left: 1em;
}

[dir="rtl"] [data-namespace="search-box-legacy"] .search-box__search-icon {
  right: 1rem;
  left: auto;
}

[dir="rtl"] [data-namespace="search-box-legacy"] .search-box__button::after {
  transform: rotate(180deg);
}

[dir="rtl"] [data-namespace="search-box-legacy"] .search-box__buttons {
  flex-direction: row-reverse;
}

[data-namespace="search-box-legacy"] .search-field {
  position: relative;
  flex: 1 1 auto;
  width: auto;
}

/* Search icon */
[data-namespace="search-box-legacy"] .search-field::before {
  position: absolute;
  top: 50%;
  left: 1.5rem;
  width: 1rem;
  height: 1rem;
  pointer-events: none;
  content: '';
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='17' fill='%23111' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6.5 11a4.5 4.5 0 110-9 4.5 4.5 0 010 9zm4.968-.307a6.5 6.5 0 10-1.514 1.315l3.996 3.996 1.414-1.414-3.896-3.897z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: cover;
  transform: translateY(-50%);
}

[dir="rtl"] [data-namespace="search-box-legacy"] .search-field::before {
  right: 1rem;
  left: auto;
}

[data-namespace="search-box-legacy"] .search-field__input {
  display: block;
  appearance: none;
  width: 100%;
  padding: 0.5rem 3.375rem;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.5;
  background-color: #f5f5f5;
  border: 0;
  border-radius: 50em;
  outline: 0;
  box-shadow: none;
  transition: background 0.2s;
}

@media (min-width: 56.25rem) {
  [data-namespace="search-box-legacy"] .search-field__input {
    padding: 0.8125rem 3.375rem 0.8125rem;
  }
}

/* Hides the native "clear" X in IE */
[data-namespace="search-box-legacy"] .search-field__input::-ms-clear {
  display: none;
}

[data-namespace="search-box-legacy"] .search-field__input:hover {
  background-color: #e2e2e2;
}

[dir="rtl"] [data-namespace="search-box-legacy"] .search-field__input {
  padding: 0.75rem 5.25rem 0.75rem 7.25rem;
}
