﻿body > header {
    display: grid;
    grid-template-columns: auto auto auto;
    grid-template-rows: 1fr 1fr;
    justify-content: space-between;
    align-content: center;
    padding: 20px 0 11px;
}
body > header a {
    display: block;
    /* remove default link styling */
    border: none;
    color: var(--text);
    text-decoration: none;
}
@media (hover: hover) { /* if the brower supports real hovering; prevents "sticky" hovers on touch devices */
    body > header a:hover {
        color: var(--orange);
    }
    body > header a.button:hover {
        color: var(--white);
    }
    body > header a.iconAndTextLink:hover {
        color: var(--orange);
    }
}

#topLogo {
    grid-column: 1 / span 1;
    grid-row: 1 / span 2;
    height: 70px; /* same as image height */
}
#topLogo img {
    width: 225px;
    height: 70px;
    margin-top: 5px;
}

#topLinks {
    grid-column: 3 / span 1;
    grid-row: 1 / span 1;
    display: flex;
    justify-content: end;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    line-height: 16px;
    margin-bottom: 8px;
}

#topLinks a.active {
    color: var(--orange);
}

#topLinks a.active svg path {
    fill: var(--blue);
}

#topMenu {
    grid-column: 3 / span 1;
    grid-row: 2 / span 1;
    display: flex;
    justify-content: end;
    align-items: flex-end;
    gap: 40px;
    font-size: 16px;
    font-weight: 700;
    line-height: normal;
}
#topLinks > *, #topMenu > * {
    height: fit-content;
}

#topLinks a, #topMenu a  {
    font-family: Arial, Helvetica, sans-serif;
}

#topMenu {
    position: relative;
}

#topMenu a.active {
    color: var(--orange);
}
#topMenu a.active:hover, #topMenu .menuItem.active:hover > a  {
    color: var(--white); 
}
#topMenu .submenu a.active:hover {
    color: var(--orange);
}
/* submenu styles */


.menuItem > a {
    padding: 7px 19px 15px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}
.menuItem:hover > a{
    background-color: var(--orange);
    color: var(--white);
} 

.submenu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    border-top: 6px solid var(--orange);
    background-color: white;
    grid-template-columns: repeat(2, 1fr); 
    row-gap: 10px;
    column-gap: 20px;
    padding: 28px 27px;
    box-shadow: 0px 2px 30px 0px rgba(0, 0, 0, 0.12);
}


.submenu.with-image {
    grid-template-columns: repeat(2, max-content) 1fr;
}

.menuItem:first-child:hover .submenu {
    border-top-left-radius: 0;
}

.menuItem:last-child:hover .submenu {
    border-top-right-radius: 0;
}

.iconAndTextLink.submenuItem:hover {
    color: var(--orange);    
}


.iconAndTextLink.submenuItem:hover path {
    fill: var(--orange);
    stroke: var(--orange);
}

.submenuItem {
   padding: 6px 0;
}

.submenu.with-image img {
    margin: auto;
    grid-column: 3; 
    grid-row: 1 / -1; 
    width: 100%; 
    max-width: 190px;
    height: 240px;
    object-fit: cover; 
}
@media (min-width: 820px) { /* breakpoint when there is no longer room for the small logo + full menu - related to mobile menu breakpoint below */
    a:hover + .submenu, .submenu:hover {
        display: grid;
    }

    .menuItem:last-child .submenu, .menuItem:nth-last-child(2) .submenu, .menuItem:nth-last-child(3) .submenu { /* right-justify the submenus for the last 3 items */
        right: 0;
    }
}

/* mobile menu styles */
#mobile-menu-toggle {
    display: none;
    width: 41px; /* the wider of #mobileMenuOpen and #mobileMenuClose; prevents jitter when switching between them */
}

#phoneLink span {
    display: initial;
}

#phoneLink svg {
    display: none;
}
#phoneLinkMobile {
    display: none;
}
#phoneLink svg path {
    fill: var(--white);
}


@media (max-width: 919px) { /* breakpoint when there is no longer room for the large logo + full menu */
    body > header {
        padding: 10px 0;
    }
    #topLogo {
        height: 51px; /* same as image */
    }
    #topLogo img {
        width: 164px;
        height: 51px;
        margin-top: 0;
    }

    #topLinks {
        margin-bottom: 0;
    }

    
}

@media (max-width: 819px) { /* breakpoint when there is no longer room for the small logo + full menu */
    #topLinks #helpLink, #topLinks #serviceAreasLink, #topLinks #contactUsLink, #searchBtn {
        display: none;
    }

    #phoneLinkMobile {
        display: block;
    }

    #phoneLink {
        /*override the default button styles (i.e. as if it had the .icon class */
        background-color: inherit;
        padding: 0;
    }

    #phoneLink span {
        display: none;
    }

    #phoneLink svg {
        display: initial;
    }

    #mobile-menu-toggle {
        display: block;
    }
    #mobileMenuClose {
        display: none;
    }

    #topMenu {
        display: none;
        position: absolute;
        top: 81px;
        flex-direction: column;
        gap: 0px; /* replaced by padding (to make the whole item clickable */
        align-items: flex-start;
        width: calc(100% - 4*var(--padding-inline));
    }
    .menuItem {
        width: 100%;
    }
    #topMenu a {
        padding: 10px;
        padding-top: 20px;
        border-bottom: 1px solid var(--grey);
        width: 100%;
    }
    #topMenu a:hover{
        border-bottom-color: var(--orange);
    }

    #topLinks {
        grid-row: 1 / span 2; /* expand to take both rows*/
        gap: 10px;
    }
}



.mobile-menu-dialog {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    height: 90vh;
    z-index: 1000; 
    margin: 0;
    margin-left: auto;
    padding: 26px 20px 26px 28px;
  }
  .mobile-menu-dialog::before {
    top: 0;
    bottom: 0;
    left: 0;
    content: '';
    position: absolute;
    width: 8px;
    background: var(--full-gradient-background-vertical);
  }
.mobile-menu-dialog form {
    padding: 0;
    margin: 20px 0;
    position: relative;
}
.mobile-menu-dialog form input {
    width: 100%;
}

.mobile-menu-dialog form button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 12px;
}

.mobile-menu-dialog input[type="search"] {
    padding: 12px 40px 12px 12px;
}
  
  .mobile-menu-dialog[open] {
    display: flex;
    flex-direction: column;
  }
  
  .mobile-menu-close {
    position: absolute;
    top: 26px;
    right: 1rem;
 
  }
  
  .mobile-menu-nav {
    background-color: #fff;
    flex: 1;
    overflow: auto;
  }

  .mobile-menu-nav a {
    display: block;
    border: none;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 15px;
    padding: 7px 0;
}

.mobile-menu-nav .mobile-submenu {
    padding-left: 10px;
    margin-bottom: 10px;
    display: none;
}

.mobile-menu-nav .mobile-submenu a {
    margin-bottom: 0;
}


.mobile-menu-nav a.bold {
    font-weight: bold;
}
.mobile-menu-nav a.active {
    font-weight: bold;
    color: var(--orange);
}
  .block {
    display: block !important;
  }
  
  