*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root{
    --primary: #c43d3d;
    --primary-dark: #a83232;
    --primary-tint: #fbeaea;
    --primary-btn: #c43d3d;
    --bg-mild-white: #fbfaf8;
    --black-color: #000;
    --white: #ffffff;
    --border-color: #ececec;
}

html{
    scroll-behavior: smooth;
}

/* =========================================
   HEADER
========================================= */
.cw_header{
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--bg-mild-white);
    font-family: var(--heading), sans-serif;
}

/* ---- Top bar ---- */
.cw_topbar{
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    padding: 0 5%;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    transition: max-height .35s ease, opacity .3s ease, padding .3s ease;
    overflow: hidden;
}

.cw_topbar-left{
    display: flex;
    align-items: center;
    gap: 28px;
}

.cw_topbar-left a{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--black-color);
    font-weight: 500;
    letter-spacing: .2px;
    transition: color .25s ease;
}

.cw_topbar-left a:hover{
    color: var(--primary);
}

.cw_topbar-left svg{
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: var(--primary);
}

.cw_topbar-right{
    display: flex;
    align-items: center;
    gap: 10px;
}

.cw_topbar-right a{
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    transition: all .25s ease;
}

.cw_topbar-right a img{
    width: 18px;
    height: 18px;
}

.cw_topbar-right a:hover{
    background: var(--primary);
    border-color: var(--primary);
}

.cw_topbar-right a:hover img{
    filter: brightness(0) invert(1);
}

/* ---- Accent line ---- */
.cw_accent-line{
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 60%, var(--primary) 100%);
}

/* ---- Main bar ---- */
.cw_mainbar{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 84px;
    padding: 0 5%;
    transition: height .3s ease;
}

.cw_logo{
    flex-shrink: 0;
}

.cw_logo img{
    height: 34px;
    width: auto;
}

/* ---- Nav ---- */
.cw_nav{
    flex: 1;
    display: flex;
    justify-content: center;
}

.cw_nav > ul{
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin-bottom: 0;
}

.cw_nav > ul > li{
    position: relative;
}

.cw_nav > ul > li > a{
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 30px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--black-color);
    position: relative;
    white-space: nowrap;
    transition: color .25s ease;
}

.cw_nav > ul > li > a::after{
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 24px;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s ease;
}

.cw_nav > ul > li > a:hover,
.cw_nav > ul > li > a.active{
    color: var(--primary);
}

.cw_nav > ul > li > a:hover::after,
.cw_nav > ul > li > a.active::after{
    transform: scaleX(1);
}

.cw_nav .cw_chevron{
    width: 9px;
    height: 9px;
    stroke: currentColor;
    transition: transform .3s ease;
}

.cw_nav li.has-mega:hover .cw_chevron{
    transform: rotate(180deg);
}

/* ---- CTA button ---- */
.cw_btn{
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    background: var(--primary);
    color: var(--white) !important;
    font-size: 14.5px;
    font-weight: 600;
    border-radius: 6px;
    letter-spacing: .2px;
    box-shadow: 0 6px 16px rgba(196, 61, 61, .28);
    transition: all .25s ease;
}

.cw_btn:hover{
    background: var(--primary-dark);
    box-shadow: 0 8px 20px rgba(196, 61, 61, .38);
    transform: translateY(-1px);
}

