.ui-select {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.ui-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 52px;
  border: 1px solid var(--border-base-secondary);
  border-radius: var(--radius-form);
  background: var(--bg-white);
  padding: 0 12px 0 16px;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.ui-select:hover .ui-select-trigger {
  border-color: var(--border-base-primary);
}

.ui-select-value {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  padding-right: 10px;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.16s ease;
}

.ui-select-value.is-placeholder {
  color: var(--text-secondary);
}

.ui-select[data-ui-select-floating-label-only] .ui-select-value.is-placeholder {
  color: transparent;
}

.ui-select-label {
  position: absolute;
  top: 50%;
  left: 16px;
  max-width: calc(100% - 56px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--text-secondary);
  padding: 0;
  border-radius: 4px;
  background: transparent;
  transition:
    top 0.16s ease,
    transform 0.16s ease,
    font-size 0.16s ease,
    line-height 0.16s ease,
    color 0.16s ease,
    background-color 0.16s ease;
  z-index: 1;
}

.ui-select-arrow {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ui-select-arrow svg {
  display: block;
}

.ui-select-arrow path {
  stroke: var(--fg-base-tertiary);
  stroke-width: 1.5;
  transition:
    transform 0.16s ease,
    stroke 0.16s ease;
}

.ui-select.is-open .ui-select-arrow path {
  transform-origin: center;
  transform: rotate(180deg);
}

.ui-select.is-open .ui-select-trigger {
  border-color: var(--border-base-accent);
  box-shadow: 0px 0px 0px 4px rgba(0, 93, 251, 0.12);
}

.ui-select.is-open .ui-select-label,
.ui-select.is-filled .ui-select-label {
  top: 0;
  left: 12px;
  transform: translateY(-50%);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-accent);
  padding: 0 4px;
  background: var(--bg-white);
}

.ui-select.is-open .ui-select-value,
.ui-select.is-filled .ui-select-value {
  color: var(--text-primary);
}

.ui-select.is-filled:not(.is-open):not(.is-disabled):not(.is-error)
  .ui-select-trigger {
  border-color: var(--border-base-primary);
}

.ui-select.is-disabled .ui-select-trigger {
  border-color: var(--border-base-secondary);
  background: var(--bg-secondary);
  cursor: not-allowed;
}

.ui-select.is-disabled:hover .ui-select-trigger {
  border-color: var(--border-base-secondary);
}

.ui-select.is-disabled .ui-select-label,
.ui-select.is-disabled .ui-select-value {
  color: var(--text-disabled);
}

.ui-select.is-disabled .ui-select-label {
  background: var(--bg-secondary);
}

.ui-select[data-ui-select-floating-label-only].is-disabled
  .ui-select-value.is-placeholder {
  color: transparent;
}

.ui-select.is-disabled .ui-select-arrow path {
  stroke: var(--text-disabled);
}

.ui-select.is-error .ui-select-trigger,
.ui-select.is-error:hover .ui-select-trigger {
  border-color: var(--border-base-danger);
}

.ui-select.is-error .ui-select-label {
  color: var(--text-danger);
}

.ui-select[data-ui-select-floating-label-only].is-error:not(.is-open):not(
    .is-filled
  )
  .ui-select-label {
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  line-height: 24px;
}

.ui-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  border: 1px solid var(--border-base-secondary, rgba(229, 231, 235, 1));
  border-radius: var(--radius-form);
  background: var(--bg-white);
  box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  row-gap: 4px;
  overflow-y: auto;
}

.ui-select-option {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 12px 16px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.ui-select-option:hover {
  background: var(--bg-secondary);
}

.ui-select-option-text {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--text-primary, rgba(23, 23, 23, 1));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 40px;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-select-option-title {
  display: none;
}

.ui-select-option-description {
  display: none;
}

.ui-select-option-check {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.ui-select-option-check svg {
  display: block;
}

.ui-select-option-check path {
  stroke: var(--text-primary);
  stroke-width: 1.8;
}

.ui-select-option[aria-selected="true"] .ui-select-option-check {
  opacity: 1;
}

.ui-select--searchable {
  gap: 0;
}

.ui-select--searchable .ui-select-trigger {
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
}

.ui-select--searchable .ui-select-label {
  z-index: 2;
}

.ui-select-trigger--search {
  position: relative;
}

.ui-select-search-input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  border-radius: inherit;
  background: transparent;
  padding: 0 46px 0 16px;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--text-primary);
}

.ui-select-search-input::placeholder {
  color: transparent;
}

.ui-select-search-input:disabled {
  cursor: not-allowed;
}

