/**
 * Homepage Hero Search Form Styles (Tours & Travel Guides)
 * File: assets/css/hero-search.css
 *
 * Brand System:
 * - Primary Red: #b20000 (Hover: #900000)
 * - Slate Dark: #0f172a
 * - Surface: #ffffff / #f8fafc
 * - Border: #e2e8f0
 */

:root {
  --indo-hs-red: #b20000;
  --indo-hs-red-hover: #8f0000;
  --indo-hs-ink: #0f172a;
  --indo-hs-muted: #475569;
  --indo-hs-border: #e2e8f0;
  --indo-hs-surface: #f8fafc;
}

/* Canonical Visually Hidden (Screen Reader & Keyboard Accessible) */
.indo-visually-hidden {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Đẩy dots của Flickity slider lên trên thanh search nổi ở Desktop */
@media (min-width: 850px) {
  .home-hero-slider-wrap .flickity-page-dots {
    bottom: 84px !important;
    z-index: 10 !important;
  }
}

/* =========================================================================
   1. HERO SEARCH DOCK CONTAINER
   ========================================================================= */
.indo-hero-search-dock {
  position: relative;
  z-index: 45;
  margin-top: -66px;
  padding: 0 0 8px;
  box-sizing: border-box;
}

.indo-hs-container {
  max-width: 1330px !important;
  width: 100%;
  margin: 0 auto;
  padding-inline: 15px !important;
  position: relative;
  box-sizing: border-box;
}

.indo-hs-card {
  display: block;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16), 0 4px 14px rgba(15, 23, 42, 0.06);
  padding: 18px 22px 16px;
  position: relative;
  box-sizing: border-box;
}

.indo-hs-form {
  margin: 0 !important;
  padding: 0 !important;
  position: relative;
}

/* =========================================================================
   2. SCOPE RADIO TABS (ALL / MOTORBIKE TOURS / TRAVEL GUIDES)
   ========================================================================= */
.indo-hs-scope-group {
  border: 0 !important;
  margin: 0 0 14px 0 !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.indo-hs-scope-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 11px;
  border: 1px solid #e2e8f0;
}

.indo-hs-pill-item {
  position: relative;
}

.indo-hs-pill-label {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 !important;
  padding: 8px 15px !important;
  min-height: 38px;
  border-radius: 8px;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  color: #475569 !important;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.indo-hs-pill-label:hover {
  color: var(--indo-hs-ink) !important;
  background: rgba(255, 255, 255, 0.65);
}

.indo-hs-scope-radio:checked + .indo-hs-pill-label {
  background: var(--indo-hs-red) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(178, 0, 0, 0.28);
}

.indo-hs-scope-radio:focus-visible + .indo-hs-pill-label {
  outline: 3px solid #0f172a;
  outline-offset: 2px;
}

.indo-hs-trust-note {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--indo-hs-muted);
  letter-spacing: 0.01em;
}

/* =========================================================================
   3. MAIN SEARCH CONTROLS ROW
   ========================================================================= */
.indo-hs-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.indo-hs-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.indo-hs-field--query {
  flex: 1 1 320px;
}

.indo-hs-tour-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex: 0 1 430px;
}

.indo-hs-form[data-scope="guides"] .indo-hs-tour-filters {
  display: none !important;
}

.indo-hs-field--select {
  flex: 1 1 0;
  min-width: 175px;
}

.indo-hs-label {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569 !important;
  line-height: 1.2 !important;
}

.indo-hs-input-wrap,
.indo-hs-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.indo-hs-field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.indo-hs-input,
.indo-hs-select {
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  margin: 0 !important;
  font: inherit !important;
  font-size: max(1rem, 15px) !important;
  font-weight: 500 !important;
  color: var(--indo-hs-ink) !important;
  background-color: var(--indo-hs-surface) !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
}

.indo-hs-input {
  padding: 0 40px 0 40px !important;
  -webkit-appearance: none;
  appearance: none;
}

.indo-hs-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.indo-hs-input::placeholder {
  color: #64748b;
  font-weight: 400;
}

.indo-hs-select {
  padding: 0 34px 0 38px !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: none !important;
  cursor: pointer;
  text-overflow: ellipsis;
}

.indo-hs-input:hover,
.indo-hs-select:hover {
  border-color: #94a3b8 !important;
  background-color: #ffffff !important;
}

