// ========================================
// POS Modern Design - Clean & Minimalist
// Design inspired by: Stripe Dashboard, Zoho POS, Apple Design
// ========================================

// ========================================
// 1. DESIGN TOKENS (SCSS Variables)
// ========================================

// Color Palette
$pos-primary: #4c7cff !default;
$pos-primary-hover: #3d6ae6 !default;
$pos-primary-light: #e8eeff !default;

$pos-white: #ffffff !default;
$pos-gray-50: #fafafa !default;
$pos-gray-100: #f5f5f5 !default;
$pos-gray-200: #e5e5e5 !default;
$pos-gray-300: #d4d4d4 !default;
$pos-gray-400: #a3a3a3 !default;
$pos-gray-500: #737373 !default;
$pos-gray-600: #525252 !default;
$pos-gray-700: #404040 !default;
$pos-gray-800: #262626 !default;
$pos-gray-900: #171717 !default;

$pos-success: #10b981 !default;
$pos-success-light: #d1fae5 !default;
$pos-danger: #ef4444 !default;
$pos-danger-light: #fee2e2 !default;
$pos-warning: #f59e0b !default;
$pos-warning-light: #fef3c7 !default;
$pos-info: #3b82f6 !default;
$pos-info-light: #dbeafe !default;

// Typography
$pos-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !default;
$pos-font-size-xs: 0.75rem !default;    // 12px
$pos-font-size-sm: 0.875rem !default;   // 14px
$pos-font-size-base: 1rem !default;     // 16px
$pos-font-size-lg: 1.125rem !default;   // 18px
$pos-font-size-xl: 1.25rem !default;    // 20px
$pos-font-size-2xl: 1.5rem !default;    // 24px
$pos-font-size-3xl: 1.875rem !default;  // 30px

// Spacing
$pos-space-1: 0.25rem !default;   // 4px
$pos-space-2: 0.5rem !default;    // 8px
$pos-space-3: 0.75rem !default;   // 12px
$pos-space-4: 1rem !default;      // 16px
$pos-space-5: 1.25rem !default;   // 20px
$pos-space-6: 1.5rem !default;    // 24px
$pos-space-8: 2rem !default;      // 32px
$pos-space-10: 2.5rem !default;   // 40px

// Border Radius
$pos-radius-sm: 4px !default;
$pos-radius: 8px !default;
$pos-radius-lg: 12px !default;
$pos-radius-xl: 16px !default;
$pos-radius-full: 9999px !default;

// Shadows
$pos-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !default;
$pos-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !default;
$pos-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !default;
$pos-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !default;

// Transitions
$pos-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !default;

// ========================================
// 2. MIXINS
// ========================================

@mixin pos-scrollbar {
  &::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  &::-webkit-scrollbar-track {
    background: $pos-gray-100;
    border-radius: $pos-radius-full;
  }

  &::-webkit-scrollbar-thumb {
    background: $pos-gray-400;
    border-radius: $pos-radius-full;

    &:hover {
      background: $pos-gray-500;
    }
  }
}

@mixin pos-focus-ring($color: $pos-primary) {
  &:focus {
    outline: none;
    border-color: $color;
    box-shadow: 0 0 0 3px rgba($color, 0.2);
  }
}

@mixin pos-button-variant($bg-color, $hover-color) {
  background: $bg-color;
  color: $pos-white;
  border: none;
  transition: $pos-transition;

  &:hover:not(:disabled) {
    background: $hover-color;
    transform: translateY(-1px);
    box-shadow: $pos-shadow-md;
  }

  &:active:not(:disabled) {
    transform: translateY(0);
  }

  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
}

// ========================================
// 3. BASE STYLES & RESETS
// ========================================

.pos_page {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  min-height: 100vh;
  background: $pos-gray-50;
  font-family: $pos-font-family;
  overflow: hidden;

  * {
    font-family: $pos-font-family;
    text-transform: none;
  }
}

#pos {
  height: 100vh;
  overflow: hidden;
}

// ========================================
// 4. HEADER STYLES
// ========================================

.pos-header {
  background: $pos-white;
  border-bottom: 1px solid $pos-gray-200;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 $pos-space-6;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: $pos-shadow-sm;

  .logo {
    display: flex;
    align-items: center;

    img {
      width: 36px;
      height: 36px;
      border-radius: $pos-radius;
      object-fit: cover;
    }
  }

  &-actions {
    display: flex;
    align-items: center;
    gap: $pos-space-4;
    margin-left: auto;
  }

  &-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: $pos-radius;
    background: $pos-gray-100;
    color: $pos-gray-700;
    transition: $pos-transition;
    cursor: pointer;
    font-size: 18px;
    border: none;

    &:hover {
      background: $pos-gray-200;
      color: $pos-gray-900;
    }

    &.active {
      background: $pos-primary-light;
      color: $pos-primary;
    }
  }
}

// ========================================
// 5. LAYOUT - TWO COLUMN GRID
// ========================================

.pos-layout {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 60px);
  gap: 0;
  overflow: hidden;
  width: 100%;
}

// ========================================
// 6. LEFT PANEL - CART & ORDER
// ========================================

.pos-left-panel {
  background: $pos-white;
  border-right: 1px solid $pos-gray-200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 420px;
  min-width: 420px;
  flex-shrink: 0;
}

.pos-cart-header {
  padding: $pos-space-6;
  border-bottom: 1px solid $pos-gray-200;
}

.pos-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: $pos-space-4;
  @include pos-scrollbar;
}

.pos-cart-footer {
  border-top: 1px solid $pos-gray-200;
  background: $pos-gray-50;
}

// Customer & Warehouse Selects
.pos-select-group {
  margin-bottom: $pos-space-4;

  label {
    font-size: $pos-font-size-sm;
    font-weight: 500;
    color: $pos-gray-700;
    margin-bottom: $pos-space-2;
    display: block;
  }

  .v-select {
    border-radius: $pos-radius;
  }

  .vs__dropdown-toggle {
    border: 1px solid $pos-gray-300;
    border-radius: $pos-radius;
    padding: $pos-space-2;
    background: $pos-white;
    transition: $pos-transition;

    &:hover {
      border-color: $pos-gray-400;
    }

    &:focus-within {
      border-color: $pos-primary;
      box-shadow: 0 0 0 3px $pos-primary-light;
    }
  }
}

// Cart Items Table
.pos-cart-table {
  background: $pos-white;
  border-radius: $pos-radius;
  overflow: hidden;
  max-height: calc(100vh - 520px);
  overflow-y: auto;
  @include pos-scrollbar;

  table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  thead {
    background: $pos-gray-50;
    position: sticky;
    top: 0;
    z-index: 10;

    th {
      padding: $pos-space-3;
      font-size: $pos-font-size-xs;
      font-weight: 600;
      text-transform: uppercase;
      color: $pos-gray-600;
      border-bottom: 1px solid $pos-gray-200;
      text-align: left;
    }
  }

  tbody {
    td {
      padding: $pos-space-4 $pos-space-3;
      font-size: $pos-font-size-sm;
      color: $pos-gray-700;
      border-bottom: 1px solid $pos-gray-100;
    }

    tr:hover {
      background: $pos-gray-50;
    }
  }
}

.pos-cart-item-name {
  font-weight: 500;
  color: $pos-gray-900;
  margin-bottom: $pos-space-1;
}

.pos-cart-item-code {
  font-size: $pos-font-size-xs;
  color: $pos-gray-500;
}

// Quantity Controls
.pos-qty-control {
  display: flex;
  align-items: center;
  gap: $pos-space-1;
  width: 100px;
}

.pos-qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid $pos-gray-300;
  background: $pos-white;
  border-radius: $pos-radius-sm;
  color: $pos-gray-700;
  font-size: $pos-font-size-base;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: $pos-transition;
  padding: 0;

  &:hover {
    background: $pos-primary;
    color: $pos-white;
    border-color: $pos-primary;
  }
}

.pos-qty-input {
  flex: 1;
  text-align: center;
  border: 1px solid $pos-gray-300;
  border-radius: $pos-radius-sm;
  height: 28px;
  font-size: $pos-font-size-sm;
  padding: 0;

  @include pos-focus-ring;
}

// Cart Summary
.pos-cart-summary {
  padding: $pos-space-6;
  background: $pos-white;
}

.pos-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: $pos-space-3 0;
  font-size: $pos-font-size-sm;
  color: $pos-gray-700;
  border-bottom: 1px solid $pos-gray-100;

  &.grand-total {
    padding-top: $pos-space-4;
    border-top: 2px solid $pos-gray-300;
    border-bottom: none;
    margin-top: $pos-space-2;

    .label {
      font-size: $pos-font-size-lg;
      font-weight: 600;
      color: $pos-gray-900;
    }

    .value {
      font-size: $pos-font-size-2xl;
      font-weight: 700;
      color: $pos-primary;
    }
  }
}

// Discount & Tax Inputs
.pos-input-group {
  margin-bottom: $pos-space-4;

  label {
    font-size: $pos-font-size-sm;
    font-weight: 500;
    color: $pos-gray-700;
    margin-bottom: $pos-space-2;
    display: block;
  }

  input {
    width: 100%;
    padding: $pos-space-3;
    border: 1px solid $pos-gray-300;
    border-radius: $pos-radius;
    font-size: $pos-font-size-sm;
    transition: $pos-transition;

    @include pos-focus-ring;
  }
}

// Action Buttons
.pos-action-buttons {
  padding: $pos-space-4 $pos-space-6;
  display: flex;
  gap: $pos-space-3;
  background: $pos-white;
  border-top: 1px solid $pos-gray-200;
}

.pos-btn {
  flex: 1;
  padding: $pos-space-4;
  font-size: $pos-font-size-sm;
  font-weight: 500;
  border-radius: $pos-radius;
  border: none;
  cursor: pointer;
  transition: $pos-transition;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: $pos-space-2;

  &-primary {
    @include pos-button-variant($pos-primary, $pos-primary-hover);
  }

  &-success {
    @include pos-button-variant($pos-success, darken($pos-success, 8%));
  }

  &-danger {
    @include pos-button-variant($pos-danger, darken($pos-danger, 8%));
  }

  &-light {
    background: $pos-gray-100;
    color: $pos-gray-700;
    border: 1px solid $pos-gray-300;

    &:hover {
      background: $pos-gray-200;
    }
  }
}

// ========================================
// 7. RIGHT PANEL - PRODUCTS
// ========================================

