/**
 * BizSync POS Stylesheet
 * Mobile-first responsive design for Point of Sale interface
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    /* Colors */
    --primary-color: #4a90e2;
    --primary-dark: #357abd;
    --primary-light: #7ab3f0;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;

    /* Text Colors */
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --text-light: #adb5bd;

    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-hover: #e9ecef;
    --bg-active: #dee2e6;

    /* Borders */
    --border-color: #dee2e6;
    --border-light: #e9ecef;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Courier New', monospace;

    /* Layout */
    --header-height: 60px;
    --cart-width: 380px;
}

/* ============================================
   Dark Mode Variables
   ============================================ */
[data-theme="dark"] {
    /* Colors - keep brand colors */
    --primary-color: #5a9fef;
    --primary-dark: #4a90e2;
    --primary-light: #7ab3f0;

    /* Text Colors */
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-light: #4b5563;

    /* Backgrounds */
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-hover: #374151;
    --bg-active: #4b5563;

    /* Borders */
    --border-color: #374151;
    --border-light: #4b5563;

    /* Shadows - darker for dark mode */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.pos-body {
    overflow: hidden;
    height: 100vh;
}

/* ============================================
   Header
   ============================================ */
.pos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--spacing-md);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.pos-header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.pos-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.pos-business-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: none;
}

.pos-header-center {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pos-header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.pos-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.user-icon {
    font-size: 1.1rem;
}

.pos-nav-btn,
.pos-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    text-decoration: none;
    transition: background 0.2s;
}

.pos-nav-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.pos-nav-btn:hover {
    background: var(--bg-hover);
}

.pos-logout-btn {
    background: #fee2e2;
    color: var(--danger-color);
}

.pos-logout-btn:hover {
    background: #fecaca;
}

/* ============================================
   Main Layout
   ============================================ */
.pos-main {
    display: flex;
    height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
}

/* ============================================
   Products Panel (Left)
   ============================================ */
.pos-products-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
    overflow: hidden;
}

.pos-search-container {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.pos-search-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-right: 40px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}

.pos-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.pos-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: var(--bg-hover);
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-muted);
}

.pos-search-clear:hover {
    background: var(--bg-active);
}

/* Category Tabs */
.pos-category-tabs {
    display: flex;
    gap: var(--spacing-xs);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pos-category-tabs::-webkit-scrollbar {
    display: none;
}

.pos-category-tab {
    flex-shrink: 0;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pos-category-tab:hover {
    border-color: var(--primary-light);
}

.pos-category-tab.active {
    color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
    border-color: var(--primary-color);
}

/* Product Grid */
.pos-product-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    grid-auto-rows: min-content;
    align-content: start;
    gap: var(--spacing-md);
    overflow-y: auto;
    padding-right: var(--spacing-xs);
    padding-bottom: var(--spacing-md);
}

.pos-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-sm);
}

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

/* Product Card */
.product-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: fit-content;
    max-height: 220px;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.product-card:active {
    transform: scale(0.98);
}

.product-image {
    width: 40%;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
    background: var(--bg-secondary);
    margin-left: auto;
    margin-right: auto;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
}

.product-info {
    flex: 1;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-code {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-mono);
}

.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-mono);
}

.product-unavailable {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--danger-color);
    font-size: 0.85rem;
}

/* ============================================
   Cart Panel (Right)
   ============================================ */
