.toc-nav {
  z-index: 20;
  background: #fff;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 19px 43.4px -16px rgba(0, 0, 0, 0.1);
}

.toc-nav ul, .toc-nav ul li {
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  padding: 0px;
}

.toc-nav p {
  margin: 0;
}

.toc-nav ul li {
  display: flex;
  list-style: none !important;
  padding: 16px 0;
  border-top: 2px solid #f6f6f6;
}

.nav-header {
  font-weight: 700;
  font-size: 24px;
  line-height: 100%;
}

.nav-header-mobile {
  display: none;
  font-weight: 700;
}

.toc-nav ul li:last-child {
  border-bottom: 2px solid #f6f6f6;
}

.toc-nav a {
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  text-decoration: none;
  color: black;
  position: relative;
  transition: left 0.2s ease;
  left: 0;
}

.toc-nav a:hover {
  text-decoration: none;
}

.toc-nav a.active {
  font-weight: bold;
  text-decoration: none;
}

.toc-nav.marker a.active {
  left: 20px;
  transition: left 0.1s ease;
}

.toc-dropdown {
  display: none;
}

.toc-dropdown p {
  padding: 0;
}

.toc-nav-toggle-icon {
    color: #211E16;
    transform: rotate(90deg);
    transition: transform 0.3s ease;
    margin-right: 8px;
}

[data-widget_type="table_of_contents_nav.default"]:has(.sticky-enabled) {
  position: sticky;
  top: var(--toc-sticky-offset, 0);
  z-index: 20;
}

.marker .toc-active-indicator {
  position: absolute;
  width: 16px;
  height: 16px;
  transition: transform 0.1s ease;
}

.marker .toc-active-indicator i {
  position: relative;
  top: 2px;
}

.toc-active-indicator.inactive {
  display: none;
  transform: translateY(50px);
}

/* Mobile styles */
@media screen and (max-width: 767px) {
  .toc-active-indicator { display: none; }

  .e-con.e-child:has(.sticky-enabled) {
    position: sticky;
    top: var(--toc-sticky-offset, 0);
    z-index: 50;
    background: #fff;
    transition: none;
    width: 100%;
  }

  .toc-sticky-sentinel {
    top: calc(var(--toc-sticky-offset, 0) * -1 - 2px);
  }

  .e-con.e-child:has(.is-sticky) {
    left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 50;
    background: #fff;
    padding: 16px;
    box-shadow: 0 8px 24px -16px rgba(0, 0, 0, 0.3);
    min-width: 100vw;
  }

  [data-widget_type="table_of_contents_nav.default"]:has(.sticky-enabled) {
    position: relative;
    top: 0;
    z-index: 50;
  }

  .toc-nav {
    border: none;
    border-radius: 0;
    padding: 0;
    position: relative;
    display: block;
    box-shadow: none !important;
  }

  .nav-header {
    display: none;
    font-size: 14px;
    padding-bottom: 8px;
  }
  
  .nav-header-mobile {
    display: block;
    font-size: 14px;
    padding-bottom: 8px;
  }

  .toc-dropdown-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .toc-dropdown {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 2px solid #EFEFEF;
    background: #fff;
    cursor: pointer;
    width: 100%;
    z-index: 90;
  }

  .toc-dropdown.active {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .toc-dropdown.active .toc-nav-toggle-icon {
    transform: rotate(-90deg); /* Right to down */
  }

  .toc-nav ul {
    display: none;
    position: absolute;
    background-color: #fff;
    left: 0px;
    right: 0px;
    z-index: 50;
    gap: 12px;
    padding: 12px;
  }

  .toc-nav a.active,
  .toc-nav.marker a.active {
    left: 0;
  }

  .toc-nav ul li {
    padding: 0;
    border: none;
  }

  .toc-nav ul li:last-child {
    border-bottom: none;
  }

  .toc-nav ul.active {
    display: flex !important;
    border-left: 2px solid #EFEFEF;
    border-right: 2px solid #EFEFEF;
    border-bottom: 2px solid #EFEFEF;
    gap: 12px;
    padding: 12px;
  }
}