/* ========================================
   Master Splinter POS - Mobile Fixes
   إصلاحات شاملة للموبايل والأجهزة المحمولة
   ======================================== */

/* ========================================
   Base Mobile Fixes
   ======================================== */
@media (max-width: 992px) {
  /* Fix html and body */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
  }
  
  body {
    display: block !important;
    flex-direction: column !important;
  }
  
  /* Sidebar Mobile - RTL Fix */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    right: -300px !important;
    left: auto !important;
    width: 280px !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 1100 !important;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease !important;
    transform: none !important;
    background: var(--color-surface) !important;
  }
  
  .sidebar.active {
    right: 0 !important;
  }
  
  .sidebar-close {
    display: flex !important;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
  }
  
  /* Main Content Full Width - CRITICAL FIX */
  .main-content,
  body > .main-content,
  html body .main-content {
    margin: 0 !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    flex: 1 1 100% !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
  }
  
  .page-content {
    padding: 1rem !important;
  }
  
  /* Show sidebar toggle */
  .sidebar-toggle {
    display: flex !important;
  }
}


/* ========================================
   Topbar Mobile Fixes
   ======================================== */
@media (max-width: 768px) {
  .topbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .topbar-search {
    display: none;
  }
  
  .topbar-subscription {
    display: none !important;
  }
  
  .topbar-actions {
    margin-right: auto;
  }
  
  /* Page Header Mobile */
  .page-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }
  
  .page-header .btn,
  .page-header .page-actions {
    width: 100%;
  }
  
  .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .page-actions .btn {
    flex: 1;
    min-width: 120px;
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
  }
  
  .page-content {
    padding: 1rem;
  }
  
  .page-header h1 {
    font-size: 1.25rem;
  }
}

