/* ============================================
   MWANGAZABIZ - MAIN STYLESHEET
   Primary: Green (#2e7d32)
   Secondary: Maroon (#8b1a1a)
   ============================================ */

/* ----- ROOT VARIABLES ----- */
:root {
  --primary-green: #2e7d32;
  --primary-green-dark: #1b5e20;
  --primary-maroon: #8b1a1a;
  --primary-maroon-light: #ef9a9a;
  --text-dark: #2c3e50;
  --text-light: #666666;
  --bg-light: #f8f9fa;
  --font-primary: 'Roboto', sans-serif;
  --font-secondary: 'Raleway', sans-serif;
  --font-tertiary: 'Nunito', sans-serif;
}

/* ----- GLOBAL RESET & BASE ----- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  background-color: #ffffff;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

a {
  text-decoration: none;
  color: var(--primary-green);
  transition: 0.3s;
}

a:hover {
  color: var(--primary-green-dark);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-secondary);
  font-weight: 700;
}

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ----- UTILITY CLASSES ----- */
.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
  max-width: 1200px;
}

.section {
  padding: 60px 0;
  scroll-margin-top: 80px;
}

.section-title {
  text-align: center;
  padding-bottom: 30px;
}

.section-title h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 20px;
  position: relative;
  color: var(--text-dark);
}

.section-title h2::after {
  content: '';
  position: absolute;
  display: block;
  width: 50px;
  height: 3px;
  background: var(--primary-green);
  bottom: 0;
  left: calc(50% - 25px);
}

.section-title p {
  margin-bottom: 0;
  color: var(--text-light);
  font-size: 1.1rem;
}

.light-background {
  background-color: var(--bg-light);
}

.dark-background {
  background-color: #1a1a2e;
}

/* ----- HEADER ----- */
.header {
  background: #ffffff;
  transition: all 0.5s;
  z-index: 997;
  padding: 15px 0;
  box-shadow: 0px 2px 15px rgba(0, 0, 0, 0.1);
}

.header.sticky-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

.header .logo img {
  max-height: 50px;
  width: auto;
}

/* ----- NAV MENU (desktop) ----- */
.navmenu {
  padding: 0;
}

.navmenu > ul {
  margin: 0;
  padding: 0;
  display: flex;
  list-style: none;
  align-items: center;
}

.navmenu li {
  position: relative;
}

.navmenu a,
.navmenu a:focus {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 10px 30px;
  font-family: var(--font-secondary);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  transition: 0.3s;
}

.navmenu a:hover,
.navmenu .active,
.navmenu .active:focus,
.navmenu li:hover > a {
  color: var(--primary-green);
}

/* Dropdown (desktop hover) */
.navmenu .dropdown > ul {
  display: block;
  position: absolute;
  visibility: hidden;
  opacity: 0;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25);
  transition: 0.3s;
  border-radius: 4px;
  padding: 10px 0;
  z-index: 99;
  min-width: 200px;
  list-style: none;
}

.navmenu .dropdown:hover > ul {
  opacity: 1;
  visibility: visible;
  top: 100%;
}

.navmenu .dropdown ul a {
  padding: 10px 20px;
  font-size: 14px;
  text-transform: none;
  font-weight: 500;
  color: var(--text-dark);
}

.navmenu .dropdown ul a:hover {
  color: var(--primary-green);
  background: #f1f1f1;
}

/* Chevron icon inside dropdown parent */
.navmenu .dropdown > a .toggle-dropdown {
  font-size: 0.85rem;
  margin-left: 6px;
  transition: transform 0.3s ease;
}

/* ============================================
   MOBILE NAV TOGGLE — Bootstrap Icon
   ============================================ */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--text-dark);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-nav-toggle:hover,
.mobile-nav-toggle:focus-visible {
  background: rgba(46, 125, 50, 0.08);
  color: var(--primary-green);
  outline: none;
}

.mobile-nav-toggle:active {
  background: rgba(46, 125, 50, 0.15);
}

/* Both icons stacked, but only one visible at a time */
.mobile-nav-toggle .nav-icon-open,
.mobile-nav-toggle .nav-icon-close {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem;
  line-height: 1;
  transition: opacity 0.2s ease, transform 0.25s ease;
  color: currentColor;
  pointer-events: none;
}

/* Default: bars visible, X hidden */
.mobile-nav-toggle .nav-icon-open {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.mobile-nav-toggle .nav-icon-close {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-90deg) scale(0.6);
}

/* Open state: bars hidden, X visible */
.mobile-nav-toggle.open {
  color: var(--primary-green);
}

.mobile-nav-toggle.open .nav-icon-open {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg) scale(0.6);
}

