:root {
    --tooth-space-indigo: #1e293b;
    --tooth-platinum: #f1f5f9;
    --tooth-border-radius-lg: 12px;
    --tooth-lemon-lime: #a3e635;
    --tooth-blue-slate: #64748b;
    --tooth-gap-sm: 8px;
}

.rtl-mega-wrapper {
    position: relative;
    z-index: 999;

}

.rtl-mega-wrapper * {
    box-sizing: border-box;
}

.rtl-mega-wrapper ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rtl-mega-wrapper a {
    text-decoration: none;
}

.rtl-mega-wrapper button {
    font-family: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

/* ============ top navbar ============ */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border-top: 1px solid var(--tooth-light-gray);
    padding-top: 13px ;
}

.nav-right {
    display: flex;
    align-items: center;
    width: 20%;
}

.top-navbar .nav-right {
    justify-content: flex-start;
}

.tooth-divider.header {
    height: 20px;
    width: 3px;
    background-color: black;
    border-radius: var(--tooth-border-radius-lg);
    margin: 0 50px;
}

.mega-trigger {
    display: flex;
    align-items: center;
    gap: 13px;
    font-weight: 600;
    font-size: 13px;
    color: var(--tooth-space-indigo);
    padding: 5px 8px;
    border-radius: var(--tooth-border-radius);
    transition: background 0.2s;
}

.mega-trigger:hover,
.mega-trigger[aria-expanded="true"],
.mega-trigger.active {
   /* background: var(--tooth-platinum);*/
    /*color:var(--tooth-lemon-lime);*/
}

.nav-center .top-links-list {
    display: flex;
    gap: 38px;
    justify-content: center;
}

.nav-center {
    width: 60%;
    padding: 0 38px;
}

.nav-center::before{
    content:"";
    width: 3px;
    height: 20px;
    background-color: var(--tooth-space-indigo);
}

.nav-center a {
    color: var(--tooth-space-indigo);
    font-size: 14px;
    transition: color 0.2s;
}

.nav-left {
    width: 20%;
}

.nav-left .tooth-header-call.flex {
    flex-direction: column;
    align-items: flex-end;
}

.tooth-header-bottom_call-wrapper.flex {
    gap: var(--tooth-gap-sm);
    justify-content: flex-end;
}

/* ============ mega menu panel ============ */
.mega-menu-panel {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    z-index: 1000;
    pointer-events: none; /* allow clicks on page content below when closed */
}

.mega-menu-panel.open {
    display: block;
    pointer-events: auto;
}

.mega-menu-inner {
    display: flex;
    position: relative; /* acts as the absolute anchor for sub-panels */
    min-height: 500px;
    justify-content: flex-start;
    background: #fff;
    box-shadow: 5px 5px 15px 0 rgba(0, 0, 0, 0.15);
    border-top: 1px solid #eee;
    border-radius: var(--tooth-border-radius-lg);
    max-height: 70vh;
    overflow: hidden;
    pointer-events: auto; /* re enable pointer events for the panel itself */
}

.breadcrumb-top {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: 13px;
    color: #777;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    z-index: 2;
}

/* ============ RIGHT PANEL: Main Categories ============ */
ul.main-categories {
    width: 280px;
    background: var(--tooth-platinum);
    border-left: 1px solid #eee;
    padding: 15px 46px 15px 0;
    flex-shrink: 0;
    overflow-y: auto;
}

.main-cat-item {
    position: static; /* must be static to allow absolute nested sub-panels to align to .mega-menu-inner */
    border-right: 3px solid transparent;
    transition: all 0.2s;
    margin-bottom: 30px;
}


.cat-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* padding: 13px 20px;*/
    font-size: 14px;
    color: var(--tooth-space-indigo);
    text-align: right;
    opacity: 0.4;
    transition: all 0.2s;
    position: relative; /* relative anchor for arrow placement */
}

.main-cat-item.active .cat-toggle,
.main-cat-item:hover .cat-toggle {
    opacity: 1;
    font-weight: 600;
}

/* arrow indicator repositioned to .cat-toggle */
.cat-toggle::after {
    content: ">";
    font-size: 13px;
    font-weight: normal;
    position: absolute;
    left: 46px;
    top: 50%;
    transform: translateY(-50%) scaleY(2.5);
    color: var(--tooth-space-indigo);
    transition: transform 0.2s;
}

.main-cat-item.active .cat-toggle::after {
    content: "<";
    transform: translateY(-50%) scaleY(2.5);
}


/* ============ left panel: sub panel ============ */
.sub-panel-wrapper {
    display: none;
    position: absolute;
    top: 0;
    right: 280px; /* starts where main-categories ends */
    left: 0;
    bottom: 0;
    overflow-y: auto; /* this will have the scrollbar */
    direction: ltr; /* scrollbar on the right */
}

.main-cat-item.active > .sub-panel-wrapper {
    display: block;
}

ul.sub-panel {
    background: #fff;
    column-gap: 30px;
    direction: rtl; /* content remains rtl */
    writing-mode: horizontal-tb; /* default writing mode */
    padding: 25px 30px 5px;
}

.main-cat-item.active > .sub-panel {
    animation: fadeIn 0.3s ease;
}

.col-children li {
    margin: 0;
}

.tooth-header-call #call-us{
    color:var(--tooth-blue-slate);
    font-size:14px;
}

.tooth-header-call #call-number{
    color:var(--tooth-space-indigo);
    font-size:18px;
    font-weight: bold;
}

.tooth-header-call #call-number span{
    color:var(--tooth-space-indigo);
    font-size:14px;
    font-weight: bold;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.col-title-item {
    break-inside: avoid;
    page-break-inside: avoid; /* legacy support */
    margin-bottom: 14px;
}

.col-title-item a {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    color: #222;
    font-weight: 600;
    font-size: 14px;
    padding: 6px 0 5px 0;
    gap: var(--tooth-gap-sm);
}

.col-title-item a::before {
    content: "";
    height: 15px;
    width: 3px;
    background-color: var(--tooth-lemon-lime);
    margin-top: 5px;
}

.col-children li a {
    display: block;
    color: #555;
    font-size: 13px;
    padding: 5px 15px 5px 0;
    transition: color 0.2s;
    font-weight: normal;
}


/* scrollbars styling */
.main-categories::-webkit-scrollbar,
.sub-panel-wrapper::-webkit-scrollbar {
    width: 6px;
}

.main-categories::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.sub-panel-wrapper::-webkit-scrollbar-thumb {
    background: var(--tooth-blue-slate);
    border-radius: var(--tooth-border-radius-lg);
}

.sub-panel-wrapper::-webkit-scrollbar-track {
    background: var(--tooth-platinum);
}

/* responsive breakpoint styling */
@media (max-width: 1024px) {
    .sub-panel {
        columns: 2 !important;
    }

    .main-categories, .breadcrumb-top {
        width: 220px;
    }

    .sub-panel-wrapper {
        right: 220px;
    }
}

@media (max-width: 768px) {
    .nav-center {
        display: none;
    }

    .mega-menu-inner {
        flex-direction: column;
        height: auto;
        max-height: none;
    }

    .main-categories,
    .breadcrumb-top {
        position: static;
        width: 100%;
        border-left: none;
        border-bottom: 1px solid #eee;
    }

    .main-categories {
        margin-top: 0;
    }

    .sub-panel-wrapper {
        position: static;
        overflow-y: visible;
    }

    .sub-panel {
        columns: 1 !important;
        padding: 15px 20px;
    }
}
