/* ═══ Search Overlay & Enhanced Results ═══════════════════════ */

/* ─── Overlay backdrop ──────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: none;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: soFadeIn .15s ease;
}
.search-overlay.open { display: block; }

@keyframes soFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes soSlideDown { from { opacity: 0; transform: translateX(-50%) translateY(-12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ─── Overlay panel ─────────────────────────────────────────── */
.search-overlay-panel {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 640px;
  max-height: calc(85vh - 48px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25), 0 0 0 1px rgba(0,0,0,.05);
  display: flex;
  flex-direction: column;
  animation: soSlideDown .2s ease;
  overflow: hidden;
}

/* ─── Search input area ─────────────────────────────────────── */
.so-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 2px solid var(--neutral-100, #f3f4f6);
  background: linear-gradient(to bottom, rgba(232,93,4,.03), transparent);
}
.so-input-wrap .so-search-icon { flex-shrink: 0; color: var(--orange, #e85d04); }
.so-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.1rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--neutral-900, #111827);
  background: transparent;
}
.so-input::placeholder { color: var(--neutral-400, #9ca3af); font-weight: 400; }
.so-clear-btn {
  border: none;
  background: var(--neutral-100, #f3f4f6);
  color: var(--neutral-500, #6b7280);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  transition: background .12s, color .12s;
}
.so-clear-btn:hover { background: var(--neutral-200, #e5e7eb); color: var(--neutral-700); }
.so-clear-btn.visible { display: flex; }
.so-close-btn {
  border: none;
  background: none;
  color: var(--neutral-400, #9ca3af);
  cursor: pointer;
  padding: 6px;
  margin-left: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .12s, background .12s;
  font-size: .72rem;
  font-weight: 600;
  font-family: inherit;
  gap: 4px;
}
.so-close-btn:hover { color: var(--neutral-700, #374151); background: var(--neutral-100, #f3f4f6); }
.so-close-btn .so-kbd { pointer-events: none; }

/* ─── Results body (scrollable) ─────────────────────────────── */
.so-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 0;
  flex: 1;
}

/* ─── Section labels ────────────────────────────────────────── */
.so-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 4px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--neutral-400, #9ca3af);
}
.so-section-label button {
  border: none;
  background: none;
  color: var(--neutral-400, #9ca3af);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.so-section-label button:hover { color: var(--orange, #e85d04); }

/* ─── Generic list item ─────────────────────────────────────── */
.so-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background .1s;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  font-size: .92rem;
  text-align: left;
}
.so-item:hover, .so-item.so-active { background: var(--neutral-50, #f9fafb); }
.so-item svg { flex-shrink: 0; color: var(--neutral-400, #9ca3af); }

/* ─── Suggestion items ──────────────────────────────────────── */
.so-suggestion {
  font-weight: 500;
  color: var(--neutral-700, #374151);
}
.so-suggestion .so-arrow { margin-left: auto; opacity: 0; transition: opacity .1s; color: var(--neutral-300); }
.so-suggestion:hover .so-arrow, .so-suggestion.so-active .so-arrow { opacity: 1; }

/* ─── History item ──────────────────────────────────────────── */
.so-history-remove {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--neutral-300, #d1d5db);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  opacity: 0;
  transition: opacity .1s, color .1s;
}
.so-item:hover .so-history-remove { opacity: 1; }
.so-history-remove:hover { color: var(--neutral-600, #4b5563); }

/* ─── Product preview items ─────────────────────────────────── */
.so-product {
  gap: 14px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.so-product-img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--neutral-50, #f9fafb);
  border: 1px solid var(--neutral-100, #f3f4f6);
  object-fit: contain;
  flex-shrink: 0;
}
.so-product-info { flex: 1; min-width: 0; }
.so-product-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--neutral-800, #1f2937);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.so-product-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}
.so-product-price {
  font-size: .85rem;
  font-weight: 800;
  color: var(--orange, #e85d04);
}
.so-product-stock {
  font-size: .75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}
.so-stock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.so-product-arrow {
  margin-left: auto;
  color: var(--neutral-300, #d1d5db);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .1s;
}
.so-product:hover .so-product-arrow { opacity: 1; color: var(--orange, #e85d04); }

/* ─── Category chips ────────────────────────────────────────── */
.so-cat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 20px 10px; }
.so-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--neutral-100, #f3f4f6);
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--neutral-600, #4b5563);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.so-cat-chip:hover { background: var(--orange-light, #fff7ed); color: var(--orange, #e85d04); }

/* ─── Section divider ───────────────────────────────────────── */
.so-divider {
  height: 1px;
  background: var(--neutral-100, #f3f4f6);
  margin: 4px 20px;
}

/* ─── "Alle resultaten" link ────────────────────────────────── */
.so-all-results {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: var(--orange, #e85d04);
  margin: 8px 12px 12px;
  border-radius: 10px;
  transition: background .12s, transform .1s;
}
.so-all-results:hover { background: #d45303; transform: translateY(-1px); }
.so-all-results svg { stroke: #fff; }

/* ─── Highlight <mark> ──────────────────────────────────────── */
mark.search-hl {
  background: transparent;
  color: var(--orange, #e85d04);
  font-weight: 700;
}

/* ─── Loading spinner ───────────────────────────────────────── */
.so-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  color: var(--neutral-400, #9ca3af);
  font-size: .88rem;
}
.so-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--neutral-200, #e5e7eb);
  border-top-color: var(--orange, #e85d04);
  border-radius: 50%;
  animation: soSpin .6s linear infinite;
}
@keyframes soSpin { to { transform: rotate(360deg); } }

/* ─── Keyboard hint ─────────────────────────────────────────── */
.so-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  font-size: .7rem;
  font-weight: 700;
  color: var(--neutral-400, #9ca3af);
  background: var(--neutral-100, #f3f4f6);
  border: 1px solid var(--neutral-200, #e5e7eb);
  border-radius: 4px;
  font-family: inherit;
}

/* ─── No-results tips ───────────────────────────────────────── */
.so-tips { padding: 16px 20px; }
.so-tips p { font-size: .85rem; color: var(--neutral-500); margin-bottom: 8px; }
.so-tips ul { list-style: none; padding: 0; }
.so-tips li { font-size: .82rem; color: var(--neutral-500); padding: 3px 0; padding-left: 16px; position: relative; }
.so-tips li::before { content: '\2022'; position: absolute; left: 0; color: var(--neutral-300); }

/* ─── Popular pills in overlay ──────────────────────────────── */
.so-pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 20px 12px; }
.so-pill {
  display: inline-block;
  padding: 6px 14px;
  background: var(--neutral-100, #f3f4f6);
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--neutral-600, #4b5563);
  text-decoration: none;
  transition: background .12s, color .12s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.so-pill:hover { background: var(--orange-light, #fff7ed); color: var(--orange, #e85d04); }

/* ═══ Enhanced Search Results Page ════════════════════════════ */

/* ─── Result card ───────────────────────────────────────────── */
.search-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: var(--radius-lg, 14px);
  border: 1px solid var(--neutral-200, #e5e7eb);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.search-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.1);
}
.search-card-img {
  position: relative;
  aspect-ratio: 1;
  background: var(--neutral-50, #f9fafb);
  overflow: hidden;
}
.search-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform .35s;
}
.search-card:hover .search-card-img img { transform: scale(1.05); }
.search-discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #dc2626;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  letter-spacing: .02em;
}
.search-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.search-card-brand {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--orange, #e85d04);
  margin-bottom: 3px;
}
.search-card-title {
  font-size: .92rem;
  font-weight: 700;
  color: var(--neutral-900, #111827);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.search-card-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.search-card-price {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--neutral-900, #111827);
}
.search-card-price-old {
  font-size: .82rem;
  color: var(--neutral-400, #9ca3af);
  text-decoration: line-through;
}
.search-card-stock {
  font-size: .78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}
.search-card-stock svg { flex-shrink: 0; }
.search-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--orange, #e85d04);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s, transform .2s;
}
.search-card:hover .search-card-cta { opacity: 1; transform: translateX(0); }

/* ═══ Mobile fullscreen overlay ══════════════════════════════ */
@media (max-width: 768px) {
  .search-overlay-panel {
    top: 0;
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .so-input-wrap { padding: 14px 16px; }
  .so-input { font-size: 1rem; }
  .so-item { padding: 10px 16px; }
  .so-section-label { padding: 10px 16px 4px; }
  .so-cat-chips { padding: 6px 16px 10px; }
  .so-pills { padding: 6px 16px 12px; }
  .so-all-results { margin: 8px 10px 10px; padding: 13px 16px; }
  .so-tips { padding: 16px; }
  .so-divider { margin: 4px 16px; }
  .so-product-img { width: 48px; height: 48px; }
  .so-close-btn .so-kbd { display: none; }
  .search-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
