:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --danger: #ef4444;
    --glass: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: grid;
    grid-template-columns: 80px 1fr 400px;
    height: 100vh;
    gap: 1rem;
    padding: 1rem;
}

/* Sidebar */
.sidebar {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 0;
    gap: 2rem;
}

.logo {
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.nav-item {
    text-decoration: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.nav-item:hover,
.nav-item.active {
    color: white;
    background: var(--primary);
}

/* Product Section */
.product-section {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-bar {
    width: 300px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: white;
    outline: none;
    transition: 0.3s;
}

.search-bar:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.product-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.product-price {
    color: var(--accent);
    font-weight: 700;
}

/* Cart Section */
.cart-section {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 700;
    font-size: 1.25rem;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.cart-footer {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--glass-border);
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.checkout-btn:hover {
    background: var(--primary-hover);
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1.25rem;
    text-align: right;
}

/* Receipt Print Style - 5.6cm Width */
@media print {
    @page {
        size: 5.6cm auto;
        margin: 0;
    }

    body {
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body>*:not(#receipt) {
        display: none !important;
    }

    #receipt {
        display: block !important;
        visibility: visible !important;
        width: 5.6cm !important;
        padding: 4mm !important;
        margin: 0 !important;
        position: static !important;
    }
}

#receipt {
    display: none;
}

.receipt-header {
    text-align: center;
    margin-bottom: 10px;
    border-bottom: 1px dashed #000;
    padding-bottom: 5px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.receipt-footer {
    margin-top: 10px;
    border-top: 1px dashed #000;
    padding-top: 5px;
    text-align: center;
}