/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #F7FAFC 0%, #EDF2F7 100%);
    min-height: 100vh;
    color: #2D3748;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 420px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Navigation Header */
.nav-header {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.nav-btn {
    flex: 1;
    padding: 14px 18px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.nav-btn:not(.active) {
    background: transparent;
    color: #718096;
}

.nav-btn:not(.active):hover {
    background: rgba(102, 126, 234, 0.05);
    color: #4A5568;
}

/* Action Buttons Row */
.action-row {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.action-btn {
    flex: 1;
    padding: 16px 20px;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #4A5568;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
    background: rgba(255, 255, 255, 1);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn .icon {
    font-size: 16px;
    color: #667eea;
}

/* Categories Container */
.categories-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin-bottom: 120px;
}

.categories-title {
    font-size: 20px;
    font-weight: 700;
    color: #2D3748;
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: -0.5px;
}

/* Search and Sort Container */
.search-sort-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
    transition: all 0.3s ease;
}

.search-container {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    color: #2D3748;
    background: rgba(247, 250, 252, 0.5);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #A0AEC0;
    font-size: 16px;
}

.sort-btn {
    padding: 12px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    background: rgba(247, 250, 252, 0.5);
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sort-btn:hover {
    background: white;
    border-color: #667eea;
    transform: scale(1.05);
}

/* Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #F7FAFC;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    font-size: 14px;
    color: #2D3748;
}

.search-result-subtitle {
    font-size: 12px;
    color: #718096;
    margin-top: 2px;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.category-item:hover {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
}

.category-item.active {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}

.category-btn {
    width: 100%;
    padding: 18px 24px;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 16px;
    color: #2D3748;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.category-btn:hover {
    background: rgba(102, 126, 234, 0.05);
}

.category-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.category-arrow {
    font-size: 12px;
    color: #A0AEC0;
    transition: transform 0.3s ease;
}

.category-item.active .category-arrow {
    transform: rotate(180deg);
}

/* Menu Items Container */
.menu-items-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: rgba(247, 250, 252, 0.5);
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.menu-items-container.active {
    max-height: 1000px;
    padding: 20px 24px 24px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px 8px 4px 4px;
    min-height: 120px; /* Ensure space for empty state message */
}

/* Empty state styling */
.menu-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #718096;
    border-radius: 12px;
    background: rgba(247, 250, 252, 0.5);
    border: 2px dashed #E2E8F0;
    margin: 8px 0;
}

.menu-grid-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
    display: block;
}

.menu-grid-empty .empty-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #4A5568;
}

.menu-grid-empty .empty-subtitle {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.4;
}

/* Custom scrollbar for menu grid */
.menu-grid::-webkit-scrollbar {
    width: 6px;
}

.menu-grid::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.3);
    border-radius: 3px;
}

.menu-grid::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.menu-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.menu-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid rgba(102, 126, 234, 0.05);
    position: relative;
    overflow: visible;
    margin: 2px;
}

.menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.15);
}

.menu-item.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.menu-item-image {
    width: 100%;
    height: 70px;
    background: linear-gradient(135deg, #E2E8F0 0%, #CBD5E0 100%);
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #667eea;
    overflow: hidden;
}

.menu-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.menu-item-name {
    font-weight: 600;
    font-size: 13px;
    color: #2D3748;
    margin-bottom: 4px;
    line-height: 1.3;
}

.menu-item-price {
    font-weight: 700;
    font-size: 13px;
    color: #667eea;
    margin-bottom: 8px;
}

.menu-item-controls {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    gap: 12px;
}

.menu-item.selected .menu-item-controls {
    display: flex;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #667eea;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
    flex-shrink: 0;
}

.quantity-btn:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.quantity-btn.delete {
    background: #E53E3E;
}

.quantity-btn.delete:hover {
    background: #C53030;
}

.quantity-input {
    flex: 1;
    max-width: 80px;
    text-align: center;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 14px;
    color: #2D3748;
    background: white;
}

/* REMOVED: Quantity display styling - no longer needed */

/* Bottom Bar */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
}

.bottom-bar.active {
    transform: translateY(0);
}

.bottom-bar-content {
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.clear-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 107, 107, 0.1);
    color: #E53E3E;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.clear-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    transform: scale(1.05);
}

.order-summary {
    flex: 1;
    text-align: center;
}

.order-summary-items {
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}

.order-summary-total {
    font-size: 17px;
    color: #2D3748;
    font-weight: 700;
}

.confirm-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
}

.confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 380px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #2D3748;
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: -0.5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #4A5568;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    color: #2D3748;
    transition: all 0.2s ease;
    background: rgba(247, 250, 252, 0.5);
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    color: #2D3748;
    background: rgba(247, 250, 252, 0.5);
    cursor: pointer;
}

/* File Upload Styles */
.file-upload-container {
    position: relative;
    margin-top: 8px;
}

