/* ============================================================
   SITE SEARCH
   The search strip that rides inside the header on every page —
   above the header's pink rule, so it sticks along with the
   hamburger and the bag button — and the results panel that drops
   out of it. Leans on the shared tokens from site-chrome.css so it
   speaks the same pink/acid vocabulary as the rest of the chrome.
   ============================================================ */

.lucky-search {
  position: relative;
  z-index: 900;
  padding: 10px clamp(12px, 4vw, 40px) 12px;
  border-bottom: 2px solid rgba(255, 79, 154, .34);
  /* Deliberately translucent — the night sky reads through the strip. */
  background: linear-gradient(180deg, rgba(255, 60, 141, .12), rgba(0, 0, 0, .66) 70%);
}

.lucky-search-inner {
  position: relative;
  width: min(620px, 100%);
  margin: 0 auto;
}

/* ---------- INSIDE THE HEADER ----------
   The header already draws the black plate and the pink rule that closes
   the chrome off, so the strip drops its own copies of both and just
   claims a slice of the header's padding box. */
.unified-header .lucky-search {
  padding: 2px 0 5px;
  border-bottom: 0;
  background: transparent;
}

.lucky-search-form {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  border: 2px solid var(--lc-pink-hot);
  background: rgba(5, 5, 12, .94);
  box-shadow: 4px 4px 0 rgba(214, 255, 73, .18);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.lucky-search-inner:focus-within .lucky-search-form {
  border-color: var(--lc-acid);
  box-shadow: 4px 4px 0 rgba(255, 60, 141, .34);
}

.lucky-search-glass {
  justify-self: center;
  width: 15px;
  height: 15px;
  color: var(--lc-acid);
}

.lucky-search-input {
  min-width: 0;
  min-height: 42px;
  padding: 10px 6px;
  border: 0;
  background: transparent;
  color: var(--lc-cream);
  font-family: var(--lc-font);
  font-size: 9px;
  line-height: 1.8;
  letter-spacing: .4px;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}

/* The wrapper takes the acid border on focus, so the input's own ring would
   only double it up. */
.lucky-search-input:focus { outline: none; }
.lucky-search-input::placeholder { color: rgba(255, 181, 213, .72); }
.lucky-search-input::-webkit-search-cancel-button,
.lucky-search-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }

.lucky-search-clear,
.lucky-search-go {
  min-height: 42px;
  border: 0;
  font-family: var(--lc-font);
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.lucky-search-clear {
  width: 34px;
  padding: 0;
  background: transparent;
  color: var(--lc-pink-soft);
  font-size: 15px;
}

.lucky-search-clear:hover,
.lucky-search-clear:focus-visible { color: var(--lc-acid); }

.lucky-search-go {
  width: auto;
  padding: 0 15px;
  border-left: 2px solid var(--lc-pink-hot);
  background: var(--lc-acid);
  color: #000;
  font-size: 9px;
  letter-spacing: 1px;
}

.lucky-search-go:hover,
.lucky-search-go:focus-visible {
  background: var(--lc-pink-hot);
  color: #000;
}

/* ---------- RESULTS PANEL ---------- */
.lucky-search-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 10005;
  max-height: min(62vh, 460px);
  overflow-y: auto;
  border: 2px solid var(--lc-pink-hot);
  background: #05050b;
  box-shadow: 8px 8px 0 rgba(255, 60, 141, .22);
  animation: luckySearchDrop .16s ease;
}

@keyframes luckySearchDrop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.lucky-search-group-label {
  position: sticky;
  top: 0;
  margin: 0;
  padding: 9px 13px 7px;
  border-bottom: 1px solid rgba(255, 181, 213, .18);
  background: #0a0a12;
  color: var(--lc-acid);
  font-family: var(--lc-font);
  font-size: 7px;
  letter-spacing: 2px;
  line-height: 1.6;
  text-align: left;
}

.lucky-search-hit {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  border-bottom: 1px solid rgba(255, 79, 154, .14);
  color: var(--lc-cream);
  text-decoration: none;
  transition: background .14s ease, padding-left .14s ease;
}

.lucky-search-hit:hover,
.lucky-search-hit:focus-visible,
.lucky-search-hit.is-active {
  padding-left: 17px;
  background: rgba(255, 60, 141, .18);
  outline: none;
}

.lucky-search-hit-thumb {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 181, 213, .34);
  background: #000;
  object-fit: cover;
}

.lucky-search-hit-glyph {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(214, 255, 73, .34);
  color: var(--lc-acid);
  font-size: 13px;
  line-height: 1;
}

.lucky-search-hit-text {
  display: grid;
  gap: 4px;
  min-width: 0;
  text-align: left;
}

.lucky-search-hit-name {
  font-family: var(--lc-font);
  font-size: 9px;
  line-height: 1.7;
}

.lucky-search-hit-flag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 5px;
  background: var(--lc-acid);
  color: #000;
  font-size: 6px;
  letter-spacing: 1px;
  vertical-align: middle;
}

.lucky-search-hit-meta {
  color: var(--lc-pink-soft);
  font-family: var(--lc-font);
  font-size: 7px;
  line-height: 1.7;
}

.lucky-search-all {
  display: block;
  padding: 12px 13px;
  background: rgba(214, 255, 73, .1);
  color: var(--lc-acid);
  font-family: var(--lc-font);
  font-size: 8px;
  letter-spacing: 1px;
  text-align: center;
  text-decoration: none;
  transition: background .16s ease, color .16s ease;
}

.lucky-search-all:hover,
.lucky-search-all:focus-visible {
  background: var(--lc-acid);
  color: #000;
  outline: none;
}

.lucky-search-empty {
  margin: 0;
  padding: 20px 15px;
  color: var(--lc-pink-soft);
  font-family: var(--lc-font);
  font-size: 8px;
  line-height: 2.1;
  text-align: center;
}

@media (max-width: 900px) {
  .lucky-search { padding: 8px 10px 10px; }
  .lucky-search-form { grid-template-columns: 32px minmax(0, 1fr) auto auto; }
  .lucky-search-glass { width: 14px; height: 14px; }
  .lucky-search-input { font-size: 8px; }
  .lucky-search-go { padding: 0 11px; font-size: 8px; }
  .lucky-search-panel { max-height: 58vh; }
}

/* The sticky header is a three-column grid on phones (hamburger, logo,
   bag). Give the strip its own full-width row underneath that trio, and
   run the controls shorter — everything here is pinned to the top of the
   screen now, so every pixel it spends is a pixel off the first screen. */
@media (max-width: 900px) {
  .unified-header .lucky-search {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 0 0 3px;
  }

  .unified-header .lucky-search-input,
  .unified-header .lucky-search-clear,
  .unified-header .lucky-search-go { min-height: 36px; }

  .unified-header .lucky-search-input { padding-block: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .lucky-search-panel { animation: none; }
  .lucky-search-form,
  .lucky-search-hit,
  .lucky-search-all { transition: none; }
}
