.custom-search {
  --search-brand: #4a3aff;
  --search-brand-hover: #392bdc;
  --search-brand-soft: #f1f0ff;
  --search-ink: #191827;
  --search-muted: #687080;
  --search-border: #dfe3ea;
  --search-border-hover: #aeb6c3;
  --search-focus: 0 0 0 3px rgba(74, 58, 255, .16);
  position: relative;
  color: var(--search-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.custom-search *,
.custom-search *::before,
.custom-search *::after {
  box-sizing: border-box;
}

.custom-search button,
.custom-search input,
.custom-search select {
  font: inherit;
}

.custom-search button,
.custom-search select {
  cursor: pointer;
}

.custom-search .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.custom-search .product-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  background: #f0f1f5;
  border-radius: 12px;
}

.custom-search .product-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  color: #535b6b;
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-weight: 650;
  transition: color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.custom-search .product-tab svg,
.custom-search .search-button svg,
.custom-search .advanced-toggle svg,
.custom-search .popover-search svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.custom-search .product-tab.is-active {
  color: var(--search-brand);
  background: #fff;
  box-shadow: 0 1px 3px rgba(25, 24, 39, .08);
}

.custom-search .primary-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 1.1fr .85fr .9fr 190px;
  gap: 8px;
  align-items: stretch;
}

.custom-search .field-shell {
  position: relative;
  min-width: 0;
}

.custom-search .filter-shell {
  position: relative;
  min-width: 0;
}

.custom-search .field-button,
.custom-search .filter-button {
  width: 100%;
  min-width: 0;
  height: 60px;
  color: var(--search-ink);
  background: #fff;
  border: 1px solid var(--search-border);
  border-radius: 12px;
  box-shadow: none;
}

.custom-search .field-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px 8px 13px;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.custom-search .field-button:hover,
.custom-search .filter-button:hover {
  border-color: var(--search-border-hover);
}

.custom-search .field-button[aria-expanded="true"],
.custom-search .field-button:focus-visible,
.custom-search .filter-button[aria-expanded="true"],
.custom-search .filter-button:focus-visible,
.custom-search .search-button:focus-visible,
.custom-search .product-tab:focus-visible,
.custom-search .advanced-toggle:focus-visible,
.custom-search .popover button:focus-visible,
.custom-search .popover input:focus-visible {
  outline: 0;
  border-color: var(--search-brand);
  box-shadow: var(--search-focus);
}

.custom-search .field-copy {
  display: block;
  min-width: 0;
}

.custom-search .field-label,
.custom-search .filter-label {
  display: block;
  margin-bottom: 3px;
  color: var(--search-muted);
  font-size: 12px;
  font-weight: 550;
  line-height: 14px;
}

.custom-search .field-value {
  display: block;
  overflow: hidden;
  font-size: 16px;
  font-weight: 550;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-search .field-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--search-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.custom-search .calendar-icon {
  width: 19px;
  height: 19px;
}

.custom-search .search-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 60px;
  padding: 0 20px;
  color: #fff;
  background: var(--search-brand);
  border: 1px solid var(--search-brand);
  border-radius: 12px;
  box-shadow: none;
  font-size: 16px;
  font-weight: 750;
  transition: background-color .15s ease, border-color .15s ease, transform .08s ease;
}

.custom-search .search-button:hover {
  background: var(--search-brand-hover);
  border-color: var(--search-brand-hover);
}

.custom-search .search-button:active {
  transform: translateY(1px);
}

.custom-search .search-button:disabled {
  cursor: wait;
  opacity: .72;
}

.custom-search .advanced-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-height: 180px;
  margin-top: 10px;
  opacity: 1;
  transition: max-height .2s ease, margin .2s ease, opacity .15s ease;
}