.pos-right-panel {
  background: $pos-gray-50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.pos-search-section {
  background: $pos-white;
  padding: $pos-space-6;
  border-bottom: 1px solid $pos-gray-200;
}

.pos-search-bar {
  position: relative;
  margin-bottom: $pos-space-4;
}

.pos-search-input {
  width: 100%;
  padding: $pos-space-4 $pos-space-4 $pos-space-4 48px;
  border: 1px solid $pos-gray-300;
  border-radius: $pos-radius;
  font-size: $pos-font-size-base;
  transition: $pos-transition;
  background: $pos-white;

  @include pos-focus-ring;

  &::placeholder {
    color: $pos-gray-400;
  }
}

.pos-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: $pos-gray-400;
  font-size: 20px;
  pointer-events: none;
}

.pos-scan-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  cursor: pointer;
  opacity: 0.6;
  transition: $pos-transition;

  &:hover {
    opacity: 1;
  }
}

// Filter Buttons
.pos-filter-buttons {
  display: flex;
  gap: $pos-space-3;
}

.pos-filter-btn {
  flex: 1;
  padding: $pos-space-3;
  background: $pos-gray-100;
  border: 1px solid $pos-gray-200;
  border-radius: $pos-radius;
  font-size: $pos-font-size-sm;
  color: $pos-gray-700;
  cursor: pointer;
  transition: $pos-transition;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: $pos-space-2;

  &:hover {
    background: $pos-gray-200;
    border-color: $pos-gray-300;
  }
}

// Products Grid
.pos-products-container {
  flex: 1;
  overflow-y: auto;
  padding: $pos-space-6;
  @include pos-scrollbar;
}

.pos-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: $pos-space-4;
  margin-bottom: $pos-space-6;
}

.pos-product-card {
  background: $pos-white;
  border: 1px solid $pos-gray-200;
  border-radius: $pos-radius;
  overflow: hidden;
  cursor: pointer;
  transition: $pos-transition;
  display: flex;
  flex-direction: column;

  &:hover {
    border-color: $pos-primary;
    box-shadow: $pos-shadow-md;
    transform: translateY(-2px);
  }
}

.pos-product-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: $pos-gray-100;
}

.pos-product-info {
  padding: $pos-space-3;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pos-product-name {
  font-size: $pos-font-size-sm;
  font-weight: 500;
  color: $pos-gray-900;
  margin-bottom: $pos-space-1;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pos-product-code {
  font-size: $pos-font-size-xs;
  color: $pos-gray-500;
  margin-bottom: $pos-space-2;
}

.pos-product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.pos-product-price {
  font-size: $pos-font-size-base;
  font-weight: 600;
  color: $pos-primary;
}

.pos-product-stock {
  font-size: $pos-font-size-xs;
  padding: 2px 8px;
  background: $pos-success-light;
  color: $pos-success;
  border-radius: $pos-radius-full;
}

// Pagination
.pos-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: $pos-space-2;
  padding: $pos-space-4 0;

  button {
    width: 36px;
    height: 36px;
    border: 1px solid $pos-gray-300;
    background: $pos-white;
    border-radius: $pos-radius;
    color: $pos-gray-700;
    cursor: pointer;
    transition: $pos-transition;

    &:hover {
      border-color: $pos-primary;
      color: $pos-primary;
    }

    &.active {
      background: $pos-primary;
      border-color: $pos-primary;
      color: $pos-white;
    }
  }
}

// ========================================
// 8. MODAL STYLES
// ========================================

.pos-modal-header {
  border-bottom: 1px solid $pos-gray-200;
  padding: $pos-space-6;
  background: $pos-white;
}

.pos-modal-title {
  font-size: $pos-font-size-xl;
  font-weight: 600;
  color: $pos-gray-900;
}

.pos-modal-body {
  padding: $pos-space-6;
  background: $pos-gray-50;
}

.pos-modal-footer {
  border-top: 1px solid $pos-gray-200;
  padding: $pos-space-4 $pos-space-6;
  background: $pos-white;
  display: flex;
  gap: $pos-space-3;
  justify-content: flex-end;
}

// Payment Modal
.pos-payment-summary {
  background: $pos-white;
  border: 1px solid $pos-gray-200;
  border-radius: $pos-radius;
  padding: $pos-space-6;

  &-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: $pos-space-4 0;
    border-bottom: 1px solid $pos-gray-100;

    &:last-child {
      border-bottom: none;
    }
  }

  &-label {
    font-size: $pos-font-size-sm;
    color: $pos-gray-600;
    display: flex;
    align-items: center;
    gap: $pos-space-2;
  }

  &-value {
    font-size: $pos-font-size-base;
    font-weight: 600;
    color: $pos-gray-900;
  }
}

// Keypad
.pos-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: $pos-space-2;
  margin-top: $pos-space-4;

  &-btn {
    padding: $pos-space-4;
    background: $pos-white;
    border: 1px solid $pos-gray-300;
    border-radius: $pos-radius;
    font-size: $pos-font-size-lg;
    color: $pos-gray-900;
    cursor: pointer;
    transition: $pos-transition;
    font-weight: 500;

    &:hover {
      background: $pos-gray-100;
      border-color: $pos-gray-400;
    }

    &:active {
      transform: scale(0.95);
    }
  }
}

// ========================================
// 9. SIDEBAR STYLES
// ========================================

.pos-sidebar {
  background: $pos-white;
  padding: $pos-space-6;

  &-title {
    font-size: $pos-font-size-xl;
    font-weight: 600;
    color: $pos-gray-900;
    margin-bottom: $pos-space-6;
  }
}

// Category/Brand Grid
.pos-category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: $pos-space-3;
}

.pos-category-item {
  background: $pos-white;
  border: 2px solid $pos-gray-200;
  border-radius: $pos-radius;
  padding: $pos-space-4;
  text-align: center;
  cursor: pointer;
  transition: $pos-transition;
  font-size: $pos-font-size-sm;
  font-weight: 500;
  color: $pos-gray-700;

  &:hover {
    border-color: $pos-gray-400;
    background: $pos-gray-50;
  }

  &.active {
    border-color: $pos-primary;
    background: $pos-primary-light;
    color: $pos-primary;
    font-weight: 600;
  }
}

// ========================================
// 10. UTILITY CLASSES
// ========================================

.pos-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: $pos-radius-full;
  font-size: $pos-font-size-xs;
  font-weight: 500;

  &-success {
    background: $pos-success-light;
    color: $pos-success;
  }

  &-primary {
    background: $pos-primary-light;
    color: $pos-primary;
  }

  &-warning {
    background: $pos-warning-light;
    color: $pos-warning;
  }

  &-danger {
    background: $pos-danger-light;
    color: $pos-danger;
  }
}

.pos-text-muted {
  color: $pos-gray-500;
}

.pos-divider {
  height: 1px;
  background: $pos-gray-200;
  margin: $pos-space-4 0;
}

// ========================================
// 11. LOADING & EMPTY STATES
// ========================================

.pos-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: $pos-gray-50;
}

.pos-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid $pos-gray-200;
  border-top-color: $pos-primary;
  border-radius: 50%;
  animation: pos-spin 0.8s linear infinite;
}

@keyframes pos-spin {
  to {
    transform: rotate(360deg);
  }
}

.pos-empty-state {
  text-align: center;
  padding: $pos-space-10;
  color: $pos-gray-500;

  &-icon {
    font-size: 48px;
    margin-bottom: $pos-space-4;
    opacity: 0.5;
  }

  &-text {
    font-size: $pos-font-size-base;
  }
}

// ========================================
// 12. AUTOCOMPLETE RESULTS
// ========================================

.pos-autocomplete {
  position: relative;

  &-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: $pos-white;
    border: 1px solid $pos-gray-300;
    border-top: none;
    border-radius: 0 0 $pos-radius $pos-radius;
    box-shadow: $pos-shadow-lg;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: -8px;
  }

  &-item {
    padding: $pos-space-3 $pos-space-4;
    cursor: pointer;
    transition: $pos-transition;
    font-size: $pos-font-size-sm;
    color: $pos-gray-700;
    border-bottom: 1px solid $pos-gray-100;

    &:last-child {
      border-bottom: none;
    }

    &:hover {
      background: $pos-gray-50;
      color: $pos-gray-900;
    }
  }
}

// ========================================
// 13. PRINT STYLES
// ========================================

#invoice-POS {
  font-size: 14px;
  line-height: 20px;
  font-family: sans-serif;
  text-transform: capitalize;
  max-width: 400px;

  h1, h2, h3, h4, h5, h6 {
    color: #05070b;
    font-weight: bolder;
  }

  table tr {
    border-bottom: 3px dotted #ddd !important;
  }
}

#invoice-POS,
#invoice-POS-return {
  .invoice-content {
    max-width: 400px;
    margin: 0 auto;
  }

  .invoice-table {
    font-size: 10px;
  }

  .invoice-header-row {
    background: #eee;
  }

  .invoice-label-cell {
    text-align: left;
    background: #eee;
    width: 50%;
  }

  .invoice-value-cell {
    text-align: right;
    width: 50%;
  }
}

#total tr {
  background-color: #ddd;
}

#top .logo {
  height: 100px;
  width: 100px;
  background-size: 100px 100px;
}

.title {
  float: right;

  p {
    text-align: right;
  }
}

.tabletitle {
  font-size: 0.5em;
  background: #eee;
}

#legalcopy {
  margin-top: 5mm;

  p {
    text-align: center;
  }
}

#bar {
  text-align: center;
}

@media print {
  .pos_page {
    position: static;
  }

  .pos-header,
  .pos-action-buttons,
  .pos-filter-buttons,
  .pos-search-section {
    display: none !important;
  }

  * {
    font-size: 12px;
    line-height: 18px;
  }

  body {
    margin: 0.5cm;
    margin-bottom: 1.6cm;
    visibility: hidden;
  }

  #invoice-POS {
    visibility: visible;
    font-size: 12px;
    line-height: 20px;
  }

  @page {
    margin: 0;
  }
}

// ========================================
// 14. RESPONSIVE ADJUSTMENTS
// ========================================

@media (max-width: 1200px) {
  .pos-left-panel {
    width: 380px;
    min-width: 380px;
  }
}

@media (max-width: 992px) {
  .pos-layout {
    flex-direction: column;
  }

  .pos-left-panel {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid $pos-gray-200;
    max-height: 50vh;
  }
  
  .pos-right-panel {
    flex: 1;
  }
}

