/* === Search overlay modal === */

/* Search icon button in header */
.search-open {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  transition: transform 0.22s ease-out;
}
.search-open:hover { transform: scale(1.12); }
.search-open svg { width: 18px; height: 18px; stroke-width: 1.5; }

/* Modal backdrop */
.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(245, 240, 230, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  overflow-y: auto;
}
.search-modal.open { display: block; }
body.search-open-no-scroll { overflow: hidden; }

.search-modal-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 24px 80px;
  min-height: 100%;
  box-sizing: border-box;
}

/* Close button */
.search-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: inherit;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.04em;
  transition: transform 0.22s ease-out;
}
.search-close:hover { transform: scale(1.15); }

/* Search field */
.search-field {
  margin: 40px 0 24px;
}
.search-field input[type="search"] {
  width: 100%;
  font-family: inherit;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 300;
  line-height: 1.2;
  background: transparent;
  border: none;
  border-bottom: 1px solid #1f1812;
  padding: 14px 0;
  color: inherit;
  outline: none;
  letter-spacing: 0.005em;
}
.search-field input[type="search"]::placeholder {
  color: #1f1812;
  opacity: 0.32;
}
.search-field input[type="search"]:focus {
  border-bottom-color: #1f1812;
}
/* hide webkit clear button (we have our own UX) */
.search-field input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Filter chips group */
.search-filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 32px;
  padding: 0;
}
.filter-group {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-group .label {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
  min-width: 86px;
  flex-shrink: 0;
  padding-top: 4px;
}
.filter-chip {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid rgba(31, 24, 18, 0.32);
  border-radius: 100px;
  font-size: 12px;
  letter-spacing: 0.05em;
  cursor: pointer;
  background: transparent;
  color: inherit;
  font-family: inherit;
  transition: all 0.18s ease-out;
}
.filter-chip:hover { transform: scale(1.04); border-color: #1f1812; }
.filter-chip.active {
  background: #1f1812;
  color: #f5f0e6;
  border-color: #1f1812;
}
.filter-chip .count {
  font-size: 10px;
  opacity: 0.7;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

/* Reset button */
.filter-reset {
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.7;
  color: inherit;
  padding: 6px 10px;
  font-family: inherit;
  transition: opacity 0.18s, transform 0.22s;
}
.filter-reset:hover { opacity: 1; transform: scale(1.05); }

/* Result count */
.search-meta {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
  padding: 18px 0 14px;
  border-top: 1px solid #d8d0c4;
}
.search-meta .count { font-weight: 500; }
.search-meta .lang-en { opacity: 0.8; margin-left: 4px; }

/* Results list */
.search-results {
  list-style: none;
  padding: 0;
  margin: 0;
}
.search-results li {
  border-top: 1px solid #e5dcce;
}
.search-results li:last-child { border-bottom: 1px solid #e5dcce; }
.search-results a {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: baseline;
  padding: 18px 0;
  text-decoration: none;
  transition: transform 0.22s ease-out;
  gap: 14px;
}
.search-results a:hover { transform: scale(1.012); }
.search-results .type {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
}
.search-results .name {
  font-size: 18px;
  line-height: 1.3;
}
.search-results .name mark {
  background: rgba(31, 24, 18, 0.12);
  color: inherit;
  padding: 0 2px;
}
.search-results .botanical {
  font-style: italic;
  font-size: 13px;
  opacity: 0.78;
  display: block;
  margin-top: 2px;
}
.search-results .tag-row {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.65;
  display: block;
  margin-top: 4px;
}
.search-results .tag-row .sep { margin: 0 6px; opacity: 0.5; }
.search-results .arrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  opacity: 0.7;
}

/* Empty state */
.search-empty {
  text-align: center;
  padding: 60px 0;
  font-size: 14px;
  opacity: 0.7;
}
.search-empty .lang-en {
  display: block;
  font-style: italic;
  opacity: 0.8;
  margin-top: 4px;
}

/* Loading state */
.search-loading {
  text-align: center;
  padding: 60px 0;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.5;
}

@media (max-width: 540px) {
  .search-modal-inner { padding: 28px 18px 60px; }
  .search-close { top: 16px; right: 18px; }
  .search-field input[type="search"] { font-size: 26px; }
  .filter-group .label { min-width: 70px; font-size: 10px; }
  .search-results a {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .search-results .type {
    grid-column: 1 / -1;
    margin-bottom: 4px;
  }
}
