/* General App Reset */
body, html {
    height: 100%;
    margin: 0;
    overflow: hidden; /* Prevents the whole page from bouncing */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#app {
    height: calc(100vh - 120px); /* Leaves room for top Navbar and bottom Nav */
    overflow-y: auto;
    padding: 10px;
}

/* Hidden by default */
.view-section {
    display: none;
    height: 100%;
}

/* Only show when active */
.view-section.active-view {
    display: block;
}

/* SALES VIEW GRID LOGIC */
#sales-view.active-view {
    display: grid !important;
    grid-template-rows: auto auto 1fr auto; /* Header, Search, List (Scroll), Cart (Fixed) */
    height: calc(100vh - 140px);
    gap: 10px;
}

/* The scrollable list of books/products */
#searchResults {
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}

/* The Fixed Cart at the bottom */
.cart-section {
    background: #fff;
    border-top: 2px solid #0d6efd;
    padding-top: 10px;
}

#cartItems {
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    margin-bottom: 5px;
    padding: 5px;
}

/* Bottom Navigation Styling */
.nav-bottom {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 65px;
    background: #fff;
    border-top: 1px solid #eee;
    z-index: 1000;
}

.nav-item {
    text-align: center;
    color: #666;
    text-decoration: none;
    font-size: 12px;
    padding-top: 10px;
}

.nav-item.active {
    color: #0d6efd;
}

/* Receipt Print Logic */
#receipt-zone { display: none; }
@media print {
    body * { display: none; }
    #receipt-zone { display: block; width: 100%; }
}