/*=============================
	1. Variable CSS
===============================*/
:root {
    --thm-body-font: "Sora", sans-serif;
    --thm-heading-font: 'Big Shoulders Display';
    --thm-primary: #E8B64A;
    --pad-x:100px;
}
body{
    overflow-x: hidden;
}
[type=button]:focus, [type=button]:hover, [type=submit]:focus, [type=submit]:hover, button:focus, button:hover {
    background: transparent;
}

/* ============ Header / Nav ============ */
header.main-header {
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 111;
}

.main-header__container {
    width: 100%;
    padding: 0px var(--pad-x);
    box-sizing: border-box;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
}
/* Desktop header layout — a real grid on the same 1244px track as the hero
   (.hero__inner): [ logo | menu ][ CTA ]. No absolute positioning.
   The logo holds the left on its own; the menu and the CTA read as one group
   on the right, so the free space collects in the middle rather than being
   split either side of a centred menu.
   Scoped to desktop so the hamburger-mode media queries below stay untouched. */
@media (min-width: 1200px) {
    .main-header__nav,
    .main-header__inner {
        display: block;
        width: 100%;
    }

    /* Pushed to the end of the middle track so it sits against the CTA — the
       24px grid gap is then the only thing between the two.

       Qualified with the container on purpose. The base .main-menu__list rule
       further down this file absolutely positions and centres the menu, and a
       media query carries no extra specificity — at (0,1,0) each, that later
       rule wins on source order and the menu never rejoins the grid. (0,2,0)
       here is what actually makes this stick. The offsets are cleared too:
       leaving a stale `left` behind lets the 1300/1340px blocks re-centre it
       the moment anything restores positioning. */
    .main-header__container .main-menu__list {
        position: static;
        top: auto;
        left: auto;
        transform: none;
        justify-self: end;
    }

    /* CTA becomes a normal grid item on the right */
    .main-header__container .main-header__cta {
        justify-self: end;
    }
}

/* ============ Menu ============ */
.main-menu__list {
    position: absolute;
    top: 50%;
    left: calc(50% + 17px);
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    list-style: none;
}

.main-menu__list > li {
        position: relative;
    padding: 12px 30px 12px 30px;
}

.main-menu__list > li:first-child {
    padding-left: 35px;
}

.main-menu__list > li > a {
    position: relative;
    display: inline-block;
    font-family: var(--thm-heading-font);
    
    font-weight: 600;
    font-size: 1.3vw;
    line-height: 26px;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    transition: color .3s ease;
}

/* caret on items that have a dropdown */
.main-menu__list > li.has-dropdown > a {
    padding-right: 15px;
}

.main-menu__list > li.has-dropdown > a::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -5px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg);
    transition: transform .3s ease;
}

.main-menu__list > li.has-dropdown:hover > a::after,
.main-menu__list > li.has-dropdown:focus-within > a::after {
    transform: rotate(225deg);
    margin-top: -1px;
}

/* slanted underline reveal (Insur style) */
.main-menu__list > li > a::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -12px;
    width: 21%;
    height: 0;
    border-bottom: 4px solid var(--insur-base);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    opacity: 0;
    transition: opacity .3s ease;
}

.main-menu__list > li > a:hover,
.main-menu__list > li:hover > a,
.main-menu__list > li:focus-within > a {
    color: var(--thm-primary);
}

.main-menu__list > li.current > a {
    color: var(--thm-primary);
}

/* ---------- Dropdown, level 1 ---------- */
.main-menu__list .dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 24px;                 /* aligns with the li text (li has 24px left padding) */
    min-width: 240px;
    list-style: none;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(16, 39, 89, 0.14);
    padding: 12px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
    z-index: 100;
}

.main-menu__list > li:first-child > .dropdown { left: 35px; }

/* invisible bridge so the pointer can travel from the item to the panel */
.main-menu__list .dropdown::before {
    content: "";
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
}

.main-menu__list > li:hover > .dropdown,
.main-menu__list > li:focus-within > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-menu__list .dropdown li {
    position: relative;
}

