/* ==========================================
   GOOGLE FONT & RESET
========================================== */

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

:root {

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;

    --bg: #f4f7fb;
    --white: #ffffff;

    --text: #1f2937;
    --text-light: #6b7280;

    --border: #e5e7eb;

    --shadow:
        0 8px 25px rgba(0,0,0,.08);

    --radius: 14px;

}

body {

    font-family: "Poppins", sans-serif;

    background: var(--bg);

    color: var(--text);

    min-height: 100vh;

}

/* ==========================================
   HEADER
========================================== */

.header {

    background: var(--white);

    box-shadow: var(--shadow);

    padding: 20px 35px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    flex-wrap: wrap;

}

.header-left h1 {

    color: var(--primary);

    font-size: 30px;

}

.header-left p {

    color: var(--text-light);

    margin-top: 5px;

}

.header-right {

    display: flex;

    gap: 15px;

}

.date-box,
.time-box {

    background: #eef4ff;

    padding: 12px 18px;

    border-radius: 10px;

    text-align: center;

    min-width: 120px;

}

.date-box span,
.time-box span {

    color: var(--text-light);

    font-size: 13px;

}

.date-box h3,
.time-box h3 {

    margin-top: 5px;

    color: var(--primary);

}

/* ==========================================
   MAIN LAYOUT
========================================== */

.container {

    width: 95%;

    margin: 30px auto;

    display: grid;

    grid-template-columns: 2fr 1fr;

    gap: 25px;

}

.left-panel,
.right-panel {

    display: flex;

    flex-direction: column;

    gap: 20px;

}

/* ==========================================
   COMMON CARD
========================================== */

.card,
.bill-card {

    background: var(--white);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    padding: 25px;

}

.card h2,
.bill-card h2 {

    margin-bottom: 20px;

    color: var(--primary);

}

/* ==========================================
   INPUTS
========================================== */

.input-group {

    margin-bottom: 20px;

}

.input-group label {

    display: block;

    margin-bottom: 8px;

    font-weight: 500;

}

.input-group input {

    width: 100%;

    padding: 12px 14px;

    border: 1px solid var(--border);

    border-radius: 10px;

    font-size: 15px;

    outline: none;

    transition: .3s;

}

.input-group input:focus {

    border-color: var(--primary);

    box-shadow: 0 0 0 3px rgba(37,99,235,.15);

}

/* ==========================================
   FOOD GRID
========================================== */

.food-container {

    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(220px,1fr));

    gap: 20px;

}

.food-card {

    background: #fbfcff;

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 18px;

    transition: .3s;

}

.food-card:hover {

    transform: translateY(-5px);

    box-shadow: var(--shadow);

}

.food-card h3 {

    color: var(--primary);

    margin-bottom: 8px;

}

.food-price {

    color: var(--success);

    font-weight: 600;

    margin-bottom: 15px;

}

.food-top {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 15px;

}
/* ==========================================
   CHECKBOX
========================================== */

.food-check {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ==========================================
   QUANTITY CONTROLS
========================================== */

.qty-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: .3s;
}

.qty-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.08);
}

.qty-btn:active {
    transform: scale(.95);
}

.qty {
    min-width: 35px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

/* ==========================================
   LIVE BILL PANEL
========================================== */

.bill-header {
    margin-bottom: 15px;
}

.bill-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-row span {
    color: var(--text-light);
}

.bill-card hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

/* ==========================================
   BILL ITEMS
========================================== */

.bill-items {
    min-height: 220px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 5px;
}

.empty {
    text-align: center;
    color: var(--text-light);
    margin-top: 50px;
}

.bill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}

.bill-item:last-child {
    border-bottom: none;
}

.bill-item-name {
    font-weight: 500;
}

.bill-item-details {
    color: var(--text-light);
    font-size: 14px;
}

.bill-item-total {
    font-weight: 600;
    color: var(--primary);
}

/* ==========================================
   SUMMARY
========================================== */

.summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-row.total {
    margin-top: 8px;
    padding-top: 15px;
    border-top: 2px dashed var(--border);
    font-size: 20px;
    font-weight: 700;
    color: var(--success);
}

/* ==========================================
   BUTTONS
========================================== */

.bill-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.bill-buttons button {
    flex: 1;
    padding: 13px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: white;
    font-size: 15px;
    font-weight: 600;
    transition: .3s;
}

.print-btn {
    background: var(--success);
}

.print-btn:hover {
    background: #15803d;
}

.clear-btn {
    background: var(--danger);
}

.clear-btn:hover {
    background: #b91c1c;
}

.bill-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,.15);
}

.bill-buttons button:active {
    transform: scale(.98);
}

/* ==========================================
   CUSTOM SCROLLBAR
========================================== */

.bill-items::-webkit-scrollbar {
    width: 6px;
}

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

.bill-items::-webkit-scrollbar-thumb {
    background: #2563eb;
    border-radius: 10px;
}

.bill-items::-webkit-scrollbar-thumb:hover {
    background: #1d4ed8;
}

/* ==========================================
   SMALL ANIMATIONS
========================================== */

.food-card,
.card,
.bill-card,
button,
input {
    transition: all .3s ease;
}

.food-card:hover {
    border-color: var(--primary);
}

input:hover {
    border-color: var(--primary);
}

/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 992px) {

    .container {
        grid-template-columns: 1fr;
    }

    .right-panel {
        order: -1;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

}

@media (max-width: 768px) {

    .food-container {
        grid-template-columns: 1fr;
    }

    .bill-buttons {
        flex-direction: column;
    }

    .date-box,
    .time-box {
        flex: 1;
    }

}

@media (max-width: 480px) {

    .header {
        padding: 20px;
    }

    .container {
        width: 95%;
    }

    .card,
    .bill-card {
        padding: 18px;
    }

    .header-left h1 {
        font-size: 24px;
    }

    .summary-row.total {
        font-size: 18px;
    }

}

/* ==========================================
   PRINT RECEIPT
========================================== */

.print-section {
    display: none;
}

.receipt {
    width: 80mm;
    margin: 0 auto;
    padding: 20px;
    background: white;
    color: black;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

.receipt-header {
    text-align: center;
    margin-bottom: 15px;
}

.receipt-header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}

.receipt-subtitle {
    margin: 5px 0 0 0;
    font-size: 11px;
    font-weight: 600;
}

.receipt-divider {
    border-top: 1px dashed #000;
    margin: 10px 0;
}

.receipt-info {
    margin-bottom: 10px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    padding: 3px 0;
}

.receipt-row span {
    flex: 1;
}

.receipt-row strong {
    text-align: right;
    flex: 1;
    word-break: break-word;
}

.receipt-items {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 11px;
}

.receipt-items thead {
    border-bottom: 1px solid #000;
}

.receipt-items th {
    padding: 5px 2px;
    text-align: left;
    font-weight: bold;
    border-bottom: 1px dashed #000;
}

.receipt-items td {
    padding: 4px 2px;
    text-align: left;
}

.receipt-items td:nth-child(2),
.receipt-items td:nth-child(3),
.receipt-items td:nth-child(4) {
    text-align: right;
}

.receipt-total {
    margin: 10px 0;
}

.receipt-total .receipt-row {
    padding: 4px 0;
}

.receipt-total .grand-total {
    font-weight: bold;
    font-size: 12px;
    padding-top: 8px;
    border-top: 2px solid #000;
    margin-top: 5px;
}

.receipt-thanks {
    text-align: center;
    margin: 15px 0 0 0;
    font-weight: bold;
    font-size: 11px;
}

/* ==========================================
   PRINT MODE - HIDE ALL UI
========================================== */

@media print {

    body * {
        visibility: hidden;
    }

    .print-section,
    .print-section * {
        visibility: visible;
    }

    .print-section {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        background: white;
    }

    .receipt {
        width: 80mm;
        margin: 0;
        padding: 0;
    }

}

/* ==========================================
   END OF STYLE.CSS
========================================== */