/* ========================================
   Stats Grid Mobile
   ======================================== */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem;
  }
  
  .stat-card {
    padding: 0.75rem;
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .stat-icon {
    width: 45px;
    height: 45px;
    font-size: 1.25rem;
  }
  
  .stat-value {
    font-size: 1.25rem;
  }
  
  .stat-info h3 {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  
  .stat-card {
    flex-direction: row;
    text-align: right;
  }
}


/* ========================================
   Quick Actions Mobile
   ======================================== */
@media (max-width: 768px) {
  .quick-actions {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.75rem;
  }
  
  .quick-action-card {
    padding: 1rem 0.5rem;
  }
  
  .quick-action-card i {
    font-size: 1.5rem;
  }
  
  .quick-action-card span {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .quick-actions {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ========================================
   Dashboard Grid Mobile
   ======================================== */
@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
}

/* ========================================
   Cards Mobile
   ======================================== */
@media (max-width: 768px) {
  .card {
    border-radius: var(--radius-md);
  }
  
  .card-header {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .card-title {
    font-size: 0.95rem;
  }
  
  .card-body {
    padding: 1rem;
  }
}

/* ========================================
   Tables Mobile
   ======================================== */
@media (max-width: 768px) {
  .table-responsive {
    margin: 0 -1rem;
    padding: 0 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table {
    min-width: 600px;
  }
  
  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }
}


/* ========================================
   POS Page Mobile - Critical Fixes
   ======================================== */
@media (max-width: 992px) {
  .pos-container {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr auto;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
  }
  
  .pos-products {
    order: 2;
    height: calc(100vh - 300px);
    height: calc(100dvh - 300px);
    overflow-y: auto;
  }
  
  .pos-cart {
    order: 3;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    max-height: 60vh;
    border-top: 2px solid var(--color-border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(calc(100% - 120px));
    transition: transform 0.3s ease;
    z-index: 100;
  }
  
  .pos-cart.expanded {
    transform: translateY(0);
  }
  
  .pos-header {
    order: 1;
    position: sticky;
    top: 0;
    z-index: 50;
  }
}

@media (max-width: 768px) {
  .pos-header {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .pos-back {
    width: 36px;
    height: 36px;
  }
  
  .pos-search {
    flex: 1;
    min-width: 0;
  }
  
  .pos-search input {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
  
  .pos-btn {
    width: 36px;
    height: 36px;
  }
  
  .employee-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
  
  #current-employee-name {
    display: none;
  }
  
  .pos-categories {
    padding: 0.5rem;
    gap: 0.35rem;
  }
  
  .category-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .pos-products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  
  .pos-product-card {
    padding: 0.5rem;
  }
  
  .pos-product-image {
    height: 60px;
  }
  
  .pos-product-name {
    font-size: 0.75rem;
  }
  
  .pos-product-price {
    font-size: 0.85rem;
  }
}


/* ========================================
   Cart Mobile Fixes
   ======================================== */
@media (max-width: 992px) {
  .cart-header {
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: var(--color-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  
  .cart-header::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
  }
  
  .cart-items {
    max-height: 200px;
    overflow-y: auto;
  }
  
  .cart-summary {
    padding: 0.5rem 0.75rem;
  }
  
  .summary-row {
    font-size: 0.85rem;
    padding: 0.25rem 0;
  }
  
  .summary-row.total-row {
    font-size: 1rem;
  }
  
  .cart-payment-section {
    padding: 0.5rem 0.75rem;
  }
  
  .cart-actions {
    padding: 0.5rem 0.75rem;
  }
  
  .cart-actions .btn-block {
    padding: 0.5rem;
    font-size: 0.85rem;
  }
  
  .payment-options {
    gap: 0.35rem;
  }
  
  .payment-options .btn {
    padding: 0.4rem;
    font-size: 0.8rem;
  }
}

/* ========================================
   Modal Mobile Fixes
   ======================================== */
@media (max-width: 768px) {
  .modal {
    padding: 0.5rem;
    align-items: flex-end;
  }
  
  .modal-content {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin: 0;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-header h3 {
    font-size: 1.1rem;
  }
  
  .modal-body {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
  }
  
  .modal-footer {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .modal-footer .btn {
    flex: 1;
    min-width: 100px;
  }
  
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }
  
  .form-group {
    margin-bottom: 0.75rem;
  }
  
  .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
  }
  
  .form-control {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }
}


/* ========================================
   Products Page Mobile
   ======================================== */
@media (max-width: 768px) {
  .filters-bar {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }
  
  .product-card {
    border-radius: var(--radius-md);
  }
  
  .product-image {
    height: 100px;
  }
  
  .product-info {
    padding: 0.75rem;
  }
  
  .product-info h4 {
    font-size: 0.85rem;
  }
  
  .product-price {
    font-size: 0.95rem;
  }
  
  .product-actions {
    padding: 0.5rem 0.75rem 0.75rem;
    flex-direction: column;
    gap: 0.35rem;
  }
  
  .product-actions .btn {
    font-size: 0.8rem;
    padding: 0.4rem;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr !important;
  }
  
  .product-card {
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  
  .product-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
  }
  
  .product-info {
    flex: 1;
    min-width: 0;
  }
  
  .product-actions {
    flex-direction: row;
    padding: 0.75rem;
    border-top: 1px solid var(--color-border);
    width: 100%;
  }
}

/* ========================================
   Employees Grid Mobile
   ======================================== */
@media (max-width: 768px) {
  .employees-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }
  
  .employee-card {
    border-radius: var(--radius-md);
  }
  
  .employee-header {
    padding: 0.75rem;
  }
  
  .employee-avatar {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .employee-body {
    padding: 0.75rem;
  }
  
  .employee-body h4 {
    font-size: 1rem;
  }
  
  .employee-actions {
    padding: 0.75rem;
    flex-wrap: wrap;
  }
  
  .employee-actions .btn {
    flex: 1;
    min-width: 80px;
    font-size: 0.8rem;
  }
}


/* ========================================
   Reports & Settings Mobile
   ======================================== */
@media (max-width: 992px) {
  .reports-grid,
  .settings-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .mini-stats {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .mini-stat {
    padding: 0.75rem 1rem;
  }
  
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.35rem;
    gap: 0.35rem;
  }
  
  .tab {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .header-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }
  
  .header-actions .btn,
  .header-actions .form-control {
    width: 100%;
  }
  
  .quick-reports-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }
  
  .quick-report-btn {
    padding: 1rem;
  }
  
  .quick-report-btn i {
    font-size: 1.25rem;
  }
  
  .quick-report-btn span {
    font-size: 0.8rem;
  }
  
  .date-range-picker .form-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .theme-options {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .theme-option {
    flex-direction: row;
    justify-content: flex-start;
    gap: 1rem;
    padding: 0.75rem 1rem;
  }
}

/* ========================================
   Devices & Services Grid Mobile
   ======================================== */
@media (max-width: 768px) {
  .devices-grid,
  .services-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }
  
  .device-card,
  .service-card {
    padding: 1rem;
  }
  
  .device-icon,
  .service-icon {
    width: 50px;
    height: 50px;
  }
  
  .device-icon i,
  .service-icon i {
    font-size: 1.5rem;
  }
  
  .device-menu,
  .service-actions {
    opacity: 1;
  }
}


/* ========================================
   Bookings & Calendar Mobile
   ======================================== */
@media (max-width: 768px) {
  .date-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .current-date {
    order: -1;
    width: 100%;
    max-width: none;
  }
  
  .view-toggle {
    margin-right: auto;
  }
  
  .timeline-view {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .bookings-list {
    gap: 0.5rem;
  }
  
  .booking-item {
    padding: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .booking-item-time {
    min-width: 50px;
    font-size: 0.85rem;
  }
  
  .booking-item-info h4 {
    font-size: 0.9rem;
  }
  
  .booking-item-info p {
    font-size: 0.8rem;
  }
}

/* ========================================
   Delivery Page Mobile
   ======================================== */
@media (max-width: 768px) {
  .delivery-filters {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  
  .filter-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .delivery-orders-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }
  
  .delivery-order-card {
    padding: 1rem;
  }
  
  .delivery-order-card .order-actions {
    flex-direction: column;
    gap: 0.35rem;
  }
  
  .delivery-order-card .order-actions .btn {
    width: 100%;
  }
  
  .zones-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================
   Promotions Mobile
   ======================================== */
@media (max-width: 768px) {
  .promos-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }
  
  .promo-card {
    padding: 1rem;
  }
  
  .promo-name {
    padding-left: 70px;
    font-size: 1rem;
  }
  
  .promo-value {
    font-size: 1.5rem;
  }
  
  .promo-actions {
    flex-wrap: wrap;
  }
  
  .promo-actions .btn {
    flex: 1;
    min-width: 80px;
  }
}


/* ========================================
   Buttons Mobile Fixes
   ======================================== */
@media (max-width: 768px) {
  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .btn-lg {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
  }
  
  .btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .btn-icon {
    width: 36px;
    height: 36px;
  }
}

/* ========================================
   Empty State Mobile
   ======================================== */
@media (max-width: 768px) {
  .empty-state {
    padding: 1.5rem 1rem;
  }
  
  .empty-state i {
    font-size: 2.5rem;
  }
  
  .empty-state p {
    font-size: 0.95rem;
  }
}

/* ========================================
   Specialized POS Pages Mobile
   ======================================== */
@media (max-width: 992px) {
  .pos-playstation,
  .pos-supermarket,
  .pos-restaurant,
  .pos-pharmacy,
  .pos-clothing,
  .pos-electronics,
  .pos-salon,
  .pos-clinic,
  .pos-gym,
  .pos-cyber {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr auto;
  }
  
  .sidebar-panel,
  .cart-panel,
  .order-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 60vh;
    border-top: 2px solid var(--color-border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(calc(100% - 100px));
    transition: transform 0.3s ease;
    z-index: 100;
  }
  
  .sidebar-panel.expanded,
  .cart-panel.expanded,
  .order-panel.expanded {
    transform: translateY(0);
  }
  
  .devices-panel,
  .products-panel,
  .tables-panel,
  .main-panel {
    height: calc(100vh - 100px);
    height: calc(100dvh - 100px);
    overflow-y: auto;
    padding-bottom: 120px;
  }
}


/* ========================================
   Touch Improvements
   ======================================== */
@media (max-width: 992px) {
  /* Better touch targets */
  .nav-item {
    padding: 1rem 1.25rem;
    min-height: 48px;
  }
  
  .topbar-btn {
    min-width: 44px;
    min-height: 44px;
  }
  
  /* Prevent text selection on buttons */
  .btn,
  .nav-item,
  .tab,
  .category-btn,
  .quick-action-card {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Smooth scrolling */
  .sidebar-nav,
  .cart-items,
  .pos-products-grid,
  .products-grid,
  .modal-body {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
  
  /* Active states for touch */
  .btn:active,
  .nav-item:active,
  .quick-action-card:active,
  .pos-product-card:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
}

/* ========================================
   Safe Area Insets (Notch Support)
   ======================================== */
@supports (padding: max(0px)) {
  .topbar {
    padding-top: max(1rem, env(safe-area-inset-top));
  }
  
  .sidebar {
    padding-top: max(0px, env(safe-area-inset-top));
  }
  
  .cart-actions,
  .modal-footer {
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }
  
  .pos-cart {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ========================================
   Landscape Mode Fixes
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .pos-container {
    grid-template-columns: 1fr 300px;
    grid-template-rows: 1fr;
  }
  
  .pos-cart {
    position: relative;
    transform: none;
    max-height: 100vh;
  }
  
  .pos-products {
    height: 100vh;
  }
  
  .modal-content {
    max-height: 95vh;
  }
  
  .modal-body {
    max-height: 50vh;
  }
}


/* ========================================
   Print Styles (Hide on Mobile Print)
   ======================================== */
@media print {
  .sidebar,
  .topbar,
  .sidebar-toggle,
  .modal {
    display: none !important;
  }
  
  .main-content {
    margin: 0 !important;
  }
}

/* ========================================
   Accessibility Improvements
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
.btn:focus-visible,
.nav-item:focus-visible,
.form-control:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========================================
   Dark Mode Mobile Fixes
   ======================================== */
@media (max-width: 768px) {
  [data-theme="dark"] .sidebar {
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
  }
  
  [data-theme="dark"] .pos-cart {
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.4);
  }
  
  [data-theme="dark"] .modal-content {
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  }
}

/* ========================================
   Subscription Bar Mobile
   ======================================== */
@media (max-width: 992px) {
  .topbar-subscription {
    display: none !important;
  }
}

/* Show subscription info in sidebar on mobile */
@media (max-width: 992px) {
  .sidebar-subscription-mobile {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8rem;
  }
  
  .sidebar-subscription-mobile .sub-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    color: var(--color-text-muted);
  }
  
  .sidebar-subscription-mobile .sub-item i {
    width: 16px;
    color: var(--color-primary);
  }
}


/* ========================================
   Auth Pages Mobile Fixes
   ======================================== */
@media (max-width: 768px) {
  .auth-card {
    padding: 1.5rem 1rem;
    min-height: 100vh;
  }
  
  .auth-header h1 {
    font-size: 1.5rem;
  }
  
  .auth-logo {
    font-size: 1.25rem;
  }
  
  .auth-logo img {
    width: 40px;
    height: 40px;
  }
  
  .auth-form {
    max-width: 100%;
  }
  
  .auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
  }
}

/* ========================================
   Landing Page Mobile Fixes
   ======================================== */
@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 1rem;
    text-align: center;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .hero-buttons .btn {
    width: 100%;
  }
  
  .features-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
  
  .pricing-grid {
    grid-template-columns: 1fr !important;
  }
  
  .footer-grid {
    grid-template-columns: 1fr !important;
    text-align: center;
  }
}

/* ========================================
   Admin Pages Mobile Fixes
   ======================================== */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(100%);
    position: fixed;
    z-index: 1100;
  }
  
  .admin-sidebar.active {
    transform: translateX(0);
  }
  
  .admin-content {
    margin-right: 0 !important;
  }
  
  .admin-header {
    padding: 0.75rem 1rem;
  }
  
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem;
  }
  
  .admin-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .admin-stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================
   Customer App Mobile Fixes
   ======================================== */
@media (max-width: 768px) {
  .customer-header {
    padding: 0.75rem 1rem;
  }
  
  .customer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 0.5rem;
    z-index: 100;
  }
  
  .customer-content {
    padding-bottom: 80px;
  }
  
  .menu-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }
  
  .cart-drawer {
    width: 100% !important;
    max-width: 100%;
  }
}

/* ========================================
   Fix for iOS Safari 100vh issue
   ======================================== */
@supports (-webkit-touch-callout: none) {
  .pos-container,
  .pos-playstation,
  .pos-supermarket,
  .pos-restaurant,
  .pos-pharmacy,
  .pos-clothing,
  .pos-electronics,
  .pos-salon,
  .pos-clinic,
  .pos-gym,
  .pos-cyber {
    height: -webkit-fill-available;
  }
  
  .sidebar {
    height: -webkit-fill-available;
  }
}


/* ========================================
   Sidebar Overlay - CRITICAL
   ======================================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1050;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Ensure sidebar toggle is always visible on mobile */
@media (max-width: 992px) {
  .sidebar-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--color-bg);
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 100;
  }
  
  .sidebar-toggle:active {
    background: var(--color-primary);
    color: #000;
  }
  
  .sidebar-close {
    display: flex !important;
    color: var(--color-text);
  }
  
  /* Body when sidebar is open */
  body.sidebar-open {
    overflow: hidden !important;
  }
  
  /* Sidebar nav scrollable */
  .sidebar-nav {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
