/* Botiga header search integration for Isla Essentials */

#masthead.site-header {
  position: sticky;
}

.header-actions .header-search {
  background: none;
  border: 0;
  font-size: 21px;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.header-actions .header-search .ws-svg-icon {
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  width: 18px;
  height: 18px;
}

.header-actions .header-search .ws-svg-icon svg {
  width: 21px;
  height: 21px;
}

.ws-svg-icon svg:not(.stroke-based) {
  fill: currentColor;
}

.search-submit .ws-svg-icon {
  width: 24px;
  height: 24px;
}

.search-submit .ws-svg-icon svg:not(.stroke-based) {
  fill: #fff;
}

.header-search .icon-search,
.header-search .icon-cancel {
  display: none;
  cursor: pointer;
  position: relative;
  z-index: 999;
}

.header-search .icon-search.active,
.header-search .icon-cancel.active {
  display: inline-block;
}

.header-search .icon-cancel {
  font-size: 18px;
}

.header-search .icon-cancel svg {
  width: 20px;
  height: 24px;
}

.header-search.hide {
  opacity: 0;
  visibility: hidden;
}

.header-search-form {
  position: absolute;
  width: 100%;
  top: 100%;
  left: 0;
  background-color: #fff;
  padding: 40px 15px;
  z-index: 999999;
  left: -9999em;
  opacity: 0;
  transition: opacity 0.3s;
  visibility: hidden;
}

.header-search-form form {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
}

.header-search-form form .search-field {
  font-size: 1rem;
  width: 100%;
}

.header-search-form form button,
.header-search-form form .search-field {
  display: block;
  min-height: 0;
  font-size: 1rem;
  padding: 0.7em 1em;
}

.header-search-form form button {
  padding: 0.7em 1.25em !important;
  border-radius: 0;
  background: var(--teal, #267d79);
  color: #fff;
  border: 0;
  cursor: pointer;
}

.header-search-form-active .header-search-form {
  opacity: 1;
  left: 0;
  visibility: visible;
}

.search-overlay {
  position: fixed;
  top: 0;
  height: 100%;
  width: 100%;
  z-index: 998;
  background-color: rgba(33, 33, 33, 0.3);
  left: -100%;
  opacity: 0;
  transition: opacity 0.3s;
}

.search-overlay.active {
  opacity: 1;
  left: 0;
  z-index: 9;
}

/* Ajax search dropdown */
.botiga-ajax-search {
  position: relative;
  z-index: 11;
}

.botiga-ajax-search-products {
  max-height: 40vh;
  overflow-y: auto;
}

.botiga-ajax-search__heading-title {
  font-size: 1.125rem;
  margin: 0 0 15px;
}

.botiga-ajax-search__divider {
  background-color: rgba(221, 221, 221, 0.87);
  border: 0;
  height: 1px;
  margin: 0 0 15px;
}

.botiga-ajax-search__wrapper {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #f5f5f5;
  padding: 15px;
  border: 1px solid rgba(221, 221, 221, 0.87);
  width: 100%;
  min-width: 600px;
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.1);
}

.botiga-ajax-search__item {
  display: flex;
  transition: ease opacity 300ms;
  text-decoration: none;
  color: inherit;
}

.botiga-ajax-search__item:hover {
  opacity: 0.8;
}

.botiga-ajax-search__item + .botiga-ajax-search__item {
  position: relative;
  margin-top: 30px;
}

.botiga-ajax-search__item + .botiga-ajax-search__item:before {
  content: "";
  position: absolute;
  top: -15px;
  left: 0;
  width: 100%;
  border-top: 1px solid rgba(221, 221, 221, 0.87);
}

.botiga-ajax-search__item-image {
  max-width: 60px;
  margin-right: 20px;
}

.botiga-ajax-search__item-info {
  width: 100%;
}

.botiga-ajax-search__item-info h3 {
  font-size: 0.875rem;
  margin: 0;
}

.botiga-ajax-search__item-price {
  margin-left: 20px;
  text-align: right;
}

.botiga-ajax-search-categories,
.botiga-ajax-search-tags,
.botiga-ajax-search-attributes__terms {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 10px;
}

.botiga-ajax-search__see-all {
  text-align: center;
  padding: 20px 20px 10px;
}

@media (max-width: 900px) {
  .botiga-ajax-search__wrapper {
    min-width: 0;
  }
}
