/**
 * Bus search module — aligned with com_bookpro bustrips design tokens.
 */
.mod-jbbus-bussearch.com-bookpro-bustrips {
  --bp-accent: #c41e3a;
  --bp-accent-soft: #fff1f2;
  --bp-border: #e5e7eb;
  --bp-muted: #6b7280;
  --bp-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --bp-radius: 16px;
}

.mod-jbbus-bussearch.bustrips-search {
  padding: 0;
}

.bp-search-panel .mod-jbbus-bussearch.bustrips-search {
  margin: 0;
}

.bp-search-card {
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius);
  background: #fff;
  box-shadow: var(--bp-shadow);
  overflow: visible;
}

.bp-search-card__body {
  overflow: visible;
  padding: 1.25rem;
  position: relative;
  z-index: 1;
}

.bp-search-form__trip {
  margin: 0;
  padding: 1rem 1.25rem;
  border: 0;
  border-bottom: 1px dashed var(--bp-border);
  background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
  text-align: center;
}

.bp-search-segment {
  display: inline-flex;
  gap: .25rem;
  padding: .3rem;
  border: 1px solid var(--bp-border);
  border-radius: 999px;
  background: #f3f4f6;
}

.bp-search-segment__option {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.bp-search-segment__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bp-search-segment__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: .45rem 1.15rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--bp-muted);
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.bp-search-segment__option input:checked + .bp-search-segment__label {
  background: var(--bp-accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(196, 30, 58, 0.28);
}

.bp-search-segment__option input:focus-visible + .bp-search-segment__label {
  outline: 2px solid var(--bp-accent);
  outline-offset: 2px;
}

.bp-search-field {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.bp-search-field__label {
  margin: 0;
  font-size: .9rem;
  font-weight: 700;
  color: #111827;
}

.bp-search-form__pax {
  margin: 1.25rem 0 0;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--bp-border);
  border-radius: 12px;
  background: #fafafa;
}

.bp-search-form__pax > .bp-search-field__label {
  margin-bottom: .85rem;
  font-size: .95rem;
}

.bp-search-pax-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.bp-search-pax-item {
  flex: 1 1 110px;
  max-width: 150px;
}

.bp-search-pax-item .bp-search-field__label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--bp-muted);
}

.mod-jbbus-bussearch .bp-search-control,
.mod-jbbus-bussearch .form-select.bp-search-control,
.mod-jbbus-bussearch .form-control.bp-search-control {
  min-height: 46px;
  border: 2px solid #d1d5db;
  border-radius: 12px;
  font-weight: 600;
  color: #111827 !important;
  background: #fff !important;
  box-shadow: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.mod-jbbus-bussearch .bp-search-control--compact {
  min-height: 42px;
  text-align: center;
}

.mod-jbbus-bussearch .bp-search-control:focus,
.mod-jbbus-bussearch .form-select.bp-search-control:focus,
.mod-jbbus-bussearch .form-control.bp-search-control:focus {
  border-color: var(--bp-accent);
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12);
  outline: 0;
}

.mod-jbbus-bussearch select.bp-search-control option {
  color: #111827;
  background: #fff;
}

.bp-search-card__actions {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px dashed var(--bp-border);
  background: #fafafa;
}

.bp-search-submit {
  width: 100%;
  min-height: 48px;
  padding: .75rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(196, 30, 58, 0.25);
}

.bp-search-submit:hover,
.bp-search-submit:focus {
  box-shadow: 0 12px 28px rgba(196, 30, 58, 0.32);
}

.bp-date-field {
  position: relative;
}

.bp-date-field.is-open {
  z-index: 50;
}

.bp-date-field__popover {
  display: none;
  left: 0;
  margin-top: 0.45rem;
  position: absolute;
  right: 0;
  z-index: 60;
}

.bp-date-field.is-open .bp-date-field__popover {
  display: block;
}

.bp-date-field__popover[hidden] {
  display: none !important;
}

.bp-date-field__control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0;
  position: relative;
}

.bp-date-field__display {
  border-bottom-right-radius: 0 !important;
  border-right: 0 !important;
  border-top-right-radius: 0 !important;
  cursor: pointer;
  padding-right: 0.75rem;
}

.bp-date-field__display:focus {
  position: relative;
  z-index: 1;
}

.bp-date-field__btn {
  align-items: center;
  background: #fff;
  border: 2px solid #d1d5db;
  border-bottom-right-radius: 12px;
  border-left: 0;
  border-top-right-radius: 12px;
  color: var(--bp-accent);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 46px;
  min-width: 46px;
  padding: 0;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.bp-date-field.is-open .bp-date-field__btn,
.bp-date-field__btn:hover {
  background: var(--bp-accent-soft);
  border-color: var(--bp-accent);
}

.bp-date-field.is-open .bp-date-field__display,
.bp-date-field__display:focus {
  border-color: var(--bp-accent);
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12);
}

.bp-date-field.is-open .bp-date-field__btn {
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12);
}

.bp-date-field__icon {
  background: currentColor;
  display: block;
  height: 1.15rem;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3' ry='3'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center / contain no-repeat;
  width: 1.15rem;
}

.bp-cal {
  background: #fff;
  border: 1px solid var(--bp-border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  overflow: hidden;
  padding: 0.85rem;
}

.bp-cal__header {
  align-items: center;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: auto 1fr auto;
  margin-bottom: 0.75rem;
}

.bp-cal__title {
  color: #111827;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  text-transform: capitalize;
}

.bp-cal__nav {
  align-items: center;
  background: #f3f4f6;
  border: 0;
  border-radius: 10px;
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.2rem;
  font-weight: 700;
  height: 2rem;
  justify-content: center;
  line-height: 1;
  width: 2rem;
}

.bp-cal__nav:hover {
  background: var(--bp-accent-soft);
  color: var(--bp-accent);
}

.bp-cal__weekdays,
.bp-cal__grid {
  display: grid;
  gap: 0.25rem;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.bp-cal__weekdays {
  margin-bottom: 0.35rem;
}

.bp-cal__weekdays span {
  color: var(--bp-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  text-transform: lowercase;
}

.bp-cal__pad {
  display: block;
  min-height: 2.2rem;
}

.bp-cal__day {
  align-items: center;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 600;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0;
}

.bp-cal__day:hover:not(:disabled) {
  background: var(--bp-accent-soft);
  border-color: #fecdd3;
  color: var(--bp-accent);
}

.bp-cal__day--today {
  border-color: #d1d5db;
}

.bp-cal__day--selected {
  background: var(--bp-accent);
  border-color: var(--bp-accent);
  box-shadow: 0 6px 14px rgba(196, 30, 58, 0.28);
  color: #fff;
}

.bp-cal__day--selected:hover {
  background: var(--bp-accent);
  color: #fff;
}

.bp-cal__day--disabled,
.bp-cal__day:disabled {
  background: #f9fafb;
  color: #cbd5e1;
  cursor: not-allowed;
}

@media (max-width: 767px) {
  .bp-search-card__body {
    padding: 1rem;
  }

  .bp-search-segment {
    display: flex;
    width: 100%;
  }

  .bp-search-segment__option {
    flex: 1 1 50%;
  }

  .bp-search-segment__label {
    width: 100%;
    padding-inline: .65rem;
    font-size: .85rem;
  }

  .bp-search-pax-item {
    flex: 1 1 calc(50% - .5rem);
    max-width: none;
  }
}
