/* =====================================================
   search.css — Navbar dropdown search (injected pages)
   Used on: products-tvarnice, DT, DT30, products-new
   ===================================================== */

/* ── Trigger button ─────────────────────────────────── */
.nav-search-btn {
  width: 36px;
  height: 36px;
  border: 1.5px solid #E5E7EB;
  border-radius: 6px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6B7280;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
  margin-right: 0.5rem;
  position: relative;
}

.nav-search-btn:hover,
.nav-search-btn.open {
  border-color: #C8A84B;
  color: #C8A84B;
  background: #FEFCE8;
}

/* ── Dropdown panel ─────────────────────────────────── */
.ns-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 400px;
  background: #fff;
  border-radius: 0 0 12px 12px;
  border: 1.5px solid #E5E7EB;
  border-top: 3px solid #C8A84B;
  box-shadow: 0 12px 40px rgba(0,0,0,0.13);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 500;
  overflow: hidden;
}

.nav-search-btn.open + .ns-panel,
.ns-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ── Input row ──────────────────────────────────────── */
.ns-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #F3F4F6;
}

.ns-input-icon {
  color: #9CA3AF;
  flex-shrink: 0;
}

.ns-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: #111827;
  background: transparent;
}

.ns-input::placeholder { color: #9CA3AF; }

.ns-clear {
  width: 24px;
  height: 24px;
  border: none;
  background: #F3F4F6;
  border-radius: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6B7280;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.ns-clear:hover { background: #E5E7EB; }
.ns-clear.visible { display: flex; }

/* ── Results ────────────────────────────────────────── */
.ns-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #E5E7EB transparent;
}
.ns-results::-webkit-scrollbar { width: 4px; }
.ns-results::-webkit-scrollbar-track { background: transparent; }
.ns-results::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 2px; }

.ns-cat-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9CA3AF;
  padding: 0.75rem 0.875rem 0.25rem;
}

.ns-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.6rem 0.875rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.ns-item:hover { background: #F7F5F0; }
.ns-item:hover .ns-arrow { color: #C8A84B; transform: translateX(3px); }

.ns-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  overflow: hidden;
}
.ns-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ns-info { flex: 1; min-width: 0; }

.ns-name {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ns-name mark {
  background: #FEFCE8;
  color: #92400E;
  border-radius: 2px;
  padding: 0 2px;
  font-style: normal;
}

.ns-meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.775rem;
  color: #9CA3AF;
  margin-top: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ns-arrow {
  color: #D1D5DB;
  flex-shrink: 0;
  transition: color 0.15s ease, transform 0.15s ease;
  font-size: 1rem;
  line-height: 1;
}

/* ── No results ─────────────────────────────────────── */
.ns-no-results {
  padding: 1.75rem 1rem;
  text-align: center;
}
.ns-no-results p {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: #374151;
  margin: 0 0 0.25rem;
}
.ns-no-results span {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: #9CA3AF;
}

/* ── Footer ─────────────────────────────────────────── */
.ns-footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid #F3F4F6;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: #9CA3AF;
}
.ns-footer kbd {
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.7rem;
  color: #374151;
  font-family: inherit;
}

/* ── Mobile ─────────────────────────────────────────── */
@media (max-width: 820px) {
  .ns-panel {
    position: fixed;
    top: 65px;
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
  }

  .ns-footer {
    display: none;
  }

  .ns-results {
    max-height: calc(100dvh - 180px);
  }
}
