/* ────────────────────────────────────────────────
 * Live search dropdown
 * Source: extracted from index.css lines 8023–8179
 * ──────────────────────────────────────────────── */

/* ── Live Search Dropdown ── */
.search-form {
  position: relative;
}
/* Dropdown: ss-dropdown — це той самий елемент, що live-search-dropdown,
   просто smart-search.js перейменовує клас при init. Cтилі мають дублюватись
   на обидва селектори, інакше @media-блоки нижче не матчаться. */
.live-search-dropdown,
.ss-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--color-bg-main);
  border: 1px solid var(--color-border);
  border-top: none;
  max-height: 26rem;
  overflow-y: auto;
  animation: lsSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes lsSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.ls-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--color-text-white);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s ease;
  cursor: pointer;
}
.ls-item:last-child {
  border-bottom: none;
}
.ls-item:hover,
.ls-item.is-active {
  background: var(--color-accent);
  color: var(--color-text-on-accent);
}
.ls-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  background: var(--overlay-light-05);
}
.ls-item-info {
  flex: 1;
  min-width: 0;
}
.ls-item-name {
  font-family: 'Manrope', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ls-item-price {
  font-family: 'Manrope', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent-text);
  margin-top: 2px;
}
.ls-item:hover .ls-item-price,
.ls-item.is-active .ls-item-price {
  color: var(--color-text-on-accent);
}
.ls-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--color-text-gray);
  font-family: 'Manrope', sans-serif;
  font-size: 0.8125rem;
}
/* Loading skeleton */
.ls-loading {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ls-loading span {
  display: block;
  height: 68px;
  background: linear-gradient(90deg,
    var(--color-bg-main) 25%,
    var(--color-border) 50%,
    var(--color-bg-main) 75%
  );
  background-size: 200% 100%;
  animation: lsShimmer 1.5s ease-in-out infinite;
  border-bottom: 1px solid var(--color-border);
}
@keyframes lsShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* White theme overrides */

/* Live search dropdown — mobile (bottom-sheet, Awwards/MD3 pattern).
   Stacked above bottom nav (z-index 100002) і має drag handle згори
   щоб виглядати як native iOS bottom-sheet. Backdrop через ::before. */
@media (max-width: 48em) {
  .live-search-dropdown,
  .ss-dropdown {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-height: 65vh;
    border: none;
    border-top: 0.0625rem solid var(--color-border);
    border-radius: 1rem 1rem 0 0;
    background: var(--color-bg-card, var(--color-bg-main));
    box-shadow: 0 -0.75rem 2rem var(--overlay-dark-40);
    z-index: 100002;
    padding-top: 1.25rem;
  }
  /* Drag handle indicator — як в iOS bottom-sheets */
  .live-search-dropdown::before,
  .ss-dropdown::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2.25rem;
    height: 0.25rem;
    background: var(--color-text-muted);
    border-radius: 0.125rem;
    opacity: 0.4;
  }
  .ls-item img,
  .ss-product__img {
    width: 2.5rem;
    height: 2.5rem;
  }
  .ls-item,
  .ss-product {
    padding: 0.5rem 0.75rem;
    gap: 0.625rem;
  }
  .ls-item-name { font-size: 0.75rem; }
  .ls-item-price { font-size: 0.6875rem; }
}