@media (min-width: 1400px) {
  .pos-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 1024px) {
  .pos-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: $pos-space-3;
  }

  .pos-action-buttons {
    flex-wrap: wrap;
  }

  .pos-btn {
    flex: 1 1 calc(50% - 6px);
  }
}

// ========================================
// 15. ACCESSIBILITY
// ========================================

.pos-btn:focus,
.pos-product-card:focus,
.pos-category-item:focus {
  outline: 2px solid $pos-primary;
  outline-offset: 2px;
}

.pos-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

// ========================================
// 16. TOAST/NOTIFICATION OVERRIDES
// ========================================

.b-toaster .b-toast {
  border-radius: $pos-radius;
  box-shadow: $pos-shadow-lg;
}

// ========================================
// 17. LEGACY SUPPORT & COMPATIBILITY
// ========================================

// Support for old class names
.pos-detail {
  height: 42vh !important;

  .table-responsive {
    max-height: 40vh !important;
    height: 40vh !important;
    border-bottom: none !important;

    tr {
      font-size: 14px;
    }
  }
}

.card-order {
  min-height: 100%;

  .main-header {
    position: relative;
  }
}

.grandtotal {
  text-align: center;
  height: 40px;
  background-color: #7ec8ca;
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 5px;
}

.list-grid {
  height: 100%;
  min-height: 100%;
  overflow: scroll;

  .list-item .list-thumb img {
    width: 100% !important;
    height: 100px !important;
    max-height: 100px !important;
    object-fit: cover;
  }

  @media (min-width: 1024px) {
    height: 100vh;
    min-height: 100vh;
    overflow: scroll;
  }
}

.brand-Active {
  border: 2px solid;
}

.centred {
  text-align: center;
  align-content: center;
}

.card.o-hidden {
  width: 18%;
  max-width: 18%;
  min-width: 130px;

  &:hover {
    cursor: pointer;
    border: 1px solid;
  }
}

.input-customer {
  position: relative;
  display: flex;
  flex-wrap: unset;
  align-items: stretch;
  width: 100%;
}

.quantity {
  max-width: 95px;
  width: 95px;

  input {
    text-align: center;
    border: none;
  }

  .form-control:focus {
    color: #374151;
    background-color: unset;
    border-color: #e1d5fd;
    outline: 0;
    box-shadow: unset;
  }

  span {
    padding: 8px;
  }
}

// ========================================
// 18. PAYMENT MODAL - ENHANCED LAYOUT
// ========================================

// Premium Payment Modal
.premium-payment-modal {
  .modal-dialog {
    max-width: 1200px;
  }
}

.payment-checkout-wrapper {
  background: $pos-white;
  border-radius: $pos-radius-lg;
  overflow: hidden;
}

.checkout-header {
  padding: $pos-space-6;
  border-bottom: 1px solid $pos-gray-200;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: $pos-white;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.checkout-header-content {
  flex: 1;
}

.checkout-title {
  font-size: $pos-font-size-2xl;
  font-weight: 700;
  margin: 0 0 $pos-space-1 0;
  color: $pos-white;
}

.checkout-subtitle {
  font-size: $pos-font-size-base;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.checkout-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: $pos-radius;
  padding: $pos-space-2;
  cursor: pointer;
  transition: $pos-transition;
  display: flex;
  align-items: center;
  justify-content: center;
  color: $pos-white;

  &:hover {
    background: rgba(255, 255, 255, 0.3);
  }
}

.checkout-body {
  padding: $pos-space-6;
  background: $pos-gray-50;
}

// Summary Card
.summary-col {
  padding-right: $pos-space-4;
}

.order-summary-card {
  background: $pos-white;
  border: 1px solid $pos-gray-200;
  border-radius: $pos-radius-lg;
  padding: $pos-space-6;
  height: 100%;
  box-shadow: $pos-shadow-sm;
}

.summary-card-title {
  font-size: $pos-font-size-lg;
  font-weight: 600;
  color: $pos-gray-900;
  margin-bottom: $pos-space-5;
}

.summary-items {
  margin-bottom: $pos-space-4;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: $pos-space-3 0;
  font-size: $pos-font-size-sm;
  border-bottom: 1px solid $pos-gray-100;

  &:last-child {
    border-bottom: none;
  }
}

.summary-label {
  color: $pos-gray-600;
}

.summary-value {
  font-weight: 600;
  color: $pos-gray-900;
}

.summary-divider {
  height: 2px;
  background: $pos-gray-200;
  margin: $pos-space-4 0;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: $pos-space-4 0;
  margin-bottom: $pos-space-5;
}

.total-label {
  font-size: $pos-font-size-lg;
  font-weight: 600;
  color: $pos-gray-900;
}

.total-amount {
  font-size: $pos-font-size-3xl;
  font-weight: 700;
  color: $pos-primary;
}

.payment-status {
  display: grid;
  grid-template-columns: 1fr;
  gap: $pos-space-3;
}

.status-item {
  background: $pos-gray-50;
  padding: $pos-space-3;
  border-radius: $pos-radius;
}

.status-label {
  font-size: $pos-font-size-xs;
  color: $pos-gray-600;
  margin-bottom: $pos-space-1;
}

.status-value {
  font-size: $pos-font-size-base;
  font-weight: 600;
  color: $pos-gray-900;
}

// Payment Form
.payment-form-col {
  padding-left: $pos-space-4;
}

.payment-form-card {
  background: $pos-white;
  border: 1px solid $pos-gray-200;
  border-radius: $pos-radius-lg;
  padding: $pos-space-6;
  box-shadow: $pos-shadow-sm;
}

.form-section {
  margin-bottom: $pos-space-6;

  &:last-child {
    margin-bottom: 0;
  }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: $pos-space-4;
}

.section-title {
  font-size: $pos-font-size-base;
  font-weight: 600;
  color: $pos-gray-900;
  margin: 0;
}

.line-count {
  font-size: $pos-font-size-sm;
  color: $pos-gray-500;
  background: $pos-gray-100;
  padding: $pos-space-1 $pos-space-3;
  border-radius: $pos-radius-full;
}

// Payment Method Tabs
.payment-method-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: $pos-space-2;
}

.method-tab {
  background: $pos-white;
  border: 2px solid $pos-gray-300;
  border-radius: $pos-radius;
  padding: $pos-space-3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: $pos-space-2;
  cursor: pointer;
  transition: $pos-transition;

  &:hover {
    border-color: $pos-gray-400;
    background: $pos-gray-50;
  }

  &.active {
    border-color: $pos-primary;
    background: $pos-primary-light;

    .method-icon {
      color: $pos-primary;
    }

    .method-name {
      color: $pos-primary;
      font-weight: 600;
    }
  }
}

.method-icon {
  width: 24px;
  height: 24px;
  color: $pos-gray-600;

  svg {
    width: 100%;
    height: 100%;
  }
}

.method-name {
  font-size: $pos-font-size-sm;
  color: $pos-gray-700;
  text-align: center;
}

// Payment Lines - Enhanced Card Layout
.payment-lines-list {
  display: flex;
  flex-direction: column;
  gap: $pos-space-4;
  margin-bottom: $pos-space-4;
}

.payment-line-card {
  background: $pos-gray-50;
  border: 1px solid $pos-gray-200;
  border-radius: $pos-radius;
  overflow: hidden;
}

.payment-line-header {
  background: $pos-white;
  border-bottom: 1px solid $pos-gray-200;
  padding: $pos-space-3 $pos-space-4;
  display: flex;
  align-items: center;
  gap: $pos-space-3;
}

.line-badge {
  background: $pos-primary;
  color: $pos-white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: $pos-font-size-xs;
  font-weight: 600;
}

.line-title {
  flex: 1;
  font-size: $pos-font-size-sm;
  font-weight: 600;
  color: $pos-gray-900;
}

.line-remove-btn {
  color: $pos-danger;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: $pos-transition;
  font-size: 18px;

  &:hover {
    color: darken($pos-danger, 10%);
    transform: scale(1.1);
  }
}

.payment-line-body {
  padding: $pos-space-4;
  display: grid;
  grid-template-columns: 1fr;
  gap: $pos-space-3;
}

.form-label-sm {
  font-size: $pos-font-size-sm;
  font-weight: 500;
  color: $pos-gray-700;
  margin-bottom: $pos-space-2;
}

.amount-input-group {
  .input-group-text {
    background: $pos-primary-light;
    border-color: $pos-gray-300;
    color: $pos-primary;
    font-weight: 600;
  }

  .form-control {
    border-left: none;
  }
}

.line-amount-input {
  font-size: $pos-font-size-base;
  font-weight: 600;
  color: $pos-gray-900;
}

.payment-method-select {
  .vs__dropdown-toggle {
    min-height: 42px;
  }
}

.add-line-btn {
  width: 100%;
  border-style: dashed;
  border-width: 2px;
  background: transparent;
  color: $pos-primary;
  font-weight: 500;
  transition: $pos-transition;

  &:hover {
    background: $pos-primary-light;
    border-style: solid;
  }
}

// Quick Amount Grid
.quick-amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: $pos-space-2;
}

.quick-btn {
  padding: $pos-space-3;
  font-size: $pos-font-size-sm;
  font-weight: 500;
  border: 1px solid $pos-gray-300;
  background: $pos-white;
  border-radius: $pos-radius;
  color: $pos-gray-700;
  cursor: pointer;
  transition: $pos-transition;

  &:hover {
    background: $pos-primary;
    color: $pos-white;
    border-color: $pos-primary;
  }
}

// Keypad
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: $pos-space-2;
}

.keypad-key {
  padding: $pos-space-4;
  background: $pos-white;
  border: 1px solid $pos-gray-300;
  border-radius: $pos-radius;
  font-size: $pos-font-size-lg;
  font-weight: 500;
  color: $pos-gray-900;
  cursor: pointer;
  transition: $pos-transition;

  &:hover {
    background: $pos-gray-100;
    border-color: $pos-gray-400;
  }

  &:active {
    transform: scale(0.95);
  }
}

// Credit Card Section
.saved-cards {
  margin-top: $pos-space-4;
}

.saved-cards-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: $pos-space-4;

  span {
    font-size: $pos-font-size-base;
    font-weight: 600;
    color: $pos-gray-900;
  }
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: $pos-space-3;
}

.card-option {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: $pos-white;
  border-radius: $pos-radius;
  padding: $pos-space-4;
  cursor: pointer;
  transition: $pos-transition;
  position: relative;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  &:hover {
    transform: translateY(-2px);
    box-shadow: $pos-shadow-lg;
  }

  &.selected {
    box-shadow: 0 0 0 3px $pos-primary;
  }
}

