/* FluentSearch — Vilgain-inspired wide autocomplete */

:root {
  --fs-bg: #f2f2f0;
  --fs-panel: #f2f2f0;
  --fs-input: #ffffff;
  --fs-text: #111111;
  --fs-muted: #777777;
  --fs-line: rgba(0, 0, 0, 0.06);
  --fs-btn: #e8e8e6;
  --fs-btn-hover: #ddddda;
  --fs-overlay: rgba(0, 0, 0, 0.45);
  --fs-radius: 28px;
  --fs-pill: 999px;
  --fs-font: inherit;
}

#fluent-search-root[hidden] {
  display: none !important;
}

.fs-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: var(--fs-overlay);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.fs-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.fs-modal {
  position: fixed;
  z-index: 99991;
  left: 50%;
  top: clamp(72px, 10vh, 120px);
  transform: translateX(-50%) translateY(8px);
  width: min(920px, calc(100vw - 24px));
  max-height: min(78vh, 820px);
  background: var(--fs-panel);
  border-radius: var(--fs-radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--fs-font);
  color: var(--fs-text);
}

.fs-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.fs-modal__top {
  padding: 22px 22px 8px;
  flex: 0 0 auto;
}

.fs-searchbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--fs-input);
  border-radius: var(--fs-pill);
  min-height: 52px;
  padding: 0 18px 0 20px;
  border: 1px solid transparent;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.fs-searchbar:focus-within {
  border-color: rgba(0, 0, 0, 0.12);
}

.fs-searchbar__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: #666;
  display: block;
}

.fs-searchbar__input {
  flex: 1 1 auto;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  line-height: 1.3;
  color: var(--fs-text);
  min-width: 0;
  padding: 14px 0;
}

.fs-searchbar__input::placeholder {
  color: #999;
}

.fs-searchbar__close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #666;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
}

.fs-searchbar__close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #111;
}

.fs-modal__body {
  overflow: auto;
  padding: 8px 10px 22px;
  -webkit-overflow-scrolling: touch;
}

.fs-section {
  padding: 10px 12px 6px;
}

.fs-section__title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fs-muted);
  letter-spacing: 0.01em;
}

.fs-trend {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 8px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.fs-trend:hover {
  background: rgba(255, 255, 255, 0.7);
}

.fs-trend__thumb,
.fs-row__thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
  flex: 0 0 auto;
}

.fs-trend__title {
  font-size: 15px;
  font-weight: 500;
  color: #222;
}

.fs-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 10px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.fs-row:hover {
  background: rgba(255, 255, 255, 0.72);
}

.fs-row__thumb {
  width: 56px;
  height: 56px;
}

.fs-row__main {
  min-width: 0;
}

.fs-row__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #111;
}

.fs-row__excerpt {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.4;
  color: #888;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fs-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.fs-row__price {
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.fs-row__compare {
  font-size: 13px;
  color: #999;
  text-decoration: line-through;
}

.fs-row__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fs-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--fs-btn);
  color: #111;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 12px;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.fs-btn:hover {
  background: #ddddda;
}

.fs-btn:active {
  transform: scale(0.98);
}

.fs-btn.is-busy,
.fs-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.fs-btn.is-done {
  background: #111;
  color: #fff;
}

.fs-empty,
.fs-loading {
  padding: 28px 18px;
  text-align: center;
  color: var(--fs-muted);
  font-size: 14px;
}

.fs-footer {
  padding: 4px 18px 8px;
  text-align: center;
}

.fs-footer a {
  color: #111;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.fs-open {
  overflow: hidden;
}

/* Make header search feel like a trigger */
#brxe-searchwrap,
#brxe-searchel {
  cursor: pointer;
}

@media (max-width: 720px) {
  .fs-modal {
    top: 12px;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 24px);
    border-radius: 22px;
  }

  .fs-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
  }

  .fs-row__actions {
    grid-column: 1 / -1;
    justify-content: stretch;
    padding-left: 60px;
  }

  .fs-btn {
    width: 100%;
    text-align: center;
  }

  .fs-row__thumb {
    width: 48px;
    height: 48px;
  }
}
