/* Such-Overlay (assets/js/suche.js). Panel unter dem Kopf, Seite dahinter unscharf. */

.coffeosi-suche {
  --coffeosi-suche-top: 0px;
  --suche-bg: #fbf7ef;
  --suche-line: #e6dccb;
  --suche-accent: #d2bea0;
  --suche-accent-dark: #c0a062;
  --suche-text: #352723;
  position: fixed;
  inset: var(--coffeosi-suche-top) 0 0 0;
  z-index: 998;
}
.coffeosi-suche[hidden] {
  display: none;
}

.coffeosi-suche__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(53, 39, 35, 0.28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.coffeosi-suche__panel {
  position: relative;
  background: var(--suche-bg);
  box-shadow: 0 24px 48px rgba(53, 39, 35, 0.18);
  max-height: 72vh;
  max-height: min(72vh, calc(100dvh - var(--coffeosi-suche-top)));
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(-12px);
  opacity: 0;
  transition:
    transform 0.22s ease,
    opacity 0.22s ease;
}
.coffeosi-suche.is-open .coffeosi-suche__backdrop,
.coffeosi-suche.is-open .coffeosi-suche__panel {
  opacity: 1;
}
.coffeosi-suche.is-open .coffeosi-suche__panel {
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .coffeosi-suche__backdrop,
  .coffeosi-suche__panel {
    transition: none;
  }
}

.coffeosi-suche__inner {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 40px 48px;
}

.coffeosi-suche__close {
  display: none;
  position: absolute;
  top: 18px;
  right: 24px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.coffeosi-suche__close::before,
.coffeosi-suche__close::after,
.coffeosi-suche__clear::before,
.coffeosi-suche__clear::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 1.5px;
  background: var(--suche-text);
  transform: translate(-50%, -50%) rotate(45deg);
}
.coffeosi-suche__close::after,
.coffeosi-suche__clear::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.coffeosi-suche__close:hover,
.coffeosi-suche__close:focus-visible {
  background: #efe7da;
  outline: none;
}

/* Feld */
.coffeosi-suche__label {
  display: block;
  margin: 0 0 10px;
  color: var(--suche-accent-dark);
  font-size: 18px !important;
  letter-spacing: 0.12em !important;
}
.coffeosi-suche__field {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--suche-text);
}
.coffeosi-suche__field::before {
  content: "";
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin-right: 14px;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23352723' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E");
}
.coffeosi-suche .coffeosi-suche__input {
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 8px 0 10px;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--suche-text);
  font-size: 46px !important;
  line-height: 1.1 !important;
  letter-spacing: 0.04em !important;
  -webkit-appearance: none;
  appearance: none;
}
.coffeosi-suche .coffeosi-suche__input:focus {
  outline: none;
}
.coffeosi-suche .coffeosi-suche__input::placeholder {
  color: #b9ab95;
  opacity: 1;
  text-transform: none;
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  font-size: 32px;
  letter-spacing: 0;
}
.coffeosi-suche__input::-webkit-search-cancel-button,
.coffeosi-suche__input::-webkit-search-decoration {
  -webkit-appearance: none;
}
.coffeosi-suche__clear {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #efe7da;
  cursor: pointer;
}
.coffeosi-suche__clear::before,
.coffeosi-suche__clear::after {
  width: 14px;
}
.coffeosi-suche__clear[hidden] {
  display: none;
}

/* Ladebalken unter dem Feld */
.coffeosi-suche__form {
  position: relative;
}
.coffeosi-suche.is-loading .coffeosi-suche__field::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 30%;
  background: var(--suche-accent-dark);
  animation: coffeosi-suche-laden 0.9s ease-in-out infinite;
}
@keyframes coffeosi-suche-laden {
  from { left: 0; }
  to { left: 70%; }
}

/* Abschnitte */
.coffeosi-suche__body {
  margin-top: 30px;
}
.coffeosi-suche__section + .coffeosi-suche__section {
  margin-top: 30px;
}
.coffeosi-suche__heading {
  margin: 0 0 14px !important;
  color: var(--suche-text);
  font-size: 20px !important;
  letter-spacing: 0.1em !important;
}

