/* ==============================
   GENERAL NAVBAR LAYOUT
   ============================== */
.menu-wrapper {
  display: flex;
  flex-wrap: wrap; /* allows rotating text + stats to go to next line */
  align-items: center;
  justify-content: space-between; /* logo left, burger right */

  /* NEW: prevent big vertical gap when wrapping */
  align-content: flex-start; /* IMPORTANT */
  row-gap: 0;                /* IMPORTANT */

  background: #fff;
  padding: 0.35em 1em;
  position: relative;
  z-index: 1000;
  border-bottom: 1px solid #ddd;

  /* safety: never force extra height */
  height: auto;
  min-height: 0;
}

/* LOGO (left side) */
.logo img {
  max-height: 100px;
  max-width: 300px;
  width: auto;
  height: auto;
  display: block;
}

/* Optional: slightly smaller logo on small screens so it doesn't crowd burger */
@media (max-width: 600px) {
  .logo img {
    max-height: 70px;
    max-width: 220px;
  }
}

/* BURGER ICON (right side) */
.menu-toggle {
  font-size: 1.8em;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  order: 2;
  z-index: 1100;
}

/* MAIN MENU (HIDDEN BY DEFAULT) */
.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  right: 0;
  width: 250px;
  text-align: left;
  background: #fff;
}

/* SHOW MENU ON TOGGLE */
.menu.show {
  display: flex;
}

/* MENU LINKS */
.menu li a {
  display: block;
  padding: 0.8em 1em;
  text-decoration: none;
  color: #222;
  transition: background 0.3s ease;
}

.menu li a:hover {
  background: #f0f0f0;
}

/* SUBMENU */
.submenu {
  list-style: none;
  padding: 0;
  display: none;
}
.has-submenu.open > .submenu {
  display: block;
}

/* REMOVE DEFAULT ARROW */
.has-submenu > a::after {
  content: "";
}

/* ==============================
   ROTATING TEXT + STATS WRAPPER
   ============================== */
.hero-rotating {
  width: 100%;
  order: 3;
  margin-top: -3em; /* CHANGED: was 0.5em (this reduces top gap) */
}

/* ==============================
   ROTATING TEXT (Centered)
   ============================== */
.rotating-text {
  position: relative;
  display: block;
  width: 100%;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;

  margin-top: 0.2em; /* CHANGED: was 0.5em (reduces gap above text) */

  color: #302301;
  font-family: 'Roboto', sans-serif;
  animation: fadeIn 0.6s ease;
}

/* Simple fade animation for word changes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==============================
   STATS BAR
   ============================== */
.hero-stats {
  margin-top: 8px;     /* CHANGED: was 14px */
  padding-top: 8px;    /* CHANGED: was 14px */
  border-top: 1px solid rgba(0,0,0,0.12);

  display: flex;
  gap: 56px;
  align-items: flex-start;
  justify-content: center;
}

.hero-stat {
  min-width: 140px;
  text-align: center;
}

.hero-stat__value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: #0fa37a;
}

.hero-stat__label {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(0,0,0,0.55);
}

/* ==============================
   MOBILE OPTION 2
   - Adds extra space above rotating block (text + stats)
   ============================== */
@media (max-width: 700px) {

  /* MORE GAP above rotating section */
  .hero-rotating{
    margin-top: -1em !important; /* increase to 1.4em / 1.8em if needed */
  }

  /* ✅ FALLBACK mobile layout (works even if JS fails and is-rotating is missing) */
  .hero-stats{
    flex-wrap: wrap;
    gap: 12px;
    padding-left: 10px;
    padding-right: 10px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .hero-stat{
    min-width: 0;
    flex: 1 1 30%;
  }

  .hero-stat__value{ font-size: 24px; }
  .hero-stat__label{ font-size: 10px; }

  /* ✅ ROTATING MODE (when JS adds .is-rotating) */
  .hero-stats.is-rotating{
    flex-wrap: nowrap;
    position: relative;
    height: 64px;
    gap: 0;
    overflow: hidden;
  }

  .hero-stats.is-rotating .hero-stat{
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    flex: 0 0 100%;
    text-align: center;

    opacity: 0;
    transform: translateY(6px);
    transition: opacity 350ms ease, transform 350ms ease;
    pointer-events: none;
  }

  .hero-stats.is-rotating .hero-stat.is-active{
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==============================
   Larger text on desktop
   ============================== */
@media (min-width: 901px) {
  .rotating-text {
    font-size: 2rem;
    margin-top: 0.25em; /* CHANGED: reduce extra gap */
  }

  .menu {
    position: absolute;
    right: 0;
    display: none;
    flex-direction: column;
    width: 250px;
  }
}