.main-menu__list .dropdown li + li {
    border-top: 1px solid rgba(16, 39, 89, 0.07);
}

.main-menu__list .dropdown li a {
    display: block;
    padding: 10px 24px;
    
    font-weight: 500;
    font-size: 15px;
    line-height: 24px;
    color: #102759;
    text-decoration: none;
    white-space: nowrap;
    transition: color .3s ease, background .3s ease, padding-left .3s ease;
}

.main-menu__list .dropdown li:hover > a,
.main-menu__list .dropdown li:focus-within > a {
    color: var(--thm-primary);
    background: rgba(16, 39, 89, 0.04);
    padding-left: 29px;
}

.main-menu__list .dropdown li.current > a {
    color: var(--thm-primary);
}

/* right chevron on nested parents */
.main-menu__list .dropdown li.has-dropdown > a {
    padding-right: 38px;
}

.main-menu__list .dropdown li.has-dropdown > a::after {
    content: "";
    position: absolute;
    right: 22px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(-45deg);
}

/* ---------- Dropdown, level 2+ (flyout) ---------- */
.main-menu__list .dropdown .dropdown {
    top: -12px;                 /* aligns first sub item with the parent item */
    left: 100%;
    transform: translateX(14px);
}

.main-menu__list .dropdown .dropdown::before {
    top: 0;
    bottom: 0;
    left: -14px;
    right: auto;
    width: 14px;
    height: auto;
}

.main-menu__list .dropdown li:hover > .dropdown,
.main-menu__list .dropdown li:focus-within > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* flip the flyout to the left when it would overflow the viewport */
.main-menu__list .dropdown li.flip > .dropdown {
    left: auto;
    right: 100%;
    transform: translateX(-14px);
}

.main-menu__list .dropdown li.flip > .dropdown::before {
    left: auto;
    right: -14px;
}

.main-menu__list .dropdown li.flip:hover > .dropdown,
.main-menu__list .dropdown li.flip:focus-within > .dropdown {
    transform: translateX(0);
}

/* ============ Right: phone ============ */
.main-menu__right {
    position: absolute;
    top: 18.5px;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.main-menu__contact {
    position: relative;
    min-height: 40px;
    padding: 8px 0 3.1px 51px;
    display: flex;
    flex-direction: column;
    gap: 5.9px;
}

.main-menu__contact-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: #102759;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-menu__contact-icon svg {
    fill: #ffffff;
}

.main-menu__contact-tagline {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 12px;
    line-height: 12px;
    color: var(--insur-gray);
    white-space: nowrap;
}

.main-menu__contact-number {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 19.8px;
    color: var(--insur-black);
    text-decoration: none;
    white-space: nowrap;
    transition: color .3s ease;
}

.main-menu__contact-number:hover {
    color: var(--insur-base);
}

/* ============ Right: Get a Quote CTA ============ */
.main-header__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 1.1vw 1.9vw;
    font-family: var(--thm-body-font);
    font-size: 1vw;
    line-height: 1;
    color: #1C3244;
    text-decoration: none;
    white-space: nowrap;
    background: var(--thm-primary);
    border: 0;
    cursor: pointer;
    transition: background .3s ease, transform .3s ease;
    border-radius: 8px;
}

.main-header__cta:hover,
.main-header__cta:focus-visible {
    background: #111827;
    color: #ffffff;
}

.main-header__cta-icon {
    flex: none;
    display: block;
    color: #ffffff;
    transition: transform .3s ease;
}

.main-header__cta:hover .main-header__cta-icon {
    transform: rotate(90deg) scale(1.08);
}

/* keep the desktop CTA out of the hamburger layout — the drawer carries its
   own copy (.mobile-nav__cta), which sits outside .main-header, so scope the
   hide to the header itself */
@media (max-width: 1199px) {
    .main-header .main-header__cta { display: none; }
}