.ui-select-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: calc(var(--radius-form) - 2px);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ui-select-toggle:focus-visible {
  outline: 2px solid var(--border-base-accent);
  outline-offset: 1px;
}

.ui-select.is-open .ui-select-toggle .ui-select-arrow path {
  transform-origin: center;
  transform: rotate(180deg);
}

.ui-select.is-disabled .ui-select-toggle {
  cursor: not-allowed;
}

.ui-select.is-disabled .ui-select-toggle .ui-select-arrow path {
  stroke: var(--text-disabled);
}

.ui-field.is-focused .ui-select--searchable .ui-select-label,
.ui-field.is-filled .ui-select--searchable .ui-select-label,
.ui-select--searchable.is-open .ui-select-label,
.ui-select--searchable.is-filled .ui-select-label {
  top: 0;
  left: 12px;
  transform: translateY(-50%);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-accent);
  padding: 0 4px;
  background: var(--bg-white);
}

.ui-field.is-focused .ui-select--searchable .ui-select-search-input,
.ui-field.is-filled .ui-select--searchable .ui-select-search-input,
.ui-select--searchable.is-open .ui-select-search-input,
.ui-select--searchable.is-filled .ui-select-search-input {
  color: var(--text-primary);
}

.ui-field.is-error .ui-select--searchable .ui-select-trigger,
.ui-field.is-error .ui-select--searchable .ui-select-trigger:hover {
  border-color: var(--border-base-danger);
}

.ui-field.is-error .ui-select--searchable .ui-select-label {
  color: var(--text-danger);
}

.ui-select-menu--delivery {
  max-height: 320px;
  padding: 8px 0;
  row-gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-base-quaternary, rgba(82, 82, 91, 1)) transparent;
}

.ui-select-menu--delivery::-webkit-scrollbar {
  width: 12px;
}

.ui-select-menu--delivery::-webkit-scrollbar-track {
  background: transparent;
}

.ui-select-menu--delivery::-webkit-scrollbar-thumb {
  border-radius: 2px;
  border: 4px solid transparent;
  background-clip: content-box;
  background-color: var(--bg-base-quaternary, rgba(82, 82, 91, 1));
}

.ui-select-option--delivery {
  width: calc(100% - 16px);
  min-height: 36px;
  margin: 0 8px;
  border-radius: 6px;
  padding: 8px 12px;
  gap: 20px;
}

.ui-select-option--delivery .ui-select-option-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.ui-select-option--delivery:hover,
.ui-select-option--delivery.is-active {
  background: var(--bg-secondary);
}

.ui-select-empty {
  padding: 8px 16px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.ui-select-loader {
  width: calc(100% - 16px);
  min-height: 36px;
  margin: 0 8px;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
}

.ui-select-loader-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-top-color: var(--text-accent, rgba(0, 86, 218, 1));
  border-right-color: var(--text-accent, rgba(0, 86, 218, 1));
  animation: ui-select-loader-spin 0.75s linear infinite;
}

.ui-select-loader-text {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

@keyframes ui-select-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@media screen and (max-width: 650px) {
  .ui-select-menu {
    top: auto;
    bottom: calc(100% + 8px);
    border-radius: 20px 20px 0 0;
    padding: 0 0 24px;
    row-gap: 8px;
    background: var(--bg-primary, rgba(255, 255, 255, 1));
  }

  .ui-select-menu::before {
    content: attr(data-mobile-title);
    min-height: 52px;
    display: flex;
    align-items: flex-start;
    padding: 20px 20px 0 24px;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    letter-spacing: 0;
    color: var(--text-accent, rgba(0, 86, 218, 1));
  }

  .ui-select-option {
    width: calc(100% - 48px);
    margin: 0 24px;
    min-height: 48px;
    padding: 12px;
    gap: 20px;
  }

  .ui-select-menu--delivery {
    max-height: 220px;
    bottom: calc(100% + 8px);
    border-radius: 20px 20px 0 0;
    padding: 8px 0 24px;
    row-gap: 0;
  }

  .ui-select-menu--delivery::before {
    display: none;
    content: none;
    min-height: 0;
    padding: 0;
  }

  .ui-select-menu--delivery .ui-select-option--delivery {
    width: calc(100% - 16px);
    margin: 0 8px;
    min-height: 36px;
    padding: 8px 12px;
  }

  .ui-select-menu--delivery .ui-select-option-text {
    font-size: 14px;
    line-height: 20px;
  }
}

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

.ui-select.is-error .ui-field-error {
  display: block;
}

.ui-select[data-ui-select-floating-label-only] .ui-field-error {
  display: none;
}