.coffeosi-suche__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.coffeosi-suche a.coffeosi-suche__chip {
  display: inline-block;
  padding: 10px 18px 9px;
  border: 1px solid var(--suche-accent);
  border-radius: 999px;
  background: #fff;
  color: var(--suche-text);
  font-size: 18px !important;
  line-height: 1 !important;
  letter-spacing: 0.08em !important;
  text-decoration: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.coffeosi-suche a.coffeosi-suche__chip:hover,
.coffeosi-suche a.coffeosi-suche__chip:focus-visible {
  background: var(--suche-accent);
  border-color: var(--suche-accent);
  outline: none;
}

/* Produkte: Zeilen mit Bild links, zwei Spalten */
.coffeosi-suche__products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}
.coffeosi-suche a.coffeosi-suche__product {
  display: flex;
  align-items: center;
  min-height: 96px;
  background: #fff;
  color: var(--suche-text);
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.coffeosi-suche a.coffeosi-suche__product:hover,
.coffeosi-suche a.coffeosi-suche__product:focus-visible {
  box-shadow: 0 10px 24px rgba(53, 39, 35, 0.12);
  transform: translateY(-2px);
  outline: none;
}
.coffeosi-suche__img {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  overflow: hidden;
  background: #fff;
}
.coffeosi-suche__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.coffeosi-suche__text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 10px 18px;
  border-left: 1px solid var(--suche-line);
  align-self: stretch;
  justify-content: center;
}
.coffeosi-suche__name {
  font-size: 18px !important;
  line-height: 1.15 !important;
  letter-spacing: 0.04em !important;
}
.coffeosi-suche__price {
  font-size: 17px;
  font-style: italic;
}
.coffeosi-suche__price del {
  margin-right: 6px;
  opacity: 0.55;
}
.coffeosi-suche__price ins {
  text-decoration: none;
}

.coffeosi-suche a.coffeosi-suche__all {
  margin-top: 22px;
}
.coffeosi-suche__empty {
  margin: 0 0 14px;
  font-size: 19px;
  font-style: italic;
}

/* Theme-Dropdown nicht mehr zeigen */
.coffeosi-suche-offen .header-search .header-search-widget {
  display: none !important;
}

/* Tablet */
@media (max-width: 1023px) {
  .coffeosi-suche .coffeosi-suche__input {
    font-size: 38px !important;
  }
}

/* Handy: ganzer Bildschirm ueber dem Kopf (sonst bliebe neben der Tastatur kaum Platz), eigenes Schliessen-Kreuz */
@media (max-width: 767px) {
  .coffeosi-suche {
    inset: 0;
    z-index: 100000;
  }
  .coffeosi-suche__panel {
    max-height: none;
    height: 100vh;
    height: 100dvh;
  }
  .coffeosi-suche__close {
    display: block;
  }
  .coffeosi-suche__inner {
    padding: 22px 16px 32px;
  }
  .coffeosi-suche__close {
    top: 8px;
    right: 6px;
  }
  .coffeosi-suche__label {
    font-size: 16px !important;
    padding-right: 44px;
  }
  .coffeosi-suche__field::before {
    width: 22px;
    height: 22px;
    margin-right: 10px;
  }
  .coffeosi-suche .coffeosi-suche__input {
    font-size: 28px !important;
  }
  .coffeosi-suche .coffeosi-suche__input::placeholder {
    font-size: 20px;
  }
  .coffeosi-suche__body {
    margin-top: 22px;
  }
  .coffeosi-suche__products {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .coffeosi-suche a.coffeosi-suche__product {
    min-height: 72px;
  }
  .coffeosi-suche__img {
    flex-basis: 72px;
    width: 72px;
    height: 72px;
  }
  .coffeosi-suche__text {
    padding: 8px 12px;
  }
  .coffeosi-suche__name {
    font-size: 16px !important;
  }
  .coffeosi-suche__price {
    font-size: 16px;
  }
  .coffeosi-suche a.coffeosi-suche__chip {
    font-size: 16px !important;
    padding: 9px 14px 8px;
  }
  .coffeosi-suche a.coffeosi-suche__all {
    display: block;
    text-align: center;
  }
}
