/* Header search above toilet list + large clear on mobile */

/* Header must stack above .panel (z-index 40) or suggestions are covered */
.header {
  z-index: 60 !important;
  position: relative;
  isolation: isolate;
}

.search-box {
  position: relative;
  z-index: 70;
  overflow: visible !important;
}

/* Dropdown above panel / map FABs */
.search-suggest {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: 100% !important;
  margin-top: 4px !important;
  z-index: 80 !important;
  background: var(--surface, #0f1623) !important;
  border: 1px solid var(--border, #2a3548) !important;
  border-radius: 12px !important;
  max-height: min(50vh, 280px) !important;
  overflow-y: auto !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5) !important;
  pointer-events: auto !important;
}

.search-suggest[hidden] {
  display: none !important;
}

.search-suggest button,
.search-suggest .suggest-item {
  position: relative;
  z-index: 81;
  pointer-events: auto !important;
}

@media (max-width: 720px) {
  .header-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .brand {
    order: 1;
    margin-right: auto;
  }
  .header-row > .btn-icon {
    order: 2;
  }
  .search-box {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
  .search-box input {
    font-size: 0.92rem;
    padding-top: 11px;
    padding-bottom: 11px;
    padding-right: 48px;
  }
  .search-box .clear {
    width: 44px;
    height: 44px;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .search-box.has-value .clear {
    display: flex;
  }
  .search-box .clear:active {
    background: var(--surface2);
    color: var(--text);
  }
}

@media (max-width: 380px) {
  .brand {
    font-size: 0;
    gap: 0;
  }
  .brand-icon {
    font-size: 16px;
  }
}