.indo-hs-input:focus-visible,
.indo-hs-select:focus-visible {
  outline: none !important;
  background-color: #ffffff !important;
  border-color: var(--indo-hs-red) !important;
  box-shadow: 0 0 0 3px rgba(178, 0, 0, 0.14) !important;
}

.indo-hs-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
}

/* Clear Button & Spinner inside Search Input */
.indo-hs-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  min-height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: #64748b !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.indo-hs-clear-btn:hover {
  background: #e2e8f0 !important;
  color: var(--indo-hs-ink) !important;
}

.indo-hs-clear-btn[hidden] {
  display: none !important;
}

.indo-hs-spinner {
  position: absolute;
  right: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid #e2e8f0;
  border-top-color: var(--indo-hs-red);
  border-radius: 50%;
  animation: indoHsSpin 0.65s linear infinite;
}

.indo-hs-spinner[hidden] {
  display: none !important;
}

@keyframes indoHsSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Submit Button */
.indo-hs-submit-wrap {
  flex: 0 0 auto;
}

.indo-hs-submit-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 26px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, var(--indo-hs-red) 0%, #cc1111 100%) !important;
  color: #ffffff !important;
  font-size: 14.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-shadow: 0 6px 18px rgba(178, 0, 0, 0.28) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease !important;
}

.indo-hs-submit-btn:hover {
  background: linear-gradient(135deg, var(--indo-hs-red-hover) 0%, var(--indo-hs-red) 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(178, 0, 0, 0.34) !important;
}

.indo-hs-submit-btn:active {
  transform: translateY(0);
}

.indo-hs-submit-btn:focus-visible {
  outline: 3px solid #0f172a !important;
  outline-offset: 2px !important;
}

/* =========================================================================
   4. POPULAR QUICK-SEARCH CHIPS
   ========================================================================= */
.indo-hs-chips-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed #e2e8f0;
}

.indo-hs-chips-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  flex-shrink: 0;
}

.indo-hs-chips-track {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 1px;
}

.indo-hs-chips-track::-webkit-scrollbar {
  display: none;
}

.indo-hs-chip {
  display: inline-flex !important;
  align-items: center;
  padding: 5px 12px !important;
  min-height: 30px !important;
  margin: 0 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 999px !important;
  background: #f8fafc !important;
  color: #334155 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.indo-hs-chip:hover {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: var(--indo-hs-red) !important;
}

.indo-hs-chip:focus-visible {
  outline: 2px solid var(--indo-hs-red) !important;
  outline-offset: 2px !important;
}

/* =========================================================================
   5. LIVE SEARCH RESULTS DROPDOWN
   ========================================================================= */
.indo-hs-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  z-index: 90;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.2), 0 4px 16px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  max-height: 480px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.indo-hs-dropdown[hidden] {
  display: none !important;
}

.indo-hs-results-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.indo-hs-results-grid.has-both {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.indo-hs-group {
  padding: 14px 16px;
}

.indo-hs-results-grid.has-both .indo-hs-group:first-child {
  border-right: 1px solid #f1f5f9;
}

.indo-hs-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.indo-hs-group-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.indo-hs-group-badge--tour {
  background: #fef2f2;
  color: var(--indo-hs-red);
}

.indo-hs-group-badge--guide {
  background: #eff6ff;
  color: #1d4ed8;
}

.indo-hs-group-count {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.indo-hs-result-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.indo-hs-result-list li {
  margin: 0 !important;
  padding: 0 !important;
}

.indo-hs-result-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none !important;
  color: var(--indo-hs-ink) !important;
  transition: background-color 0.15s ease;
}

.indo-hs-result-item:hover,
.indo-hs-result-item.is-active,
.indo-hs-result-item:focus-visible {
  background: #f8fafc;
  outline: none;
}

.indo-hs-result-item.is-active {
  box-shadow: inset 0 0 0 1.5px rgba(178, 0, 0, 0.35);
}

.indo-hs-result-thumb {
  width: 56px !important;
  height: 44px !important;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e2e8f0;
}

.indo-hs-result-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.indo-hs-result-title {
  font-size: 13.8px;
  font-weight: 700;
  color: var(--indo-hs-ink);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.indo-hs-result-item:hover .indo-hs-result-title {
  color: var(--indo-hs-red);
}

.indo-hs-result-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.2;
}

.indo-hs-meta-tag {
  background: #f1f5f9;
  color: #334155;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
}

.indo-hs-meta-price {
  color: var(--indo-hs-red);
  font-weight: 700;
}

.indo-hs-meta-cat {
  color: #1d4ed8;
  font-weight: 600;
}

.indo-hs-result-arrow {
  color: #94a3b8;
  font-size: 15px;
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.indo-hs-result-item:hover .indo-hs-result-arrow,
.indo-hs-result-item.is-active .indo-hs-result-arrow {
  color: var(--indo-hs-red);
  transform: translateX(3px);
}

.indo-hs-dropdown-foot {
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
  padding: 10px 16px;
  text-align: center;
}

.indo-hs-view-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--indo-hs-red) !important;
  text-decoration: none !important;
  padding: 4px 12px;
  border-radius: 6px;
}

