.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .header-blocks {
    flex-direction: column;
    padding: 10px 12px;
    gap: 10px;
  }
  .header-block.brand-nav {
    width: 100%;
    justify-content: center;
  }
  .header-block.search-rate {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  .search-form {
    width: 100% !important;
  }
  .header-block.user-cart {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .social-links-header {
    display: none !important;
  }
  .rate {
    font-size: 0.78rem;
    padding: 6px 10px;
  }

  .admin-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    z-index: 1050;
    transition: left 0.3s ease;
    width: 260px;
  }
  .admin-sidebar.mobile-open {
    left: 0;
  }
  .admin-wrapper {
    width: 100%;
  }
  .admin-content {
    padding: 16px 12px;
    width: 100%;
  }
  .admin-content .panel-header {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .sr-sidebar {
    position: fixed !important;
    left: -280px;
    top: 0;
    z-index: 1050;
    transition: left 0.3s ease;
    width: 260px !important;
  }
  .sr-sidebar.mobile-open {
    left: 0;
  }
  .salesrep-layout {
    width: 100%;
  }
  .salesrep-content {
    padding: 16px 12px;
    width: 100%;
  }

  .sr-sb-brand-text,
  .sr-sb-section-label {
    display: block !important;
  }
  .sr-sb-link span:not(.sr-sb-icon) {
    display: inline !important;
  }
  .sr-sb-user-info {
    display: block !important;
  }
  .sr-sb-brand {
    padding: 24px 22px 20px !important;
    justify-content: flex-start !important;
  }
  .sr-sb-link {
    justify-content: flex-start !important;
    padding: 10px 14px !important;
  }
  .sr-sb-user {
    padding: 16px 18px !important;
    justify-content: flex-start !important;
  }

  .sidebar-overlay,
  .sr-sidebar-overlay,
  .mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1049;
  }
  .sidebar-overlay.active,
  .sr-sidebar-overlay.active,
  .mobile-sidebar-overlay.active {
    display: block;
  }

  .mobile-topbar {
    display: flex !important;
  }

  .dealer-header .header-top .container-fluid {
    flex-wrap: wrap;
    padding: 10px 12px !important;
    gap: 10px;
  }
  .dealer-header .logo {
    order: 1;
  }
  .dealer-header .user-actions {
    order: 2 !important;
  }
  .dealer-header .search-bar {
    order: 3 !important;
    max-width: 100% !important;
    margin: 0 !important;
    width: 100%;
    flex: 1 1 100% !important;
  }
  .dealer-header .header-info {
    order: 4 !important;
    flex: 1 1 100%;
    justify-content: center;
  }
  .dealer-header .header-nav .container-fluid {
    flex-direction: column;
    padding: 0 !important;
    align-items: stretch !important;
  }
  .dealer-header .header-nav nav {
    display: flex !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0 !important;
    white-space: nowrap;
  }
  .dealer-header .header-nav nav::-webkit-scrollbar {
    display: none;
  }
  .dealer-header .header-nav nav .nav-item {
    padding: 10px 14px;
    font-size: 0.8rem;
    flex-shrink: 0;
  }
  .dealer-header .header-nav > .container-fluid > div:last-child {
    display: none !important;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-content input[type="text"],
  .admin-content input[type="number"],
  .admin-content input[type="email"],
  .admin-content input[type="password"],
  .admin-content input[type="date"],
  .admin-content select,
  .admin-content textarea {
    width: 100%;
  }
  .sr-form-control {
    width: 100%;
  }

  .stat-card {
    width: 100%;
  }
  .sr-stat-card {
    width: 100%;
  }
  .sr-stats {
    grid-template-columns: 1fr 1fr;
  }
  .sr-grid-2, .sr-grid-3 {
    grid-template-columns: 1fr !important;
  }
  .sr-quick-actions {
    grid-template-columns: 1fr !important;
  }
  .sr-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .sr-filters {
    flex-direction: column;
  }
  .sr-filters select,
  .sr-filters input[type="text"] {
    width: 100%;
  }

  .catalog .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .catalog .sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }
  .catalog {
    flex-direction: column;
    padding: 12px;
  }
  .catalog .toolbar {
    flex-direction: column;
  }

  .sr-panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .header-blocks {
    padding: 8px 10px;
    gap: 8px;
  }
  .brand-nav .brand img {
    height: 32px !important;
  }
  .user-cart a {
    padding: 8px 14px;
    font-size: 0.8rem;
  }
  .header-login-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

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

  .admin-content {
    padding: 10px 8px;
  }
  .admin-content .panel-header {
    padding: 12px;
  }
  .admin-content table th,
  .admin-content table td {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .salesrep-content {
    padding: 12px 8px;
  }
  .sr-table thead th,
  .sr-table tbody td {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .sr-stats {
    grid-template-columns: 1fr;
  }
  .sr-stat-value {
    font-size: 1.4rem;
  }

  .stat-card {
    padding: 14px;
  }

  .sr-panel-header {
    padding: 12px 16px;
  }

  .dealer-header .header-top .container-fluid {
    padding: 8px 10px !important;
  }
  .dealer-header .search-bar input {
    font-size: 0.9rem !important;
    padding: 10px 16px !important;
  }
}

@media (min-width: 769px) {
  .mobile-topbar,
  .mobile-header-bar,
  .sr-mobile-header-bar {
    display: none !important;
  }
  .sidebar-overlay,
  .sr-sidebar-overlay,
  .mobile-sidebar-overlay {
    display: none !important;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .catalog .grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .sr-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 8998;
}
.mobile-topbar .mobile-topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-topbar .mobile-topbar-logo img {
  height: 28px;
  object-fit: contain;
}
.mobile-topbar .mobile-topbar-logo span {
  font-weight: 700;
  font-size: 1rem;
  color: white;
}
.mobile-hamburger {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
}
.mobile-hamburger:hover {
  background: rgba(255,255,255,0.1);
}
.mobile-hamburger svg {
  width: 24px;
  height: 24px;
}
