/* =========================================================
   Smart Coupons Pro — Header Live Search
   Screenshot-style rectangular search box
   ========================================================= */

.scp-live-search {
  --scp-ls-primary: #071A63;
  --scp-ls-accent: #6D28FF;
  --scp-ls-accent-lt: #ede8ff;
  --scp-ls-border: #cfd5df;
  --scp-ls-text: #1F2937;
  --scp-ls-text-muted: #64748b;
  --scp-ls-bg: #f8f8f9;

  position: relative;
  width: 100%;
  max-width: 100%;
  font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  box-sizing: border-box;
}

.scp-live-search * {
  box-sizing: border-box;
}

/* ---- Search Box ---- */
.scp-ls-inner {
  display: flex;
  align-items: center;
  width: 100%;
  height: 48px;

  gap: 12px;

  background: var(--scp-ls-bg);
  border: 1px solid var(--scp-ls-border);
  border-radius: 5px;

  padding: 0 14px;

  transition:
    border-color .15s ease,
    box-shadow .15s ease,
    background-color .15s ease;
}

.scp-ls-inner:focus-within {
  border-color: #b8c0cc;
  box-shadow: 0 0 0 2px rgba(109, 40, 255, .06);
}

/* ---- Search Icon ---- */
.scp-ls-inner svg {
  width: 23px;
  height: 23px;
  color: #111827;
  flex-shrink: 0;
  stroke-width: 1.4;
}

/* ---- Input ---- */
.scp-ls-input {
  flex: 1;
  min-width: 0;

  width: 100%;
  height: 100%;

  border: none;
  outline: none;

  background: transparent;

  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;

  color: var(--scp-ls-text);
  font-family: inherit;

  padding: 0;
  margin: 0;
}

.scp-ls-input::placeholder {
  color: #64748b;
  opacity: 1;
}

/* ---- Clear Button ---- */
.scp-ls-clear {
  display: none;
  align-items: center;
  justify-content: center;

  width: 24px;
  height: 24px;

  border: none;
  border-radius: 50%;

  background: #e9ebef;
  color: #64748b;

  font-size: 15px;
  line-height: 1;

  cursor: pointer;
  flex-shrink: 0;
}

.scp-ls-clear-visible {
  display: flex;
}

.scp-ls-clear:hover {
  background: #dfe2e7;
  color: #1f2937;
}


/* =========================================================
   Dropdown
   ========================================================= */

.scp-ls-results {
  display: none;

  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;

  background: #ffffff;

  border: 1px solid var(--scp-ls-border);
  border-radius: 6px;

  box-shadow:
    0 10px 30px rgba(7, 26, 99, .12),
    0 2px 8px rgba(7, 26, 99, .05);

  max-height: 70vh;
  overflow-y: auto;

  z-index: 9999;
  padding: 6px 0;
}

.scp-live-search.scp-ls-open .scp-ls-results {
  display: block;
}

.scp-ls-loading,
.scp-ls-empty {
  display: none;
  padding: 18px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--scp-ls-text-muted);
}

.scp-ls-section {
  display: none;
}

.scp-ls-section + .scp-ls-section {
  border-top: 1px solid var(--scp-ls-border);
  margin-top: 4px;
  padding-top: 4px;
}

.scp-ls-heading {
  padding: 8px 16px 4px;

  font-size: 11px;
  font-weight: 700;

  letter-spacing: .04em;
  text-transform: uppercase;

  color: var(--scp-ls-text-muted);
}

.scp-ls-list {
  display: flex;
  flex-direction: column;
}

.scp-ls-row {
  display: flex;
  align-items: center;

  gap: 10px;
  padding: 8px 16px;

  text-decoration: none;
  color: inherit;

  transition: background .12s;
}

.scp-ls-row:hover,
.scp-ls-row:focus,
.scp-ls-row.scp-ls-active {
  background: #f1f5f9;
}

.scp-ls-row:focus-visible,
.scp-ls-input:focus-visible,
.scp-ls-clear:focus-visible {
  outline: 2px solid var(--scp-ls-accent);
  outline-offset: -2px;
}

.scp-ls-thumb {
  flex-shrink: 0;

  width: 34px;
  height: 34px;

  border-radius: 8px;

  overflow: hidden;

  background: var(--scp-ls-accent-lt);

  display: flex;
  align-items: center;
  justify-content: center;
}

.scp-ls-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scp-ls-initials {
  font-size: 12px;
  font-weight: 700;
  color: var(--scp-ls-accent);
}

.scp-ls-info {
  flex: 1;
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: 1px;
}

.scp-ls-title {
  font-size: 13.5px;
  font-weight: 600;

  color: var(--scp-ls-text);

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scp-ls-sub {
  font-size: 12px;
  color: var(--scp-ls-text-muted);

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scp-ls-badge {
  flex-shrink: 0;

  font-size: 11px;
  font-weight: 700;

  padding: 3px 9px;

  border-radius: 100px;

  background: var(--scp-ls-accent-lt);
  color: var(--scp-ls-accent);

  white-space: nowrap;
}

.scp-ls-badge-cashback {
  background: #d1fae5;
  color: #059669;
}

.scp-ls-badge-bank_offer {
  background: #dbeafe;
  color: #2563eb;
}

.scp-ls-badge-new_user {
  background: #fef3c7;
  color: #b45309;
}

.scp-ls-badge-student {
  background: #fce7f3;
  color: #db2777;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 640px) {

  .scp-live-search {
    max-width: 100%;
  }

  .scp-ls-inner {
    height: 46px;
    padding: 0 12px;
    gap: 10px;
    border-radius: 5px;
  }

  .scp-ls-inner svg {
    width: 22px;
    height: 22px;
  }

  .scp-ls-input {
    font-size: 16px;
  }

  .scp-ls-results {
    left: 0;
    right: 0;
    max-height: 60vh;
  }

  .scp-ls-title {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scp-ls-inner,
  .scp-ls-row { transition: none; }
}