.file-upload-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-area {
    border: 2px dashed #E2E8F0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    background: rgba(247, 250, 252, 0.5);
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.file-upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.file-upload-icon {
    font-size: 24px;
    color: #A0AEC0;
    margin-bottom: 8px;
}

.file-upload-text {
    font-size: 14px;
    color: #4A5568;
    font-weight: 500;
}

.file-upload-subtext {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

.file-preview {
    margin-top: 12px;
    display: none;
}

.file-preview.active {
    display: block;
}

.file-preview-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
}

.color-picker-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.color-option.selected {
    border-color: #2D3748;
    transform: scale(1.1);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.modal-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-secondary {
    background: #EDF2F7;
    color: #4A5568;
    border: 1px solid #E2E8F0;
}

.btn-secondary:hover {
    background: #E2E8F0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #E53E3E 0%, #FC8181 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
}

/* Edit List Styles */
.edit-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 20px 0;
}

.edit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(247, 250, 252, 0.7);
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.edit-item:hover {
    background: rgba(247, 250, 252, 1);
    border-color: #CBD5E0;
}

.edit-item-info {
    flex: 1;
}

.edit-item-name {
    font-weight: 600;
    color: #2D3748;
    font-size: 14px;
}

.edit-item-price {
    font-size: 12px;
    color: #718096;
    margin-top: 2px;
}

.edit-item-actions {
    display: flex;
    gap: 8px;
}

.edit-btn {
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.edit-btn.edit {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.edit-btn.delete {
    background: rgba(229, 62, 62, 0.1);
    color: #E53E3E;
}

.edit-btn:hover {
    transform: scale(1.05);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(45, 55, 72, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    z-index: 3000;
    transition: transform 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: linear-gradient(135deg, #48BB78 0%, #68D391 100%);
}

.toast.error {
    background: linear-gradient(135deg, #E53E3E 0%, #FC8181 100%);
}

/* Sort Modal - VERSI COMPACT (Anti-Potong) */
.sort-modal {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px; /* Radius dikurangi sedikit */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Shadow lebih tajam */
    z-index: 2000; /* Z-index ditingkatkan */
    min-width: 150px;
    display: none;
    
    /* PERBAIKAN UTAMA: */
    /* 1. Max-height dipangkas jadi 180px agar scrollbar muncul lebih cepat */
    max-height: 180px;       
    overflow-y: auto;        
    overflow-x: hidden;      
    margin-top: 4px; /* Sedikit jarak dari tombol */
}

.sort-modal.active {
    display: block;
}

/* Scrollbar lebih tipis */
.sort-modal::-webkit-scrollbar {
    width: 3px;
}
.sort-modal::-webkit-scrollbar-track {
    background: #f7f7f7;
}
.sort-modal::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.sort-option {
    /* 2. Padding sangat dirapatkan */
    padding: 8px 12px;      
    cursor: pointer;
    border-bottom: 1px solid #EDF2F7;
    transition: all 0.1s ease;
    
    /* 3. Font diperkecil */
    font-size: 12px;         
    color: #4A5568;
    white-space: nowrap;
    line-height: 1.2; /* Jarak antar baris teks dirapatkan */
}

.sort-option:hover {
    background: rgba(102, 126, 234, 0.08);
    color: #5a67d8;
}

.sort-option:last-child {
    border-bottom: none;
}

.sort-option.active {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    font-weight: 700;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 20px;
        padding: 24px;
    }
    
    /* PERBAIKAN 1: Pastikan search & sort tetap horizontal */
    .search-sort-container {
        flex-direction: row; /* Paksa tetap baris */
        gap: 8px;
    }
    
    /* Agar tombol sort tidak mengecil */
    .sort-btn {
        min-width: 44px;
        height: 44px; /* Samakan tinggi dengan input */
        padding: 0;
    }

    /* Agar input search mengambil sisa ruang */
    .search-container {
        flex: 1;
        min-width: 0; /* Mencegah overflow flex item */
    }
    
    .quantity-input {
        min-width: 35px;
        max-width: 50px;
    }
}

/* Prevent zoom on input focus */
input, select, textarea {
    font-size: 16px !important;
}

/* Better touch targets */
.menu-item, .category-btn, .action-btn {
    min-height: 44px;
}

/* Improve scrolling performance */
* {
    -webkit-overflow-scrolling: touch;
}

/* Hide address bar on mobile */
html, body {
    height: 100%;
    overflow-x: hidden;
}

/* Focus styles for accessibility */
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Loading states */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* --- Tambahkan kode ini di baris paling bawah index.css --- */

/* 1. Menghilangkan panah atas/bawah (spinner) pada input number */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Untuk Firefox */
.quantity-input {
    -moz-appearance: textfield;
    text-align: center; /* Memastikan angka di tengah */
}

/* 2. Style untuk container tombol +/- */
.qty-control-group {
    display: flex;
    align-items: center;
    gap: 5px; /* Jarak antar tombol dan input */
    background: #f7fafc;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Style khusus tombol plus minus agar terlihat rapi */
.quantity-btn.plus, .quantity-btn.minus {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
}

/* Sesuaikan input agar tidak ada border karena sudah ada di container */
.qty-control-group .quantity-input {
    border: none;
    background: transparent;
    width: 40px; /* Lebar input angka */
    padding: 4px;
}

/* Mencegah teks terpilih (biru-biru) saat tombol ditekan lama */
.quantity-btn {
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+/Edge */
    user-select: none;         /* Standard */
    
    /* Memastikan tombol responsif terhadap sentuhan cepat di HP */
    touch-action: manipulation; 
}

/* --- Style untuk Fitur Catatan --- */

/* Input Catatan di Bottom Bar */
.note-input-bar {
    width: 100%;
    border: none;
    border-bottom: 1px dashed #cbd5e0;
    background: transparent;
    padding: 8px 4px;
    font-size: 13px;
    color: #4a5568;
    transition: all 0.2s;
    border-radius: 4px;
}

.note-input-bar:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.5);
    border-bottom-color: #667eea;
}

/* Penyesuaian Bottom Bar agar muat */
.bottom-bar {
    display: flex;
    flex-direction: column; /* Ubah jadi kolom agar catatan ada di atas tombol */
    padding: 0 0 20px 0; /* Padding disesuaikan */
}

.bottom-bar-content {
    padding: 10px 20px; /* Pindahkan padding ke content dalam */
    width: 100%;
}

/* =========================================
   PERBAIKAN FINAL: PRESISI PIXEL & FIX GRID
   (Gunakan kode ini di paling bawah index.css)
   ========================================= */

/* 1. GRID MENU: Tetap 3 Kolom Presisi */
.menu-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    padding: 4px 0 !important;
}

/* 2. ITEM MENU: Teknik Border Transparan */
.menu-item {
    /* PENTING: Border dihitung masuk dalam ukuran kotak, bukan di luar */
    box-sizing: border-box !important;
    
    /* PENTING: Berikan border 2px TRANSPARAN sejak awal.
       Jadi ukurannya sudah 'memakan tempat' border sejak belum dipilih. */
    border: 2px solid transparent !important;
    
    /* Reset style lainnya */
    padding: 4px !important; /* Padding sedikit dikecilkan agar muat border */
    border-radius: 8px;
    min-height: auto;
    width: 100% !important;
    margin: 0 !important;
    
    /* Matikan animasi gerak/zoom */
    transform: none !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, background-color 0.2s ease !important;
}

/* Override Total untuk Hover & Selected */
.menu-item:hover,
.menu-item.selected,
.menu-item.selected:hover {
    transform: none !important; /* JANGAN PERNAH MEMBESAR */
    box-shadow: none !important;
}

/* 3. SAAT DIPILIH: Cukup Ganti WARNA Border */
.menu-item.selected {
    /* Karena tebal border sudah 2px dari awal, kita cuma ganti warnanya saja.
       Ukuran kotak TIDAK akan berubah 1 pixel pun. */
    border-color: #667eea !important; 
    background-color: rgba(102, 126, 234, 0.08) !important;
    z-index: 1;
}

/* 4. GAMBAR: Kotak Sempurna (1:1) */
.menu-item-image {
    width: 100%;
    height: auto !important;
    aspect-ratio: 1 / 1;
    margin-bottom: 6px;
    border-radius: 6px;
}

/* 5. TEKS: Ukuran Kecil & Rapi */
.menu-item-name {
    font-size: 11px !important;
    line-height: 1.2;
    height: 2.4em;
    overflow: hidden;
    margin-bottom: 4px;
    text-align: center;
}

.menu-item-price {
    font-size: 11px !important;
    text-align: center;
    margin-bottom: 6px;
}

/* 6. KONTROL: Input di Atas, Hapus di Bawah */
.menu-item-controls {
    flex-direction: column;
    gap: 0 !important;
    padding-top: 4px !important;
    margin-top: 4px !important;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

/* Group Input Angka */
.qty-control-group {
    width: 100%;
    justify-content: space-between;
    padding: 0 !important;
    background: transparent;
    border: none;
    margin-bottom: 6px;
}

/* Tombol +/- */
.quantity-btn.plus, .quantity-btn.minus {
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
    border-radius: 4px;
    line-height: 1;
    padding: 0;
}

/* Input Angka */
.qty-control-group .quantity-input {
    width: 24px !important;
    font-size: 12px !important;
    padding: 0 !important;
    height: 22px;
}

/* Tombol Hapus (X) */
.quantity-btn.delete {
    width: 100% !important;
    height: 20px !important;
    border-radius: 4px;
    font-size: 10px !important;
    margin-top: 2px;
    background-color: #FED7D7 !important;
    color: #C53030 !important;
    border: 1px solid #C53030 !important;
}

.quantity-btn.delete:hover {
    background-color: #C53030 !important;
    color: white !important;
}