html {
    --admin-bar-height: 0px;

    &:has(.admin-bar) {
        --admin-bar-height: 32px; /* Example value, adjust as needed */

        @media (max-width: 782px) {
            --admin-bar-height: 46px; /* Example value for mobile, adjust as needed */
        }

        @media (max-width: 600px) {
            --admin-bar-height: 0px;
        }
    }

    --main-header-height: 90px;

    @media (min-width: 480px) {
        --main-header-height: 100px; /* Example value for larger screens, adjust as needed */
    }

    @media (min-width: 1120px) {
        --main-header-height: 160px; /* Example value for larger screens, adjust as needed */
    }

    scroll-padding-top: calc(var(--admin-bar-height) + var(--main-header-height) + 40px);
}

.table-of-contents__toggle {
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 0px;
    width: 100%;
}

.table-of-contents__wrapper {
    overflow-y: auto;
    padding: 20px;
}

.table-of-contents__list {
    padding: 0px;
    list-style: none;
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 18px;
}

.table-of-contents__wrapper.table-of-contents--visible .table-of-contents__list {
    display: flex;
}

.table-of-contents__link {
    text-decoration: none;
    color: inherit;
}


@media (max-width: 1023px) {
    .table-of-contents__sidebar:has(.table-of-contents__list) {
        position: fixed;
        width: 100%;
        top: calc(var(--admin-bar-height) + var(--main-header-height) - 4px);
        z-index: 199;
        left: 0px;
    }
    .table-of-contents__wrapper {
        background-color: transparent;
        color: white;
        transition: background-color 0.3s ease, color 0.3s ease;
    }
    body:has(.bde-header-builder--sticky-styles) .table-of-contents__wrapper, .table-of-contents__wrapper.table-of-contents--visible {
        background-color: #d6d2c4;
        color: #00202C;
    }

}

@media (min-width: 1024px) {
    .table-of-contents__container:has(.table-of-contents__list) {
        display: grid !important;
        grid-template-columns: 1fr 300px;
        column-gap: 100px;
    }

    .table-of-contents__sidebar:has(.table-of-contents__list) {
        grid-row: 1 / 10;
        grid-column: 2 / 3;
        position: relative;
        min-height: 100%;
    }

    .table-of-contents__wrapper {
        position: sticky;
        background: #d6d2c4;
        top: calc(var(--admin-bar-height) + var(--main-header-height) + 20px);
        max-height: calc(100vh - var(--admin-bar-height) - var(--main-header-height) - 40px);
    }
}