/* FAM Tours Global Unified Search Styles */

/* Header Search */
.nav__search {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 0.75rem;
}

.nav__search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  width: 240px;
}

.nav--solid .nav__search-box {
  background: rgba(14, 27, 36, 0.04);
  border-color: rgba(14, 27, 36, 0.14);
}

.nav__search-box:focus-within {
  width: 320px;
  background: #ffffff;
  border-color: #B3A27C;
  box-shadow: 0 8px 24px rgba(14, 27, 36, 0.12);
}

.nav__search-icon {
  width: 15px;
  height: 15px;
  color: currentColor;
  opacity: 0.7;
  flex-shrink: 0;
  margin-right: 0.5rem;
}

.nav__search-box:focus-within .nav__search-icon {
  color: #8E704F;
  opacity: 1;
}

.nav__search-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.8125rem;
  color: inherit;
  width: 100%;
}

.nav__search-box:focus-within .nav__search-input {
  color: #0E1B24;
}

.nav__search-input::placeholder {
  color: inherit;
  opacity: 0.6;
}

.nav__search-box:focus-within .nav__search-input::placeholder {
  color: #64748B;
  opacity: 0.8;
}

.nav__search-clear {
  border: none;
  background: transparent;
  color: #94A3B8;
  cursor: pointer;
  padding: 2px;
  display: none;
  align-items: center;
  justify-content: center;
}

.nav__search-box.has-val .nav__search-clear {
  display: flex;
}

/* Mobile search trigger button */
.nav__search-mobile-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  margin-right: 0.5rem;
}

.nav--solid .nav__search-mobile-btn {
  border-color: rgba(14, 27, 36, 0.14);
  background: rgba(14, 27, 36, 0.04);
}

@media (max-width: 991px) {
  .nav__search-box {
    display: none;
  }
  .nav__search-mobile-btn {
    display: inline-flex;
  }
}

/* Autocomplete Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 480px;
  max-width: calc(100vw - 2rem);
  max-height: 520px;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(14, 27, 36, 0.22), 0 0 0 1px rgba(14, 27, 36, 0.06);
  z-index: 9999;
  display: none;
  flex-direction: column;
  padding: 0.75rem 0;
  color: #0E1B24;
}

.search-dropdown.is-open {
  display: flex;
}

.search-group {
  padding: 0.5rem 0;
  border-bottom: 1px solid #F1F5F9;
}

.search-group:last-child {
  border-bottom: none;
}

.search-group__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 1rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8E704F;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  color: #0E1B24;
  text-decoration: none;
  transition: background 0.15s ease;
}

.search-item:hover,
.search-item.is-selected {
  background: #F8FAFC;
}

.search-item__thumb {
  width: 44px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  background: #0E1B24;
  flex-shrink: 0;
}

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

.search-item__title {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #0E1B24;
}

.search-item__meta {
  font-size: 0.6875rem;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item__price {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #8E704F;
  white-space: nowrap;
  text-align: right;
}

.search-item__price span {
  font-size: 0.6875rem;
  font-weight: 400;
  color: #94A3B8;
}

.search-dropdown__footer {
  padding: 0.5rem 1rem 0.25rem;
  background: #F8FAFC;
  font-size: 0.6875rem;
  color: #64748B;
  text-align: center;
  border-top: 1px solid #EDF2F7;
}

.search-dropdown__footer a {
  color: #8E704F;
  font-weight: 600;
  text-decoration: underline;
}

/* Dedicated Search Results Modal */
.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 27, 36, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.search-modal.is-open {
  display: flex;
}

.search-modal__dialog {
  background: #ffffff;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

.search-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #E2E8F0;
}

.search-modal__searchbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  max-width: 600px;
  background: #F1F5F9;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
}

.search-modal__searchbox input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #0E1B24;
}

.search-modal__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F1F5F9;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  cursor: pointer;
  transition: all 0.2s;
}

.search-modal__close:hover {
  background: #E2E8F0;
  color: #0E1B24;
}

.search-modal__body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

/* Hero Search Bar on Homepage & Luxury Cars */
.hero-search-wrapper {
  margin-top: 1.75rem;
  width: 100%;
  max-width: 580px;
  position: relative;
}

.hero-search-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(179, 162, 124, 0.4);
  border-radius: 9999px;
  padding: 0.5rem 0.6rem 0.5rem 1.25rem;
  box-shadow: 0 16px 36px rgba(14, 27, 36, 0.14);
  transition: all 0.3s var(--ease-lux);
}

.hero-search-box:focus-within {
  border-color: #8E704F;
  box-shadow: 0 20px 45px rgba(14, 27, 36, 0.2);
}

.hero-search-icon {
  width: 18px;
  height: 18px;
  color: #8E704F;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.hero-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9375rem;
  color: #0E1B24;
  width: 100%;
}

.hero-search-btn {
  background: #0E1B24;
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 0.6rem 1.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.3s ease;
}

.hero-search-btn:hover {
  background: #8E704F;
}

.hero-search-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.6875rem;
  color: #64748B;
}

.hero-search-tag {
  background: rgba(14, 27, 36, 0.05);
  border-radius: 9999px;
  padding: 0.2rem 0.6rem;
  color: #0E1B24;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-search-tag:hover {
  background: #8E704F;
  color: #ffffff;
}