.custom-search .advanced-grid.is-collapsed {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.custom-search .filter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px 7px 13px;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.custom-search .filter-copy {
  min-width: 0;
}

.custom-search .filter-value {
  display: block;
  overflow: hidden;
  min-width: 0;
  color: var(--search-ink);
  font-size: 16px;
  font-weight: 550;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-search .filter-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--search-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.custom-search .form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.custom-search .advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 10px;
  color: #555d6d;
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
}

.custom-search .advanced-toggle:hover {
  color: var(--search-brand);
  background: var(--search-brand-soft);
}

.custom-search .search-hint {
  margin: 0;
  color: var(--search-muted);
  font-size: 13px;
  line-height: 18px;
}

.custom-search .popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  width: min(340px, calc(100vw - 32px));
  padding: 10px;
  color: var(--search-ink);
  background: #fff;
  border: 1px solid var(--search-border);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(25, 24, 39, .16);
}

.custom-search .destination-popover {
  width: min(470px, calc(100vw - 32px));
}

.custom-search .popover[hidden] {
  display: none;
}

.custom-search .popover-search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 11px;
  color: var(--search-muted);
  background: #fff;
  border: 1px solid var(--search-border);
  border-radius: 10px;
}

.custom-search .popover-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  color: var(--search-ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 15px;
}

.custom-search .option-list {
  display: grid;
  gap: 3px;
  margin-top: 8px;
}

.custom-search .list-popover .option-list {
  max-height: 310px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c1c7d0 transparent;
  scrollbar-width: thin;
}

.custom-search .list-popover .option-list::-webkit-scrollbar {
  width: 8px;
}

.custom-search .list-popover .option-list::-webkit-scrollbar-thumb {
  background: #c1c7d0;
  border: 2px solid #fff;
  border-radius: 999px;
}

.custom-search .option-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.custom-search .option-group-title {
  margin: 12px 8px 4px;
  color: var(--search-muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 16px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.custom-search .option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 10px;
  color: var(--search-ink);
  background: transparent;
  border: 0;
  border-radius: 9px;
  text-align: left;
  font-size: 14px;
  line-height: 20px;
}

.custom-search .option span {
  color: var(--search-muted);
  font-size: 12px;
}

.custom-search .option:hover,
.custom-search .option.is-selected {
  color: var(--search-brand);
  background: var(--search-brand-soft);
}

.custom-search .filter-popover {
  width: min(360px, calc(100vw - 32px));
  padding: 10px;
}

.custom-search .filter-shell:nth-child(n + 4) .filter-popover {
  right: 0;
  left: auto;
}

.custom-search .filter-options {
  display: grid;
  gap: 2px;
  max-height: 310px;
  margin: 8px 0 10px;
  overflow: auto;
  overscroll-behavior: contain;
}

.custom-search .filter-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--search-ink);
  background: transparent;
  border: 0;
  border-radius: 9px;
  text-align: left;
  font-size: 14px;
  line-height: 20px;
}

.custom-search .filter-option:hover {
  background: #f5f6f8;
}

.custom-search .filter-option.is-selected {
  color: var(--search-brand);
  background: var(--search-brand-soft);
}

.custom-search .filter-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: transparent;
  background: #fff;
  border: 1px solid #b8bfca;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.custom-search .filter-option.is-selected .filter-check {
  color: #fff;
  background: var(--search-brand);
  border-color: var(--search-brand);
}

.custom-search .filter-option.is-radio .filter-check {
  border-radius: 50%;
}

.custom-search .filter-option.is-radio.is-selected .filter-check {
  background: #fff;
  border: 5px solid var(--search-brand);
}

.custom-search .filter-empty {
  margin: 4px;
  padding: 12px;
  color: var(--search-muted);
  font-size: 14px;
  text-align: center;
}

.custom-search .date-popover,
.custom-search .counter-popover {
  width: min(380px, calc(100vw - 32px));
  padding: 16px;
}

.custom-search .date-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.custom-search .date-inputs label span {
  display: block;
  margin-bottom: 6px;
  color: var(--search-muted);
  font-size: 13px;
  font-weight: 600;
}