.card-chip {
  width: 30px;
  height: 22px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  margin-bottom: $pos-space-2;
}

.card-last-four {
  font-size: $pos-font-size-lg;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: $pos-space-1;
}

.card-exp {
  font-size: $pos-font-size-xs;
  opacity: 0.9;
}

.card-checkmark {
  position: absolute;
  top: $pos-space-2;
  right: $pos-space-2;
  width: 24px;
  height: 24px;
  background: $pos-white;
  color: $pos-primary;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.new-card-form {
  margin-top: $pos-space-4;
}

.new-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: $pos-space-4;
}

.card-form-label {
  font-size: $pos-font-size-base;
  font-weight: 600;
  color: $pos-gray-900;
  margin: 0;
}

.stripe-card-element {
  padding: $pos-space-4;
  border: 1px solid $pos-gray-300;
  border-radius: $pos-radius;
  background: $pos-white;
  transition: $pos-transition;

  &:focus-within {
    border-color: $pos-primary;
    box-shadow: 0 0 0 3px $pos-primary-light;
  }
}

.card-errors {
  color: $pos-danger;
  font-size: $pos-font-size-sm;
  margin-top: $pos-space-2;
}

// Notes & Options
.form-textarea-sm {
  font-size: $pos-font-size-sm;
  resize: vertical;
}

.account-select {
  .vs__dropdown-toggle {
    min-height: 42px;
  }
}

// Checkboxes
.checkboxes-group {
  display: flex;
  flex-direction: column;
  gap: $pos-space-3;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: $pos-space-2;
  font-size: $pos-font-size-sm;
  color: $pos-gray-700;

  i {
    font-size: 16px;
    color: $pos-gray-500;
  }
}

// Checkout Footer
.checkout-footer {
  background: $pos-white;
  border-top: 1px solid $pos-gray-200;
  padding: $pos-space-5 $pos-space-6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: $pos-space-4;
}

.footer-info {
  display: flex;
  gap: $pos-space-6;
  flex: 1;
}

.footer-amount {
  display: flex;
  flex-direction: column;
  gap: $pos-space-1;

  .label {
    font-size: $pos-font-size-xs;
    color: $pos-gray-600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .amount {
    font-size: $pos-font-size-lg;
    font-weight: 700;
    color: $pos-gray-900;
  }
}

.footer-actions {
  display: flex;
  gap: $pos-space-3;
  align-items: center;
}

.btn-cancel {
  min-width: 120px;
}

.btn-pay {
  min-width: 180px;
  font-size: $pos-font-size-base;
  font-weight: 600;
}

// Responsive Adjustments for Payment Modal
@media (max-width: 992px) {
  .summary-col,
  .payment-form-col {
    padding-left: 15px;
    padding-right: 15px;
  }

  .checkout-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-info {
    justify-content: space-between;
  }

  .footer-actions {
    width: 100%;

    .btn {
      flex: 1;
    }
  }
}

// ========================================
// 19. POS UTILITY CLASSES
// ========================================

.pos-brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.pos-dropdown-min-w {
  min-width: 140px;
}

.pos-qr-scanner-view {
  width: 100%;
  height: calc(100vh - 56px);
}

.pos-invoice-wrapper {
  max-width: 400px;
  margin: 0 auto;
}

.pos-invoice-table-full {
  width: 100%;
}

.pos-td-right-bottom {
  text-align: right;
  vertical-align: bottom;
}

.pos-row-spaced {
  margin-top: 10px;
}

.pos-text-right {
  text-align: right;
}

.pos-text-left {
  text-align: left;
}

.pos-text-center {
  text-align: center;
}

.pos-payment-change-table {
  font-size: 10px;
  width: 100%;
}

.pos-payment-header-bg {
  background: #eee;
}

.pos-invoice-table-compact {
  width: 100%;
  font-size: 11px;
}

.pos-invoice-info-compact {
  font-size: 11px;
}

// ========================================
// 20. POS COMPONENT STYLES
// ========================================


// Color Palette & Typography
$color-bg-light: #f8f9fb;
$color-card-bg: #ffffff;
$color-text-primary: #1a1a2e;
$color-text-secondary: #6b7280;
$color-text-tertiary: #9ca3af;
$color-border-light: #e5e7eb;
$color-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
$color-gradient-hover: linear-gradient(135deg, #5568d3 0%, #69408f 100%);
$color-success: #10b981;
$color-warning: #f59e0b;
$color-danger: #ef4444;

$font-family-primary: 'Inter', 'Poppins', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
$font-size-xs: 12px;
$font-size-sm: 14px;
$font-size-base: 16px;
$font-size-lg: 18px;
$font-size-xl: 20px;

$shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
$shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
$shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.12);
$shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.15);

$radius-sm: 6px;
$radius-md: 12px;
$radius-lg: 16px;

$transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
$transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

.pos-codecanyon {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: $color-bg-light;
  font-family: $font-family-primary;
  color: $color-text-primary;
  overflow: hidden;

  /* Custom Scrollbar */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
  }

  ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;

    &:hover {
      background: rgba(0, 0, 0, 0.12);
    }
  }
}

/* ============================================
   HEADER STYLES
   ============================================ */
.pos-header {
  display: flex;
  align-items: center;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: $color-card-bg;
  border-bottom: 1px solid $color-border-light;
  box-shadow: $shadow-md;
  min-height: 70px;
}

/* Mobile header base styles (hidden by default; shown only on ≤480px) */
.pos-header-mobile {
  display: none;
}

.header-left {
  display: flex;
  align-items: center;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;

  .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: $radius-md;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: inherit;
    box-shadow: none;
    flex-shrink: 0;
  }

  .brand-info {
    h2 {
      margin: 0;
      font-size: 16px;
      font-weight: 700;
      color: $color-text-primary;
      letter-spacing: -0.3px;
      line-height: 1.2;
    }

    p {
      margin: 2px 0 0 0;
      font-size: 11px;
      color: $color-text-tertiary;
      font-weight: 400;
      line-height: 1.2;
    }
  }
}

.header-center {
  display: flex;
  align-items: center;
  height: 100%;
  flex: 1 1 auto;

  .search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 40px;
    width: 100%;

    .search-icon {
      position: absolute;
      left: 12px;
      width: 18px;
      height: 18px;
      color: $color-text-tertiary;
      pointer-events: none;
    }

    .search-input {
      width: 100%;
      height: 100%;
      padding: 0 50px 0 40px;
      background: $color-bg-light;
      border: none;
      border-radius: $radius-md;
      font-size: $font-size-sm;
      color: $color-text-primary;
      transition: $transition-fast;

      &:focus {
        outline: none;
        background: white;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
      }
    }

    /* Style the Scan button like an input-group append */
    > .action-btn-icon {
      position: absolute;
      right: 0;
      top: 0;
      height: 100% !important;
      width: 44px !important;
      padding: 0 !important;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: white;
      border: 1px solid $color-border-light;
      border-left: 1px solid $color-border-light;
      border-radius: 0 $radius-md $radius-md 0;
      box-shadow: none;
    }
  }
}

