/* UX Builder: form tìm tuyến xe ngang trên trang chủ. */

.knt-home-route-search {
  --knt-home-search-primary: var(--pcb-primary, #125895);
  --knt-home-search-primary-dark: var(--pcb-primary-dark, #0b3c69);
  --knt-home-search-accent: var(--pcb-secondary, #dea938);
  --knt-home-search-heading: var(--pcb-heading, #123a60);
  --knt-home-search-text: var(--pcb-text, #465c6f);
  --knt-home-search-muted: var(--pcb-muted, #6e8293);
  display: grid;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding: 24px;
  border: 1px solid rgba(18, 88, 149, 0.18);
  border-top: 4px solid var(--knt-home-search-primary);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 46px rgba(13, 59, 91, 0.14);
  color: var(--knt-home-search-text);
}

.knt-home-route-search *,
.knt-home-route-search *::before,
.knt-home-route-search *::after {
  box-sizing: border-box;
}

.knt-home-route-search__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: currentColor;
  line-height: 1;
}

.knt-home-route-search__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.knt-home-route-search__heading {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.knt-home-route-search__heading-icon {
  display: inline-flex;
  flex: 0 0 52px;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: linear-gradient(
    145deg,
    var(--knt-home-search-primary),
    var(--knt-home-search-primary-dark)
  );
  box-shadow: 0 9px 20px rgba(18, 88, 149, 0.22);
  color: #fff;
}

.knt-home-route-search__heading-icon .knt-home-route-search__icon {
  width: 27px;
  height: 27px;
}

.knt-home-route-search__heading-copy {
  min-width: 0;
}

.knt-home-route-search__heading-copy strong,
.knt-home-route-search__heading-copy small {
  display: block;
}

.knt-home-route-search__heading-copy strong {
  margin-bottom: 4px;
  color: var(--knt-home-search-heading);
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.knt-home-route-search__heading-copy small {
  color: var(--knt-home-search-muted);
  font-size: 13px;
  line-height: 1.45;
}

.knt-home-route-search__form {
  display: grid;
  grid-template-columns:
    minmax(170px, 1.2fr)
    minmax(150px, 1fr)
    minmax(150px, 0.85fr)
    minmax(150px, 0.85fr)
    minmax(120px, 0.85fr);
  align-items: end;
  gap: 10px;
  min-width: 0;
  margin: 0;
}

.knt-home-route-search__field {
  min-width: 0;
}

.knt-home-route-search__field label {
  display: block;
  margin: 0 0 7px;
  color: var(--knt-home-search-heading);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.knt-home-route-search__control {
  position: relative;
  min-width: 0;
}

.knt-home-route-search__control > .knt-home-route-search__icon {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 14px;
  width: 19px;
  height: 19px;
  color: var(--knt-home-search-primary);
  transform: translateY(-50%);
  pointer-events: none;
}

.knt-home-route-search__field input,
.knt-home-route-search__field select {
  display: block;
  width: 100%;
  height: 52px;
  min-height: 52px;
  margin: 0;
  padding: 0 38px 0 43px;
  border: 1px solid #ccdbe6;
  border-radius: 10px;
  background: #fbfdff;
  box-shadow: none;
  color: var(--knt-home-search-heading);
  font-family: inherit;
  font-size: 15px;
  line-height: 52px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.knt-home-route-search__field input::placeholder {
  color: #8195a5;
  opacity: 1;
}

.knt-home-route-search__field input:hover,
.knt-home-route-search__field select:hover {
  border-color: #9eb9cc;
  background: #fff;
}

.knt-home-route-search__field input:focus,
.knt-home-route-search__field select:focus {
  border-color: var(--knt-home-search-primary);
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(18, 88, 149, 0.13);
}

.knt-home-route-search__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    var(--knt-home-search-primary),
    var(--knt-home-search-primary-dark)
  );
  box-shadow: 0 10px 22px rgba(18, 88, 149, 0.23);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-transform: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.knt-home-route-search__submit .knt-home-route-search__icon:last-child {
  margin-left: auto;
  transition: transform 180ms ease;
}

.knt-home-route-search__submit:hover {
  box-shadow: 0 13px 27px rgba(18, 88, 149, 0.3);
  color: #fff;
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.knt-home-route-search__submit:hover .knt-home-route-search__icon:last-child {
  transform: translateX(3px);
}

.knt-home-route-search__submit:focus-visible {
  outline: 3px solid rgba(18, 88, 149, 0.28);
  outline-offset: 3px;
}

.knt-home-route-search__submit:disabled,
.knt-home-route-search__submit.is-loading {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

/* Select2 */
.knt-home-route-search .select2-container {
  display: block;
  width: 100% !important;
  max-width: 100%;
}

.knt-home-route-search .select2-container .select2-selection--single {
  height: 52px;
  border: 1px solid #ccdbe6;
  border-radius: 10px;
  background: #fbfdff;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.knt-home-route-search .select2-container:hover .select2-selection--single {
  border-color: #9eb9cc;
  background: #fff;
}

.knt-home-route-search .select2-container--focus .select2-selection--single,
.knt-home-route-search .select2-container--open .select2-selection--single {
  border-color: var(--knt-home-search-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(18, 88, 149, 0.13);
}

.knt-home-route-search
  .select2-container
  .select2-selection--single
  .select2-selection__rendered {
  padding-right: 38px;
  padding-left: 43px;
  color: var(--knt-home-search-heading);
  font-size: 15px;
  line-height: 50px;
}

.knt-home-route-search
  .select2-container
  .select2-selection--single
  .select2-selection__placeholder {
  color: #748a9c;
}

.knt-home-route-search
  .select2-container
  .select2-selection--single
  .select2-selection__arrow {
  top: 0;
  right: 7px;
  width: 26px;
  height: 52px;
}

.knt-home-route-search
  .select2-container
  .select2-selection--single
  .select2-selection__clear {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 31px;
  height: 50px;
  margin: 0;
  padding: 0 4px;
  color: #7d909e;
  font-size: 18px;
  line-height: 50px;
}

.knt-home-route-search-dropdown.select2-dropdown {
  z-index: 9999;
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid #b9cedd;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 17px 38px rgba(13, 59, 91, 0.18);
}

.knt-home-route-search-dropdown .select2-search--dropdown {
  padding: 10px;
  border-bottom: 1px solid #edf2f6;
}

.knt-home-route-search-dropdown .select2-search__field {
  height: 42px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #c8d9e5;
  border-radius: 8px;
  font-size: 16px;
}

.knt-home-route-search-dropdown .select2-search__field:focus {
  border-color: #125895;
  outline: none;
  box-shadow: 0 0 0 3px rgba(18, 88, 149, 0.12);
}

.knt-home-route-search-dropdown .select2-results__options {
  max-height: 260px;
  padding: 6px;
}

.knt-home-route-search-dropdown .select2-results__option {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 7px;
  color: #3f5668;
  font-size: 15px;
  line-height: 1.45;
}

.knt-home-route-search-dropdown
  .select2-results__option--highlighted[aria-selected] {
  background: #eaf4fc;
  color: #0b3c69;
}

.knt-home-route-search-dropdown .select2-results__option[aria-selected="true"] {
  background: #125895;
  color: #fff;
  font-weight: 700;
}

@media (max-width: 1199px) {
  .knt-home-route-search {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .knt-home-route-search__heading-copy small {
    max-width: none;
  }
}

@media (max-width: 899px) {
  .knt-home-route-search__form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .knt-home-route-search__submit {
    grid-column: 1 / -1;
  }
}

@media (max-width: 599px) {
  .knt-home-route-search {
    gap: 20px;
    padding: 22px 16px 18px;
    border-radius: 16px;
  }

  .knt-home-route-search__heading-icon {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
  }

  .knt-home-route-search__heading-copy strong {
    font-size: 20px;
  }

  .knt-home-route-search__form {
    grid-template-columns: 1fr;
  }

  .knt-home-route-search__submit {
    grid-column: auto;
  }

  .knt-home-route-search__field input,
  .knt-home-route-search__field select,
  .knt-home-route-search
    .select2-container
    .select2-selection--single
    .select2-selection__rendered {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .knt-home-route-search *,
  .knt-home-route-search *::before,
  .knt-home-route-search *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
