.top-container {
  position: absolute;
  top: 90px;
  left: 410px;
  width: calc(100% - 420px);
  height: 75px;
  margin-top: 0;
  margin-top: 0;

  display: flex;
  align-items: center;

  border-radius: 0;

  z-index: 999;

  background: var(--card);
  border: 2px solid var(--background3);
  box-shadow: var(--box-shadow1);
  border-radius: 16px;
}

.top-links-wrapper {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.top-links {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  padding-right: 10px;
  height: 100%;

  color: var(--text);
  white-space: nowrap;

  overflow-x: auto;
  overflow-y: hidden;

  scrollbar-width: none;
  -ms-overflow-style: none;

  z-index: 999;
}

.top-links::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.top-links > * {
  flex: 0 0 auto;
}

.listing-management-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(380px, 100%);
  height: 45px;
  margin: 0 0 0 1px;
  padding: 0 14px;
  border: 1px solid var(--background4);
  border-radius: 14px;
  background: var(--background3);
  color: var(--text2);
  box-sizing: border-box;
}

.listing-management-search i {
  flex: 0 0 auto;
  color: var(--text2);
}

.listing-management-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.listing-management-search input::placeholder {
  color: var(--text3);
}

.top-links a {
  color: var(--text);
}

.top-link-home {
  flex: 0 0 auto;
  font-size: 18px;
  margin: 21px 0px 22px 13px;
  cursor: pointer;
  position: relative;
  background-color: var(--background3);
  width: 45px;
  height: 45px;
  align-content: center;
  text-align: center;
  border-radius: 16px;
  transition: border-color 0.25s;
  box-shadow: var(--box-shadow2);
  border: 2px solid var(--background4);
}

.top-link {
  flex: 0 0 auto;
  margin: 25px 0;
  font-weight: 300;
  font-size: 16px;
}

.top-link-search {
  flex: 0 0 auto;
  margin: 25px 0;
  font-weight: 100;
  font-size: 16px;
  font-style: italic;
  color: var(--text3);
}

.top-link-active {
  flex: 0 0 auto;
  margin: 25px 0;
  font-weight: 500;
  font-size: 16px;
}

.top-link-separator {
  flex: 0 0 auto;
  margin: 20px 10px;
  font-size: 16px;
  color: var(--text3);
}

.sorting-menu {
  display: none;
}

.sorting-phone {
  display: none;
}

.top-sorting-desktop {
  flex: 0 0 auto;
  position: relative;
  height: 100%;

  display: flex;
  align-items: center;

  white-space: nowrap;
}

.sort-dropdown {
  flex: 0 0 auto;
  position: relative;
}

.sort-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  height: 40px;
  padding: 10px 19px;

  border-radius: 12px;
  border: 2px solid var(--background4);
  background: var(--background3);
  box-shadow: var(--box-shadow2);
  color: var(--text2);

  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition:
    background 0.25s ease,
    border-color 0.25s ease;
}

.sort-dropdown-toggle:hover {
  border-color: var(--background4);
}

.sort-dropdown-label {
  white-space: nowrap;
}