/* Autocomplete dropdown: visible list below search input */
.pos-autocomplete-results {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: white;
  border: 1px solid $color-border-light;
  border-top: none;
  border-radius: 0 0 $radius-md $radius-md;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
}
.pos-autocomplete-item {
  padding: 10px 14px;
  font-size: 14px;
  color: $color-text-primary;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.pos-autocomplete-item:last-child {
  border-bottom: none;
}
.pos-autocomplete-item:hover {
  background: $color-bg-light;
}
.pos-autocomplete-item:active {
  background: rgba(102, 126, 234, 0.08);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  justify-content: flex-end;
}

/* Category & Brand filters row (mobile); desktop uses same v-selects as warehouse/customer */
.pos-header-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* Register status unified button styling */
.register-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Quick Add Customer placement:
   - 320px–768px: show inside the 320px-style header layout (Register Status)
   - >768px: keep it in the header-right area (unchanged position) */
.quick-add-customer--in-register { display: none !important; }
.quick-add-customer--in-header { display: inline-flex !important; }
@media (max-width: 768px) {
  .quick-add-customer--in-register { display: inline-flex !important; }
  .quick-add-customer--in-header { display: none !important; }
}

/* Display inside register-status: mobile only (pos-header-mobile) */
.register-status .register-status-display {
  display: inline-flex;
  align-items: center;
}

.register-status .register-toggle-btn {
  background: $color-bg-light;
  color: $color-text-primary;
  border: 1px solid $color-border-light;
  padding: 4px 10px;
  font-weight: 600;
}

.register-status .register-toggle-btn:hover {
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
}

.register-status .register-toggle-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

/* POS only: v-select one-line + ellipsis (selected value + search on one line) */
.pos-codecanyon {
  .vs__selected-options {
    flex-wrap: nowrap !important;
    align-items: center;
    overflow: hidden;
  }
  .vs__selected {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .vs__search {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* All POS v-selects: same width and min-width, flexible + truncate */
.warehouse-select,
.display-screen-select,
.customer-select-header,
.category-select-header,
.brand-select-header {
  flex: 1 1 0;
  min-width: 160px;

  .vs__dropdown-toggle {
    width: 100%;
    min-width: 0;
    border: 1px solid #e5e7eb;
  }

  .vs__selected-options {
    width: 100%;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .vs__placeholder {
    width: 100%;
    white-space: nowrap;
    overflow: visible;
    max-width: 100%;
  }

  .vs__selected {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

// Ensure v-select and action buttons layout properly
.header-right {
  // Ensure action buttons maintain their size
  .action-btn-icon,
  .btn-new-customer,
  .btn-pos-settings,
  .btn-offline-status,
  .register-status {
    flex: 0 0 auto;
    flex-shrink: 0;
    min-width: auto;
  }

  // All selects same width and min-width (including customer when selected)
  .warehouse-select,
  .display-screen-select,
  .customer-select-header,
  .category-select-header,
  .brand-select-header {
    flex: 1 1 0;
    min-width: 160px;
  }
}

.user-profile {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: $color-gradient-primary;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  font-size: $font-size-sm;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
  cursor: pointer;
  transition: $transition-fast;
  flex-shrink: 0;

  &:hover {
    transform: scale(1.05);
  }
}

/* ============================================
   MAIN CONTAINER & LAYOUT
   ============================================ */
.pos-container {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  padding: 24px;
  padding-bottom: 100px;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

.pos-column-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}

/* ============================================
   CARD STYLING
   ============================================ */
.card {
  background: $color-card-bg;
  border-radius: $radius-lg;
  box-shadow: $shadow-md;
  border: 1px solid $color-border-light;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: $transition-smooth;

  &:hover {
    box-shadow: $shadow-lg;
  }
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid $color-border-light;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to right, #fafbfc 0%, white 100%);
  flex-shrink: 0;

  h3 {
    margin: 0;
    font-size: $font-size-lg;
    font-weight: 600;
    color: $color-text-primary;
    letter-spacing: -0.2px;
  }

  .badge-count {
    background: $color-gradient-primary;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  }

  .filter-section {
    display: flex;
    gap: 10px;
    align-items: center;
  }
}

/* ============================================
   FLAT INPUTS & SELECTS
   ============================================ */
.flat-input,
.flat-select {
  padding: 10px 12px;
  background: $color-bg-light;
  border: none;
  border-radius: $radius-sm;
  font-size: $font-size-sm;
  color: $color-text-primary;
  font-family: $font-family-primary;
  transition: $transition-fast;
  cursor: pointer;

  &:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  }

  &::placeholder {
    color: $color-text-tertiary;
  }
}

.flat-select {
  appearance: none;
  background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="rgb(107, 114, 128)" stroke-width="2"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 20px;
  padding-right: 36px;
}

/* ============================================
   CARD: UNIFIED CHECKOUT
   ============================================ */
.card-unified-checkout {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.cart-section {
  flex: 0 0 auto;
  overflow-y: auto;
  max-height: 45%;
  padding: 12px 16px;
  border-bottom: 1px solid $color-border-light;
  min-height: 80px;
}

.cart-items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.cart-item-card {
  padding: 10px;
  background: linear-gradient(to right, #f9fafb 0%, white 100%);
  border: 1px solid $color-border-light;
  border-radius: $radius-sm;
  transition: $transition-smooth;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  grid-template-areas:
    "header header"
    "sku sku"
    "qty price";

  &:hover {
    border-color: #667eea;
    background: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
  }

  .item-header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;

    .item-name {
      margin: 0;
      font-size: 12px;
      font-weight: 600;
      color: $color-text-primary;
      flex: 1;
      word-break: break-word;
    }

    .edit-btn {
      width: 24px;
      height: 24px;
      min-width: 24px;
      border: 1px solid $color-border-light;
      background: white;
      color: $color-text-secondary;
      border-radius: 4px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: $transition-fast;
      padding: 0;
      -webkit-tap-highlight-color: transparent;

      svg {
        width: 14px;
        height: 14px;
        display: block;
      }

      &:hover {
        border-color: #667eea;
        background: rgba(102, 126, 234, 0.06);
        color: #667eea;
        transform: scale(1.05);
      }

      &:focus,
      &:active,
      &:focus-visible {
        outline: none !important;
        box-shadow: none !important;
      }
    }

    .remove-btn {
      width: 24px;
      height: 24px;
      min-width: 24px;
      border: 1px solid $color-border-light;
      background: white;
      color: #ef4444;
      border-radius: 4px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: $transition-fast;
      padding: 0;
      -webkit-tap-highlight-color: transparent;

      svg {
        width: 14px;
        height: 14px;
        display: block;
      }

      &:hover {
        border-color: #ef4444;
        background: rgba(239, 68, 68, 0.06);
        color: #ef4444;
        transform: scale(1.05);
      }

      &:focus,
      &:active,
      &:focus-visible {
        outline: none !important;
        box-shadow: none !important;
      }
    }
  }

  .item-sku {
    grid-area: sku;
    margin: 0;
    font-size: 10px;
    color: $color-text-tertiary;
    font-weight: 500;
  }

.item-qty-section {
  grid-area: qty;
  display: flex;
  align-items: center;
  gap: 6px;

  .qty-controller {
    display: flex;
    align-items: center;
    gap: 4px;

    .qty-btn {
      width: 24px;
      height: 24px;
      border: 1px solid $color-border-light;
      background: white;
      border-radius: 3px;
      cursor: pointer;
      font-size: 12px;
      font-weight: 600;
      color: $color-text-primary;
      transition: $transition-fast;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;
      outline: none;

      &:hover {
        border-color: #667eea;
        background: rgba(102, 126, 234, 0.05);
      }

      &:focus,
      &:focus-visible,
      &:active {
        outline: none !important;
        box-shadow: none !important;
        -webkit-box-shadow: none !important;
        border-color: $color-border-light !important;
      }

      &::-moz-focus-inner { border: 0; }
      &:-moz-focusring { outline: none; }
    }

    .qty-input {
      width: 40px;
      padding: 4px 6px;
      background: $color-bg-light;
      border: none;
      border-radius: 3px;
      text-align: center;
      font-size: 11px;
      font-weight: 600;
      transition: $transition-fast;

      &:focus {
        outline: none;
        background: white;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
      }
    }
  }
}

/* (Online reload confirmation now uses a Bootstrap-Vue modal; no extra styles required) */

.pos-price-container {
  max-width: 220px;
}

.pos-price-select {
  min-width: 120px;
  padding: 2px 6px;
  height: 28px;
}

  .item-price {
    grid-area: price;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;

    .item-amount {
      background: $color-gradient-primary;
      background-clip: text;
      background-clip: text;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .pos-price-select {
      -webkit-text-fill-color: initial;
      -webkit-background-clip: initial;
      background-clip: initial;
      color: $color-text-primary;
    }

    .item-subtotal {
      font-size: 11px;
      font-weight: 400;
      color: $color-text-secondary;
      margin-top: 2px;

      .subtotal-label {
        margin-right: 4px;
      }
    }
  }
}

.summary-section {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 80px;
}

/* ============================================
   CARD: SUMMARY
   ============================================ */
.card-summary {
  flex: 1;
  min-height: auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.charges-section {
  padding: 12px 20px;
  border-bottom: 1px solid $color-border-light;
  display: flex;
  flex-direction: column;
  gap: 0px;
  flex-shrink: 0;
}

.charge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  padding: 3px 0;
  border-bottom: 1px solid $color-border-light;

  &:last-child {
    border-bottom: none;
  }

  &.no-border-bottom {
    border-bottom: none;
  }

  label {
    font-size: $font-size-xs;
    font-weight: 600;
    color: $color-text-secondary;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
  }

  .charge-input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100px;

    .flat-input {
      width: 100%;
      text-align: left;
      font-size: 13px;
      padding: 5px 10px;
    }

    .input-suffix {
      position: absolute;
      right: 10px;
      font-size: 10px;
      color: $color-text-tertiary;
      pointer-events: none;
      font-weight: 600;
    }
    
    &.discount-input-group {
      .discount-type-toggle {
        position: absolute;
        right: 8px;
        background: white;
        border: 1px solid $color-border-light;
        border-radius: 4px;
        padding: 2px 6px;
        font-size: 11px;
        font-weight: 700;
        color: $color-text-primary;
        cursor: pointer;
        pointer-events: auto;
        transition: $transition-fast;
        min-width: 32px;
        text-align: center;
        
        &:hover {
          border-color: #667eea;
          background: rgba(102, 126, 234, 0.06);
          color: #667eea;
        }
        
        &:active {
          transform: scale(0.95);
        }
        
        &:focus,
        &:focus-visible {
          outline: none;
          box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
        }
      }
    }
  }
}

.summary-totals {
  padding: 12px 20px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: $color-card-bg;
  border-top: 2px solid $color-border-light;
  margin-top: auto;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  gap: 8px;

  .total-label {
    color: $color-text-secondary;
    font-weight: 500;
    flex: 1;
    min-width: 0;

    &.discount-row {
      color: $color-danger;
    }
  }

  .total-value {
    color: $color-text-primary;
    font-weight: 600;
    text-align: right;
    flex-shrink: 0;

    &.discount-value {
      color: $color-danger;
    }
  }

  &.grand-total {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid $color-border-light;
    margin-bottom: 0;

    .total-label {
      font-weight: 700;
      color: $color-text-primary;
    }

    .total-value {
      font-size: 15px;
      font-weight: 700;
    }
  }
}

.summary-divider {
  height: 1px;
  background: $color-border-light;
  margin: 2px 0;
}

.gradient-text {
  background: $color-gradient-primary;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: $color-text-tertiary;
  text-align: center;
  padding: 20px;
  min-height: 80px;

  svg {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
    opacity: 0.15;
    stroke-width: 1.5;
  }

  p {
    margin: 0 0 4px 0;
    font-size: 13px;
    font-weight: 500;
    color: $color-text-secondary;
  }

  .empty-hint {
    font-size: 11px;
    color: $color-text-tertiary;
  }
}

.register-toggle-icon {
  border: none;
  background: transparent;
  padding: 0;
  margin-right: 4px;
  cursor: pointer;
  font-size: 16px;
}

/* ============================================
   CARD: PRODUCTS
   ============================================ */
.card-products {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-products .card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.card-products .products-search-wrapper {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.card-products .products-search-wrapper .search-wrapper {
  position: relative;
  height: 40px;
  display: flex;
  align-items: center;
  background: $color-bg-light;
  border: 1px solid $color-border-light;
  border-radius: $radius-md;
  overflow: visible;
}

.card-products .products-search-wrapper .search-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: $color-text-secondary;
  pointer-events: none;
}

.card-products .products-search-wrapper .search-input {
  flex: 1;
  height: 100%;
  padding: 0 50px 0 38px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: $color-text-primary;

  &:focus,
  &:active,
  &:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none;
  }
}

.card-products .products-search-wrapper .action-btn-icon {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: none;
  border-left: 1px solid $color-border-light;
}

.card-products .products-search-wrapper .pos-autocomplete-results {
  left: 0;
  right: 0;
}

/* Category & brand below autocomplete: hidden on laptop (1366px+), shown on tablet and smaller */
.card-products-mobile-filters {
  display: none;
}

@media (max-width: 1365px) {
  /* Show categories and brands below search (all non-laptop sizes) */
  .card-products-mobile-filters {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin-top: 10px;
  }
  .card-products-mobile-filters .category-select-header,
  .card-products-mobile-filters .brand-select-header {
    width: 100%;
  }
  /* Hide categories and brands in desktop header when below search */
  .header-right .category-select-header,
  .header-right .brand-select-header {
    display: none !important;
  }
}

.card-products.is-loading {
  position: relative;
}

.card-products.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  pointer-events: auto;
}

.card-products.is-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  margin-left: -16px;
  border-radius: 50%;
  border: 3px solid rgba(102, 126, 234, 0.25);
  border-top-color: #667eea;
  animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.reset-filters-btn {
  width: 36px;
  height: 36px;
  border: 1px solid $color-border-light;
  background: white;
  border-radius: $radius-sm;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: $transition-fast;
  outline: none;
  box-shadow: none;

  svg {
    width: 16px;
    height: 16px;
    color: $color-text-secondary;
  }

  &:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);

    svg {
      color: #667eea;
    }
  }

  &:focus,
  &:active,
  &:focus-visible {
    outline: none !important;
    box-shadow: none !important;
  }
  -webkit-tap-highlight-color: transparent;
}

.products-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  padding-bottom: 100px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.product-card {
  background: $color-card-bg;
  border: 1px solid $color-border-light;
  border-radius: $radius-md;
  overflow: hidden;
  cursor: pointer;
  transition: $transition-smooth;
  display: flex;
  flex-direction: column;
  height: 100%;

  &:hover {
    border-color: #667eea;
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.15);
    transform: translateY(-6px);

    .add-to-cart-btn {
      transform: scale(1.15);
    }
  }
}

.product-image-wrapper {
  position: relative;
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid $color-border-light;

  .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
  }

  .product-image-placeholder {
    font-size: 48px;
    font-weight: 700;
    color: rgba(102, 126, 234, 0.2);
  }

  .discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, $color-warning 0%, $color-danger 100%);
    color: white;
    padding: 6px 10px;
    border-radius: $radius-sm;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.25);
  }
}