.custom-search .date-inputs input {
  width: 100%;
  height: 44px;
  padding: 0 10px;
  color: var(--search-ink);
  background: #fff;
  border: 1px solid var(--search-border);
  border-radius: 10px;
}

.custom-search .popover-note {
  margin: 13px 0;
  color: var(--search-muted);
  font-size: 13px;
  line-height: 19px;
}

.custom-search .popover-apply {
  width: 100%;
  min-height: 42px;
  color: #fff;
  background: var(--search-brand);
  border: 1px solid var(--search-brand);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
}

.custom-search .counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
}

.custom-search .counter-row + .counter-row {
  border-top: 1px solid #eceef2;
}

.custom-search .counter-row strong,
.custom-search .counter-row span {
  display: block;
}

.custom-search .counter-row strong {
  font-size: 15px;
  line-height: 20px;
}

.custom-search .counter-row span {
  margin-top: 2px;
  color: var(--search-muted);
  font-size: 12px;
  line-height: 17px;
}

.custom-search .stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-search .stepper button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--search-brand);
  background: var(--search-brand-soft);
  border: 1px solid #dcd8ff;
  border-radius: 10px;
  font-size: 20px;
  line-height: 1;
}

.custom-search .stepper output {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
}

.custom-search .range-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0 14px;
  padding-top: 12px;
  border-top: 1px solid #eceef2;
  color: #4e5666;
  font-size: 14px;
}

.custom-search .range-switch input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--search-brand);
}

.custom-search .child-age-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 14px;
  padding-top: 12px;
  border-top: 1px solid #eceef2;
}

.custom-search .child-age-fields[hidden] {
  display: none;
}

.custom-search .child-age-field span {
  display: block;
  margin-bottom: 5px;
  color: var(--search-muted);
  font-size: 12px;
  font-weight: 600;
}

.custom-search .child-age-field select {
  width: 100%;
  height: 40px;
  padding: 0 9px;
  color: var(--search-ink);
  background: #fff;
  border: 1px solid var(--search-border);
  border-radius: 9px;
}

.vendor-search-engine {
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

.vendor-search-engine.is-ready {
  height: auto;
  overflow: visible;
  visibility: visible;
}

.custom-search,
.custom-search * {
  font-weight: 300 !important;
}

@media (max-width: 1120px) {
  .custom-search .primary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .custom-search .search-button {
    grid-column: 4 / 6;
  }
}

@media (max-width: 820px) {
  .custom-search .primary-grid,
  .custom-search .advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .custom-search .search-button {
    grid-column: 1 / -1;
  }

  .custom-search .advanced-grid .filter-shell:last-child {
    grid-column: 1 / -1;
  }

  .custom-search .form-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  body.custom-search-popover-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .custom-search .product-tabs {
    width: 100%;
  }

  .custom-search .product-tab {
    flex: 1 1 0;
    justify-content: center;
  }

  .custom-search .primary-grid,
  .custom-search .advanced-grid {
    grid-template-columns: 1fr;
  }

  .custom-search .advanced-grid {
    max-height: 420px;
  }

  .custom-search .advanced-grid.is-collapsed {
    max-height: 0;
  }

  .custom-search .search-button,
  .custom-search .advanced-grid .filter-shell:last-child {
    grid-column: auto;
  }

  .custom-search .popover {
    position: fixed;
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: min(70dvh, 620px);
    overflow: auto;
    border-radius: 16px;
    contain: layout paint;
    overscroll-behavior: contain;
    transform: translateZ(0);
  }

  .custom-search .list-popover .option-list,
  .custom-search .filter-options {
    max-height: min(48dvh, 390px);
    -webkit-overflow-scrolling: touch;
  }

  .custom-search .filter-shell:nth-child(n + 4) .filter-popover {
    right: 10px;
    left: 10px;
  }

  .custom-search .option-grid,
  .custom-search .date-inputs,
  .custom-search .child-age-fields {
    grid-template-columns: 1fr;
  }

  .custom-search .search-hint {
    padding: 0 10px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .custom-search *,
  .custom-search *::before,
  .custom-search *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