.mobile-nav-toggle.open .nav-icon-close {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

/* ----- HEADER SOCIAL LINKS ----- */
.header-social-links a {
  color: var(--text-dark);
  font-size: 1.2rem;
  margin-left: 15px;
  transition: color 0.3s;
  display: inline-block;
}

.header-social-links a:hover {
  color: var(--primary-green);
}

/* ----- FOOTER ----- */
.footer {
  color: #ffffff;
  background-color: #1a1a2e;
  padding: 60px 0 30px 0;
  font-size: 14px;
  position: relative;
}

.footer .footer-top {
  padding-bottom: 30px;
}

.footer .footer-about .logo img {
  max-height: 50px;
  margin-bottom: 15px;
  background: white;
  padding: 5px;
  border-radius: 5px;
}

.footer .footer-contact p {
  margin-bottom: 10px;
  color: #e0e0e0;
}

.footer .footer-contact strong {
  color: var(--primary-green);
  margin-right: 5px;
}

.footer h4 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.footer h4::after {
  content: '';
  position: absolute;
  display: block;
  width: 20px;
  height: 2px;
  background: var(--primary-green);
  bottom: 0;
  left: 0;
}

.footer .footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer .footer-links ul li {
  padding: 8px 0;
  display: flex;
  align-items: center;
}

.footer .footer-links ul li a {
  color: #e0e0e0;
  transition: 0.3s;
  display: inline-block;
  line-height: 1;
}

.footer .footer-links ul li a:hover {
  color: var(--primary-green);
}

/* Newsletter form */
.footer .newsletter-form {
  margin-top: 15px;
}

.footer .newsletter-form input[type="email"] {
  border: 1px solid #444;
  background: #2c2c2c;
  color: #fff;
  padding: 10px;
  border-radius: 4px 0 0 4px;
  flex: 1;
  outline: none;
}

.footer .newsletter-form input[type="email"]::placeholder {
  color: #999;
}

.footer .newsletter-form input[type="submit"] {
  background: var(--primary-green);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: 0.3s;
  font-weight: 600;
}

.footer .newsletter-form input[type="submit"]:hover {
  background: var(--primary-green-dark);
}

.footer .trust-badges .badge {
  display: inline-block;
  background: rgba(46, 125, 50, 0.2);
  color: #a5d6a7;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  margin-right: 5px;
  margin-bottom: 5px;
}

.footer .social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-right: 10px;
  color: #ffffff;
  transition: 0.3s;
  font-size: 16px;
}

.footer .social-links a:hover {
  background: var(--primary-green);
  border-color: var(--primary-green);
}

.footer .copyright {
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  font-size: 13px;
}

.footer .copyright strong {
  color: var(--primary-green);
}

/* ----- SCROLL TOP BUTTON ----- */
.scroll-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 15px;
  bottom: 15px;
  z-index: 996;
  background: var(--primary-green);
  width: 40px;
  height: 40px;
  border-radius: 4px;
  transition: all 0.4s;
}

.scroll-top i {
  font-size: 24px;
  color: #ffffff;
  line-height: 0;
}

.scroll-top:hover {
  background: var(--primary-green-dark);
  color: #ffffff;
}

.scroll-top.active {
  visibility: visible;
  opacity: 1;
}

/* ----- PRELOADER ----- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  background: #ffffff;
}

#preloader:before {
  content: "";
  position: fixed;
  top: calc(50% - 30px);
  left: calc(50% - 30px);
  border: 6px solid var(--primary-green);
  border-top-color: transparent;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: animate-preloader 1s linear infinite;
}

@keyframes animate-preloader {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE — MOBILE NAV (max-width: 991px)
   ============================================ */
@media (max-width: 991px) {

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Hide desktop menu by default */
  .navmenu > ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
    border-radius: 0 0 12px 12px;
    z-index: 999;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: slideDownMenu 0.25s ease forwards;
  }

  @keyframes slideDownMenu {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .navmenu > ul.active {
    display: flex;
  }

  .navmenu li {
    width: 100%;
    position: relative;
  }

  .navmenu > ul > li > a {
    padding: 14px 22px;
    justify-content: flex-start;
    border-bottom: 1px solid #f0f0f0;
  }

  .navmenu > ul > li:last-child > a {
    border-bottom: none;
  }

  .navmenu .dropdown > ul {
    position: static !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: none;
    box-shadow: none !important;
    background: #f8f9fa;
    border-radius: 0;
    margin: 0;
    padding: 0;
    min-width: 100%;
    top: auto;
    transform: none !important;
  }

  .navmenu .dropdown.active > ul {
    display: block;
  }

  .navmenu .dropdown ul a {
    padding: 12px 22px 12px 44px;
    font-size: 0.92rem;
    border-bottom: 1px solid #eaeaea;
  }

  .navmenu .dropdown ul li:last-child a {
    border-bottom: none;
  }

  .navmenu .dropdown.active > a .toggle-dropdown {
    transform: rotate(180deg);
  }

  .header-social-links {
    display: none;
  }

  body.menu-open {
    overflow: hidden;
  }
}

/* ============================================
   RESPONSIVE — DESKTOP NAV (min-width: 992px)
   ============================================ */
@media (min-width: 992px) {
  .mobile-nav-toggle {
    display: none !important;
  }

  .navmenu .dropdown > ul {
    visibility: hidden;
    opacity: 0;
    display: block;
  }

  .navmenu .dropdown:hover > ul {
    visibility: visible;
    opacity: 1;
  }
}

/* ============================================
   RESPONSIVE — GENERAL SPACING (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
  .section {
    padding: 40px 0;
  }

  .section-title h2 {
    font-size: 26px;
  }

  .footer {
    padding: 40px 0 20px 0;
  }

  .footer .footer-top {
    padding-bottom: 20px;
  }
}

/* ============================================
   RESPONSIVE — NARROW DESKTOP (max-width: 1200px)
   ============================================ */
@media (max-width: 1200px) {
  .navmenu a {
    padding: 10px 0 10px 20px;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}