.product-details {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;

  .product-name {
    margin: 0 0 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: $color-text-primary;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-brand {
    margin: 0 0 4px 0;
    font-size: 11px;
    color: $color-text-tertiary;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
  }

  .product-stock {
    margin: 0 0 8px 0;
    font-size: 11px;
    color: $color-success;
    font-weight: 600;

    &.low-stock {
      color: $color-warning;
    }
  }

  .product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid $color-border-light;

    .product-price {
      font-size: 14px;
      font-weight: 700;
      background: $color-gradient-primary;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .add-to-cart-btn {
      width: 32px;
      height: 32px;
      border: none;
      background: rgba(102, 126, 234, 0.1);
      color: #667eea;
      border-radius: $radius-sm;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: $transition-fast;
      outline: none;
      box-shadow: none;

      svg {
        width: 16px;
        height: 16px;
      }

      &:hover:not(:disabled) {
        background: rgba(102, 126, 234, 0.2);
      }

      &:disabled {
        opacity: 0.5;
        cursor: not-allowed;
      }

      &:focus,
      &:active,
      &:focus-visible {
        outline: none !important;
        box-shadow: none !important;
      }
      -webkit-tap-highlight-color: transparent;
    }
  }
}

/* ============================================
   FIXED FOOTER BAR
   ============================================ */
.pos-footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: $color-card-bg;
  border-top: 1px solid $color-border-light;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  height: auto;
}

.footer-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: $color-success;

  svg {
    width: 16px;
    height: 16px;
  }

  &.is-offline {
    color: $color-warning;
  }
}

.footer-main-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
}

.footer-main-group .action-btn {
  padding: 12px 0;
}

.action-btn {
  padding: 12px 20px;
  border: none;
  border-radius: $radius-md;
  font-size: $font-size-sm;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: $transition-smooth;
  font-family: $font-family-primary;
  outline: none;
  box-shadow: none;

  svg {
    width: 18px;
    height: 18px;
  }

  &:hover {
    transform: translateY(-2px);
  }

  &:active {
    transform: translateY(0);
  }

  &:focus,
  &:active,
  &:focus-visible {
    outline: none !important;
    box-shadow: none !important;
  }
  -webkit-tap-highlight-color: transparent;
}

.action-btn-secondary {
  border: 1.5px solid $color-border-light;
  background: white;
  color: $color-text-secondary;

  &:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
  }
}

.action-btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid $color-border-light;
  background: white;
  color: $color-text-secondary;
  border-radius: $radius-md;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;

  i {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
  }

  &:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
  }

  &:focus,
  &:active,
  &:focus-visible {
    outline: none !important;
    box-shadow: none !important;
  }
  -webkit-tap-highlight-color: transparent;
}

/* Allow dropdown menus to escape the 44×44 action-btn-icon wrapper */
.dropdown.action-btn-icon {
  overflow: visible;
  position: relative;
}

/* Bootstrap-Vue dropdown toggles inside action-btn-icon wrappers */
.dropdown.action-btn-icon > .dropdown > button.dropdown-toggle.action-btn-icon,
.dropdown.action-btn-icon button.dropdown-toggle.action-btn-icon {
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  > a.action-btn-icon {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
  }
}

/* Offline status button - always red */
.btn-offline-status {
  border-color: $color-danger !important;
  background: $color-danger !important;
  color: #fff !important;

  i {
    color: #fff !important;
  }

  &:hover {
    border-color: darken($color-danger, 5%) !important;
    background: darken($color-danger, 5%) !important;
    color: #fff !important;
  }
}

/* Ensure icomoon icons render consistently inside this component */
i[class^="i-"] {
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

.action-btn-primary {
  background: $color-gradient-primary;
  color: white;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);
  flex: 1;
  max-width: 300px;
  justify-content: center;

  &:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.35);
    background: $color-gradient-hover;
  }

  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
}

.footer-space {
  flex: 1;
}
/* Languages dropdown */
#lang-dd .dropdown-menu,
#lang-dd-mobile .dropdown-menu {
  min-width: 220px;
  padding: 8px;
}

// .lang-menu {
//   display: grid;
//   grid-template-columns: repeat(2, minmax(0, 1fr));
//   gap: 6px;
// }

.lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  // border: 1px solid $color-border-light;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.lang-item:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.06);
}
.lang-item .flag-icon { width: 20px; height: 14px; object-fit: cover; }
.lang-item .title-lang { font-size: 12px; color: $color-text-primary; }
/* New Customer Modal improvements */
.new-customer-form {
  .form-group {
    margin-bottom: 12px;
  }

  input.form-control {
    height: 38px;
    border-radius: 8px;
  }

  .custom-control-label {
    user-select: none;
  }

  .loyalty-eligible-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid $color-border-light;
    border-radius: 10px;
    background: #fff;
  }

  .loyalty-info {
    display: flex;
    flex-direction: column;
  }

  .loyalty-title {
    font-weight: 700;
    color: $color-text-primary;
    margin-bottom: 2px;
  }

  .loyalty-help {
    font-size: 12px;
  }
}

.pos-gate-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
}

.card-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.6);
  backdrop-filter: saturate(150%) blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 2;
}

