/*
 * Header search overlay (template-parts/search.php), additions to css/search.less (compiled into main.min.css),
 * enqueued by src/Search.php after main.min.css:
 * - close X: 44 x 44 px tap area around the 18 px icon; the icon and the row keep their size and place
 * - "Im Shop": own products above the recipe results (template-parts/search-products.php)
 */

#search-box #search-close {
  position: relative; /* anchor of the tap area, and above the logo row that overlaps it by 14 px */
  pointer-events: none; /* only the icon and its tap area close, not the empty rest of the full-width row */
}

#search-box #search-close svg,
#search-box #search-close::after {
  pointer-events: auto;
}

#search-box #search-close::after {
  content: "";
  position: absolute;
  top: -13px; /* icon: 18 px at the top right of the row → (44 - 18) / 2 */
  right: -13px;
  width: 44px;
  height: 44px;
}

#search-box .jo-search-shop {
  padding: 15px 0;
  font-family: 'Open Sans', sans-serif;
}

#search-box .jo-search-shop__title {
  margin-bottom: 10px;
  color: #A59C91;
  font-size: 14px;
  font-weight: 500;
  line-height: 19px;
  letter-spacing: 2px;
}

#search-box .jo-search-shop__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#search-box .jo-search-shop__item {
  min-width: 0;
  margin: 0;
  padding: 0;
}

#search-box .jo-search-shop__item::before {
  content: none;
}

#search-box .jo-search-shop__link {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr); /* text column ~91 px: most product words fit in one line */
  column-gap: 8px;
  align-items: start;
  color: #191919;
  text-decoration: none;
}

#search-box .jo-search-shop__image {
  display: block;
  width: 52px;
  height: 52px;
  overflow: hidden;
  background: #fff;
  border-radius: 2px;
}

#search-box .jo-search-shop__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#search-box .jo-search-shop__item.is-out .jo-search-shop__image img {
  opacity: .55;
}

#search-box .jo-search-shop__texts {
  display: block;
  min-width: 0;
}

#search-box .jo-search-shop__name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 13px;
  font-weight: 600;
  line-height: 17px;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

@media only screen and (min-width: 1194px) {
  /* the overlay's text column is narrowest here (wide left padding), keep whole words where possible */
  #search-box .jo-search-shop__name {
    font-size: 12px;
    line-height: 16px;
  }
}

#search-box .jo-search-shop__link:hover .jo-search-shop__name,
#search-box .jo-search-shop__link:focus-visible .jo-search-shop__name {
  text-decoration: underline;
}

#search-box .jo-search-shop__price {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 500;
  line-height: 17px;
}

#search-box .jo-search-shop__price del {
  margin-right: 3px;
  color: #6E665C;
  font-size: 11px;
}

#search-box .jo-search-shop__price ins {
  text-decoration: none;
}

#search-box .jo-search-shop__price .woocommerce-price-suffix {
  display: block;
  color: #6E665C;
  font-size: 10px;
  font-weight: 400;
  line-height: 13px;
}

#search-box .jo-search-shop__stock {
  display: block;
  color: #6E665C;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
}

#search-box .jo-search-shop .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