/* The base sizing above is in vw, which collapses to a few pixels on a phone —
   the corner chamfers then swallow the button and the fixed-size icon dwarfs
   the label. Widgets reuse this class, so pin it to real sizes below desktop. */
@media (max-width: 1199px) {
    .main-header__cta {
        gap: 8px;
        padding: 18px 26px;
        font-size: 15px;
    }

    .main-header__cta-icon {
        width: 15px;
        height: 15px;
    }
}

@media (max-width: 767px) {
    .main-header__cta {
        padding: 18px 25px;
        font-size: 14px;
    }

    .main-header__cta-icon {
        width: 14px;
        height: 14px;
    }
}

/* ============ Hamburger (hidden on desktop) ============ */
.mobile-nav__toggler {
    width: 44px;
    height: 44px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.mobile-nav__toggler span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .3s ease, opacity .3s ease;
}

body.mobile-nav-open .mobile-nav__toggler span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.mobile-nav-open .mobile-nav__toggler span:nth-child(2) { opacity: 0; }
body.mobile-nav-open .mobile-nav__toggler span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Mobile drawer ============ */
.mobile-nav__overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 39, 89, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s ease, visibility .4s ease;
    z-index: 998;
}

.mobile-nav__panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 84vw;
    background: #34433C;
    transform: translateX(-100%);
    transition: transform .4s ease;
    z-index: 999;
    overflow-y: auto;
    padding: 28px 0;
}

body.mobile-nav-open .mobile-nav__overlay { opacity: 1; visibility: visible; }
body.mobile-nav-open .mobile-nav__panel  { transform: translateX(0); }

.mobile-nav__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    
}

.mobile-nav__brand {
    display: block;
    padding: 6px 24px 22px;
}

.mobile-nav__brand img {
    width: 190px;
    height: auto;
    display: block;
}

.mobile-nav__list {
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
}

.mobile-nav__list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav__item-row {
    display: flex;
    align-items: stretch;
}

.mobile-nav__list li a {
    display: block;
    flex: 1;
    padding: 13px 24px;
    
    font-weight: 500;
    font-size: 15px;
    line-height: 24px;
    color: #ffffff;
    text-decoration: none;
    transition: color .3s ease, background .3s ease;
}

.mobile-nav__list li a:hover,
.mobile-nav__list li.current > .mobile-nav__item-row > a {
    color: var(--thm-primary);
}

/* accordion toggle button */
.mobile-nav__sub-toggle {
    flex: none;
    width: 50px;
    background: rgba(255, 255, 255, 0.06);
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
}

.mobile-nav__sub-toggle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    margin: -6px 0 0 -4px;
    border-right: 1.6px solid #ffffff;
    border-bottom: 1.6px solid #ffffff;
    transform: rotate(45deg);
    transition: transform .3s ease, margin .3s ease;
}

li.sub-open > .mobile-nav__item-row > .mobile-nav__sub-toggle::after {
    transform: rotate(225deg);
    margin-top: -2px;
}

/* accordion submenus */
.mobile-nav__list .sub-menu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
    background: rgba(0, 0, 0, 0.18);
    border-top: 0;
}

li.sub-open > .sub-menu {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav__list .sub-menu li:last-child { border-bottom: 0; }

.mobile-nav__list .sub-menu a { padding-left: 40px; font-size: 14px; }
.mobile-nav__list .sub-menu .sub-menu { background: rgba(0, 0, 0, 0.22); }
.mobile-nav__list .sub-menu .sub-menu a { padding-left: 56px; }

/* CTA inside the drawer — the header one is hidden in hamburger mode.
   The base .main-header__cta sizing is in vw, which is far too small in a
   300px panel, so it is reset to fixed sizes here. */
.mobile-nav__cta {
    display: flex;
    justify-content: center;
    margin: 24px 24px 0;
    padding: 15px 22px;
    font-size: 15px;
    white-space: normal;
    text-align: center;
}

.mobile-nav__cta:hover,
.mobile-nav__cta:focus-visible {
    transform: none;
}

.mobile-nav__contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 0;
}

