/* ШАПКА ФИЛЬТРА */

.doctors-filter {
  background: var(--white);
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: 0 10px 24px -6px rgba(0, 25, 87, 0.12);
  gap: 16px;
  margin-bottom: 32px;
  box-sizing: border-box;
}

.doctors-filter__desktop {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.doctors-filter__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.doctors-filter__mobile {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.doctors-filter .search-input {
  flex: 1 1 50%;
  height: 52px;
  padding: 0 20px;
  background: #f4f7f9;
  border: none;
  outline: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--dark);
  box-sizing: border-box;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.doctors-filter .search-input::placeholder {
  color: rgba(0, 26, 92, 0.5);
  font-weight: 500;
}

.doctors-filter .search-input:focus {
  background: var(--bg);
  box-shadow: 0 4px 12px -2px rgba(0, 25, 87, 0.1);
}

/* ИКОНКИ */

.filter-icon {
  display: block;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.filter-icon--stethoscope {
  --icon: url(../../assets/icons/stethoscope.svg);
  width: 20px;
  height: 20px;
}

.filter-icon--funnel {
  --icon: url(../../assets/icons/funnel.svg);
  width: 20px;
  height: 20px;
}

.filter-icon--chevron {
  --icon: url(../../assets/icons/chevron-dark.svg);
  width: 24px;
  height: 24px;
}

.filter-icon--close {
  --icon: url(../../assets/icons/close-dark.svg);
}

.filter-icon--check {
  --icon: url(../../assets/icons/check-white.svg);
  width: 13px;
  height: 13px;
}

/* ПРИЕМ / ПАЦИЕНТ / ВРАЧИ */

.doctors-filter .choose-nav {
  flex: 1 1 0;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 7px 12px 7px 18px;
  background: #f4f7f9;
  border: none;
  border-radius: 12px;
  box-sizing: border-box;
}

.doctors-filter .choose-nav__name {
  margin-right: 6px;
  color: rgba(0, 26, 92, 0.55);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.doctors-filter .choose-nav__p {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.choose-nav__option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  background: var(--white);
  color: var(--dark);
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(0, 25, 87, 0.04);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.25, 1, 0.5, 1);
}

.choose-nav__option:hover {
  background: var(--bg);
  color: var(--primary);
}

.choose-nav__option._active {
  padding-right: 18px;
  background: var(--secondary);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(138, 175, 0, 0.28);
}

.choose-nav__close {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #e2e8f0;
  color: var(--dark);
  border: 1.5px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 26, 92, 0.14);
  box-sizing: border-box;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.choose-nav__option._active .choose-nav__close {
  display: inline-flex;
}

.choose-nav__close:hover {
  background: var(--primary);
  color: var(--white);
  transform: scale(1.1);
}

.choose-nav__close .filter-icon {
  width: 10px;
  height: 10px;
}

/* ВЫПАДАЮЩИЙ СПИСОК СПЕЦИАЛИЗАЦИЙ */

.spec-select {
  position: relative;
  z-index: 45;
  flex: 1 1 50%;
  min-width: 260px;
  user-select: none;
}

.spec-select__control {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 6px 16px 6px 18px;
  background: #f4f7f9;
  border-radius: 12px;
  box-sizing: border-box;
  cursor: text;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.spec-select__control:hover,
.spec-select._open .spec-select__control {
  background: var(--bg);
}

.spec-select._open .spec-select__control {
  box-shadow: 0 4px 12px -2px rgba(0, 25, 87, 0.1);
}

.spec-select__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--primary);
  transition: color 0.2s ease;
}

.spec-select._selected .spec-select__icon {
  color: var(--secondary);
}

.spec-select__input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 6px 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--dark);
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
}

.spec-select__input::placeholder {
  color: rgba(0, 26, 92, 0.55);
  font-weight: 500;
  opacity: 1;
}

.spec-select._selected:not(._open) .spec-select__input::placeholder {
  color: var(--dark);
  font-weight: 700;
}

.spec-select__badge {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--secondary);
  color: var(--white);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-sizing: border-box;
}

.spec-select._selected .spec-select__badge {
  display: inline-flex;
}

.spec-select__clear {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  background: #e2e8f0;
  color: var(--dark);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.spec-select__clear:hover {
  background: var(--primary);
  color: var(--white);
}

.spec-select._selected .spec-select__clear,
.spec-select._query .spec-select__clear {
  display: inline-flex;
}

.spec-select__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--dark);
  cursor: pointer;
  transition: transform 0.25s ease, color 0.2s ease;
}

.spec-select._open .spec-select__chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.spec-select__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  display: none;
  overflow: hidden;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 14px 32px -6px rgba(0, 25, 87, 0.25);
}

.spec-select._open .spec-select__menu {
  display: block;
  animation: doctorsFilterFade 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.spec-select__selected {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg);
  border-bottom: 1px solid #e2e8f0;
  color: var(--dark);
  font-size: 13px;
  font-weight: 700;
}

.spec-select._selected .spec-select__selected {
  display: flex;
}

.spec-select__reset {
  padding: 5px 12px;
  background: var(--white);
  color: var(--primary);
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.spec-select__reset:hover {
  background: var(--primary);
  color: var(--white);
}

.spec-select__list {
  max-height: 300px;
  margin: 0;
  padding: 8px 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--secondary) #f4f7f9;
}

.spec-select__list::-webkit-scrollbar {
  width: 6px;
}

.spec-select__list::-webkit-scrollbar-track {
  background: #f4f7f9;
  border-radius: 100px;
}

.spec-select__list::-webkit-scrollbar-thumb {
  background: var(--secondary);
  border-radius: 100px;
}

.spec-select__item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 11px 20px;
  background: transparent;
  border: none;
  text-align: left;
  box-sizing: border-box;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.spec-select__item[hidden] {
  display: none;
}