.sort-dropdown-icon {
  flex: 0 0 auto;
  font-size: 11px;
  opacity: 0.8;
}
@keyframes sortDropdownFadeIn {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes sortDropdownItemIn {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.sort-dropdown-menu {
  position: fixed;
  right: 85px;
  top: 170px;
  margin-top: -4px;
  min-width: 208px;
  background: var(--loBackground5);
  border-radius: 16px;
  border: 2px solid var(--background2);
  box-shadow: var(--box-shadow1);
  overflow: hidden;
  opacity: 0;
  transform-origin: top right;
  animation: sortDropdownFadeIn 0.22s ease-out forwards;
  z-index: 99999999999999999999;
}

.sort-dropdown-menu > * {
  opacity: 0;
  transform: translateY(5px);
  animation: sortDropdownItemIn 0.28s ease-out forwards;
}
.sort-dropdown-menu > *:nth-child(1) {
  animation-delay: 0.03s;
}
.sort-dropdown-menu > *:nth-child(2) {
  animation-delay: 0.06s;
}
.sort-dropdown-menu > *:nth-child(3) {
  animation-delay: 0.09s;
}
.sort-dropdown-menu > *:nth-child(4) {
  animation-delay: 0.12s;
}
.sort-dropdown-menu > *:nth-child(5) {
  animation-delay: 0.15s;
}
.sort-dropdown-menu > *:nth-child(6) {
  animation-delay: 0.18s;
}
.sort-dropdown-menu > *:nth-child(7) {
  animation-delay: 0.21s;
}
.sort-dropdown-menu > *:nth-child(8) {
  animation-delay: 0.24s;
}
.sort-dropdown-menu > *:nth-child(9) {
  animation-delay: 0.27s;
}
.sort-dropdown-menu > *:nth-child(10) {
  animation-delay: 0.3s;
}
.sort-dropdown-menu > *:nth-child(11) {
  animation-delay: 0.33s;
}
.sort-dropdown-menu > *:nth-child(12) {
  animation-delay: 0.36s;
}
.sort-dropdown-menu > *:nth-child(13) {
  animation-delay: 0.39s;
}
.sort-dropdown-menu > *:nth-child(14) {
  animation-delay: 0.41s;
}

.sort-dropdown-option {
  padding: 9px 10px;
  font-size: 14px;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    padding-left 0.25s ease;
}

.sort-dropdown-option:hover {
  background: var(--secondary);
  color: var(--primary);
  padding-left: 12px;
}

.sort-dropdown-option.active {
  background: var(--secondary);
  color: var(--primary);
}

.sort-dropdown-option.active::after {
  content: '<';
  font-size: 16px;
  opacity: 0.9;
}

.sort-dropdown-group-label {
  padding: 8px 0 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text3);
  pointer-events: none;
}

.sort-dropdown-separator {
  margin: 4px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

@media (max-width: 768px) {
  .top-sorting-desktop {
    display: none;
  }
}

.sort-dropdown {
  flex: 0 0 auto;
  position: relative;
}

.sort-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  height: 40px;
  padding: 10px 19px;

  border-radius: 12px;
  border: 2px solid var(--background4);
  background: var(--background3);
  box-shadow: var(--box-shadow2);
  color: var(--text2);

  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition:
    background 0.25s ease,
    border-color 0.25s ease;
}

.sort-dropdown-toggle:hover {
  border-color: var(--background4);
}

.sort-dropdown-label {
  white-space: nowrap;
}

.sort-dropdown-icon {
  flex: 0 0 auto;
  font-size: 11px;
  opacity: 0.8;
}
@keyframes sortDropdownFadeIn {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes sortDropdownItemIn {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.sort-dropdown-menu {
  position: fixed;
  right: 65px;
  top: 170px;
  margin-top: -4px;
  min-width: 208px;
  background: var(--loBackground5);
  border-radius: 16px;
  border: 2px solid var(--background2);
  box-shadow: var(--box-shadow1);
  overflow: hidden;
  opacity: 0;
  transform-origin: top right;
  animation: sortDropdownFadeIn 0.22s ease-out forwards;
  z-index: 99999999999999999999;
  visibility: hidden;
  pointer-events: none;
}

.sort-dropdown-menu.is-open {
  visibility: visible;
  pointer-events: auto;
}

.sort-dropdown-menu > * {
  opacity: 0;
  transform: translateY(5px);
  animation: sortDropdownItemIn 0.28s ease-out forwards;
}
.sort-dropdown-menu > *:nth-child(1) {
  animation-delay: 0.03s;
}
.sort-dropdown-menu > *:nth-child(2) {
  animation-delay: 0.06s;
}
.sort-dropdown-menu > *:nth-child(3) {
  animation-delay: 0.09s;
}
.sort-dropdown-menu > *:nth-child(4) {
  animation-delay: 0.12s;
}
.sort-dropdown-menu > *:nth-child(5) {
  animation-delay: 0.15s;
}
.sort-dropdown-menu > *:nth-child(6) {
  animation-delay: 0.18s;
}
.sort-dropdown-menu > *:nth-child(7) {
  animation-delay: 0.21s;
}
.sort-dropdown-menu > *:nth-child(8) {
  animation-delay: 0.24s;
}
.sort-dropdown-menu > *:nth-child(9) {
  animation-delay: 0.27s;
}
.sort-dropdown-menu > *:nth-child(10) {
  animation-delay: 0.3s;
}
.sort-dropdown-menu > *:nth-child(11) {
  animation-delay: 0.33s;
}
.sort-dropdown-menu > *:nth-child(12) {
  animation-delay: 0.36s;
}
.sort-dropdown-menu > *:nth-child(13) {
  animation-delay: 0.39s;
}
.sort-dropdown-menu > *:nth-child(14) {
  animation-delay: 0.41s;
}

.sort-dropdown-option {
  padding: 9px 10px;
  font-size: 14px;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    padding-left 0.25s ease;
}

.sort-dropdown-option:hover {
  background: var(--secondary);
  color: var(--primary);
  padding-left: 12px;
}

.sort-dropdown-option.active {
  background: var(--secondary);
  color: var(--primary);
}

.sort-dropdown-option.active::after {
  content: '<';
  font-size: 16px;
  opacity: 0.9;
}

.sort-dropdown-group-label {
  padding: 8px 0 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text3);
  pointer-events: none;
}

.sort-dropdown-separator {
  margin: 4px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.listing-view-wrapper {
  display: inline-flex;
  align-items: stretch;
  width: auto;
  margin-right: 15px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  height: 40px;
  background: var(--background3);
  color: var(--text2);
  cursor: pointer;
  box-shadow: var(--box-shadow2);
  font-size: 17px;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease;
}

.listing-view-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 50px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.listing-view-option.is-active {
  background: var(--background4);
  color: var(--text);
}
.listing-view-option:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.top-container.topbar-detail .top-view-controls,
.top-container.topbar-detail .sorting-phone {
  display: none !important;
}

@media (max-width: 768px) {
  .listing-view-wrapper {
    display: none;
  }

  .top-sorting-desktop {
    display: none;
  }

  .top-container {
    top: 72px;
    left: 0;
    width: 100%;
    height: 72px;
  }

  .sorting-phone {
    display: grid;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin: 0;
    place-items: center;
    border-radius: 12px;
    color: var(--text);
    font-size: 24px;
  }
}
@keyframes sortDropdownFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.sort-dropdown-menu {
  opacity: 0;
  animation: none;
  visibility: hidden;
  pointer-events: none;
}

.sort-dropdown-menu > * {
  opacity: 1;
  transform: none;
  animation-name: none;
  animation-duration: 0s;
  animation-timing-function: ease;
  animation-iteration-count: 1;
  animation-direction: normal;
  animation-fill-mode: none;
}

.sort-dropdown-menu.is-open {
  visibility: visible;
  pointer-events: auto;
  animation: sortDropdownFadeIn 0.22s ease-out both;
}

.sort-dropdown-menu.is-closing {
  visibility: visible;
  pointer-events: none;
  animation: sortDropdownFadeOut 0.18s ease-in both;
}

.sort-dropdown-menu.is-open > * {
  opacity: 0;
  transform: translateY(5px);
  animation-name: sortDropdownItemIn;
  animation-duration: 0.28s;
  animation-timing-function: ease-out;
  animation-iteration-count: 1;
  animation-direction: normal;
  animation-fill-mode: forwards;
}
