body.kasir-page {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    padding-bottom: 0;
}

body.kasir-page .bottom-nav {
    z-index: 150;
}

body.kasir-page .container {
    padding: 0;
    max-width: 100%;
}

body.kasir-page .header {
    position: relative;
    padding: 10px 16px;
}

body.kasir-page .header h1 {
    font-size: 17px;
    margin-bottom: 0;
}

.kasir-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-h) - var(--bottom-nav-h) - var(--safe-bottom));
    height: calc(100dvh - var(--header-h) - var(--bottom-nav-h) - var(--safe-bottom));
}

.menu-section {
    flex: 1;
    background: var(--surface);
    padding: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.menu-section h2 {
    font-size: 15px;
    margin-bottom: 10px;
    color: var(--text);
    flex-shrink: 0;
}

.category-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
    scrollbar-width: none;
}

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

.category-tab {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.category-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    align-content: start;
}

.menu-item {
    background: var(--surface);
    color: var(--text);
    padding: 12px 10px;
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--border);
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.menu-item:active {
    background: var(--primary-light);
    border-color: var(--primary);
}

.menu-item-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-item-price {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}

.cart-section {
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
    transition: max-height 0.25s ease;
}

.cart-section.collapsed {
    max-height: 52px;
    overflow: hidden;
}

.cart-section.collapsed .cart-body {
    display: none;
}

.cart-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    border: none;
    background: var(--surface);
    width: 100%;
    min-height: 44px;
    font-size: 14px;
    color: var(--text);
}

.cart-toggle-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.cart-badge {
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.cart-toggle-total {
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
}

.cart-toggle-icon {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 6px;
}

.cart-body {
    padding: 0 12px 12px;
    display: flex;
    flex-direction: column;
    max-height: 38vh;
    overflow: hidden;
}

.platform-selector {
    padding: 10px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    flex-shrink: 0;
}

.platform-selector label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.platform-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.platform-option {
    padding: 8px 4px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-option.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 8px;
    min-height: 40px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.cart-item-name {
    font-weight: 500;
    font-size: 13px;
}

.cart-item-detail {
    font-size: 11px;
    color: var(--text-muted);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--primary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:active {
    background: var(--primary-light);
}

.qty-value {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.cart-item-subtotal {
    min-width: 70px;
    text-align: right;
    font-weight: 600;
    font-size: 13px;
}

.cart-summary {
    padding-top: 8px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.summary-row.total {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-shrink: 0;
}

.btn-clear {
    flex: 1;
    padding: 12px;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    min-height: 44px;
}

.btn-pay {
    flex: 2;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    min-height: 44px;
}

.btn-pay:active {
    background: var(--primary-dark);
}

.empty-cart {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.temperature-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 2000;
    justify-content: center;
    align-items: flex-end;
    padding: 16px;
    padding-bottom: calc(16px + var(--safe-bottom));
}

.temperature-modal.show {
    display: flex;
}

.temperature-modal-content {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.temperature-modal h3 {
    margin: 0 0 14px;
    font-size: 16px;
}

.temperature-options {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.temperature-option {
    flex: 1;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    text-align: center;
    font-weight: 500;
    min-height: 44px;
}

.temperature-option.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.temperature-fee {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.temperature-modal-actions {
    display: flex;
    gap: 8px;
}

.temperature-modal-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    min-height: 44px;
}

.btn-temperature-cancel {
    background: var(--bg);
    color: var(--text-muted);
}

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

.print-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 2000;
    padding: 16px;
    overflow-y: auto;
}

.print-content {
    background: white;
    width: 80mm;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #000;
}

.print-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.print-actions {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.btn-print {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    margin-right: 8px;
    min-height: 44px;
}

.btn-close {
    padding: 12px 24px;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    min-height: 44px;
}

@media (min-width: 480px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .platform-option {
        font-size: 12px;
    }
}

@media (min-width: 768px) {
    body.kasir-page {
        overflow: auto;
        height: auto;
        padding-bottom: 0;
    }

    .kasir-layout {
        flex-direction: row;
        height: calc(100vh - var(--header-h) - 24px);
        height: calc(100dvh - var(--header-h) - 24px);
        padding: 12px;
        gap: 12px;
    }

    .menu-section {
        flex: 1.2;
        border-radius: var(--radius);
        border: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .cart-section {
        flex: 0.8;
        max-width: 380px;
        border-radius: var(--radius);
        border: 1px solid var(--border);
        box-shadow: var(--shadow);
        max-height: none !important;
        position: relative;
    }

    .cart-section.collapsed .cart-body {
        display: flex;
    }

    .cart-toggle {
        display: none;
    }

    .cart-body {
        max-height: none;
        flex: 1;
        padding: 12px;
        display: flex;
        flex-direction: column;
    }

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

    .temperature-modal {
        align-items: center;
    }

    .temperature-modal-content {
        border-radius: var(--radius);
    }
}

@media (min-width: 1024px) {
    .menu-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media print {
    @page { size: 80mm auto; margin: 0; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    .header, .bottom-nav, .print-actions, .cart-toggle, .cart-section, .menu-section, .kasir-layout { display: none !important; }
    body { margin: 0; padding: 0; background: white !important; }
    body > * { visibility: hidden; }
    .container { visibility: visible; }
    .container > *:not(.print-modal) { visibility: hidden; }
    .print-modal, .print-modal * { visibility: visible !important; }
    .print-modal {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        background: white !important;
        padding: 0 !important;
        z-index: 9999 !important;
    }
    .print-content {
        width: 80mm; max-width: 80mm; margin: 0 auto; padding: 5px;
        color: #000 !important; font-size: 14px !important;
    }
    .print-content * { color: #000 !important; visibility: visible !important; }
    .print-header h1 { font-weight: 900 !important; font-size: 20px !important; }
}
