﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", sans-serif;
}

body {
    background: #ffffff;
}

/* NAVBAR */
.navbar {
    width: 80%;
    margin: 20px auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e6e6e6;
}

/* LOGO */
.logo img {
    transition: transform .4s ease;
}
.logo img:hover {
    transform: scale(1.1);
}

/* MENU */
.nav-menu {
    list-style: none;
    display: flex;
    gap: 18px;
}

.nav-menu a {
    text-decoration: none;
    color: #1f8b3a;
    font-weight: 600;
    padding: 8px;
}

/* DROPDOWN */
.has-dropdown {
    position: relative;
}

.has-dropdown > .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
    border-radius: 6px;
    list-style: none;
    z-index: 9999;
}

/* SHOW ON ACTIVE */
.has-dropdown.active > .dropdown {
    display: block;
}

/* SECOND LEVEL */
.dropdown .has-dropdown > .dropdown {
    top: 0;
    left: 100%;
}

/* DESKTOP HOVER */
@media (min-width: 993px) {
    .has-dropdown:hover > .dropdown {
        display: block;
    }
}

/* HAMBURGER */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}
.hamburger span {
    width: 26px;
    height: 3px;
    background: #1f8b3a;
    margin: 4px 0;
}

/* MOBILE */
@media (max-width: 992px) {

    .navbar {
        width: 100%;
        margin: 0;
        border-radius: 0;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 70px);
        background: #fff;
        flex-direction: column;
        padding: 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: right .3s ease;
        
    }

    .nav-menu.show {
        right: 0;
    }

    .has-dropdown > .dropdown {
        position: static;
        box-shadow: none;
        margin-left: 14px;
    }
}

/* BIG ARROW FOR TOP LEVEL DROPDOWN */
.has-dropdown > .menu-link::after {
    content: "▾";
    font-size: 1rem;              /* BIG ARROW */
    margin-left: 6px;
    transition: transform 0.3s ease;
    display: inline-block;
}

/* Rotate arrow when open */
.has-dropdown.active > .menu-link::after,
@media (min-width: 993px) {
    .has-dropdown:hover > .menu-link::after {
        transform: rotate(180deg);
    }
}
.has-dropdown > .dropdown {
    padding: 10px 0;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    animation: fadeSlide 0.25s ease;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* First-level dropdown links */
.dropdown > li > a {
    padding: 10px 18px;
    font-size: 14.5px;
    font-weight: 600;
    color: #1f8b3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* SMALL ARROW */
.dropdown > .has-dropdown > a::after {
    content: "›";
    font-size: 14px;
    color: #1f8b3a;
}

/* Hover effect */
.dropdown > li > a:hover {
    background: #f3fbf6;
    color: #146b2b;
}
/* Second-level dropdown container */
/* KEEP SECOND LEVEL OPEN WHILE HOVERING */
.has-dropdown:hover > .dropdown,
.has-dropdown > .dropdown:hover {
    display: block;
}
/* INVISIBLE HOVER BRIDGE TO PREVENT GAP */
.dropdown .has-dropdown::after {
    content: "";
    position: absolute;
    top: 0;
    right: -12px;      /* bridge width */
    width: 12px;
    height: 100%;
}
/* SMOOTH SECOND LEVEL APPEARANCE */
.has-dropdown > .dropdown {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.has-dropdown:hover > .dropdown,
.has-dropdown.active > .dropdown {
    opacity: 1;
    visibility: visible;
}

.dropdown .dropdown {
    padding: 6px 0;
}

/* Second-level list items */
.dropdown .dropdown li a {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #2c7a3f;
    position: relative;
}

/* CIRCLE BULLET */
.dropdown .dropdown li a::before {
    content: "●";
    font-size: 8px;
    color: #1f8b3a;
    margin-right: 10px;
    position: relative;
    top: -1px;
}

/* Hover */
.dropdown .dropdown li a:hover {
    background: #eef9f2;
}
/* Second level positioning spacing */
.dropdown .has-dropdown > .dropdown {
    left: calc(100% + 8px);
}
@media (max-width: 992px) {

    .dropdown > li > a {
        font-size: 15px;
    }

    .dropdown .dropdown li a {
        font-size: 14px;
    }

    .has-dropdown > .menu-link::after {
        font-size: 1.1rem;
    }
}
/* FORCE LEFT ALIGNMENT FOR SECOND-LEVEL DROPDOWN */
.dropdown .dropdown li a {
    justify-content: flex-start !important; /* stop center spacing */
    text-align: left !important;
}
/* ===== NAVBAR FIX ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 9999;          /* VERY IMPORTANT */
  background: #ffffff;
  width: 100%;
}

/* ===== MOBILE MENU ===== */
@media (max-width: 991px) {

  .nav-menu {
    position: fixed;      /* KEY FIX */
    top: 80px;            /* below navbar */
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: #ffffff;
    flex-direction: column;
    overflow-y: auto;     /* allow scroll */
    transition: 0.3s ease-in-out;
    z-index: 9998;        /* just below navbar */
    padding-bottom: 50px;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu li a {
    display: block;
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
  }

  /* Dropdowns */
  .nav-menu .dropdown {
    position: static;
    display: none;
    background: #f9f9f9;
  }

  .nav-menu li.active > .dropdown {
    display: block;
  }
}