.indo-hs-view-all:hover {
  text-decoration: underline !important;
}

.indo-hs-empty {
  padding: 26px 20px;
  text-align: center;
}

.indo-hs-empty-title {
  margin: 0 0 6px !important;
  font-size: 15px;
  font-weight: 700;
  color: var(--indo-hs-ink);
}

.indo-hs-empty-sub {
  margin: 0 !important;
  font-size: 13.5px;
  color: #64748b;
}

/* =========================================================================
   6. TABLET & MOBILE OPTIMIZATION (<= 992px & <= 849px)
   ========================================================================= */
@media (max-width: 992px) {
  .indo-hs-controls {
    flex-wrap: wrap;
  }

  .indo-hs-field--query {
    flex: 1 1 100%;
  }

  .indo-hs-tour-filters {
    flex: 1 1 auto;
  }

  .indo-hs-field--select {
    min-width: 140px;
  }

  .indo-hs-trust-note {
    display: none;
  }
}

@media (max-width: 849px) {
  /* Đặt gọn ngay dưới video hero 16:9 trên Mobile — không che video */
  .indo-hero-search-dock {
    margin-top: 0;
    padding: 12px 12px 16px;
    background: linear-gradient(180deg, #0f172a 0%, #0f172a 42%, #f8fafc 42%, #ffffff 100%);
  }

  .indo-hs-container {
    padding-inline: 0 !important;
  }

  .indo-hs-card {
    padding: 14px 14px 12px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  }

  .indo-hs-scope-group {
    margin-bottom: 12px !important;
  }

  .indo-hs-scope-pills {
    width: 100%;
    display: grid;
    grid-template-columns: 0.72fr 1.2fr 1.08fr;
    gap: 4px;
  }

  .indo-hs-pill-label {
    width: 100%;
    padding: 8px 6px !important;
    min-height: 40px;
    font-size: 12.5px !important;
    gap: 5px;
  }

  .indo-hs-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .indo-hs-label {
    font-size: 11px !important;
  }

  /* 16px ngăn iOS Safari tự động zoom khi focus vào ô tìm kiếm */
  .indo-hs-input,
  .indo-hs-select {
    font-size: 16px !important;
    height: 48px !important;
    min-height: 48px !important;
  }

  .indo-hs-tour-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .indo-hs-field--select {
    min-width: 0;
  }

  .indo-hs-select {
    font-size: 14.5px !important;
    padding: 0 28px 0 34px !important;
  }

  .indo-hs-field--select .indo-hs-field-icon {
    left: 10px;
  }

  .indo-hs-field--select .indo-hs-chevron {
    right: 9px;
  }

  .indo-hs-submit-wrap,
  .indo-hs-submit-btn {
    width: 100% !important;
  }

  .indo-hs-chips-row {
    margin-top: 10px;
    padding-top: 10px;
    gap: 8px;
  }

  .indo-hs-chip {
    min-height: 34px !important;
    padding: 6px 12px !important;
    font-size: 12.5px !important;
  }

  /* Dropdown kết quả Live Search trên mobile: 1 cột, cuộn mượt */
  .indo-hs-dropdown {
    position: relative;
    top: 0;
    margin-top: 10px;
    max-height: 58vh;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  }

  .indo-hs-results-grid.has-both {
    grid-template-columns: 1fr;
  }

  .indo-hs-results-grid.has-both .indo-hs-group:first-child {
    border-right: 0;
    border-bottom: 1px solid #f1f5f9;
  }

  .indo-hs-group {
    padding: 12px;
  }

  .indo-hs-result-item {
    padding: 9px 8px;
    min-height: 58px;
  }
}

@media (max-width: 380px) {
  .indo-hs-pill-label svg {
    display: none;
  }
}