/* ---- Burger (mobile) ---- */
.cw_burger{
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.cw_burger span{
    display: block;
    height: 2px;
    width: 100%;
    background: var(--black-color);
    border-radius: 2px;
    transition: all .3s ease;
}

.cw_burger.active span:nth-child(1){
    transform: translateY(7px) rotate(45deg);
}
.cw_burger.active span:nth-child(2){
    opacity: 0;
}
.cw_burger.active span:nth-child(3){
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================================
   MEGA MENU
========================================= */
.cw_mega{
    position: absolute;
    top: calc(100% - 4px);
    left: 50%;
    transform: translate(-50%, 12px);
    width: min(880px, 90vw);
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 22px 45px rgba(16,16,16,.14);
    border: 1px solid var(--border-color);
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 28px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .28s ease, transform .28s ease, visibility .28s ease;
    z-index: 10;
}

li.has-mega:hover .cw_mega,
li.has-mega.mega-open .cw_mega{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.cw_mega-label{
    grid-column: 1 / -1;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--primary);
    padding-bottom: 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.cw_mega-grid{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 20px;
    align-content: start;
}

.cw_mega-grid-3{
    grid-template-columns: repeat(3, 1fr);
}

.cw_mega-grid a{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--black-color);
    transition: all .2s ease;
}

.cw_mega-grid a svg{
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: var(--primary);
    opacity: .85;
}

.cw_mega-grid a:hover{
    background: var(--primary-tint);
    color: var(--primary);
    transform: translateX(3px);
}

.cw_mega-promo{
    background: linear-gradient(155deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    padding: 24px 20px;
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
}

.cw_mega-promo h4{
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--white) !important;
}

.cw_mega-promo p{
    font-size: 13px;
    color: rgba(255,255,255,.85);
    line-height: 1.5;
}

.cw_mega-promo a{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    color: var(--primary) !important;
    font-size: 13.5px;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 6px;
    width: fit-content;
    transition: all .2s ease;
}

.cw_mega-promo a:hover{
    background: var(--black-color);
    color: var(--white) !important;
}

/* =========================================
   SCROLLED STATE
========================================= */
.cw_header.scrolled .cw_topbar{
    max-height: 0;
    opacity: 0;
    border-bottom: none;
}

.cw_header.scrolled .cw_mainbar{
    height: 68px;
}

.cw_header.scrolled{
    box-shadow: 0 6px 24px rgba(16,16,16,.08);
}

/* =========================================
   RESPONSIVE
   NOTE: the hamburger / drawer breakpoint is intentionally set
   higher than the usual 991px so that landscape tablets and
   small laptops (992px-1200px) -- which don't have room for the
   full horizontal nav AND don't support :hover -- also get the
   tap-friendly drawer menu instead of a squeezed/broken bar.
========================================= */
@media (max-width: 1200px){
    .cw_topbar-left{
        gap: 16px;
    }

    .cw_topbar-left a span{
        display: none;
    }

    .cw_burger{
        display: flex;
    }

    .cw_nav{
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: min(340px, 85vw);
        background: var(--white);
        box-shadow: -12px 0 40px rgba(0,0,0,.12);
        flex-direction: column;
        justify-content: flex-start;
        padding: 90px 26px 26px;
        overflow-y: auto;
        transition: right .35s ease;
        z-index: 1000;
    }

    .cw_nav.active{
        right: 0;
    }

    .cw_nav > ul{
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
        padding-left: 0;
    }

    .cw_nav > ul > li{
        border-bottom: 1px solid var(--border-color);
    }

    .cw_nav > ul > li > a{
        padding: 16px 4px;
        justify-content: space-between;
        width: 100%;
    }

    .cw_nav > ul > li > a::after{
        display: none;
    }

    .cw_mega{
        position: static;
        transform: none;
        width: 100%;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0 0 16px 0;
        display: none;
        grid-template-columns: 1fr;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    li.has-mega.mega-open .cw_mega{
        display: grid;
    }

    /* The desktop open-state rule (line ~312-317) sets
       transform: translate(-50%, 0) and beats the plain ".cw_mega"
       reset above on specificity alone, so on mobile the panel was
       still getting yanked sideways by 50% of its own width the
       moment the accordion opened -- that's what was clipping/
       cutting off the loan list text. Neutralise it here with a
       selector of matching specificity. */
    li.has-mega:hover .cw_mega,
    li.has-mega.mega-open .cw_mega{
        transform: none;
    }

    li.has-mega.mega-open .cw_chevron{
        transform: rotate(180deg);
    }

    .cw_mega-grid{
        grid-template-columns: 1fr;
    }

    .cw_mega-grid a{
        min-width: 0;
    }

    .cw_nav{
        overflow-x: hidden;
    }

    .cw_mega-promo{
        display: none;
    }

    .cw_overlay{
        position: fixed;
        inset: 0;
        background: rgba(16,16,16,.4);
        opacity: 0;
        visibility: hidden;
        transition: all .3s ease;
        z-index: 998;
    }

    .cw_overlay.active{
        opacity: 1;
        visibility: visible;
    }

    .cw_btn{
        padding: 10px 18px;
        font-size: 13.5px;
    }
}

@media (max-width: 575px){
    .cw_topbar{
        padding: 0 4%;
    }
    .cw_topbar-left{
        gap: 12px;
    }
    .cw_mainbar{
        padding: 0 4%;
        gap: 12px;
    }
    .cw_logo img{
        height: 28px;
    }
    .cw_btn{
        padding: 9px 14px;
        font-size: 12.5px;
        white-space: nowrap;
    }
}

/* Extra-small phones: tighten further, but keep the CTA text visible
   (hiding it entirely used to leave a blank button) */
@media (max-width: 400px){
    .cw_topbar-right{
        gap: 6px;
    }
    .cw_topbar-right a{
        width: 24px;
        height: 24px;
    }
    .cw_mainbar{
        gap: 8px;
    }
    .cw_btn{
        padding: 8px 10px;
        font-size: 11.5px;
    }
    .cw_burger{
        width: 26px;
    }
}