/* Allegory full-screen search overlay. Modeled on the allegory002 storefront:
   SEARCH / CLOSE bar, one big "SEARCH ANYTHING" field, live results grid. */

.allegory-search {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgb(var(--color-background, 255, 255, 255));
  color: rgb(var(--color-foreground, 18, 18, 18));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.allegory-search[hidden] { display: none; }
html.search-open { overflow: hidden; }

.allegory-search__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 2rem;
}
.allegory-search__bar-title,
.allegory-search__close {
  font-size: 1.3rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  font-weight: 500;
}
.allegory-search__close {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
  padding: 0.4rem;
}
.allegory-search__close svg { width: 1.6rem; height: 1.6rem; }

.allegory-search__form {
  padding: 0 2rem;
  position: relative;
}
.allegory-search__field {
  position: relative;
  max-width: 74rem;
  margin: 0 auto;
}
.allegory-search__field label {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  color: rgba(var(--color-foreground, 18, 18, 18), 0.55);
  margin: 0 0 0.6rem 1.6rem;
}
.allegory-search__input {
  width: 100%;
  border: 1px solid rgb(var(--color-foreground, 18, 18, 18));
  border-radius: 0.8rem;
  padding: 1.5rem 5rem 1.5rem 1.6rem;
  font-size: 1.7rem;
  background: transparent;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.allegory-search__input:focus { outline: none; }
.allegory-search__icon {
  position: absolute;
  right: 1.6rem;
  bottom: 1.5rem;
  width: 2.2rem;
  height: 2.2rem;
  pointer-events: none;
  color: rgb(var(--color-foreground, 18, 18, 18));
}

.allegory-search__results {
  max-width: 74rem;
  width: 100%;
  margin: 2.4rem auto 6rem;
  padding: 0 2rem;
}
.allegory-search__empty,
.allegory-search__count {
  font-size: 1.2rem;
  letter-spacing: 0.06rem;
  text-transform: uppercase;
  color: rgba(var(--color-foreground, 18, 18, 18), 0.55);
}
.allegory-search__count { margin-bottom: 1.6rem; }
.allegory-search__empty { padding: 2rem 0; }

.allegory-search__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem 1.2rem;
}
@media (min-width: 750px) {
  .allegory-search__grid { grid-template-columns: repeat(3, 1fr); gap: 2.4rem 1.6rem; }
}

.allegory-search__card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.allegory-search__thumb {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  background: rgba(var(--color-foreground, 18, 18, 18), 0.04);
  overflow: hidden;
}
.allegory-search__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.allegory-search__card.is-soldout .allegory-search__thumb img { opacity: 0.5; }
.allegory-search__soldout {
  position: absolute;
  left: 0.8rem;
  bottom: 0.8rem;
  background: rgb(var(--color-background, 255, 255, 255));
  color: rgb(var(--color-foreground, 18, 18, 18));
  font-size: 1rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
}
.allegory-search__meta { padding: 0.8rem 0 0; display: flex; flex-direction: column; gap: 0.3rem; }
.allegory-search__title { font-size: 1.2rem; letter-spacing: 0.06rem; }
.allegory-search__price { font-size: 1.2rem; color: rgba(var(--color-foreground, 18, 18, 18), 0.7); }
.allegory-search__price s { opacity: 0.5; margin-right: 0.4rem; }

/* Header trigger button */
.header__search-btn {
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
  padding: 0.4rem;
  display: inline-flex;
  align-items: center;
}
.header__search-btn svg { width: 2rem; height: 2rem; }
