/*
 * Live search dropdown — shared styles for the navbar and search section.
 */
.live-search {
  position: relative;
}

.live-search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 1080;
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--bs-border-color, #e5e7eb);
  border-radius: 1rem;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  max-height: min(70vh, 460px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.live-search-results[hidden] {
  display: none;
}

/* Navbar search inputs are narrow — give the dropdown a comfortable width
   and anchor it to the leading edge so it never overflows the viewport. */
.navbar .live-search-results {
  width: min(360px, 92vw);
}
.navbar .live-search-results {
  left: auto;
  right: 0;
}
[dir="rtl"] .navbar .live-search-results {
  right: auto;
  left: 0;
}

.ls-list {
  padding: 0.35rem;
}

.ls-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.65rem;
  text-decoration: none;
  color: var(--bs-body-color, #1f2937);
  transition: background-color 0.15s ease;
}

.ls-item:hover,
.ls-item.is-active {
  background: var(--bs-gray-100, #f3f4f6);
}

.ls-item-img {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 0.55rem;
  object-fit: cover;
  background: var(--bs-gray-100, #f3f4f6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bs-gray-400, #9ca3af);
}

.ls-item-img--empty {
  font-size: 1.1rem;
}

.ls-item-body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ls-item-name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ls-item-cat {
  font-size: 0.76rem;
  color: var(--bs-secondary-color, #6b7280);
}

.ls-item-price {
  flex-shrink: 0;
  text-align: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.ls-price {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--bs-primary, #0d6efd);
}

.ls-price-old {
  font-size: 0.72rem;
  color: var(--bs-secondary-color, #9ca3af);
  text-decoration: line-through;
}

.ls-badge {
  display: inline-block;
  margin-inline-start: 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  vertical-align: middle;
}

.ls-badge--out {
  background: var(--bs-danger-bg-subtle, #fde2e2);
  color: var(--bs-danger, #dc3545);
}

.ls-status {
  padding: 1rem;
  text-align: center;
  color: var(--bs-secondary-color, #6b7280);
  font-size: 0.88rem;
}

.ls-status--empty {
  color: var(--bs-secondary-color, #9ca3af);
}

.ls-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--bs-primary, #0d6efd);
  text-decoration: none;
  border-top: 1px solid var(--bs-border-color, #f0f0f0);
  background: var(--bs-tertiary-bg, #fafafa);
}

.ls-more:hover {
  background: var(--bs-gray-100, #f3f4f6);
}

/* Flip the "see all" arrow in RTL */
[dir="rtl"] .ls-more .fa-arrow-right {
  transform: scaleX(-1);
}

/* =============================================================
   Search section (home component)
============================================================= */
.search-section {
  background: linear-gradient(135deg, var(--bs-primary-bg-subtle, #eef2ff) 0%, var(--bs-body-bg, #fff) 100%);
}

.search-section .search-hero-card {
  max-width: 720px;
  margin: 0 auto;
}

.search-section .live-search-input {
  height: 58px;
  font-size: 1.05rem;
  border-radius: 999px;
}

.search-section .search-input-wrap {
  position: relative;
}

.search-section .search-input-wrap .search-icon {
  position: absolute;
  top: 50%;
  inset-inline-start: 1.25rem;
  transform: translateY(-50%);
  color: var(--bs-secondary-color, #6b7280);
  pointer-events: none;
}

.search-section .live-search-input {
  padding-inline-start: 3rem;
  padding-inline-end: 1.5rem;
}

.search-section .live-search-results {
  text-align: start;
}

.search-suggestions .badge {
  cursor: pointer;
}
