/* ============================================================
   HSJ-v27 Search Overlay — matches live hsj.com.np search UX
   ============================================================ */

/* Search icon button state */
.hsj-nav-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}
.hsj-nav-search-btn:hover,
.hsj-nav-search-btn.active {
  background: rgba(22, 49, 79, 0.08);
  color: var(--hsj-blue, #16314f);
}

/* ── Backdrop — covers below the nav, click to close ──────── */
.srch-backdrop {
  position: fixed;
  /* top is set dynamically via inline style from the component */
  top: 97px; /* fallback */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  background: rgba(10, 20, 40, 0.35);
}

/* ── Box (white panel at the top of the backdrop) ────────── */
.srch-box {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  border-bottom: 1px solid #e8edf3;
  animation: srch-slide-in 0.2s cubic-bezier(0.22,1,0.36,1);
  max-height: 75vh;
  overflow-y: auto;
}

@keyframes srch-slide-in {
  from { transform: translateY(-10px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ── Input row — matches .hsj-panel-search ─────────────────── */
.srch-input-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 32px;
  border-bottom: 1px solid var(--hsj-border, #e8edf3);
  background: var(--hsj-off, #f7f9fc);
  flex-wrap: nowrap;
}

.srch-icon {
  color: #8a9bb0;
  flex-shrink: 0;
}

.srch-input {
  flex: 1;
  min-width: 200px;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  color: #16314f;
  background: transparent;
}
.srch-input::placeholder {
  color: #a0adbf;
}
.srch-input::-webkit-search-cancel-button { display: none; }

.srch-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: #8a9bb0;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.12s;
}
.srch-clear:hover { background: #f0f4f8; color: #16314f; }

/* Quick pills — inline with input */
.srch-pills {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}
.srch-pill {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid #d0dae8;
  background: #fff;
  font-size: 0.82rem;
  font-family: 'Poppins', sans-serif;
  color: #16314f;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}
.srch-pill:hover,
.srch-pill.active {
  border-color: var(--hsj-blue, #16314f);
  background: var(--hsj-blue, #16314f);
  color: #fff;
}

/* ── Pane — matches mega panel inner padding ────────────────── */
.srch-pane {
  padding: 0 32px 24px;
}

/* ── Live results ──────────────────────────────────────────── */
.srch-results {
  padding-top: 12px;
}
.srch-loading,
.srch-no-results {
  color: #8a9bb0;
  font-size: 0.9rem;
  padding: 16px 0;
}
.srch-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--hsj-amber, #FBA504);
  margin-bottom: 8px;
  margin-top: 12px;
}
.srch-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e8edf3;
  border-radius: 8px;
  overflow: hidden;
}
.srch-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: #16314f;
  border-bottom: 1px solid #f0f4f8;
  transition: background 0.12s;
}
.srch-result-item:last-child { border-bottom: none; }
.srch-result-item:hover { background: #f5f8fc; }

.srch-result-img {
  width: 52px;
  height: 40px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
  background: #e8edf3;
}
.srch-result-img--empty {
  background: #e8edf3;
}
.srch-result-info {
  flex: 1;
  min-width: 0;
}
.srch-result-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.srch-hl {
  background: none;
  color: var(--hsj-amber, #FBA504);
  font-weight: 700;
}
.srch-result-meta {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.srch-result-dur {
  font-size: 0.78rem;
  color: #6b7c93;
  display: flex;
  align-items: center;
  gap: 3px;
}
.srch-result-price {
  text-align: right;
  flex-shrink: 0;
}
.srch-result-from {
  display: block;
  font-size: 0.68rem;
  color: #8a9bb0;
  letter-spacing: 0.04em;
}
.srch-result-price strong {
  font-size: 0.92rem;
  color: #16314f;
  font-weight: 700;
}

.srch-see-all {
  display: block;
  text-align: center;
  padding: 14px;
  font-size: 0.88rem;
  color: #16314f;
  text-decoration: none;
  border-top: 1px solid #e8edf3;
  margin-top: 4px;
  transition: color 0.12s;
}
.srch-see-all:hover { color: var(--hsj-amber, #FBA504); }
.srch-see-all strong { color: var(--hsj-blue, #16314f); }

/* ── Mega default panel ────────────────────────────────────── */
.srch-mega {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 260px;
  gap: 0;
  padding-top: 20px;
}
.srch-mega-col {
  padding: 0 20px 16px 0;
  border-right: 1px solid #f0f4f8;
}
.srch-mega-col:last-of-type {
  border-right: none;
}
.srch-mega-heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--hsj-amber, #FBA504);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #f0f4f8;
}
.srch-mega-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
.srch-mega-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: baseline;
  gap: 4px 8px;
  padding: 6px 0;
  text-decoration: none;
  color: #16314f;
  font-size: 0.875rem;
  line-height: 1.4;
  transition: color 0.12s;
}
.srch-mega-item:hover { color: var(--hsj-amber, #FBA504); }
.srch-mega-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.srch-mega-dur {
  font-size: 0.75rem;
  color: #8a9bb0;
  white-space: nowrap;
}
.srch-mega-badges {
  display: flex;
  gap: 4px;
}
.srch-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.srch-badge--popular { background: #FBA504; color: #fff; }
.srch-badge--new     { background: #22b76b; color: #fff; }
.srch-mega-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: #16314f;
  white-space: nowrap;
  margin-left: auto;
}
.srch-mega-all {
  font-size: 0.8rem;
  color: var(--hsj-blue, #16314f);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-top: 4px;
  transition: color 0.12s;
}
.srch-mega-all:hover { color: var(--hsj-amber, #FBA504); }

/* Featured card */
.srch-mega-featured {
  padding-left: 20px;
}
.srch-mega-featured-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--hsj-amber, #FBA504);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #f0f4f8;
}
.srch-mega-featured-card {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: #16314f;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s;
}
.srch-mega-featured-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(22,49,79,0.22);
}
.srch-mega-featured-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.srch-mega-featured-body {
  padding: 12px 14px;
}
.srch-mega-featured-title {
  display: block;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.srch-mega-featured-price {
  display: block;
  font-size: 0.78rem;
  color: #a8bdd6;
  margin-bottom: 8px;
}
.srch-mega-featured-cta {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--hsj-amber, #FBA504);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .srch-mega {
    grid-template-columns: repeat(2, 1fr);
  }
  .srch-mega-featured {
    grid-column: span 2;
    padding-left: 0;
    padding-top: 16px;
    border-top: 1px solid #f0f4f8;
    margin-top: 8px;
  }
  .srch-mega-featured-card {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .srch-mega-featured-img {
    width: 100px;
    height: 72px;
    flex-shrink: 0;
  }
}

@media (max-width: 680px) {
  .srch-input-row {
    padding: 10px 16px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .srch-pills {
    margin-left: 0;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .srch-pane {
    padding: 0 16px 20px;
  }
  .srch-mega {
    grid-template-columns: 1fr;
  }
  .srch-mega-col {
    border-right: none;
    border-bottom: 1px solid #f0f4f8;
    padding-bottom: 12px;
    margin-bottom: 8px;
  }
  .srch-mega-featured {
    grid-column: span 1;
  }
}
