/* ==========================================================================
   TOWMCL - NAVBAR  v4  (floating pill bar, pill hovers, arrow indicators)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

:root {
    --nav-green:       #198754;
    --nav-green-dark:  #146c43;
    --nav-green-deep:  #0f5132;
    --nav-mint:        #e8f5ee;
    --nav-accent:      #f4c542;
    --nav-ink:         #1b2a22;
    --nav-ease:        cubic-bezier(.2, .7, .2, 1);
}

/* Poppins on the navbar text. NOTE: do not use ".nav *" here - it would override
   Font Awesome's own font on the <i> icons and show empty boxes instead of arrows. */
.nav { font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif; }
.nav a, .nav button, .nav span, .nav strong { font-family: inherit; }

/* make sure the icons always keep the Font Awesome font */
.nav i.fa-solid, .nav i.fas {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}
.nav i.fa-regular, .nav i.far {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
    font-weight: 400 !important;
}

/* outer wrapper: transparent, just gives the floating pill some breathing room */
.nav {
    position: relative;
    z-index: 1000;
    padding: 14px 16px;
    font-size: 14.5px;
    background:linear-gradient(100deg, var(--nav-green-deep) 0%, var(--nav-green-dark) 35%, var(--nav-green) 100%);
}

/* THE PILL */
.nav__inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 6px 10px 6px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
   /* background: linear-gradient(100deg, var(--nav-green-deep) 0%, var(--nav-green-dark) 35%, var(--nav-green) 100%);*/
    /*border-radius: 999px;
    box-shadow:
        0 10px 28px -6px rgba(15, 81, 50, .45),
        inset 0 1px 0 rgba(255, 255, 255, .18);*/
}
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a  { text-decoration: none; }
.nav a:focus-visible,
.nav button:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: 2px; }

/* ---------- Logo (pill inside the pill) ---------- */
.nav__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 5px 20px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .14);
    transition: transform .25s var(--nav-ease), box-shadow .25s;
}
.nav__logo:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0, 0, 0, .2); }
.nav__logo img { height: 42px; width: auto; display: block; }
.nav__logo strong { color: var(--nav-green); font-size: 20px; letter-spacing: .6px; }

/* ---------- Top-level menu ---------- */
.nav__menu { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav__item { position: relative; }

.nav__link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 17px;
    color: #fff;
    font-weight: 500;
    letter-spacing: .15px;
    white-space: nowrap;
    border-radius: 999px;
    transition: background .2s, color .2s, box-shadow .2s;
}
/* pill hover */
.nav__menu > .nav__item:hover > .nav__link,
.nav__menu > .nav__item.is-open > .nav__link {
    background: #144f21;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3);
}
.nav__menu > .nav__item.is-current > .nav__link { background: #fff; color: var(--nav-green); }

/* dropdown arrow (plain, no box) */
.nav__caret { font-size: 10px; opacity: .9; transition: transform .25s var(--nav-ease); }
.nav__menu > .nav__item.has-sub:hover > .nav__link .nav__caret,
.nav__item.is-open > .nav__link .nav__caret { transform: rotate(180deg); }

/* ---------- Dropdown card ---------- */
.nav__sub {
    position: absolute;
    top: calc(100% + 24px);
    left: 0;
    min-width: 290px;
    padding: 14px 10px 10px;
    background:
        linear-gradient(90deg, var(--nav-green), var(--nav-accent)) top / 100% 4px no-repeat,
        #fff;
    border: 1px solid rgba(25, 135, 84, .1);
    border-radius: 22px;
    box-shadow:
        0 2px 6px rgba(15, 81, 50, .08),
        0 30px 60px -12px rgba(15, 81, 50, .38);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(.97);
    transform-origin: top left;
    transition: opacity .22s, transform .3s var(--nav-ease), visibility .22s;
}
/* hover bridge across the gap between pill and card */
.nav__sub::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: -26px;
    height: 26px;
}
/* pointer notch aimed at the parent link */
.nav__sub--1::before {
    content: "";
    position: absolute;
    top: -8px; left: 34px;
    width: 14px; height: 14px;
    background: var(--nav-green);
    border-radius: 3px 0 0 0;
    transform: rotate(45deg);
}

