@media (max-width: 767.98px) {
  html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
  }

  body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  .navbar {
    min-height: 56px !important;
    max-height: 56px !important;
    padding: 0 !important;
  }

  .navbar .container-fluid,
  .navbar .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
    min-height: 56px;
    max-height: 56px;
  }

  .navbar-logo {
    height: 26px !important;
    width: auto !important;
  }

  .navbar-brand {
    padding: 0 !important;
    margin-right: 0 !important;
  }

  .navbar-search {
    display: none !important;
  }

  .btn-become-seller {
    display: none !important;
  }

  .btn-request-game {
    display: none !important;
  }

  .navbar-right-section {
    gap: 0.25rem !important;
  }

  .navbar-action-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
  }

  .navbar-action-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .navbar-profile-trigger {
    padding: 0.15rem 0.25rem !important;
    padding-right: 0.35rem !important;
    gap: 0.25rem !important;
  }

  .navbar-profile-avatar {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
  }

  .avatar-initials {
    font-size: 0.65rem !important;
  }

  .profile-caret {
    width: 10px !important;
    height: 10px !important;
  }

  .navbar-profile-info {
    display: none !important;
  }

  .notifications-dropdown {
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: calc(100vh - 56px) !important;
    border-radius: 0 0 16px 16px !important;
    transform: none !important;
  }

  .navbar-profile-dropdown .dropdown-menu {
    position: fixed !important;
    top: 56px !important;
    right: 0 !important;
    left: auto !important;
    width: 260px !important;
    max-height: calc(100vh - 56px - 60px) !important;
    overflow-y: auto !important;
    border-radius: 0 0 0 16px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2) !important;
  }

  .mobile-search-bar {
    display: flex !important;
    padding: 8px 12px;
    background: var(--bg-soft, #faf8ff);
    border-bottom: 1px solid var(--border-light, #f3e8ff);
  }

  .mobile-search-bar form {
    display: flex;
    width: 100%;
    height: 40px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color, #e9d5ff);
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s;
  }

  .mobile-search-bar form:focus-within {
    border-color: var(--brand-primary, #8b5cf6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  }

  .mobile-search-bar input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 12px;
    font-size: 0.9rem;
    background: transparent;
    color: var(--text-main, #1e1b4b);
  }

  .mobile-search-bar input::placeholder {
    color: var(--text-light, #9ca3af);
  }

  .mobile-search-bar button {
    width: 40px;
    border: none;
    background: var(--brand-primary, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .mobile-search-bar select {
    display: none;
  }

  .mobile-bottom-nav {
    display: flex !important;
  }

  body.has-bottom-nav {
    padding-bottom: 64px;
  }

  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .container-fluid {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  h1 { font-size: 1.5rem !important; }
  h2 { font-size: 1.3rem !important; }
  h3 { font-size: 1.15rem !important; }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 10px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .form-control, .form-select {
    min-height: 44px;
    font-size: 16px !important;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
  }

  .card {
    border-radius: 14px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
  }

  .card-body {
    padding: 1rem !important;
  }

  .modal-dialog {
    margin: 0.5rem !important;
    max-width: calc(100% - 1rem) !important;
  }

  .modal-content {
    border-radius: 16px !important;
  }
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(139, 92, 246, 0.12);
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.06);
  z-index: 1040;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-nav .bottom-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.mobile-bottom-nav .bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted, #6b7280);
  font-size: 0.65rem;
  font-weight: 500;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 10px;
  transition: all 0.2s;
  position: relative;
  min-width: 56px;
}

.mobile-bottom-nav .bottom-nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.mobile-bottom-nav .bottom-nav-item.active {
  color: var(--brand-primary, #8b5cf6);
}

.mobile-bottom-nav .bottom-nav-item.active svg {
  stroke-width: 2.2;
}

.mobile-bottom-nav .bottom-nav-item:active {
  transform: scale(0.92);
}

.mobile-bottom-nav .bottom-nav-badge {
  position: absolute;
  top: 0;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.mobile-hamburger-btn {
  display: none;
  width: 34px;
  height: 34px;
  border: none;
  background: #f3f4f6;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-main, #1e1b4b);
  padding: 0;
  transition: all 0.2s;
}

.mobile-hamburger-btn svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 767.98px) {
  .mobile-hamburger-btn {
    display: flex !important;
  }
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1045;
  animation: mobileOverlayIn 0.2s ease;
}

@keyframes mobileOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mobile-menu-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: #fff;
  z-index: 1050;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
  animation: mobileDrawerIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes mobileDrawerIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.mobile-menu-drawer .drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f3e8ff;
}

.mobile-menu-drawer .drawer-header .drawer-logo {
  height: 28px;
  width: auto;
}

.mobile-menu-drawer .drawer-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f5f3ff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  font-size: 1.2rem;
}

.mobile-menu-drawer .drawer-body {
  padding: 12px 0;
}

.mobile-menu-drawer .drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-main, #1e1b4b);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s;
}

.mobile-menu-drawer .drawer-link:hover,
.mobile-menu-drawer .drawer-link:active {
  background: #f5f3ff;
}

.mobile-menu-drawer .drawer-link svg,
.mobile-menu-drawer .drawer-link i {
  width: 20px;
  height: 20px;
  color: var(--brand-primary, #8b5cf6);
  flex-shrink: 0;
}

.mobile-menu-drawer .drawer-divider {
  height: 1px;
  background: #f3e8ff;
  margin: 8px 20px;
}

.mobile-menu-drawer .drawer-section-title {
  padding: 12px 20px 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light, #9ca3af);
}

.mobile-menu-drawer .drawer-cta {
  margin: 12px 20px;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  display: block;
}

.mobile-menu-drawer .drawer-cta-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.mobile-menu-drawer .drawer-cta-outline {
  background: transparent;
  color: var(--brand-primary, #8b5cf6);
  border: 1.5px solid var(--brand-primary, #8b5cf6);
}

@media (max-width: 767.98px) {
  .mobile-search-bar {
    display: flex !important;
  }
}

.mobile-search-bar {
  display: none;
}

@media (max-width: 767.98px) {
  .login-hero-wrapper,
  .register-hero-wrapper {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    padding: 0 !important;
  }

  .login-page-container,
  .register-page-container {
    min-height: auto !important;
    padding: 1rem 0 !important;
    align-items: flex-start !important;
  }

  .login-trust-panel,
  .register-trust-panel {
    min-height: auto !important;
    padding: 1.5rem !important;
    border-radius: 18px !important;
    margin: 0 !important;
  }

  .login-trust-panel h1,
  .register-trust-panel h1 {
    font-size: 1.5rem !important;
  }

  .login-card,
  .register-card {
    padding: 1.25rem !important;
    border-radius: 18px !important;
    margin: 0 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08) !important;
  }

  .login-card .form-control,
  .register-card .form-control {
    min-height: 48px;
    font-size: 16px !important;
    border-radius: 12px;
  }

  .login-card .btn,
  .register-card .btn {
    min-height: 48px;
    font-size: 1rem;
    border-radius: 12px;
  }

  .trust-features-list {
    gap: 0.75rem !important;
  }

  .trust-feature-item {
    gap: 0.75rem !important;
  }

  .trust-badges {
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
  }

  .login-card h2,
  .register-card h2 {
    font-size: 1.3rem !important;
  }

  .social-login-group {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .social-login-group .btn {
    width: 100% !important;
  }

  .auth-navbar-links {
    display: none !important;
  }

  .auth-page-nav .container {
    justify-content: center !important;
  }

  .auth-page-nav .navbar-brand {
    margin: 0 auto !important;
  }
}

@media (max-width: 767.98px) {
  .hero-section,
  .hero-section-full {
    padding: 2rem 0 1.5rem !important;
  }

  .hero-section h1 {
    font-size: 1.6rem !important;
    line-height: 1.3 !important;
  }

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

  .hero-search-wrapper {
    flex-direction: column !important;
  }

  .hero-search-wrapper .form-control,
  .hero-search-wrapper .form-select {
    width: 100% !important;
    min-height: 48px;
    font-size: 16px !important;
  }

  .hero-search-wrapper .btn {
    width: 100% !important;
    min-height: 48px;
  }

  .stats-grid,
  .stat-cards,
  .stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
  }

  .category-card {
    padding: 0.75rem 0.5rem !important;
  }

  .category-card img,
  .category-card .category-icon {
    width: 36px !important;
    height: 36px !important;
  }

  .category-card .category-name {
    font-size: 0.72rem !important;
  }
}

@media (max-width: 767.98px) {
  .listing-card,
  .product-card,
  .offer-card {
    border-radius: 14px !important;
  }

  .listing-card .card-body,
  .product-card .card-body,
  .offer-card .card-body {
    padding: 0.75rem !important;
  }

  .listing-card .card-title,
  .product-card .card-title {
    font-size: 0.88rem !important;
    line-height: 1.3 !important;
  }

  .listing-card .card-text,
  .product-card .card-text {
    font-size: 0.8rem !important;
  }

  .listing-card .price,
  .product-card .price {
    font-size: 1rem !important;
    font-weight: 700 !important;
  }

  .listing-grid,
  .products-grid,
  .offers-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .listing-card img,
  .product-card img {
    border-radius: 12px 12px 0 0 !important;
    aspect-ratio: 4/3;
    object-fit: cover;
  }
}

@media (max-width: 767.98px) {
  .dashboard-container {
    flex-direction: column !important;
  }

  .dashboard-sidebar,
  #sellerSidebarContainer .dashboard-sidebar,
  #buyerSidebarContainer .dashboard-sidebar {
    display: none !important;
  }

  .dashboard-sidebar.mobile-show {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    z-index: 1050 !important;
    background: #fff !important;
    box-shadow: 4px 0 30px rgba(0,0,0,0.15) !important;
    overflow-y: auto !important;
    animation: mobileDrawerIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mobile-sidebar-toggle {
    display: flex !important;
    position: fixed !important;
    bottom: 70px !important;
    left: 12px !important;
    z-index: 1035 !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: var(--brand-primary, #8b5cf6) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4) !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
  }

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

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
  }

  .kpi-card {
    padding: 0.75rem !important;
  }

  .kpi-card-value {
    font-size: 1.2rem !important;
  }

  .kpi-card-label {
    font-size: 0.72rem !important;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
  }

  .quick-action-btn {
    padding: 0.75rem !important;
  }

  .insights-panel {
    grid-template-columns: 1fr !important;
  }

  .orders-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .orders-table-wrapper table {
    min-width: 600px !important;
  }

  #dashboardHeaderContainer .dashboard-header {
    padding: 0.75rem 0 !important;
  }
}

@media (max-width: 767.98px) {
  .cart-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  .cart-summary {
    position: relative !important;
    top: auto !important;
    margin-top: 1rem;
  }

  .order-details-grid {
    grid-template-columns: 1fr !important;
  }

  .chat-container {
    height: calc(100vh - 56px - 60px) !important;
  }

  .chat-sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 56px !important;
    bottom: 60px !important;
    width: 100% !important;
    z-index: 1035 !important;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .chat-sidebar.show {
    transform: translateX(0);
  }

  .chat-main {
    width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .footer {
    padding: 2rem 0 !important;
    padding-bottom: calc(2rem + 60px) !important;
  }

  .footer .row {
    gap: 1.5rem !important;
  }

  .footer .col-lg-3,
  .footer .col-lg-2,
  .footer .col-md-6,
  .footer .col-md-4 {
    width: 50% !important;
    flex: 0 0 50% !important;
  }

  .footer h5,
  .footer h6 {
    font-size: 0.9rem !important;
  }

  .footer a,
  .footer p {
    font-size: 0.82rem !important;
  }
}

@media (max-width: 767.98px) {
  .table-responsive {
    border-radius: 12px;
    overflow: hidden;
  }

  .table th,
  .table td {
    padding: 0.6rem 0.5rem !important;
    font-size: 0.82rem !important;
    white-space: nowrap;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
  }

  .page-link {
    padding: 0.4rem 0.7rem !important;
    font-size: 0.85rem !important;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 767.98px) {
  .alert {
    padding: 0.75rem 1rem !important;
    font-size: 0.88rem !important;
    border-radius: 12px !important;
  }

  .toast {
    font-size: 0.88rem !important;
  }

  .badge {
    font-size: 0.7rem !important;
    padding: 0.3em 0.6em !important;
  }

  .breadcrumb {
    font-size: 0.82rem !important;
    padding: 0.5rem 0 !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  .breadcrumb::-webkit-scrollbar {
    display: none;
  }

  .tab-content {
    padding: 1rem !important;
  }

  .nav-tabs .nav-link {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
  }

  .nav-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .listing-detail-page .listing-images {
    border-radius: 14px !important;
    overflow: hidden;
  }

  .listing-detail-page .listing-info {
    padding: 1rem 0 !important;
  }

  .listing-detail-page .listing-title {
    font-size: 1.2rem !important;
  }

  .listing-detail-page .listing-price {
    font-size: 1.4rem !important;
  }

  .listing-detail-page .listing-sidebar {
    position: relative !important;
    top: auto !important;
  }

  .listing-detail-page .seller-card {
    border-radius: 14px !important;
  }
}

@media (max-width: 767.98px) {
  .platform-hero {
    padding: 1.5rem 0 !important;
  }

  .platform-hero h1 {
    font-size: 1.4rem !important;
  }

  .platform-tabs-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 0 !important;
  }

  .platform-tabs-wrapper::-webkit-scrollbar {
    display: none;
  }

  .platform-tabs {
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    padding: 0 12px !important;
  }

  .offer-table-row {
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 0.75rem !important;
  }
}

@media (max-width: 575.98px) {
  .listing-grid,
  .products-grid,
  .offers-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.4rem !important;
  }

  .stats-grid,
  .stat-cards,
  .stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }

  .navbar-logo {
    height: 24px !important;
  }
}
