/*
 * In-list search box of category and brand pages (journal3/list_search.twig, journal3/list_search_empty.twig).
 * Added by journal3/event/products.php (listSearchAssets) while Funkcijos list_search is on. Self-contained on purpose:
 * brand pages (#product-manufacturer) are not covered by category.css, whose values (colours, 10px radius, 40px
 * controls) it repeats so the box reads as the first row of the sort bar on both. Selectors start with #content because
 * the skin CSS is printed inline after this file.
 */

#content .shp-list-search {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  margin: 0 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: #6b7280;
  transition: border-color .15s, box-shadow .15s;
}

#content .shp-list-search:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
  outline: 2px solid transparent;
}

#content .shp-list-search .shp-ls-icon {
  flex: none;
  margin-inline-start: 12px;
}

#content .shp-list-search input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
  color: #111827;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}

#content .shp-list-search input[type="search"]::placeholder {
  color: #6b7280;
  opacity: 1;
}

#content .shp-list-search input[type="search"]::-webkit-search-cancel-button,
#content .shp-list-search input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  display: none;
}

#content .shp-list-search .shp-ls-clear {
  display: none;
  flex: none;
  width: 40px;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 9px 9px 0;
  background: transparent;
  box-shadow: none;
  color: #6b7280;
  cursor: pointer;
  line-height: 1;
}

#content .shp-list-search.has-value .shp-ls-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.no-touchevents #content .shp-list-search .shp-ls-clear:hover {
  background: #f8fafc;
  color: #111827;
}

#content .shp-list-search .shp-ls-clear:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -3px;
}

/* working indicator: the list dims and a small ring turns in the field, nothing changes height */
#content .shp-list-search .shp-ls-spin {
  display: none;
  flex: none;
  width: 16px;
  height: 16px;
  margin-inline-end: 6px;
  border: 2px solid #d1d5db;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: shp-ls-spin .7s linear infinite;
}

#content .shp-list-search.is-busy .shp-ls-spin {
  display: block;
}

#content .shp-list-search.is-busy + .main-products-wrapper {
  opacity: .5;
  transition: opacity .15s;
}

@keyframes shp-ls-spin {
  to { transform: rotate(360deg); }
}

/* live region: read out always, seen only for an error */
#content .shp-list-search .shp-list-search-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#content .shp-list-search.has-error .shp-list-search-status {
  top: calc(100% + 1px);
  left: 2px;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  color: #b91c1c;
  font-size: 12px;
  line-height: 14px;
}

/* answer inside the swapped list */
#content .shp-ls-note {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 14px;
}

#content .shp-ls-empty {
  margin: 0 0 20px;
  padding: 32px 16px;
  border: 1px dashed #d1d5db;
  border-radius: 14px;
  background: #f8fafc;
  text-align: center;
}

#content .shp-ls-empty .shp-ls-empty-title {
  margin: 0 0 16px;
  color: #111827;
  font-size: 18px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

#content .shp-ls-empty .shp-ls-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* own button class: the skin forces the colours of .btn with !important */
#content .shp-ls-empty .shp-ls-btn {
  display: inline-block;
  min-height: 40px;
  margin: 0;
  padding: 9px 16px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

#content .shp-ls-empty .shp-ls-btn-primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.no-touchevents #content .shp-ls-empty .shp-ls-btn:hover {
  border-color: #9ca3af;
}

.no-touchevents #content .shp-ls-empty .shp-ls-btn-primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

#content .shp-ls-empty .shp-ls-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

@media (max-width: 575px) {
  #content .shp-list-search {
    height: 44px;
  }

  /* 16px keeps iOS from zooming in on focus */
  #content .shp-list-search input[type="search"] {
    font-size: 16px;
  }

  #content .shp-list-search .shp-ls-clear {
    width: 44px;
  }

  #content .shp-ls-empty .shp-ls-empty-actions {
    flex-direction: column;
  }

  #content .shp-ls-empty .shp-ls-empty-actions .shp-ls-btn {
    width: 100%;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #content .shp-list-search,
  #content .shp-list-search.is-busy + .main-products-wrapper {
    transition: none;
  }

  #content .shp-list-search .shp-ls-spin {
    animation: none;
  }
}