.nav__item.has-sub:hover > .nav__sub,
.nav__item.has-sub.is-open > .nav__sub { opacity: 1; visibility: visible; transform: none; }

/* items glide in one after another */
.nav__sub > li { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .3s var(--nav-ease); }
.nav__item.has-sub:hover > .nav__sub > li,
.nav__item.has-sub.is-open > .nav__sub > li { opacity: 1; transform: none; }
.nav__sub > li:nth-child(1) { transition-delay: .03s; }
.nav__sub > li:nth-child(2) { transition-delay: .06s; }
.nav__sub > li:nth-child(3) { transition-delay: .09s; }
.nav__sub > li:nth-child(4) { transition-delay: .12s; }
.nav__sub > li:nth-child(5) { transition-delay: .15s; }
.nav__sub > li:nth-child(6) { transition-delay: .18s; }
.nav__sub > li:nth-child(7) { transition-delay: .21s; }
.nav__sub > li:nth-child(8) { transition-delay: .24s; }
.nav__sub li + li { margin-top: 2px; }

/* dropdown links: pill-shaped hover */
.nav__sub .nav__link {
    position: relative;
    justify-content: space-between;
    padding: 12px 18px 12px 22px;
    color: var(--nav-ink);
    font-size: 14px;
    font-weight: 500;
    white-space: normal;
    border-radius: 999px;
    box-shadow: none;
    transition: background .2s, color .2s, padding .28s var(--nav-ease);
}
/* green dot that grows on hover */
.nav__sub .nav__link::before {
    content: "";
    position: absolute;
    left: 10px; top: 50%;
    width: 6px; height: 6px;
    margin-top: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nav-green), var(--nav-accent));
    opacity: 0;
    transform: scale(.3);
    transition: opacity .2s, transform .25s var(--nav-ease);
}
.nav__sub .nav__item:hover > .nav__link,
.nav__sub .nav__item.is-open > .nav__link {
    background: linear-gradient(90deg, var(--nav-mint) 0%, #f6fcf9 100%);
    color: var(--nav-green-dark);
    padding-left: 28px;
}
.nav__sub .nav__item:hover > .nav__link::before,
.nav__sub .nav__item.is-open > .nav__link::before { opacity: 1; transform: none; }

/* arrow for every dropdown item: plain chevron, slides right on hover */
.nav__sub .nav__item:not(.has-sub) > .nav__link::after {
    content: "\f054";
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif;
    font-weight: 900;
    font-size: 10px;
    color: var(--nav-green);
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity .2s, transform .28s var(--nav-ease);
}
.nav__sub .nav__item:not(.has-sub):hover > .nav__link::after { opacity: 1; transform: none; }

/* arrow for items that open a flyout: plain right-pointing chevron (no box) */
.nav__sub .nav__caret {
    width: auto; height: auto;
    background: none;
    border-radius: 0;
    color: var(--nav-green);
    font-size: 11px;
    opacity: 1;
    transform: rotate(-90deg);
    transition: transform .25s var(--nav-ease), color .2s;
}
.nav__sub .nav__item:hover > .nav__link .nav__caret,
.nav__sub .nav__item.is-open > .nav__link .nav__caret { color: var(--nav-green-dark); transform: rotate(-90deg) translateY(3px); }

/* second-level flyout opens to the side */
.nav__sub--2 {
    top: -14px;
    left: calc(100% + 10px);
    min-width: 260px;
    transform: translateX(-12px) scale(.97);
    transform-origin: left top;
}
.nav__sub--2::after { left: -14px; right: auto; top: 0; bottom: 0; width: 14px; height: auto; }
.nav__item.has-sub:hover > .nav__sub--2,
.nav__item.has-sub.is-open > .nav__sub--2 { transform: none; }

/* ---------- Right-hand buttons ---------- */
.nav__buttons { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 999px;
    border: 2px solid var(--nav-accent);
    background: var(--nav-accent);
    color: var(--nav-green-deep);
    font-size: 13.5px;
    font-weight: 600;
    transition: background .2s, color .2s, border-color .2s, transform .2s var(--nav-ease), box-shadow .2s;
}
.nav__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, .22);
    background: #e35325 ;
    border-color: #fff;
    color: white;
}
.nav__btn--outline { background: transparent; border-color: rgba(255, 255, 255, .85); color: #fff; }
.nav__btn--outline:hover { background: #fff; border-color: #fff; color: var(--nav-green); }

.nav__item--buttons-mobile { display: none; }

/* ---------- Hamburger ---------- */
.nav__toggle {
    display: none;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .16);
    border: 0;
    border-radius: 50%;
    color: #fff;
    font-size: 19px;
    cursor: pointer;
    transition: background .2s;
}
.nav__toggle:hover { background: rgba(255, 255, 255, .28); }

/* ---------- Tablet landscape ---------- */
@media (min-width: 992px) and (max-width: 1199px) {
    .nav__menu { gap: 0; }
    .nav__link { padding: 9px 11px; font-size: 13.5px; }
    .nav__logo { padding: 5px 14px; }
    .nav__btn { padding: 8px 12px; font-size: 13px; }
    .nav__btn i { display: none; }
    .nav__menu > .nav__item:nth-child(n+3) .nav__sub--2 { left: auto; right: calc(100% + 10px); transform-origin: right top; }
    .nav__menu > .nav__item:nth-child(n+3) .nav__sub--2::after { left: auto; right: -14px; }
}

/* ---------- Mobile / tablet: pill + drawer ---------- */
@media (max-width: 991px) {
    .nav { padding: 10px 12px; }
    .nav__inner { flex-wrap: wrap; padding: 5px 6px 5px 6px; border-radius: 34px; }
    .nav__logo { padding: 4px 16px; }
    .nav__logo img { height: 34px; }
    .nav__toggle { display: inline-flex; margin-left: auto; }
    .nav__buttons { display: none; }

    .nav__menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        width: 100%;
        margin: 6px 0 2px;
        padding: 10px;
        max-height: 74vh;
        overflow-y: auto;
        background: var(--nav-green-deep);
        border-radius: 26px;
    }
    .nav__menu.is-open { display: flex; animation: nav-drop .25s var(--nav-ease); }

    .nav__link { justify-content: space-between; padding: 13px 18px; }
    .nav__menu > .nav__item:hover > .nav__link { background: transparent; box-shadow: none; }
    .nav__menu > .nav__item.is-open > .nav__link,
    .nav__menu > .nav__item > .nav__link:active { background: rgba(255, 255, 255, .14); box-shadow: none; }
    .nav__menu > .nav__item.has-sub:hover > .nav__link .nav__caret { transform: none; }
    .nav__item.is-open > .nav__link .nav__caret,
    .nav__menu > .nav__item.has-sub.is-open:hover > .nav__link .nav__caret { transform: rotate(180deg); }

    .nav__sub,
    .nav__sub--2 {
        position: static;
        display: none;
        min-width: 0;
        margin: 4px 0 6px 12px;
        padding: 4px;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(0, 0, 0, .18);
        border: 0;
        border-radius: 22px;
        box-shadow: none;
    }
    .nav__sub::before, .nav__sub::after { display: none; }
    .nav__sub > li { opacity: 1; transform: none; transition: none; }
    .nav__item.has-sub:hover > .nav__sub { display: none; }
    .nav__item.has-sub.is-open > .nav__sub { display: block; }

    .nav__sub .nav__link { color: #fff; padding: 11px 16px; font-size: 14px; }
    .nav__sub .nav__link::before,
    .nav__sub .nav__item:not(.has-sub) > .nav__link::after { display: none; }
    .nav__sub .nav__item:hover > .nav__link,
    .nav__sub .nav__item.is-open > .nav__link { background: rgba(255, 255, 255, .12); color: var(--nav-accent); padding-left: 16px; }
    .nav__sub .nav__caret { color: #fff; transform: none; }
    .nav__sub .nav__item:hover > .nav__link .nav__caret,
    .nav__sub .nav__item.is-open > .nav__link .nav__caret { color: var(--nav-accent); transform: rotate(180deg); }

    .nav__item--buttons-mobile { display: flex; gap: 10px; padding: 12px 6px 8px; }
    .nav__item--buttons-mobile .nav__btn { flex: 1; justify-content: center; }
}

@keyframes nav-drop {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .nav *, .nav *::before, .nav *::after { transition: none !important; animation: none !important; }
    .nav__sub > li { opacity: 1; transform: none; }
}