/* ── SEARCH BUBBLE ── */

.search-drawer {
  position: fixed;
  inset: 0;
  z-index: 105;
  pointer-events: none;
}

.search-drawer.is-open {
  pointer-events: auto;
}

/* subtle backdrop — not dark, just blurs slightly */
.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 20, 0);
  transition: background .25s ease;
}
.search-drawer.is-open .search-backdrop {
  background: rgba(10, 8, 20, .22);
}

/* ── BUBBLE PANEL ── */
.search-panel {
  position: absolute;
  right: clamp(12px, 3vw, 48px);
  top: 80px;
  width: min(540px, calc(100vw - 24px));
  max-height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
  overflow: hidden;

  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, .1),
    0 8px 32px rgba(10, 8, 20, .12),
    0 32px 80px rgba(10, 8, 20, .18);

  /* appear from top-right corner */
  transform-origin: top right;
  transform: scale(.88) translateY(-12px);
  opacity: 0;
  transition: opacity .24s cubic-bezier(.2,.8,.2,1), transform .28s cubic-bezier(.34,1.56,.64,1);
}

/* little caret pointing up */
.search-panel::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 48px;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 1px solid rgba(139,92,246,.15);
  border-bottom: none;
  border-right: none;
  transform: rotate(45deg);
  border-radius: 3px 0 0 0;
  z-index: 1;
}

.search-drawer.is-open .search-panel {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ── HEAD ── */
.search-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid #f0ede8;
  flex: 0 0 auto;
  background: #fff;
  border-radius: 24px 24px 0 0;
}

.search-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.search-title-row h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: linear-gradient(90deg, #8b5cf6, #f43fbd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.search-close {
  width: 34px;
  height: 34px;
  border: 1px solid #e9e4dc;
  border-radius: 50%;
  background: #faf9f6;
  color: #666;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.search-close:hover { background: #111; color: #fff; border-color: #111; transform: rotate(90deg); }

/* ── INPUT ── */
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input-wrap::before {
  content: "";
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
  z-index: 1;
}

.search-input-wrap input {
  width: 100%;
  height: 52px;
  border: 1.5px solid #e9e4dc;
  border-radius: 14px;
  outline: none;
  padding: 0 18px 0 44px;
  background: #f8f7f4;
  color: #111;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.search-input-wrap input::placeholder { color: #aaa; font-weight: 500; }

.search-input-wrap input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, .12);
  background: #fff;
}

/* ── RESULTS ── */
.search-results {
  overflow-y: auto;
  padding: 12px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #e0dbd4 transparent;
}

.search-empty {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #888;
  gap: 8px;
  padding: 24px;
}
.search-empty strong { font-size: 14px; font-weight: 800; color: #333; display: block; margin-bottom: 4px; }
.search-empty p { margin: 0; font-size: 13px; line-height: 1.5; }
.search-empty .search-empty-icon { font-size: 32px; margin-bottom: 4px; }

/* quick tags */
.search-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; justify-content: center;
}
.search-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid #e9e4dc; background: #f8f7f4;
  font-size: 12px; font-weight: 700; color: #555;
  cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease;
  text-decoration: none;
}
.search-tag:hover { border-color: #8b5cf6; background: rgba(139,92,246,.06); color: #8b5cf6; }

.search-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-result {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #fff;
  transition: background .16s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
  text-decoration: none;
  color: inherit;
}

.search-result:hover {
  background: #faf8ff;
  border-color: rgba(139, 92, 246, .2);
  transform: translateX(3px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, .1);
}

.search-result img {
  width: 64px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: #f0ede8;
}

.search-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.search-info strong {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-info span {
  font-size: 11px;
  color: #999;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.search-price {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  background: linear-gradient(90deg, #8b5cf6, #f43fbd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* footer hint */
.search-footer {
  padding: 10px 18px;
  border-top: 1px solid #f0ede8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #bbb;
  font-weight: 600;
  flex: 0 0 auto;
  background: #faf9f6;
  border-radius: 0 0 24px 24px;
}
.search-footer kbd {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 7px; border-radius: 6px;
  background: #eee; border: 1px solid #ddd;
  font-size: 11px; font-family: inherit; color: #666;
}

@media (max-width: 600px) {
  .search-panel {
    right: 12px;
    left: 12px;
    width: auto;
    top: 70px;
    border-radius: 20px;
  }
  .search-panel::before { display: none; }
  .search-result { grid-template-columns: 56px 1fr; }
  .search-price { grid-column: 2; }
}