.mobile-nav__contact-icon {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav__contact-icon svg {
    width: 15px;
    height: 15px;
    fill: #ffffff;
}

.mobile-nav__contact-text span {
    display: block;
    font-size: 11px;
    line-height: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
}

.mobile-nav__contact-text a {
    font-size: 16px;
    line-height: 22px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 1420px) {
    .main-menu__list > li { padding-left: 18px; }
    .main-menu__list > li:first-child { padding-left: 18px; }
    .main-menu__list .dropdown { left: 18px; }
    .main-menu__list > li:first-child > .dropdown { left: 18px; }
    .main-menu__list .dropdown .dropdown { left: 100%; }
    .main-menu__list .dropdown li.flip > .dropdown { left: auto; }
}

@media (max-width: 1340px) {
    .main-menu__list { left: calc(50% + 40px); }
    .main-menu__list > li { padding-left: 14px; }
    .main-menu__list > li > a { font-size: 15px; }
    .main-menu__list .dropdown { left: 14px; }
    .main-menu__list > li:first-child > .dropdown { left: 14px; }
    .main-menu__list .dropdown .dropdown { left: 100%; }
    .main-menu__list .dropdown li.flip > .dropdown { left: auto; }
    .main-header__logo { transform: scale(.9); }
}

/* --- Narrow desktop: the right-pinned phone block converges on the navy
   shape's diagonal as the viewport shrinks. Narrow the shape and pull the
   menu left/tighter so the phone circle stays on the white area. --- */
@media (max-width: 1300px) {
    .main-header__shape { width: 80%; }
    .main-menu__list { left: calc(50% + 10px); }
    .main-menu__list > li { padding-left: 12px; }
    .main-menu__list > li > a { font-size: 14px; }
}

/* --- Tablet landscape and below: hamburger mode --- */
@media (max-width: 1199px) {
    .main-header { height: 100px; }
    .main-header__shape { display: none; }
    .main-header__inner::before { display: none; }
    /* menu and CTA are hidden here, so the grid drops to [ logo | hamburger ]
       and the toggler is pinned to the right edge. --pad-x is 100px, far too
       wide once the header is just a logo and a burger, so override it. */
    .main-header__container {
        grid-template-columns: auto 1fr;
        padding-left: 24px;
        padding-right: 24px;
    }

    .main-menu__list { display: none; }
    .mobile-nav__toggler { display: flex; justify-self: end; }

    /* scale() shrinks the logo but leaves its 280px box, so the empty part of
       that box reads as a gap — anchor the shrink to the left edge */
    .main-header__logo { transform: scale(.86); transform-origin: left center; }
    .main-header__logo-band { display: none; }

    .main-menu__right { right: 64px; }
    .main-menu__contact-icon { background: rgba(255, 255, 255, 0.1); }
    .main-menu__contact-tagline { color: rgba(255, 255, 255, 0.55); }
    .main-menu__contact-number { color: #ffffff; }
    .main-menu__contact-number:hover { color: var(--thm-primary); }
}

/* --- Tablet portrait --- */
@media (max-width: 767px) {
    .main-header { height: 88px; }
    .main-header__nav { height: 74px; }
    .main-header__container { padding-left: 16px; padding-right: 16px; }

    .main-menu__right { top: 50%; transform: translateY(-50%); right: 56px; }
    .main-menu__contact { padding: 0; min-height: 0; justify-content: center; }
    .main-menu__contact-tagline { display: none; }
    .main-menu__contact-number { display: none; }
    .main-menu__contact-icon { position: static; transform: none; }
}

/* --- Small phones --- */
@media (max-width: 420px) {
    .main-header { height: 80px; }
    .main-header__nav { height: 66px; }
    .main-header__logo {transform: inherit; }
    .main-menu__right { right: 48px; }
    .main-menu__contact-icon { width: 36px; height: 36px; }
    .main-header__container img{
        max-width: 215px;
    }
}
/*** 

====================================================================
      Mobile Menu
====================================================================