/* Responsive styles */

/* Large desktop screens (≥1920px) retain the default container width of 1320px */

/* Desktop mid screens (1440px–1919px): slightly narrower container */
@media (min-width: 1440px) and (max-width: 1919px) {
  .container {
    max-width: 1200px;
  }
}


/* Laptop adjustments (1024px–1439px) */
@media (max-width: 1439px) {
  .container {
    max-width: 1000px;
  }
}

/* Tablet adjustments (768px–1023px) */
@media (max-width: 1023px) {
  header nav {
    gap: 1rem;
  }
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: none; /* hidden by default on tablet/mobile; toggled via JS for drawer */
  }
  .admin-content {
    width: 100%;
  }

  /* Cargo page adjustments for tablet */
  .filters-sidebar {
    display: none;
  }
  .sort-and-filter .filter-toggle {
    display: inline-flex;
    align-items: center;
  }
}

/* Mobile adjustments (≤767px) */
@media (max-width: 767px) {
  header {
    height: auto;
    padding: 0.5rem 0;
  }
  .header-content {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .header-center {
    order: 1;
    flex: 1;
    justify-content: flex-start;
  }
  .burger {
    order: 2;
    display: inline-flex;
  }
  .header-left, .header-right {
    display: none;
    flex: 0 0 100%;
    order: 3;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 0;
    gap: 1rem;
  }
  header.nav-open .header-left,
  header.nav-open .header-right {
    display: flex;
  }
}

/* Tablet adjustments (768px–1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
  .header-left, .header-right {
    gap: 1rem;
  }
  .nav-link {
    font-size: 0.9rem;
  }
}

/* Burger button styles */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}
.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark);
  margin: 4px 0;
  transition: background 0.2s;
}
@media (max-width: 767px) {
  .burger {
    display: inline-flex;
  }
}

/* Admin sidebar drawer on tablet and mobile */
@media (max-width: 1023px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 240px;
    background: var(--surface);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .admin-sidebar.sidebar-open {
    display: block;
    transform: translateX(0);
  }
  /* When the sidebar is open, prevent body scroll */
  body.sidebar-open {
    overflow: hidden;
  }
  /* Hide the usual border in drawer mode */
  .admin-sidebar {
    border-right: none;
    border-bottom: none;
  }
}