/* Today Sales modal */
.today-sales-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ts-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid $color-border-light;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.ts-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.ts-icon i { font-size: 18px; }
.ts-icon.primary { background: #667eea; }
.ts-icon.success { background: #10b981; }
.ts-icon.warning { background: #f59e0b; }
.ts-icon.info { background: #3b82f6; }
.ts-icon.danger { background: #ef4444; }

.ts-content { display: flex; flex-direction: column; }
.ts-label { font-size: 12px; color: $color-text-tertiary; }
.ts-value { font-weight: 700; color: $color-text-primary; }

/* ============================================
   TOTAL PAYABLE SECTION
   ============================================ */
.total-payable-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 20px;
  border-radius: $radius-md;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  padding: 12px 20px;
}

/* Points convert UI */
.points-group {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.convert-points-btn {
  border: 1px solid $color-border-light;
  background: white;
  color: #111827;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.convert-points-btn:hover {
  border-color: #667eea;
  background: rgba(102,126,234,.06);
}
.convert-points-btn.converted {
  border: 1px solid #9CA3AF;
  color: #6B7280;
}

/* Redesigned points row */
.points-convert-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid $color-border-light;
  border-radius: 10px;
  background: #fff;
}
.points-convert-row.converted {
  border-color: #9CA3AF;
  background: #f9fafb;
}
.points-left { display: flex; flex-direction: column; gap: 6px; }
.points-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.label-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: $color-text-primary;
}
.points-value { font-weight: 700; color: $color-text-primary; text-align: right; }
.discount-hint {
  grid-column: 1 / -1;
  font-size: 12px;
  color: #10b981;
}
.points-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.points-actions .flat-input { width: 140px; max-width: 100%; }
.convert-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #111827;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.convert-btn:hover { border-color: #667eea; background: rgba(102,126,234,.06); }
.convert-btn.converted { border-color: #9CA3AF; color: #6B7280; }
.convert-btn:focus,
.convert-btn:active,
.convert-btn:focus-visible { outline: none !important; box-shadow: none !important; }
.convert-btn { -webkit-tap-highlight-color: transparent; }

/* Backward compatibility for earlier class name */
.convert-points-btn:focus,
.convert-points-btn:active,
.convert-points-btn:focus-visible { outline: none !important; box-shadow: none !important; }
.convert-points-btn { -webkit-tap-highlight-color: transparent; }

@media (max-width: 576px) {
  .points-actions { justify-content: flex-start; flex-direction: column; align-items: stretch; }
  .points-actions .flat-input { width: 100%; }
  .convert-btn { width: 100%; justify-content: center; }
}

.payable-label {
  font-size: 11px;
  font-weight: 600;
  color: $color-text-tertiary;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.payable-amount {
  font-size: 20px;
  font-weight: 700;
  background: $color-gradient-primary;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-divider {
  width: 1px;
  height: 40px;
  background: $color-border-light;
  margin: 0 8px;
}

/* ============================================
   PAGINATION FOOTER
   ============================================ */
.pagination-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid $color-border-light;
  background: linear-gradient(to right, #fafbfc 0%, white 100%);
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 50;
}

.pagination-btn {
  width: 36px;
  height: 36px;
  border: 1px solid $color-border-light;
  background: white;
  border-radius: $radius-sm;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: $transition-fast;
  color: $color-text-secondary;
  flex-shrink: 0;

  svg {
    width: 16px;
    height: 16px;
  }

  &:hover:not(:disabled) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

.pagination-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 140px;

  .page-number {
    font-size: 12px;
    font-weight: 600;
    color: $color-text-primary;
  }

  .products-count {
    font-size: 11px;
    color: $color-text-tertiary;
  }
}

.pagination-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 300px;
}

.pagination-dot {
  width: 32px;
  height: 32px;
  border: 1px solid $color-border-light;
  background: white;
  border-radius: $radius-sm;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: $color-text-secondary;
  transition: $transition-fast;
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
  }

  &.active {
    background: $color-gradient-primary;
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
  }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1400px) {
  .pos-container {
    grid-template-columns: 400px 1fr;
    gap: 20px;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .pos-header { gap: 16px; }

  .header-right {
    gap: 8px;

  }
}

@media (max-width: 1200px) {
  .pos-header { gap: 12px; }

  .summary-breakdown {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--color-border);
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bd-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .brand-info h2 {
    font-size: 16px;
  }

  .brand-info p {
    font-size: 10px;
  }

}

@media (max-width: 1000px) {
  .pos-header { gap: 10px; align-items: stretch; flex-wrap: wrap; }

  .header-left {
    min-width: 0;
  }

  .brand-info h2 {
    font-size: 15px;
  }

  .header-center {
    order: 3;
    flex: 1 1 100%;
    grid-column: 1 / -1;

    .search-wrapper {
      width: 100%;
    }
  }

  .header-right {
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;


    .user-profile {
      width: 36px;
      height: 36px;
      font-size: 12px;
      flex-shrink: 0;
    }
  }
  .pos-codecanyon {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .pos-container {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-bottom: 24px;
    height: auto;
    overflow: visible;
  }

  .pos-column-left {
    gap: 16px;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
  }

  .card-added-products {
    max-height: none;
    flex: 0 0 45%;
    min-width: 0;
  }

  .card-summary {
    flex: 0 0 55%;
    min-width: 0;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .products-container { padding-bottom: 16px; }
  .cart-section { max-height: none; }
  .pos-footer-bar { position: static; }
}

@media (max-width: 1024px) {
  .pos-header { gap: 12px; padding: 12px 16px; min-height: auto; position: static !important; height: auto; align-items: stretch; flex-wrap: wrap; }
  .pos-footer-bar { position: static; }

  /* Tablet layout: stack checkout above Available Products (single column) */
  .pos-codecanyon { height: auto; min-height: 100vh; overflow: visible; }
  .pos-container { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .pos-column-left { height: auto; overflow: visible; }

  /* Checkout card: avoid cramped internal scroll on tablet */
  .cart-section { max-height: none; }
  .summary-section { padding-bottom: 16px; }

  /* Available Products card: remove excessive bottom padding on tablet */
  .products-container { padding-bottom: 16px; }

  /* Show brand icon at tablet size */
  .header-left {
    order: 1;
    display: flex !important;
    width: 100%;
    height: auto;
  }

  .header-center {
    order: 3;
    width: 100%;
    height: 40px;

    .search-wrapper {
      height: 40px;
      margin-top: 20px;
      
      > .action-btn-icon {
        width: 36px !important;
      }
    }
  }

  .header-right {
    order: 2;
    width: 100%;
    height: 40px;
    gap: 6px;
    flex-wrap: wrap;


    .user-profile {
      width: 40px;
      height: 40px;
      flex-shrink: 0;
    }
  }

  /* Small size language dropdown toggle (override Bootstrap-Vue) */
  button#lang-dd__BV_toggle_ {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    line-height: 30px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  button#lang-dd__BV_toggle_ > a.action-btn-icon,
  button#lang-dd__BV_toggle_ .action-btn-icon {
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    line-height: 30px !important;
  }

  /* Small size display-screen dropdown toggle (override Bootstrap-Vue) */
  button#display-screen-dd__BV_toggle_ {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    line-height: 30px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  button#display-screen-dd__BV_toggle_ > a.action-btn-icon,
  button#display-screen-dd__BV_toggle_ .action-btn-icon {
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    line-height: 30px !important;
  }

  .brand {
    gap: 8px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .brand-info h2 {
    font-size: 14px;
  }

  .brand-info p {
    font-size: 10px;
  }

  .pos-container {
    padding: 12px 16px;
    gap: 12px;
  }

  /* Small screen spacing removed per request */

  /* Compact header icons on small screens */
  .action-btn-icon { width: 30px !important; height: 30px !important; }

  .pos-footer-bar {
    padding: 12px 16px;
    gap: 8px;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: stretch;
  }

  .footer-status-indicator {
    width: 100%;
    justify-content: center;
    margin-bottom: 4px;
  }

  .footer-main-group {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .action-btn {
    padding: 10px 53px;
    font-size: 12px;
  }

  .action-btn-primary {
    flex: 1;
    min-width: 100%;
  }

  .total-payable-section {
    order: -1;
    width: 100%;
    margin-bottom: 8px;
  }


  .footer-divider {
    display: none;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  .pos-autocomplete-results { left: 0; right: 0; }
  
  /* Filter section full width with 40/40/20 layout */
  .pos-header-filters {
    width: 100%;
    flex: 1 1 100%;
  }
  .pos-header-filters .category-select-header,
  .pos-header-filters .brand-select-header {
    flex: 1 1 0;
    min-width: 0;
  }

  .header-right .btn-offline-status {
    position: relative;
  }

  .header-right .btn-offline-status.is-offline {
    border-color: $color-danger;
    background: $color-danger;
    color: #fff;
  }

  .header-right .btn-offline-status.is-offline i {
    color: #fff;
  }

  .header-right .btn-offline-status .offline-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    background: $color-danger;
    color: #fff;
    border-radius: 999px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 1.4;
  }

  /* Hide Available Products heading on small screens */
  .card.card-products .card-header > h3 { display: none !important; }
}

@media (max-width: 640px) {
  .pos-header { padding: 10px 12px; gap: 10px; min-height: auto; }

  .header-center {
    height: 38px;

    .search-wrapper {
      height: 38px;
    }

    .search-input {
      padding: 0 10px 0 36px;
      font-size: 12px;
    }

    .search-icon {
      width: 16px;
      height: 16px;
      left: 10px;
    }
  }

  .header-right {
    height: 38px;
    gap: 6px;


    .user-profile {
      width: 38px;
      height: 38px;
      font-size: 11px;
    }
  }

  .pos-container {
    padding: 12px 12px;
    gap: 10px;
  }

  .card-header {
    padding: 14px 16px;
    h3 {
      font-size: 15px;
    }
  }

  .charge-row {
    gap: 0;

    label {
      font-size: 10px;
    }

    .charge-input-group {
      width: 100px;
    }
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  
  /* Hide elements on small screens */
  .header-left { display: none !important; }
  .card.card-products .card-header > h3 { display: none !important; }

  .pagination-footer {
    gap: 8px;
    padding: 10px 12px;
  }

  .pagination-dots {
    max-width: 250px;
  }

  .pos-footer-bar {
    padding: 10px 12px;
    gap: 6px;
  }

  .total-payable-section {
    padding: 10px 12px;
  }

  .payable-amount {
    font-size: 18px;
  }

  /* Header filters full width on ≤640px */
  .pos-header-filters {
    width: 100%;
    flex: 1 1 100%;
  }
  .pos-header-filters .category-select-header,
  .pos-header-filters .brand-select-header {
    flex: 1 1 0;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .pos-header { padding: 20px 10px; gap: 1px; min-height: auto; }
  /* Swap headers: hide desktop header, show mobile header */
  .pos-header { display: none !important; }
  .pos-header-mobile { display: block; padding: 12px 10px; background: $color-card-bg; border-bottom: 1px solid $color-border-light; box-shadow: $shadow-md; }

  .pos-header-mobile .mobile-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
  .pos-header-mobile .mobile-row:last-child { margin-bottom: 0; }
  .pos-header-mobile .mobile-top { justify-content: space-between; }
  .pos-header-mobile .mobile-top .brand { display: flex; align-items: center; }
  .pos-header-mobile .mobile-top .brand .brand-icon { width: 44px; height: 44px; border-radius: $radius-md; display: flex; align-items: center; justify-content: center; font-weight: 700; }
  .pos-header-mobile .mobile-top .top-icons { display: inline-flex; align-items: center; gap: 6px; }
  /* Keep icon containers same size as desktop */
  .pos-header-mobile .mobile-top .top-icons .action-btn-icon { width: 40px !important; height: 40px !important; display: inline-flex; align-items: center; justify-content: center; }
  .pos-header-mobile .mobile-top .top-icons .btn-pos-settings { width: 40px !important; height: 40px !important; }
  .pos-header-mobile .mobile-top .top-icons .btn-offline-status { width: 40px !important; height: 40px !important; }
  .pos-header-mobile .mobile-top .top-icons .btn-offline-status.is-offline { border-color: $color-danger; background: $color-danger; color: #fff; }
  .pos-header-mobile .mobile-top .top-icons .btn-offline-status.is-offline i { color: #fff; }
  .pos-header-mobile .mobile-top .top-icons .btn-offline-status .offline-badge { top: -4px; right: -2px; background: $color-danger; color: #fff; border-radius: 999px; padding: 0 4px; font-size: 10px; line-height: 1.4; }
  .pos-header-mobile .mobile-top .top-icons .user-profile { width: 40px !important; height: 40px !important; }
  /* Bootstrap-Vue language toggle button size */
  button#lang-dd-mobile__BV_toggle_ { width: 40px !important; height: 40px !important; min-width: 40px !important; min-height: 40px !important; padding: 0 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; }
  button#lang-dd-mobile__BV_toggle_ > a.action-btn-icon,
  button#lang-dd-mobile__BV_toggle_ .action-btn-icon { width: 40px !important; height: 40px !important; }

  /* Bootstrap-Vue display-screen toggle button size */
  button#display-screen-dd__BV_toggle_ { width: 40px !important; height: 40px !important; min-width: 40px !important; min-height: 40px !important; padding: 0 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; }
  button#display-screen-dd__BV_toggle_ > a.action-btn-icon,
  button#display-screen-dd__BV_toggle_ .action-btn-icon { width: 40px !important; height: 40px !important; }
  button#display-screen-dd-mobile__BV_toggle_ { width: 40px !important; height: 40px !important; min-width: 40px !important; min-height: 40px !important; padding: 0 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; }
  button#display-screen-dd-mobile__BV_toggle_ > a.action-btn-icon,
  button#display-screen-dd-mobile__BV_toggle_ .action-btn-icon { width: 40px !important; height: 40px !important; }

  /* Bootstrap-Vue user dropdown container and toggle size */
  .pos-header-mobile #user-dd-mobile { width: 40px !important; height: 40px !important; }
  button#user-dd-mobile__BV_toggle_ { width: 40px !important; height: 40px !important; min-width: 40px !important; min-height: 40px !important; padding: 0 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; }

  .pos-header-mobile .warehouse-select,
  .pos-header-mobile .customer-select-header,
  .pos-header-mobile .category-select-header,
  .pos-header-mobile .brand-select-header {
    width: 100%;
  }

  /* On mobile hide category/brand in header; they appear below search in products card */
  .pos-header-mobile .mobile-row-category,
  .pos-header-mobile .mobile-row-brand {
    display: none !important;
  }

  /* Show category & brand below autocomplete search in products card */
  .card-products-mobile-filters {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin-top: 10px;
  }
  .card-products-mobile-filters .category-select-header,
  .card-products-mobile-filters .brand-select-header {
    width: 100%;
  }

  /* Reuse existing register button neutral style */
  .pos-header-mobile .register-status { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
  .pos-header-mobile .register-toggle-btn { background: $color-bg-light; color: $color-text-primary; border: 1px solid $color-border-light; padding: 4px 10px; font-weight: 600; }
  /* Mobile-only POS header layout */
  .pos-header {
    position: static !important;
    height: auto !important;
    flex-wrap: wrap; /* allow stacking below top row */
    align-items: center; /* align brand with icons on the top row */
  }
  /* Ensure brand is visible and first */
  .header-left {
    display: flex !important;
    order: 0;
    width: auto;
    height: 36px;
    align-items: center;
  }

  .header-center {
    height: 36px;

    .search-wrapper {
      height: 36px;
    }

    .search-input {
      padding: 0 8px 0 32px;
      font-size: 11px;
    }

    .search-icon {
      width: 14px;
      height: 14px;
      left: 8px;
    }
  }

  /* Place search right below register-status */
  .header-center {
    order: 5;
    width: 100%;

    .search-wrapper {
      margin-top: 0;

      > .action-btn-icon {
        width: 32px !important;
      }
    }

    .search-input {
      padding: 0 36px 0 32px;
    }
  }

  .header-right {
    height: 36px;
    gap: 6px;


    .user-profile {
      width: 36px;
      height: 36px;
      font-size: 10px;
    }
  }

  /* Arrange header-right content rows and ordering */
  .header-right {
    order: 1;
    width: auto;
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    min-width: 0;
  }

  /* Top row items: i-Receipt, language, profile (brand is separate in .header-left) */
  .header-right > .action-btn-icon { order: 1; }
  .header-right > .dropdown.action-btn-icon { order: 2; display: inline-flex !important; }
  .header-right > .dropdown:not(.action-btn-icon) { order: 3; }

  /* Next rows: register, search (as sibling), then selects full width; move POS settings below */
  .header-right > .register-status { order: 4; flex: 1 1 100%; min-width: 0; }
  .header-right > .warehouse-select { order: 6; flex: 1 1 100%; min-width: 0; }
  .header-right > .customer-select-header { order: 7; flex: 1 1 100%; min-width: 0; }
  .header-right > .btn-pos-settings { order: 8; display: inline-flex !important; }

  /* Keep brand and icons on the same row */
  .header-left { flex: 0 0 auto; }
  .header-right { flex: 1 1 auto; }

  .brand {
    gap: 6px;
  }

  .brand-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .brand-info h2 {
    font-size: 12px;
  }

  .brand-info p {
    font-size: 9px;
  }

  .pos-container {
    padding: 8px 10px;
    padding-bottom: 100px;
    gap: 8px;
  }

  .pos-column-left {
    gap: 12px;
  }

  .card-header {
    padding: 12px 12px;
    h3 {
      font-size: 13px;
    }
  }

  .charge-row {
    gap: 0;

    label {
      font-size: 10px;
    }

    .charge-input-group {
      width: 100px;
    }
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .pagination-footer {
    gap: 6px;
    padding: 8px 10px;
  }

  .pagination-info {
    min-width: 120px;
  }

  .pagination-dots {
    max-width: 200px;
  }

  .pagination-dot {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }

  .product-image-wrapper {
    height: 120px;
  }

  .product-details {
    padding: 10px;

    .product-name {
      font-size: 11px;
    }

    .product-brand {
      font-size: 9px;
    }

    .product-stock {
      font-size: 10px;
    }

    .product-footer {
      .product-price {
        font-size: 12px;
      }
    }
  }

  .pos-footer-bar {
    padding: 8px 10px;
    gap: 4px;

    /* 2x2 footer buttons grid (Home / Reset / Recent Drafts / Hold) */
    .footer-main-group {
      width: 100%;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      justify-content: stretch;
      align-items: stretch;
    }

    /* Remove spacer in grid layout */
    .footer-space {
      display: none;
    }

    /* Secondary actions: 50% / 50% */
    .footer-main-group .action-btn.action-btn-secondary {
      width: 100%;
      justify-content: center;
      padding: 8px 10px;
      font-size: 10px;
    }

    /* Total + Pay Now full width below the 2x2 button grid */
    .total-payable-section,
    .action-btn-primary {
      grid-column: 1 / -1;
      width: 100%;
    }

    .action-btn {
      padding: 8px 12px;
      font-size: 10px;
    }

    .action-btn-icon {
      width: 36px;
      height: 36px;

      svg {
        width: 14px;
        height: 14px;
      }
    }

    .action-btn-primary {
      min-width: 100%;
      padding: 8px 12px;
    }
  }
}

.premium-payment-modal {
  --color-primary: #667eea;
  --color-secondary: #764ba2;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-border: #e5e7eb;
  --color-bg: #f8f9fb;
  --color-text: #1a1a2e;
  --color-gray: #6b7280;
}

.payment-checkout-wrapper {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  background: white;
  border-radius: 16px;
  overflow: hidden;
}

/* HEADER */
.checkout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.checkout-header-content {
  flex: 1;
}

.checkout-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.checkout-subtitle {
  margin: 4px 0 0 0;
  font-size: 14px;
  opacity: 0.95;
}

.checkout-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  transition: all 0.2s;

  &:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
  }

  svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
  }
}

/* BODY */
.checkout-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

.checkout-form {
  display: contents;
}

.checkout-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 28px;

  @media (max-width: 1024px) {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ORDER SUMMARY */
.order-summary-card {
  background: linear-gradient(135deg, var(--color-bg) 0%, #ffffff 100%);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: fit-content;
  position: sticky;
  top: 0;
}

.summary-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.summary-label {
  color: var(--color-gray);
  font-weight: 500;
}

.summary-value {
  color: var(--color-text);
  font-weight: 600;

  &.text-danger {
    color: var(--color-danger);
  }
}

.summary-divider {
  height: 1px;
  background: var(--color-border);
  margin: 4px 0;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 8px;
}

.total-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-amount {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.payment-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.status-item {
  text-align: center;
  padding: 10px;
  background: var(--color-bg);
  border-radius: 8px;
}

.status-label {
  display: block;
  font-size: 11px;
  color: var(--color-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.status-value {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);

  &.text-warning {
    color: var(--color-warning);
  }

  &.text-success {
    color: var(--color-success);
  }
}

/* PAYMENT FORM */
.payment-form-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.line-count {
  font-size: 12px;
  color: var(--color-gray);
  background: var(--color-bg);
  padding: 4px 8px;
  border-radius: 4px;
}

/* PAYMENT METHOD TABS */
.payment-method-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
}

.method-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--color-border);
  background: white;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);

  &:hover {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.04) 0%, rgba(118, 75, 162, 0.04) 100%);
  }

  &.active {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--color-primary);
  }
}

.method-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;

  svg {
    width: 100%;
    height: 100%;
    stroke-width: 1.5;
  }
}

.method-name {
  text-align: center;
  font-size: 11px;
}

/* PAYMENT LINES */
.payment-lines-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: all 0.2s;

  &:hover {
    background: white;
    border-color: var(--color-primary);
  }
}

.line-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.line-content {
  flex: 1;
}

.amount-input-group {
  font-size: 13px;
}

.line-amount-input {
  border: none;
  background: white;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;

  &:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  }
}

.line-remove-btn {
  padding: 4px 8px !important;
  color: var(--color-danger);
  font-size: 16px;
}

.add-line-btn {
  border-color: var(--color-primary);
  color: var(--color-primary);
  margin-top: 4px;
  font-weight: 600;
}

/* QUICK AMOUNT */
.quick-amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quick-btn {
  font-weight: 600;
  border-color: var(--color-border);
  transition: all 0.2s;

  &:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
  }
}

/* KEYPAD */
.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.keypad-key {
  padding: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s;

  &:hover {
    border-color: var(--color-primary);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
  }

  &:active {
    transform: translateY(0);
  }
}

/* CREDIT CARD */
.saved-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-cards-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.card-option {
  padding: 16px 12px;
  background: white;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  position: relative;

  &:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
  }

  &.selected {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  }
}

.card-chip {
  width: 40px;
  height: 30px;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-last-four {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.card-exp {
  font-size: 11px;
  color: var(--color-gray);
}

.card-checkmark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--color-success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.new-card-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stripe-card-element {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: white;
}

.card-errors {
  color: var(--color-danger);
  font-size: 12px;
}

/* FORM ELEMENTS */
.form-label-sm {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--color-gray) !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-textarea-sm {
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: 6px;

  &:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  }
}

.checkboxes-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-item {
  font-size: 13px;
  color: var(--color-text);

  i {
    margin-right: 8px;
    font-size: 14px;
  }
}

/* FOOTER */
.checkout-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 32px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  flex-wrap: wrap;
}

.footer-info {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-amount {
  display: flex;
  flex-direction: column;

  .label {
    font-size: 11px;
    color: var(--color-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
  }

  .amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);

    &.text-warning {
      color: var(--color-warning);
    }

    &.text-success {
      color: var(--color-success);
    }
  }
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-cancel {
  padding: 10px 24px;
  font-weight: 600;
  font-size: 13px;
}

.btn-pay {
  padding: 10px 32px;
  background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
  border: none;
  color: white;
  font-weight: 600;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);

  &:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
  }

  &:disabled {
    opacity: 0.6;
  }

  i {
    margin-right: 8px;
  }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .payment-checkout-wrapper {
    max-height: 100vh;
  }

  .checkout-body {
    padding: 16px;
  }

  .checkout-row {
    gap: 16px;
  }

  .order-summary-card {
    position: static;
    padding: 16px;
  }

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

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

  .keypad {
    grid-template-columns: repeat(3, 1fr);
  }

  .checkout-footer {
    flex-direction: column;
    align-items: flex-end;
    padding: 12px 16px;
  }

  .footer-info {
    width: 100%;
    justify-content: space-around;
  }

  .footer-actions {
    width: 100%;
    gap: 8px;

    button {
      flex: 1;
    }
  }
}