:host {
  display: flex;
}

.tabs {
  display: flex;
  font-family: var(--ifx-font-family);
  width: 100%;
}

.tabs.horizontal {
  flex-direction: column;
}

.tabs-container {
  display: flex;
  align-items: center;
  position: relative;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  gap: 8px;
}
.tabs-container.position-sticky {
  width: 100%;
}

.scroll-button {
  flex-shrink: 0;
  z-index: 10;
  transition: all 0.3s ease-in-out;
}
.scroll-button.hidden {
  display: none;
  pointer-events: none;
}
.scroll-button.scroll-left.hidden {
  width: 0;
  min-width: 0;
  max-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
}
.scroll-button.scroll-right.hidden {
  visibility: hidden;
  pointer-events: none;
}

.tabs.vertical {
  flex-direction: row;
}

.tabs-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  font-weight: 600;
}
.tabs-list.scrollable {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs-list.scrollable::-webkit-scrollbar {
  display: none;
}

.tabs-list:focus-within .active-border {
  display: none;
}

.active-border {
  position: absolute;
  left: 0;
  width: 0;
  transition: left 0.3s ease-in-out, width 0.3s ease-in-out, top 0.3s ease-in-out, height 0.3s ease-in-out;
}

.tabs.horizontal .active-border {
  bottom: 0;
  left: 0;
  height: 2px;
  background-color: #0A8276;
}

.tabs.vertical .tabs-list {
  border-bottom: none;
  width: auto;
  align-items: start;
  height: fit-content;
  grid-auto-flow: row;
  grid-auto-rows: auto;
  grid-auto-columns: initial;
}

.tabs.vertical .tab-content {
  padding-top: 0px;
  padding-left: 32px;
  flex: 3 1 0;
  min-width: 0;
}

.tabs .tabs-list.position-sticky,
.tabs .tabs-container.position-sticky {
  position: sticky;
  top: 0;
  background-color: #FFFFFF;
  z-index: 1000;
  box-shadow: 0 6px 9px 0 rgba(29, 29, 29, 0.1);
  transition: ease all 0.5s;
}
.tabs .tabs-list.position-sticky.at-top .tab-item .subline,
.tabs .tabs-list.position-sticky.at-top .tab-item .subline-wrapper,
.tabs .tabs-container.position-sticky.at-top .tab-item .subline,
.tabs .tabs-container.position-sticky.at-top .tab-item .subline-wrapper {
  display: none;
}

.tabs .tabs-list.position-sticky {
  align-self: flex-start;
}

.tabs:not(.vertical) .tab-item.full-width {
  flex: 1;
}
.tabs:not(.vertical).full-width-enabled .scroll-button {
  display: none;
}
.tabs:not(.vertical).full-width-enabled .tabs-list {
  flex: 1;
}
.tabs:not(.vertical).full-width-enabled .tabs-list.scrollable {
  overflow-x: visible;
}
.tabs:not(.vertical).full-width-enabled .tabs-container {
  width: 100%;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  padding: 12px 16px;
  gap: 4px;
  cursor: pointer;
}
@media (max-width: 768px) {
  .tab-item {
    font-size: 0.875rem;
    padding: 8px 8px;
  }
}
.tab-item.icon__right .top {
  flex-direction: row-reverse;
  justify-content: center;
}
.tab-item.icon__right .top:has(.label),
.tab-item.icon__right .top:has(.number) {
  flex-direction: row;
  justify-content: center;
}
.tab-item:hover {
  color: #0A8276;
}
.tab-item:hover .label {
  color: #1D1D1D;
}
.tab-item:active, .tab-item.active {
  color: #0A8276;
}
.tab-item:active .label, .tab-item.active .label {
  color: #1D1D1D;
}
.tab-item:focus, .tab-item.focus {
  outline: 2px solid #0A8276;
  outline-offset: -2px;
  border-radius: 2px;
}
.tab-item:focus + .active-border, .tab-item.focus + .active-border {
  display: none;
}
.tab-item:focus .label, .tab-item.focus .label {
  color: #1D1D1D;
}
.tab-item.disabled {
  color: #BFBBBB;
  pointer-events: none;
}
.tab-item .top {
  display: flex;
  justify-content: center;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.tab-item .chip {
  min-width: 0;
  overflow: hidden;
}
.tab-item .chip ifx-chip {
  min-width: 0;
  max-width: 100%;
}
.tab-item .header-wrapper {
  display: flex;
  overflow: hidden;
  max-width: 100%;
  flex: 0 1 auto;
  min-width: 0;
}
.tab-item .header {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  width: 100%;
}
.tab-item .subline-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.tab-item .subline {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  color: #575352;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1rem;
}

.tab-item:hover .subline,
.tab-item[aria-selected=true] .subline,
.tab-item.active .subline {
  color: #0A8276;
}

.tab-item.disabled .subline {
  color: #BFBBBB;
}

.tabs.vertical .tab-item {
  border-right: 2px solid transparent;
  justify-content: flex-start;
  align-items: flex-start;
  flex: none;
  max-width: 100%;
  width: 100%;
  text-align: left;
  align-self: start;
}
.tabs.vertical .tab-item .top,
.tabs.vertical .tab-item .subline-wrapper {
  justify-content: flex-start;
}

.number-wrapper {
  position: relative;
  display: inline-flex;
  border-radius: 9999px;
  overflow: hidden;
  vertical-align: middle;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tab-item.disabled .number-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #BFBBBB;
  mix-blend-mode: lighten;
}

ifx-chip::part(chip) {
  display: flex;
}

ifx-chip::part(label-wrapper),
ifx-chip::part(label) {
  max-width: 25ch;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

ifx-chip::part(label) {
  display: block;
  text-align: center;
}

.tabs.vertical .active-border {
  left: 0;
  top: 0;
  width: 2px;
  background-color: #0A8276;
}

.tab-content {
  padding-top: 24px;
  padding-left: 0px;
  flex-grow: 1;
}

.tabs.small .tab-item {
  font-size: 0.875rem;
}