.spec-select__item:hover {
  background-color: #f4f7f9;
}

.spec-select__item._checked {
  background-color: var(--bg);
}

.spec-select__checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: #e2e8f0;
  color: var(--white);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.spec-select__item:hover .spec-select__checkbox {
  background: #cbd5e1;
}

.spec-select__item._checked .spec-select__checkbox {
  background: var(--secondary);
  box-shadow: 0 3px 8px rgba(138, 175, 0, 0.3);
}

.spec-select__checkbox .filter-icon {
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.spec-select__item._checked .spec-select__checkbox .filter-icon {
  opacity: 1;
  transform: scale(1);
}

.spec-select__label {
  flex: 1 1 auto;
  color: var(--dark);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}

.spec-select__item._checked .spec-select__label {
  font-weight: 700;
}

.spec-select__empty {
  display: none;
  padding: 24px 20px;
  color: rgba(0, 26, 92, 0.55);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}

.spec-select__empty._visible {
  display: block;
}

@keyframes doctorsFilterFade {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* МОБИЛЬНЫЙ БЛОК "ФИЛЬТРЫ" */

.mob-filters {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.mob-filters__toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 50px;
  padding: 6px 14px 6px 16px;
  background: #f4f7f9;
  border-radius: 12px;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.mob-filters__toggle:hover,
.mob-filters._open .mob-filters__toggle {
  background: var(--bg);
}

.mob-filters__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--primary);
  transition: color 0.2s ease;
}

.mob-filters._active .mob-filters__icon {
  color: var(--secondary);
}

.mob-filters__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: rgba(0, 26, 92, 0.55);
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mob-filters._active .mob-filters__label {
  color: var(--dark);
  font-weight: 700;
}

.mob-filters__badge {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--secondary);
  color: var(--white);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-sizing: border-box;
}

.mob-filters._active .mob-filters__badge {
  display: inline-flex;
}

.mob-filters__clear {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  background: #e2e8f0;
  color: var(--dark);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mob-filters__clear:hover {
  background: var(--primary);
  color: var(--white);
}

.mob-filters._active .mob-filters__clear {
  display: inline-flex;
}

.mob-filters__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--dark);
  transition: transform 0.25s ease, color 0.2s ease;
}

.mob-filters._open .mob-filters__chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.mob-filters__drawer {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
}

.mob-filters._open .mob-filters__drawer {
  display: flex;
  animation: doctorsFilterFade 0.22s cubic-bezier(0.25, 1, 0.5, 1);
}

/* СПИСОК ВРАЧЕЙ */

.doctors-empty {
  flex: 0 0 100%;
  width: 100%;
  margin: 0;
  padding: 40px 24px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 8px 20px -6px rgba(0, 25, 87, 0.08);
  color: rgba(0, 26, 92, 0.65);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  box-sizing: border-box;
}

.doctors-more {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.doctors-more[hidden] {
  display: none;
}

.doctors-more__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 240px;
  min-height: 54px;
  padding: 15px 38px;
  background: var(--white);
  color: var(--dark);
  border: 1.5px solid var(--primary);
  border-radius: 50px;
  box-shadow: 0 6px 18px -4px rgba(0, 25, 87, 0.1);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.25, 1, 0.5, 1);
}

.doctors-more__btn:hover {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 10px 22px -4px rgba(13, 120, 186, 0.32);
  transform: translateY(-1px);
}

.doctors-more__btn:active {
  transform: translateY(0);
}

.doctors-more__btn._loading {
  opacity: 0.8;
  pointer-events: none;
}

.doctors-more__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  box-sizing: border-box;
  animation: doctorsFilterSpin 0.65s linear infinite;
}

.doctors-more__btn._loading .doctors-more__spinner {
  display: inline-block;
}

@keyframes doctorsFilterSpin {
  to {
    transform: rotate(360deg);
  }
}

/* МОБИЛЬНАЯ ВЕРСИЯ */

@media (max-width: 991.95px) {
  .doctors-filter {
    padding: 18px 16px;
    border-radius: 20px;
    gap: 12px;
  }

  .doctors-filter__desktop {
    display: none;
  }

  .doctors-filter__mobile {
    display: flex;
  }

  .doctors-filter .search-form-doctors {
    position: relative;
    width: 100%;
  }

  .doctors-filter .search-form-doctors .search-input {
    width: 100%;
    height: 50px;
    padding: 0 46px 0 18px;
  }

  .doctors-filter .search-button {
    position: absolute;
    top: 50%;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: transparent;
    border: none;
    transform: translateY(-50%);
  }

  .spec-select {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .spec-select__control {
    height: 50px;
    padding: 6px 14px 6px 16px;
  }

  .spec-select__menu {
    top: calc(100% + 6px);
    box-shadow: 0 14px 32px -4px rgba(0, 25, 87, 0.28);
  }

  .spec-select__list {
    max-height: 240px;
  }

  .spec-select__item {
    gap: 12px;
    padding: 10px 16px;
  }

  .spec-select__label {
    font-size: 14px;
  }

  .mob-filters__drawer .choose-nav {
    flex: 1 1 auto;
    width: 100%;
    min-height: 48px;
    padding: 6px 10px 6px 14px;
  }

  .mob-filters__drawer .choose-nav__name {
    margin-right: 4px;
    font-size: 11px;
  }

  .mob-filters__drawer .choose-nav__option {
    padding: 8px 12px;
    font-size: 12px;
  }

  .mob-filters__drawer .choose-nav__option._active {
    padding-right: 14px;
  }

  .doctors-more__btn {
    width: 100%;
    max-width: 360px;
    min-height: 50px;
    padding: 14px 28px;
    font-size: 13px;
  }
}

