/* ================== GLOBAL ================== */

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f2f3f7;
}

header {
    background: #2b7cff;
    color: white;
    padding: 14px 20px;
    font-size: 20px;
    font-weight: bold;
}

.container {
    display: flex;
    gap: 12px;
    padding: 10px;
}

/* ================== NAV ================== */

.nav {
    background: white;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
}

.nav a {
    text-decoration: none;
    margin-right: 15px;
    font-weight: bold;
    color: #333;
}

.nav a:hover {
    color: #2b7cff;
}

/* ================== LEFT PANEL ================== */

.products-panel {
    width: 60%;
    background: white;
    padding: 12px;
    border-radius: 6px;
}

/* Search */

#search {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

/* Category Buttons */

.category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.cat-btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    font-weight: bold;
}

.cat-btn.active {
    background: #2b7cff;
    color: white;
}

/* Category Section */

.category-section {
    margin-bottom: 15px;
}

.category-title {
    font-size: 18px;
    font-weight: bold;
    margin: 8px 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

/* ================== PRODUCTS GRID ================== */

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.product-btn {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    padding: 14px;
    text-align: center;

    display: flex;
    flex-direction: column;
    justify-content: center;

    min-height: 110px;  /* 🔥 Equal height */
    transition: 0.2s ease;
}

.product-btn:hover {
    background: #f0f7ff;
    border-color: #2b7cff;
}

.product-btn b {
    font-size: 15px;
    margin-bottom: 5px;
}

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

.bill {
    width: 50%;
    background: white;
    padding: 15px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    height: 95vh;
}

.bill-items {
    flex: 1;
    overflow-y: auto;
    padding-left: 0;
    list-style: none;
}

.bill-items li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.bill-items button {
    margin-right: 5px;
    padding: 4px 8px;
    border: none;
    background: #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.bill-items button:hover {
    background: #bbb;
}

/* ================== TOTAL SECTION ================== */

.total-box {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #ddd;
    font-size: 14px;
}

.total-box div {
    margin: 4px 0;
}

.grand {
    font-size: 18px;
    font-weight: bold;
    margin-top: 6px;
}

/* ================== DISCOUNT ================== */

#discountSelect {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
}

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

.print-btn,
button {
    padding: 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.print-btn {
    background: #2b7cff;
    color: white;
    margin-top: 10px;
}

.print-btn:hover {
    background: #1e5fd1;
}

/* ================== TABLE PAGE ================== */

.qty-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 5px;
}

.qty-controls button {
    padding: 4px 8px;
    background: #ddd;
    border-radius: 4px;
}

/* ================== SCROLLBAR CLEAN ================== */

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

.bill-items::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* ================== MOBILE FRIENDLY ================== */

@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }

    .products-panel,
    .bill {
        width: 100%;
    }

    .bill {
        height: auto;
    }
}
