/* ============================================================
   MOBILE MENU & SUBMENU FIX — Tara theme
   ============================================================ */

/* Hamburger button (hidden on desktop) */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 10px;
  width: 44px;
  height: 44px;
  position: relative;
  z-index: 1001;
}
.mobile-menu-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: #0f3b2c;
  margin: 5px auto;
  border-radius: 2px;
  transition: all 0.3s ease;
}
.mobile-menu-toggle.is-open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.mobile-menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Overlay behind the slide-in menu */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}
.mobile-menu-overlay.is-active {
  display: block;
}

/* ---------- MOBILE (≤ 991px) ---------- */
@media (max-width: 991px) {

  .mobile-menu-toggle {
    display: block;
    position: absolute;
    top: 12px;
    right: 16px;
  }

  /* Slide-in panel — .mobile-menu-target is auto-added by JS */
  .mobile-menu-target {
    position: fixed !important;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 999;
    padding: 70px 0 30px;
    margin: 0 !important;
  }
  .mobile-menu-target.is-open {
    right: 0;
  }

  /* Reset list styles */
  .mobile-menu-target ul.menu {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  .mobile-menu-target ul.menu li {
    display: block;
    width: 100%;
    position: relative;
    border-bottom: 1px solid #e5e7eb;
  }
  .mobile-menu-target ul.menu li > a {
    display: block;
    padding: 14px 20px;
    color: #0f3b2c;
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
  }
  .mobile-menu-target ul.menu li > a:hover {
    background: #f3f4f6;
  }

  /* Submenu: hidden until parent is tapped */
  .mobile-menu-target ul.menu li > ul {
    display: none !important;
    background: #f9fafb;
    padding: 0;
    margin: 0;
    position: static !important;
    width: 100% !important;
    box-shadow: none !important;
    border-left: 3px solid #d97706;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
  .mobile-menu-target ul.menu li.submenu-open > ul {
    display: block !important;
  }

  /* Nested link styling */
  .mobile-menu-target ul.menu li ul li > a {
    padding: 12px 20px 12px 34px;
    font-weight: 500;
    font-size: 14px;
    color: #4b5563;
  }

  /* Caret indicator on parents */
  .mobile-menu-target ul.menu li.has-children > a::after {
    content: "\f107";
    font-family: "Font Awesome 6 Free", "FontAwesome", sans-serif;
    font-weight: 900;
    float: right;
    transition: transform 0.3s ease;
    font-size: 12px;
  }
  .mobile-menu-target ul.menu li.submenu-open > a::after {
    transform: rotate(180deg);
  }

  /* Lock body scroll when open */
  body.mobile-menu-open {
    overflow: hidden;
  }
}

/* ---------- DESKTOP: kill mobile UI ---------- */
@media (min-width: 992px) {
  .mobile-menu-toggle,
  .mobile-menu-overlay {
    display: none !important;
  }
}