/* Below code is for all screen sizes */

/* Open the collapsed menu directly without clicking on the TB icon */
#header-nav .tbm.tbm--mobile .tbm-collapse {
    display: block;
}

#header-nav .tbm-button-container {
    display: none;
}

#header-nav .block-tb-megamenu h2.block__title {
        color: var(--color--primary-50);
        display: none; /* Removed the second media query */
    }


/* Default state: make all text inside .tbm-link-container and its span white */
li.active-trail > .tbm-link-container,
li.active-trail > .tbm-link-container span,
li.active-trail > .tbm-link-container a,
.active-trail > .tbm-submenu-toggle {
    background-color: var(--color--primary-50);
}
.tbm-submenu-toggle {
    color: #000;
}

.tbm a {
    text-decoration: none;
}

/* Below code is only for screens larger than 1200px or 75rem */
@media (min-width: 75rem) {

    /* Ensure active trail items have white text */
    .tbm .active-trail {
        color: #fff !important;
    }

    .tbm {
        background-color: transparent;
    }

    .tbm-link:hover {
        color: #fff !important;
    }

    /* Default state: make all text inside .tbm-link-container and its span white */
    li.active-trail > .tbm-link-container,
    li.active-trail > .tbm-link-container span,
    li.active-trail > .tbm-link-container a,
    .active-trail > .tbm-submenu-toggle {
        background-color: var(--color--primary-50);
        color: white; /* Makes the text white */
    }

    /* Hover state: keep the initial color for the span */
    li.active-trail > .tbm-link-container:hover span {
        color: #fff; /* Reverts to the original color on hover */
    }

    li.active .tbm-link-container > a,
    li.active .tbm-link-container a:hover {
        color: #fff;
    }

    /* --- Level-1 (Top-level) --- */
    /* Ensure level-1 items have white text on active and active-trail */
    li.active-trail.level-1 > .tbm-link,
    li.active.level-1 > .tbm-link {
        background-color: var(--color--primary-50) !important; /* Red background for active and active-trail */
        color: #fff !important; /* White text for active and active-trail */
    }

    /* --- Level-2 and beyond (Sub-items) --- */
    /* Apply black text to non-active level-2 and beyond items */
    li.tbm-item.level-2 .tbm-link,
    li.tbm-item.level-3 .tbm-link,
    li.tbm-item.level-4 .tbm-link,
    li.tbm-item.level-5 .tbm-link {
        background-color: transparent !important; /* Ensure transparent background */
        color: #000 ; /* Default black text for non-active items */
    }

    /* Ensure active-trail and active sub-items (level-2 and beyond) have red background and white text */
    li.active-trail.level-2 > .tbm-link,
    li.active.level-2 > .tbm-link {
        background-color: var(--color--primary-50) !important; /* Red background for active-trail and active */
        color: #fff !important; /* White text for active-trail and active */
    }

    /* --- Hover Effects --- */
    /* Add hover background to sub-items with #e60000 and make the text white */
    li.tbm-item.level-2 .tbm-link:hover,
    li.tbm-item.level-3 .tbm-link:hover {
        background-color: /*#e60000*/ var(--color--primary-60) !important; /* Red background on hover for sub-items */
        color: #fff !important; /* White text on hover */
    }

    /* Ensure active-trail sub-items also have white text on hover */
                 li .tbm-link.level-1:hover,
    li.active-trail .tbm-link.level-2:hover,
    li.active-trail .tbm-link.level-3:hover,
    li.active .tbm-link.level-2:hover,
    li.active .tbm-link.level-3:hover {
        background-color: /*#e60000*/ var(--color--primary-60) !important; /* Apply red background on hover for active trail sub-items */
        color: #fff !important; /* Ensure white text on hover */
    }



    .tbm-button-container span {
        background-color: var(--color--primary-50);
    }

    .tbm p {
        font-size: 70%;
        line-height: normal;
    }

    /* .tbm-link.level-1{padding:0.8rem!important} */
    .level-2 .tbm-link-container > .tbm-link {
        padding: 0.1rem 0 !important;
        font-size: 80% !important;
        line-height: 1.2rem;
    }

    /* Adds a 1px border in #d1d1d1 to the right */
    .tbm .tbm-border-right {
        border-right: solid 1px #d1d1d1;
    }

     /* Takes away formation of group titles text */
 .tbm .level-3 .tbm-group-title {
        text-transform: none;
        font-weight: normal;
    }
     /* Gives left padding to group titles */
    .tbm ul .level-2 li {
        padding-left: 15px;
    }
     /* Takes away above padding from fly-outs */
    .tbm-item--has-flyout ul li{
    padding-left:0 !important;
    }
   

   .tbm-item--has-flyout .tbm-submenu{
   /*background-color:#dcdcdc;*/
   box-shadow: 0 0 40px rgba(0, 0, 0, 0.5); /* Blurry shadow */
      border-radius: 10px; /* Optional: For rounded corners */
   }
    .level-1 > .tbm-submenu{
    border-radius: 10px; /* Optional: For rounded corners */
   }
   /* Controll distance between certain blocks in the menu */
    .tbm-row [class*='span']{
	min-height:1rem;
   }
  .tbm .menu-assurance p,.menu-assurance ul{
   font-size:70%;
   margin-top:0.1rem;
   margin-bottom : 0.1rem;
   line-height:1.5;
    }
}