/**
 * MBA Trading - Responsive & Mobile Drawer Navigation
 */

@media (max-width: 1024px) {
  .division-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .commodity-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 20px;
  }
  .stat-item:nth-child(2) {
    border-right: none;
    border-left: none;
  }
}

@media (max-width: 860px) {
  .mobile-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    align-items: flex-start;
    padding: 70px 25px 30px;
    gap: 15px;
    transition: right 0.35s ease;
    z-index: 1001;
    overflow-y: auto;
  }

  body[dir="rtl"] .nav-menu {
    right: auto;
    left: -320px;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    transition: left 0.35s ease;
  }

  .nav-menu.open {
    right: 0;
  }

  body[dir="rtl"] .nav-menu.open {
    left: 0;
  }

  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding-left: 15px;
    border-top: none;
    border-left: 2px solid var(--primary-light);
    display: none;
  }

  body[dir="rtl"] .nav-dropdown {
    padding-left: 0;
    padding-right: 15px;
    border-left: none;
    border-right: 2px solid var(--primary-light);
  }

  .nav-item.dropdown-open .nav-dropdown {
    display: block;
  }

  .hero-title {
    font-size: 34px;
  }

  .cta-wrap {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .top-bar-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .division-grid,
  .commodity-grid,
  .features-grid,
  .stats-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .stat-item {
    border: none !important;
  }
  .hero-title {
    font-size: 28px;
  }
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Mobile backdrop overlay */
.menu-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.menu-backdrop.active {
  display: block;
}

.mobile-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--primary);
}

body[dir="rtl"] .mobile-close {
  right: auto;
  left: 20px;
}
