/* ========================================================
   SWIFT EXPRESS LOGISTICS - COMPREHENSIVE RESPONSIVE DESIGN
   Mobile-first & Multi-breakpoint Mobile Responsive System
   ======================================================== */

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
}

/* Touch-friendly input controls */
button, input, select, textarea, a {
  touch-action: manipulation;
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.custom-table {
  min-width: 650px;
}

/* ========================================================
   BREAKPOINT: 1200px (Desktop / Laptop)
   ======================================================== */
@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================================
   BREAKPOINT: 992px (Tablets & Landscape Mobile)
   ======================================================== */
@media (max-width: 992px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-layout {
    flex-direction: column;
  }

  .modal-box {
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
  }
}

/* ========================================================
   BREAKPOINT: 768px (Mobile Smartphones)
   ======================================================== */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .nav-container {
    gap: 0.75rem;
  }

  .nav-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    width: min(320px, 100%);
    height: calc(100vh - 70px);
    background: var(--bg-card);
    flex-direction: column;
    padding: 1.25rem;
    gap: 0.5rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    z-index: 999;
    justify-content: flex-start;
    align-items: flex-start;
    margin: 0;
  }

  .nav-menu.open {
    display: flex;
    transform: translateX(0);
  }

  .nav-link {
    font-size: 1rem;
    width: 100%;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
  }

  /* Grid Conversions */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  /* Typography */
  .hero-title {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  /* Tracking Input Bar */
  .tracking-input-group {
    flex-direction: column;
    gap: 0.75rem;
  }

  .tracking-input-group input {
    width: 100%;
    border-radius: var(--radius-sm) !important;
  }

  .tracking-input-group button {
    width: 100%;
    border-radius: var(--radius-sm) !important;
    justify-content: center;
  }

  /* Admin & Customer Dashboard Sidebar Off-Canvas */
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.mobile-open,
  .sidebar.collapsed {
    transform: translateX(280px);
  }

  .dashboard-main {
    margin-left: 0 !important;
    width: 100%;
    padding: 1rem;
  }

  .dashboard-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  /* Footer Mobile Layout */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  /* Form & Action Buttons */
  .btn-lg {
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
  }

  /* Timeline Components */
  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-dot {
    left: -1.5rem;
  }

  /* Print Shipping Label Modal */
  .label-container {
    width: 100% !important;
    max-width: 100% !important;
    transform: scale(0.9);
  }
}

/* ========================================================
   BREAKPOINT: 480px (Extra Small Smartphones)
   ======================================================== */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .section-padding {
    padding: 2.5rem 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1.25rem;
  }

  .brand-logo {
    font-size: 1.1rem;
  }

  .modal-box {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-sm);
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }
}

/* ========================================================
   TRACKING PAGE MOBILE RESPONSIVE ENHANCEMENTS
   ======================================================== */
.tracking-main-col {
  grid-column: span 2;
}

@media (max-width: 992px) {
  .tracking-main-col {
    grid-column: span 1 !important;
  }
}

@media (max-width: 768px) {
  .tracking-hero-section {
    padding: 2.5rem 1rem !important;
  }

  .tracking-header-flex {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.25rem !important;
  }

  .tracking-header-right {
    text-align: left !important;
    width: 100%;
    border-top: 1px dashed var(--border);
    padding-top: 1rem;
  }

  .tracking-header-right button {
    width: 100%;
  }

  .tracking-number-text {
    font-size: clamp(1.3rem, 5vw, 1.85rem) !important;
    word-break: break-all;
  }

  .map-container {
    height: 280px !important;
  }

  #qrcodeBox canvas,
  #qrcodeBox img {
    max-width: 100% !important;
    height: auto !important;
  }

  #barcodeBox {
    max-width: 100% !important;
  }
}

@media (max-width: 480px) {
  .tracking-hero-section h1 {
    font-size: 1.75rem !important;
  }

  .tracking-hero-section p {
    font-size: 0.9rem !important;
  }

  .card {
    padding: 1.15rem !important;
  }
}
