* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    color: #333;
    font-size: 2em;
}

nav {
    display: flex;
    gap: 15px;
}

.nav-link {
    text-decoration: none;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: #667eea;
    color: white;
}

.container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.menu-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.menu-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.menu-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.menu-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.menu-item h3 {
    color: #333;
    margin-bottom: 5px;
    font-size: 1.2em;
}

.menu-item .price {
    color: #667eea;
    font-weight: bold;
    font-size: 1.1em;
}

.cart-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.cart-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    min-height: 200px;
}

.empty-cart {
    text-align: center;
    color: #999;
    padding: 40px 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

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

.cart-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #666;
    font-size: 0.9em;
}

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

.quantity-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.quantity-btn:hover {
    background: #5568d3;
}

.quantity {
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.remove-item {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.remove-item:hover {
    background: #c82333;
}

.cart-total {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    font-size: 1.3em;
    color: #333;
    margin-bottom: 15px;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 15px;
}

.close:hover {
    color: #000;
}

.qr-code-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.qr-code-container img {
    width: 200px;
    height: 200px;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 10px;
    background: white;
}

.qr-instruction {
    color: #666;
    margin: 15px 0;
}

/* Print Bill Styles */
.print-bill-container {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }
    
    .print-bill-container,
    .print-bill-container * {
        visibility: visible;
    }
    
    .print-bill-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block;
    }
    
    .bill-content {
        background: white;
        padding: 40px;
        font-family: 'Courier New', monospace;
    }
    
    .bill-header {
        text-align: center;
        margin-bottom: 30px;
        border-bottom: 2px solid #333;
        padding-bottom: 20px;
    }
    
    .bill-header h1 {
        font-size: 2em;
        margin-bottom: 10px;
    }
    
    .bill-info {
        margin-bottom: 20px;
    }
    
    .bill-items {
        margin: 20px 0;
    }
    
    .bill-item {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px dotted #ccc;
    }
    
    .bill-total {
        margin-top: 20px;
        padding-top: 20px;
        border-top: 2px solid #333;
        text-align: right;
        font-size: 1.2em;
        font-weight: bold;
    }
    
    .bill-footer {
        margin-top: 30px;
        text-align: center;
        font-size: 0.9em;
        color: #666;
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .cart-section {
        position: relative;
        top: 0;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    nav {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    header h1 {
        font-size: 1.5em;
    }
}