.pos-cart-panel {
    width: var(--cart-width);
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.pos-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.pos-cart-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.pos-cart-header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.pos-expand-cart {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.pos-expand-cart:hover {
    background: rgba(74, 144, 226, 0.2);
}

.pos-clear-cart {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--danger-color);
    background: transparent;
    border: 1px solid var(--danger-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.pos-clear-cart:hover {
    background: #fee2e2;
}

/* Order Type */
.pos-order-type {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.pos-order-type label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pos-order-type-buttons {
    display: flex;
    gap: var(--spacing-xs);
}

.pos-order-type-btn {
    flex: 1;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.pos-order-type-btn:hover {
    background: var(--bg-hover);
}

.pos-order-type-btn.active {
    color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
    border-color: var(--primary-color);
}

/* Cart Items */
.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.pos-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.cart-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.5;
}

.pos-cart-empty p {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.pos-cart-empty small {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Cart Item */
.cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: var(--spacing-sm);
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
}

.cart-item-info {
    overflow: hidden;
}

.cart-item-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.cart-item-qty {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-item-subtotal {
    font-weight: 600;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    min-width: 70px;
    text-align: right;
}

.cart-item-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.cart-item-remove:hover {
    color: var(--danger-color);
    background: #fee2e2;
}

/* Cart Totals */
.pos-cart-totals {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.pos-cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
    font-size: 0.9rem;
}

.pos-cart-row:last-child {
    margin-bottom: 0;
}

.pos-cart-discount {
    color: var(--success-color);
}

.pos-cart-total {
    font-size: 1.25rem;
    font-weight: 700;
    padding-top: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    border-top: 2px solid var(--border-color);
}

.pos-cart-total span:last-child {
    font-family: var(--font-mono);
}

/* Customer Section */
.pos-customer-section {
    display: flex;
    padding: var(--spacing-sm) var(--spacing-md);
    gap: var(--spacing-xs);
}

.pos-customer-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.pos-customer-btn:hover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

.pos-customer-btn.has-customer {
    border-style: solid;
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
}

.customer-icon {
    font-size: 1.25rem;
}

.pos-customer-clear {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.pos-customer-clear:hover {
    background: #fee2e2;
    color: var(--danger-color);
}

/* Checkout Button */
.pos-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-md);
    padding: var(--spacing-md);
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
}

.pos-checkout-btn:hover:not(:disabled) {
    background: var(--primary-dark);
}

.pos-checkout-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

.checkout-icon {
    font-size: 1.25rem;
}

/* ============================================
   Modals
   ============================================ */
.pos-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    padding: var(--spacing-md);
}

.pos-modal.active {
    opacity: 1;
    visibility: visible;
}

.pos-modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.pos-modal.active .pos-modal-content {
    transform: translateY(0);
}

.pos-checkout-modal {
    max-width: 600px;
}

.pos-receipt-modal {
    max-width: 400px;
}

.pos-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.pos-modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.pos-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.pos-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.pos-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

.pos-modal-footer {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* Buttons */
.pos-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.pos-btn-primary {
    color: white;
    background: var(--primary-color);
}

.pos-btn-primary:hover {
    background: var(--primary-dark);
}

.pos-btn-secondary {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.pos-btn-secondary:hover {
    background: var(--bg-hover);
}

/* ============================================
   Checkout Modal Specific
   ============================================ */
.checkout-summary {
    margin-bottom: var(--spacing-lg);
}

.checkout-summary h3,
.checkout-payment h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-md);
}

.checkout-items {
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: var(--spacing-md);
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    font-size: 0.9rem;
}

.checkout-item-name {
    flex: 1;
}

.checkout-item-qty {
    color: var(--text-muted);
    margin: 0 var(--spacing-sm);
}

.checkout-totals {
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.checkout-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
    font-size: 0.9rem;
}

.checkout-total {
    font-size: 1.1rem;
    font-weight: 700;
    padding-top: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    border-top: 2px solid var(--text-primary);
}

/* Payment Methods */
.checkout-payment {
    margin-bottom: var(--spacing-lg);
}

.payment-methods {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.payment-method-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.payment-method-btn:hover {
    border-color: var(--primary-light);
}

.payment-method-btn.active {
    color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
    border-color: var(--primary-color);
}

.payment-icon {
    font-size: 1.5rem;
}

/* Payment Fields */
.payment-fields {
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.form-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.change-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
    font-family: var(--font-mono);
}

.change-display.negative {
    color: var(--danger-color);
}

/* Quick Amount Buttons */
.quick-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
}

.quick-amount-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-amount-btn:hover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

/* Loan Warning */
.loan-warning {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    color: #92400e;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
}

.warning-icon {
    font-size: 1.25rem;
}

.loan-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Voucher Section */
.checkout-voucher-section {
    margin-bottom: var(--spacing-md);
}

.add-voucher-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
    color: var(--success-color);
    background: transparent;
    border: 1px dashed var(--success-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.add-voucher-btn:hover {
    background: rgba(39, 174, 96, 0.05);
}

.voucher-input-group {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.voucher-input-group .form-input {
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: monospace;
    font-weight: 600;
}

.apply-voucher-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    background: var(--success-color);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.apply-voucher-btn:hover {
    background: #219653;
}

.voucher-applied {
    margin-top: var(--spacing-sm);
}

.voucher-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.5rem 0.75rem;
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid var(--success-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

.voucher-code {
    font-family: monospace;
    font-weight: 600;
    color: var(--success-color);
    letter-spacing: 1px;
}

.voucher-discount {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.remove-voucher-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    margin-left: var(--spacing-xs);
}

.remove-voucher-btn:hover {
    color: #c0392b;
}

/* ============================================
   Customer Modal Specific
   ============================================ */
.customer-search {
    margin-bottom: var(--spacing-md);
}

.customer-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: var(--spacing-md);
}

.customer-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.customer-list-item:hover {
    background: var(--bg-hover);
}

.customer-list-name {
    font-weight: 500;
}

.customer-list-phone {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.customer-list-balance {
    font-size: 0.85rem;
    font-weight: 500;
}

.customer-list-balance.has-balance {
    color: var(--danger-color);
}

.customer-list-balance.no-balance {
    color: var(--success-color);
}

.customer-actions {
    text-align: center;
}

/* ============================================
   Receipt Content
   ============================================ */
.receipt-content {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.receipt-header {
    text-align: center;
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px dashed var(--border-color);
}

.receipt-business-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.receipt-info {
    margin-bottom: var(--spacing-md);
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
}

.receipt-items {
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-md);
}

.receipt-item {
    margin-bottom: var(--spacing-sm);
}

.receipt-item-line {
    display: flex;
    justify-content: space-between;
}

.receipt-totals {
    margin-bottom: var(--spacing-md);
}

.receipt-grand-total {
    font-size: 1.1rem;
    font-weight: 700;
    border-top: 2px solid var(--text-primary);
    padding-top: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.receipt-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.receipt-disclaimer {
    text-align: center;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 2px dashed var(--border-color);
}

.receipt-disclaimer p {
    font-weight: bold;
    color: #666;
    font-size: 0.85rem;
    margin: 0;
}

/* ============================================
   Toast Notification
   ============================================ */
.pos-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    opacity: 0;
    transition: all 0.3s;
}

.pos-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pos-toast.success {
    background: var(--success-color);
}

.pos-toast.error {
    background: var(--danger-color);
}

/* ============================================
   Fullscreen Order Review (Mobile)
   ============================================ */
.pos-fullscreen-order {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.pos-fullscreen-order.show {
    transform: translateY(0);
}

.fullscreen-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--primary-color);
    color: white;
}

.fullscreen-order-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.fullscreen-order-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.fullscreen-order-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fullscreen-order-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
}

.fullscreen-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
}

.fullscreen-item-info {
    flex: 1;
}

.fullscreen-item-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.fullscreen-item-price {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.fullscreen-item-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin: 0 var(--spacing-md);
}

.fullscreen-item-subtotal {
    font-weight: 700;
    font-size: 1.1rem;
    font-family: var(--font-mono);
    color: var(--text-primary);
    min-width: 90px;
    text-align: right;
}

.fullscreen-order-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.fullscreen-order-empty .cart-empty-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.fullscreen-order-empty p {
    font-size: 1.1rem;
    font-weight: 500;
}

.fullscreen-order-totals {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.fullscreen-order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
    font-size: 1rem;
}

.fullscreen-discount-row {
    color: var(--success-color);
}

.fullscreen-order-total {
    font-size: 1.5rem;
    font-weight: 700;
    padding-top: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    border-top: 2px solid var(--border-color);
}

.fullscreen-order-total span:last-child {
    font-family: var(--font-mono);
    color: var(--primary-color);
}

.fullscreen-order-actions {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    padding-bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom, 0));
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.fullscreen-back-btn {
    flex: 1;
}

.fullscreen-checkout-btn {
    flex: 2;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (min-width: 768px) {
    .pos-business-name {
        display: block;
    }

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

/* Desktop */
@media (min-width: 1024px) {
    .pos-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --cart-width: 100%;
        --header-height: 56px;
    }

    .pos-main {
        flex-direction: column;
    }

    .pos-products-panel {
        flex: 0 0 auto;
        min-height: 30vh;
        max-height: 35vh;
        overflow: hidden;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .pos-cart-panel {
        width: 100%;
        flex: 1;
        height: auto;
        min-height: auto;
        max-height: none;
        border-left: none;
        border-top: 1px solid var(--border-color);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .pos-cart-items {
        flex: 1;
        overflow-y: auto;
        min-height: 60px;
        max-height: 18vh;
    }

    .pos-expand-cart {
        display: flex;
    }

    .pos-header-center {
        display: none;
    }

    .pos-user span:not(.user-icon) {
        display: none;
    }

    .pos-product-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: min-content;
        gap: var(--spacing-xs);
        align-content: start;
        padding-right: 0;
    }

    .product-card {
        max-height: auto;
        padding: var(--spacing-xs);
    }

    .product-image,
    .product-image-placeholder {
        display: none;
    }

    .product-name {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        margin-bottom: 0.125rem;
        line-height: 1.2;
    }

    .product-code {
        font-size: 0.65rem;
        margin-bottom: 0.125rem;
    }

    .product-price {
        font-size: 0.8rem;
    }

    .cart-item {
        grid-template-columns: 1fr auto auto;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .cart-item-name {
        font-size: 0.8rem;
    }

    .cart-item-price {
        font-size: 0.65rem;
    }

    .cart-item-subtotal {
        display: none;
    }

    .payment-methods {
        flex-wrap: wrap;
    }

    .payment-method-btn {
        flex: 1 1 calc(50% - var(--spacing-xs));
    }

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

    /* Compact cart elements */
    .pos-cart-header {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .pos-cart-header h2 {
        font-size: 0.95rem;
    }

    .pos-order-type {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .pos-order-type label {
        font-size: 0.65rem;
        margin-bottom: 0.125rem;
    }

    .pos-order-type-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .pos-cart-totals {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .pos-cart-row {
        margin-bottom: 0.125rem;
        font-size: 0.8rem;
    }

    .pos-cart-total {
        font-size: 1rem;
        padding-top: var(--spacing-xs);
        margin-top: var(--spacing-xs);
    }

    .pos-customer-section {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .pos-customer-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }

    .pos-checkout-btn {
        margin: var(--spacing-xs) var(--spacing-sm);
        padding: var(--spacing-sm);
        font-size: 0.95rem;
    }

    .pos-cart-empty {
        padding: var(--spacing-sm) var(--spacing-sm);
    }

    .pos-cart-empty .cart-empty-icon {
        font-size: 1.75rem;
    }

    .pos-cart-empty p {
        font-size: 0.85rem;
        margin-bottom: 0.125rem;
    }

    .pos-cart-empty small {
        font-size: 0.7rem;
    }

    /* Search and category compact */
    .pos-search-container {
        margin-bottom: var(--spacing-xs);
    }

    .pos-search-input {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.9rem;
    }

    .pos-category-tabs {
        padding-bottom: var(--spacing-xs);
        margin-bottom: var(--spacing-xs);
        gap: 0.25rem;
    }

    .pos-category-tab {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .pos-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .pos-modal {
        padding: 0;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .pos-main {
        flex-direction: row;
    }

    .pos-products-panel {
        height: auto;
        flex: 1;
    }

    .pos-cart-panel {
        width: 300px;
        height: auto;
        border-left: 1px solid var(--border-color);
        border-top: none;
    }
}