/* Dedicated mobile navigation — independent from desktop mega menu */

.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-nav {
    display: block;
    pointer-events: none;
  }

  .mobile-nav.is-open {
    pointer-events: auto;
  }

  .mobile-nav__backdrop {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .mobile-nav.is-open .mobile-nav__backdrop {
    opacity: 1;
    visibility: visible;
  }

  .mobile-nav__panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 5001;
    width: min(340px, 92vw);
    max-width: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  }

  .mobile-nav.is-open .mobile-nav__panel {
    transform: translateX(0);
  }

  .mobile-nav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
    padding-top: max(1rem, env(safe-area-inset-top));
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
  }

  .mobile-nav__brand {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    color: var(--color-text);
    font-weight: 800;
    font-size: 1.125rem;
  }

  .mobile-nav__logo {
    height: 34px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
  }

  .mobile-nav__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: #f3f4f6;
    border-radius: 10px;
    color: var(--color-text);
    cursor: pointer;
    flex-shrink: 0;
  }

  .mobile-nav__close:active {
    background: #e5e7eb;
  }

  .mobile-nav__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0.5rem 0;
  }

  .mobile-nav__menu {
    display: flex;
    flex-direction: column;
  }

  .mobile-nav__link {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none !important;
    border-bottom: 1px solid var(--color-border);
  }

  .mobile-nav__link.is-active,
  .mobile-nav__link:active {
    background: #f9fafb;
    color: var(--color-primary);
  }

  .mobile-nav__group {
    border-bottom: 1px solid var(--color-border);
  }

  .mobile-nav__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    list-style: none;
    user-select: none;
  }

  .mobile-nav__summary::-webkit-details-marker {
    display: none;
  }

  .mobile-nav__chevron {
    transition: transform 0.25s ease;
    flex-shrink: 0;
    opacity: 0.5;
  }

  .mobile-nav__group[open] .mobile-nav__chevron {
    transform: rotate(180deg);
  }

  .mobile-nav__sub {
    list-style: none;
    margin: 0;
    padding: 0 0 0.75rem;
    background: #f9fafb;
  }

  .mobile-nav__sub-link {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    text-decoration: none !important;
    color: var(--color-text);
    border-top: 1px solid #eef0f4;
  }

  .mobile-nav__sub-link strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
  }

  .mobile-nav__sub-link small {
    display: block;
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: 0.15rem;
    line-height: 1.35;
  }

  .mobile-nav__sub-icon {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 0.1rem;
  }

  .mobile-nav__sub-all {
    padding: 0.5rem 1.25rem 0.25rem;
  }

  .mobile-nav__sub-all a,
  .mobile-nav__sub-all-link {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none !important;
  }

  .mobile-nav__sub-section {
    background: #f9fafb;
    padding-bottom: 0.75rem;
  }

  .mobile-nav__sub-label {
    margin: 0;
    padding: 0.75rem 1.25rem 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
  }

  .mobile-nav__sub--compact a {
    display: block;
    padding: 0.55rem 1.25rem;
    font-size: 0.9375rem;
    color: var(--color-text);
    text-decoration: none !important;
    border-top: 1px solid #eef0f4;
  }

  .mobile-nav__sub-section .mobile-nav__sub-all-link {
    padding: 0.75rem 1.25rem 0.25rem;
  }

  .mobile-nav__foot {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--color-border);
    background: #fff;
  }

  .mobile-nav__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none !important;
    text-align: center;
  }

  .mobile-nav__btn--outline {
    border: 1.5px solid var(--color-border);
    color: var(--color-text);
    background: #fff;
  }

  .mobile-nav__btn--primary {
    background: #111827;
    color: #fff;
    border: 1.5px solid #111827;
  }

  /* Hide desktop nav on mobile */
  .site-nav {
    display: none !important;
  }

  .menu-btn {
    position: relative;
    z-index: 5002;
  }

  .menu-btn.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .menu-btn.is-active span:nth-child(2) {
    opacity: 0;
  }
  .menu-btn.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .menu-btn span {
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  body.mobile-nav-open {
    overflow: hidden;
    touch-action: none;
  }
}

@media (min-width: 769px) {
  .mobile-nav {
    display: none !important;
  }
}
