/*
 * Resort picker (Tom Select) restyled to match the site's Tailwind inputs:
 * slate-300 border, 10px radius, blue-700 focus ring, h-12 (home) / h-11 (browse).
 * The <select> keeps its Tailwind classes for no-JS; Tom Select copies them onto the
 * wrapper, so the wrapper's own box is reset here.
 */
.ts-wrapper.resort-select {
  position: relative;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #0f172a;
}

.ts-wrapper.multi.resort-select .ts-control,
.ts-wrapper.multi.has-items.resort-select .ts-control {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  padding: 6px 6px 6px 8px !important;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: none;
  font-size: 16px;
  color: #0f172a;
  cursor: text;
}

.ts-wrapper.multi.resort-select.resort-h-11 .ts-control {
  min-height: 44px;
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

@media (min-width: 768px) {
  .ts-wrapper.multi.resort-select .ts-control {
    font-size: 15px;
  }
}

.ts-wrapper.multi.resort-select.focus .ts-control,
.ts-wrapper.multi.resort-select.dropdown-active .ts-control {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2);
}

/* A summary line instead of item tags. */
.ts-wrapper.multi.resort-select .ts-control > [data-ts-item] {
  display: none;
}

.ts-wrapper.resort-select .resort-summary {
  display: none;
  flex: 0 1 auto;
  min-width: 0;
  padding-left: 6px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-wrapper.resort-select.has-summary:not(.has-query) .resort-summary {
  display: block;
}

.ts-wrapper.resort-select .ts-control > input {
  flex: 1 1 80px;
  min-width: 80px;
  height: 32px;
  padding-left: 6px !important;
  margin: 0 !important;
  font-size: inherit;
  color: #0f172a;
}

.ts-wrapper.resort-select .ts-control > input::placeholder {
  color: #64748b;
}

.ts-wrapper.resort-select .clear-button,
.ts-wrapper.resort-select .resort-toggle {
  display: flex;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #475569;
  cursor: pointer;
}

.ts-wrapper.plugin-clear_button.resort-select .clear-button {
  position: static;
  transform: none;
  opacity: 1;
  display: none;
}

.ts-wrapper.plugin-clear_button.has-items.resort-select .clear-button {
  display: flex;
}

.ts-wrapper.resort-select .clear-button:hover,
.ts-wrapper.resort-select .resort-toggle:hover {
  background: #f1f5f9 !important;
  color: #0f172a;
}

.ts-wrapper.resort-select .clear-button:focus-visible,
.ts-wrapper.resort-select .resort-toggle:focus-visible,
.resort-group-all:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 1px;
}

/* The list: as wide as the field (the card on phones). */
.ts-wrapper.resort-select .ts-dropdown {
  z-index: 20;
  margin-top: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  color: #0f172a;
}

.ts-wrapper.resort-select .ts-dropdown-content {
  max-height: 430px;
  padding: 6px 0;
}

/* On the browse bar the field can be narrow: let the list grow leftwards. */
@media (min-width: 768px) {
  .ts-wrapper.resort-select .ts-dropdown {
    left: auto;
    right: 0;
    width: max(100%, 360px);
  }
}

.ts-wrapper.resort-select .optgroup {
  padding: 4px 0;
}

.ts-wrapper.resort-select .ts-dropdown .optgroup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.ts-wrapper.resort-select .ts-dropdown .optgroup-header > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resort-group-all {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
}

.resort-group-all.is-on {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #ffffff;
}

.ts-wrapper.resort-select.has-query .resort-group-all {
  display: none;
}

.ts-wrapper.resort-select .ts-dropdown .resort-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 14px;
  color: #0f172a;
}

.ts-wrapper.resort-select .ts-dropdown .resort-option.active {
  background: #f1f5f9;
  color: #0f172a;
}

.ts-wrapper.resort-select .resort-option-text {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  min-width: 0;
  text-align: left;
}

.resort-option-name {
  font-size: 14px;
  font-weight: 600;
}

.resort-option-abbr {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.resort-option-extra:empty {
  display: none;
}

.ts-wrapper.resort-select .ts-dropdown .tomselect-checkbox {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0 !important;
  border: 2px solid #94a3b8;
  border-radius: 5px;
  background: #ffffff center / 12px 12px no-repeat;
  pointer-events: none;
}

.ts-wrapper.resort-select .ts-dropdown .tomselect-checkbox:checked {
  border-color: #1d4ed8;
  background-color: #1d4ed8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.ts-wrapper.resort-select .ts-dropdown .no-results {
  padding: 16px 14px;
  font-size: 14px;
  color: #475569;
}

.ts-wrapper.resort-select .ts-dropdown [data-selectable] .highlight {
  background: #dbeafe;
}

/* Phone: taller rows. */
@media (max-width: 639px) {
  .ts-wrapper.resort-select .ts-dropdown .resort-option {
    min-height: 52px;
  }

  .ts-wrapper.resort-select .ts-dropdown-content {
    max-height: 420px;
  }
}
