/**
 * Mobile Menu - SIMPLE DISPLAY TOGGLE
 * No animations, just show/hide
 */

/* Hamburger button */
.mobile-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  flex-shrink: 0;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: #1a1a1a;
  transition: all 0.3s ease;
}

/* X animation */
.mobile-menu-btn.open span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.open span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.open span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* MOBILE ONLY */
@media (max-width: 1023px) {
  /* Hide header search on mobile - only show logo and hamburger */
  header .hidden.md\:flex,
  header input[type="search"],
  header .block-search {
    display: none !important;
  }

  /* Larger logo on mobile */
  header a[href="/"] img {
    height: 2.5rem !important;
    width: auto !important;
    max-width: 200px !important;
  }

  /* Hide nav by default */
  header nav,
  nav.flex.items-center.space-x-1 {
    display: none !important;
  }

  /* Show as overlay when open - SIMPLE */
  header nav.mobile-open,
  nav.flex.mobile-open,
  nav.flex.items-center.mobile-open {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 100000 !important;
    overflow-y: auto !important;
    padding: 5rem 1rem 2rem !important;
  }

  /* Close button - only visible in mobile menu */
  .mobile-menu-close {
    display: none;
  }

  nav.mobile-open .mobile-menu-close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    width: 44px !important;
    height: 44px !important;
    background: white !important;
    border: none !important;
    border-radius: 0.5rem !important;
    cursor: pointer !important;
    color: #1a1a1a !important;
    z-index: 10 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  }

  nav.mobile-open .mobile-menu-close:hover {
    background: #f3f4f6 !important;
  }

  /* Mobile menu search box - only visible in mobile menu */
  .mobile-menu-search {
    display: none;
  }

  nav.mobile-open .mobile-menu-search {
    display: block !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    background: white !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  }

  .mobile-search-form {
    display: flex !important;
    gap: 0.5rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .mobile-search-input {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 0.75rem 1rem !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.375rem !important;
    font-size: 1rem !important;
    box-sizing: border-box !important;
  }

  .mobile-search-btn {
    flex-shrink: 0 !important;
    padding: 0.75rem 1rem !important;
    background: #1a1a1a !important;
    color: white !important;
    border: none !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
  }

  /* Stack menu items vertically */
  nav.mobile-open > ul,
  nav.mobile-open ul.flex,
  nav.mobile-open ul.flex.items-center {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
    border-radius: 0.5rem !important;
  }

  nav.mobile-open ul li {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  nav.mobile-open ul li a {
    display: block !important;
    width: 100% !important;
    padding: 1.25rem 1.5rem !important;
    font-size: 1.125rem !important;
    color: #1a1a1a !important;
    border-bottom: 1px solid #e5e7eb !important;
    background: white !important;
  }

  nav.mobile-open ul li:last-child > a {
    border-bottom: none !important;
  }

  nav.mobile-open ul li a:hover {
    background: #f3f4f6 !important;
  }

  /* Submenus - hidden by default, shown when parent has .submenu-open class */
  nav.mobile-open ul ul {
    display: none !important;
    position: static !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-shadow: none !important;
    background: #f3f4f6 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  nav.mobile-open ul li.submenu-open > ul {
    display: block !important;
  }

  nav.mobile-open ul ul li a {
    padding-left: 2.5rem !important;
    font-size: 1rem !important;
    border-bottom: 1px solid #e5e7eb !important;
  }

  /* 3rd level menus */
  nav.mobile-open ul ul ul {
    background: #e5e7eb !important;
  }

  nav.mobile-open ul ul ul li a {
    padding-left: 4rem !important;
    font-size: 0.9375rem !important;
  }

  /* Toggle button for items with submenus */
  nav.mobile-open ul li:has(> ul) {
    position: relative !important;
  }

  nav.mobile-open ul li:has(> ul) > a {
    padding-right: 3.5rem !important;
  }

  /* Submenu toggle indicator */
  .submenu-toggle {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    width: 50px !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: none !important;
    border: none !important;
    border-left: 1px solid #e5e7eb !important;
    cursor: pointer !important;
    font-size: 1.25rem !important;
    color: #666 !important;
    transition: background 0.2s ease, transform 0.2s ease !important;
  }

  .submenu-toggle:hover {
    background: #f3f4f6 !important;
  }

  .submenu-toggle::after {
    content: '+' !important;
    font-weight: 300 !important;
    font-size: 1.5rem !important;
  }

  li.submenu-open > .submenu-toggle::after {
    content: '−' !important;
  }

  /* No overlay - removed per user request */
  body.mobile-menu-active {
    overflow: hidden;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .mobile-menu-btn {
    display: none !important;
  }

  /* Hide mobile-only elements on desktop */
  .mobile-menu-close,
  .mobile-menu-search {
    display: none !important;
  }
}
