/* ==========================================================================
   Trippovention Internal Website Search System CSS
   Native In-Header Search Bar, Dropdown Suggestions & Results Page Styling
   ========================================================================== */

/* --------------------------------------------------------------------------
   Header Search Integration (Inside .nav .container .nav-right)
   -------------------------------------------------------------------------- */

.header-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 10003;
}

/* Ensure navbar is solid, crystal clear, and never blurred when searching */
.nav:has(.header-search-bar:focus-within),
body.search-open .nav {
  background: var(--bg-primary) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Compact mobile search toggle button */
.header-search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: var(--shadow-light);
}

.header-search-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--orange);
  border-color: var(--orange);
  transform: translateY(-1px);
}

.header-search-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Desktop Header Search Pill */
.header-search-bar {
  display: none;
  align-items: center;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: 30px;
  padding: 2px 8px 2px 14px;
  height: 38px;
  width: 250px;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-search-bar:focus-within {
  border-color: var(--orange);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(214, 128, 78, 0.25), 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 300px;
}

.header-search-input-box {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
  min-width: 0;
}

.header-search-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-muted);
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.header-search-input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 500;
  width: 100%;
  outline: none;
  font-family: inherit;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.header-search-input::placeholder {
  color: var(--text-muted);
  font-size: 0.88rem;
  opacity: 0.9;
}

.header-search-kbd {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.3;
  margin-left: 4px;
  user-select: none;
}

.header-search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 14px;
  display: none;
  line-height: 1;
}

.header-search-clear:hover {
  color: var(--text-primary);
}

/* Responsive breakpoint for desktop search pill */
@media (min-width: 992px) {
  .header-search-toggle {
    display: none !important;
  }
  .header-search-bar {
    display: inline-flex !important;
  }
}

/* --------------------------------------------------------------------------
   Header Dropdown & Overlay Modal (Zero Blur, High Contrast)
   -------------------------------------------------------------------------- */

.header-search-dropdown-overlay {
  position: fixed;
  top: 64px;
  left: 0;
  width: 100vw;
  height: calc(100vh - 64px);
  z-index: 999;
  display: none;
}

.header-search-dropdown-overlay.active {
  display: block;
}

/* Subtle dimming WITHOUT any blur so page & typing stay 100% crisp and readable */
.header-search-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.15);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.header-search-dropdown {
  position: absolute;
  top: 10px;
  right: calc(max(16px, (100vw - 1200px) / 2));
  width: min(580px, calc(100vw - 32px));
  max-height: calc(88vh - 80px);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes searchDropSlide {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile search top bar inside dropdown */
.header-search-mobile-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.header-search-mobile-bar .header-search-input-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 8px 12px;
}

.header-search-mobile-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 991px) {
  .header-search-dropdown-overlay {
    top: 0;
    height: 100vh;
    z-index: 10001;
  }
  .header-search-dropdown {
    top: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: 90vh;
  }
  .header-search-mobile-bar {
    display: flex;
  }
}

/* Category Filter Tabs inside Dropdown */
.header-search-filters {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
}
.header-search-filters::-webkit-scrollbar {
  display: none;
}

.search-filter-tab {
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-filter-tab:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.search-filter-tab.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

/* Dropdown Body */
.header-search-body {
  overflow-y: auto;
  padding: 12px 16px;
  flex: 1;
  max-height: 480px;
}

/* Popular Suggestions Section (when search is empty) */
.search-suggestions-section {
  padding: 8px 0;
}

.search-suggestions-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.search-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-tag-chip {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.search-tag-chip:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: rgba(214, 128, 78, 0.08);
}

/* Results List in Dropdown */
.header-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.search-result-item:hover,
.search-result-item.selected {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  transform: translateX(2px);
}

.search-item-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.search-item-info {
  flex: 1;
  min-width: 0;
}

.search-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.search-item-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  white-space: nowrap;
}

.search-item-dest {
  font-size: 0.72rem;
  color: var(--orange);
  font-weight: 600;
}

.search-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-title mark {
  background: rgba(214, 128, 78, 0.25);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.search-item-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.search-item-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--emerald-dark);
  white-space: nowrap;
}
[data-theme="dark"] .search-item-price {
  color: var(--emerald);
}

/* Dropdown Footer */
.header-search-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-view-all-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--orange);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.search-view-all-link:hover {
  text-decoration: underline;
}

.search-footer-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* No Results Dropdown State */
.header-search-no-results {
  text-align: center;
  padding: 28px 12px;
}
.header-search-no-results .no-res-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.header-search-no-results h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.header-search-no-results p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Dedicated Search Results Page (.search-page)
   -------------------------------------------------------------------------- */

.search-hero {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.92) 100%),
              url('../assets/images/packages/thailand/hero_thailand.webp') center/cover no-repeat;
  color: #fff;
  padding: 50px 0 40px;
  text-align: center;
}

.search-hero h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.search-hero-box {
  max-width: 680px;
  margin: 20px auto 0;
  display: flex;
  gap: 8px;
  position: relative;
}

.search-hero-box input {
  flex: 1;
  padding: 14px 20px;
  font-size: 1rem;
  border-radius: 30px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  outline: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.search-hero-box input:focus {
  border-color: var(--orange);
  background: #ffffff;
}

.search-hero-box button.btn {
  border-radius: 30px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
}

/* Search Results Controls */
.search-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.search-page-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.search-page-pill {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.search-page-pill:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.search-page-pill.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.search-sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-sort-select {
  padding: 8px 12px;
  font-size: 0.88rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Search Results Page: Card Grid & Product Cards
   -------------------------------------------------------------------------- */

.search-results-grid {
  margin-top: 24px;
}

.search-product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  box-shadow: var(--shadow-light);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.search-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium), 0 10px 24px rgba(0, 0, 0, 0.08);
  border-color: var(--orange);
}

.search-product-card .img-wrap {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.search-product-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  display: block;
}

.search-product-card:hover .img-wrap img {
  transform: scale(1.05);
}

.search-product-card .body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.search-product-card h3 {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 8px;
  color: var(--text-primary);
}

.search-product-card h3 mark,
.search-product-card p mark {
  background: rgba(214, 128, 78, 0.25);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.search-product-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* Empty State on Search Page */
.search-page-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px dashed var(--border-color);
}

.search-page-no-results .no-res-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.search-page-no-results h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.search-page-no-results p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto 16px;
}

.no-res-suggestions {
  margin-top: 20px;
}

