/* C:\dayeuhkolot-cafe-pos\websites\dashboard\kasir\css\style.css */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
}

/* ============================================ */
/* CUSTOM SCROLLBAR - THIN GREY */
/* ============================================ */
/* For Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Custom scrollbar untuk class tertentu */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* ============================================ */
/* TOUCH SCREEN OPTIMIZATIONS */
/* ============================================ */
button, 
.order-type-btn,
.menu-item-btn,
.payment-select-btn,
#clearCartBtn,
#discountBtn,
#checkoutBtn,
.category-btn,
#startShiftBtn,
#closeShiftBtn,
#backToTopBtn,
#menuToggleBtn,
#closeSidebarBtn {
    cursor: pointer;
    min-height: 48px;
}

.cart-qty-minus,
.cart-qty-plus,
.cart-item-remove {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================ */
/* CATEGORY BUTTON */
/* ============================================ */
.category-active {
    background-color: #1a66f5;
    color: white;
}

.category-active i {
    color: white;
}

.category-btn {
    transition: all 0.15s ease;
    padding: 14px 16px;
    font-size: 14px;
}

/* ============================================ */
/* ORDER TYPE BUTTONS */
/* ============================================ */
.order-type-btn {
    transition: all 0.2s ease;
    cursor: pointer;
}

/* ============================================ */
/* FONT STYLES */
/* ============================================ */
.menu-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.menu-price {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
}

/* Line clamp untuk nama menu panjang */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================ */
/* INPUT NUMBER SPINNERS DISABLED */
/* ============================================ */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* ============================================ */
/* ANIMATIONS */
/* ============================================ */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 0.8s linear infinite;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    85% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -20px); }
}

.toast-show {
    animation: fadeInOut 2s ease forwards;
}

/* ============================================ */
/* MOBILE SIDEBAR */
/* ============================================ */
@media (max-width: 768px) {
    .sidebar-left {
        position: fixed;
        top: 73px;
        left: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        z-index: 30;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    }
    
    .sidebar-left.open {
        transform: translateX(0);
    }
    
    .category-btn {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    /* Menu grid mobile - 2 kolom */
    #menuGrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .menu-item-btn {
        min-height: 130px;
        padding: 16px 8px !important;
    }
    
    /* Cart items max height */
    #cartItems {
        max-height: 40vh !important;
    }
}

/* ============================================ */
/* DESKTOP */
/* ============================================ */
@media (min-width: 769px) {
    .sidebar-left {
        transform: translateX(0) !important;
        top: 0 !important;
        height: 100vh !important;
    }
    
    .category-btn {
        padding: 12px 16px;
    }
    
    /* Menu grid desktop - 3 kolom */
    #menuGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .menu-item-btn {
        min-height: 130px;
        padding: 20px 12px !important;
    }
    
    /* Cart items max height */
    #cartItems {
        max-height: calc(100vh - 300px) !important;
    }
}

/* ============================================ */
/* FOCUS RING FOR ACCESSIBILITY */
/* ============================================ */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #1a66f5;
    outline-offset: 2px;
}

/* ============================================ */
/* PAYMENT METHOD BUTTON */
/* ============================================ */
.payment-select-btn {
    transition: all 0.15s ease;
    padding: 14px 0;
}

/* ============================================ */
/* PRINT RECEIPT STYLES */
/* ============================================ */
@media print {
    body * {
        visibility: hidden;
    }
    .print-receipt-container, .print-receipt-container * {
        visibility: visible;
    }
    .print-receipt-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 20px;
    }
    .no-print {
        display: none;
    }
}

/* ============================================ */
/* MAIN SCROLLABLE CONTAINER */
/* ============================================ */
.main-scrollable {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: calc(100vh - 73px);
}

@media (min-width: 769px) {
    .main-scrollable {
        height: 100vh;
    }
}

/* ============================================ */
/* MOBILE MAIN CONTAINER FIX */
/* ============================================ */
@media (max-width: 768px) {
    /* Container utama */
    body > div:first-of-type {
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }
    
    /* Main content - area menu */
    main {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
    }
    
    /* Pastikan grid menu muncul */
    #menuGrid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        margin-bottom: 20px;
    }
}

/* ============================================ */
/* ENSURE MENU CONTAINER HAS HEIGHT */
/* ============================================ */
.flex-1.overflow-y-auto {
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}