

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* Palitan ang body sa style.css mo ng ganito */
body {
    background-color: #f1f3f5;
    display: flex;
    flex-direction: column;
    height: 100vh; /* Lock sa view height */
    overflow: hidden; /* Bawal mag-scroll ang buong page */
    margin: 0;
}

/* NAVBAR DESIGN */
.navbar {
    background-color: #1a252f;
    color: #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 2px solid #2c3e50;
    width: 100%;
    height: 50px; /* Binigyan ng fix na taas para sa kalkulasyon */
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    background-color: transparent;
    border: 2px solid #ecf0f1;
    padding: 2px 10px;
    font-weight: bold;
    border-radius: 4px;
}

.branch-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-right {
    display: flex;
    gap: 20px;
    font-size: 18px;
    cursor: pointer;
}

/* MAIN BODY SPLIT */
.main-container {
    display: flex;
    flex: 1;
    height: calc(100vh - 50px);
    width: 100%;
    overflow: hidden;
}

/* KALIWA: Product Section */
.menu-section {
    flex: 6.5;
    padding: 20px;
    overflow-y: auto;
    background-color: #eaeded;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

/* PRODUCT CARD DESIGN */
.product-card {
    background-color: white;
    border: none;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 200px;
    transition: transform 0.15s, box-shadow 0.15s;
    padding: 0;
}

.product-card:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 12px rgba(0,0,0,0.15);
}

.product-img-box {
    width: 100%;
    height: 130px;
    background-color: #ddd;
    overflow: hidden;
}

.product-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    width: 100%;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #fff;
    border-top: 1px solid #f0f0f0;
}

.p-name {
    font-size: 13px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
}

.p-price {
    font-size: 12px;
    color: #27ae60;
    font-weight: 600;
    text-align: center;
    margin-top: 4px;
}

/* KANAN: Receipt and Control Panel (PINAG-ISA AT INAYOS) */
.cart-section {
    flex: 3.5;
    background-color: #f8f9fa;
    border-left: 1px solid #bdc3c7;
    display: flex;
    flex-direction: column;
    padding: 15px;
    height: 100%; /* Limitado lang sa parent height */
    overflow: hidden;
}

/* Mukhang Resibo na Puti (PINAG-ISA) */
.receipt-paper {
    background-color: white;
    border: 1px solid #dcdde1;
    border-radius: 8px;
    padding: 15px;
    flex: 1; 
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Pigilan ang paglaki ng box */
    margin-bottom: 15px;
}

.receipt-title {
    text-align: center;
    font-size: 14px;
    color: #2c3e50;
    letter-spacing: 1px;
    margin-bottom: 10px;
    border-bottom: 1px dashed #bdc3c7;
    padding-bottom: 10px;
}

/* ANG LALAGYAN NG ITEMS (DITO PINAGSAMAHAN ANG LABAN) */
.cart-items-container {
    flex: 1;
    overflow-y: auto; /* DITO LANG MAG-SCROLL */
    padding-right: 5px;
    margin-bottom: 10px;
    border-bottom: 1px dashed #ccc;
}

/* Scrollbar styling para sa loob ng Cart */
.cart-items-container::-webkit-scrollbar {
    width: 6px;
}
.cart-items-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.cart-items-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.cart-items-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.receipt-list {
    list-style: none;
}

.receipt-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 500;
}

/* BREAKDOWN & DROPDOWNS AREA */
.config-container {
    padding: 5px 0 !important;
}

.config-container > div {
    margin-bottom: 8px;
}

.receipt-breakdown {
    margin-top: 5px;
    padding-bottom: 5px;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #555;
}

.receipt-total-row {
    border-top: 1px dashed #bdc3c7;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: bold;
    color: #27ae60;
}

/* ACTION BUTTONS */
.action-buttons-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-finalize {
    width: 100%;
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 14px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 1px;
}
.btn-finalize:hover { background-color: #27ae60; }

.btn-clear {
    width: 100%;
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 12px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 1px;
}
.btn-clear:hover { background-color: #c0392b; }

/* CONNECTION INDICATOR */
.status-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 11px;
    font-weight: bold;
    color: #7f8c8d;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot.online { background-color: #2ecc71; box-shadow: 0 0 6px #2ecc71; }
.dot.offline { background-color: #e74c3c; box-shadow: 0 0 6px #e74c3c; }

/* EXTRA ITEMS AT STYLES (Cart Controls mula sa huling upgrades) */
.cart-controls-btn {
    background-color: #f1f2f6;
    border: 1px solid #ced6e0;
    border-radius: 4px;
    padding: 2px 8px;
    font-weight: bold;
    cursor: pointer;
    margin: 0 3px;
}
.cart-controls-btn:hover { background-color: #dfe4ea; }

.btn-delete-item {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-left: 8px;
}

.product-stock-tag {
    font-size: 11px;
    color: #7f8c8d;
    background-color: #f1f2f6;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 3px;
}

.product-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed !important;
    border: 2px dashed #e74c3c !important;
}

.out-of-stock-label {
    color: #e74c3c;
    font-weight: bold;
    font-size: 11px;
    margin-top: 3px;
}

/* MODAL OVERLAY BACKGROUND & POPUPS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%
    display: none;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    
}

.modal-content {
    background-color: #34495e;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 360px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 90vh; 
    display: flex;
    flex-direction: column;
}

.thermal-receipt {
    background-color: #ffffff;
    color: #000000;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    border-radius: 2px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    /* DITO ANG FIX: Gawing scrollable lang ang resibo */
    overflow-y: auto; 
    flex: 1; /* Sasakupin ang lahat ng available space */
    margin-bottom: 15px;
}

.receipt-header, .receipt-footer { text-align: center; }
.receipt-header h4 { font-size: 16px; margin-bottom: 2px; }
.divider { margin: 5px 0; overflow: hidden; white-space: nowrap; }
.receipt-meta p { margin: 2px 0; }
.receipt-items table { width: 100%; border-collapse: collapse; }
.receipt-items td { padding: 4px 0; vertical-align: top; }
.r-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.r-row.bold { font-weight: bold; font-size: 15px; margin-top: 5px; }

.modal-buttons { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;}
.btn-print { background-color: #2ecc71; color: white; border: none; padding: 12px; font-weight: bold; cursor: pointer; border-radius: 4px; font-size: 14px; }
.btn-print:hover { background-color: #27ae60; }
.btn-close-modal { background-color: #95a5a6; color: white; border: none; padding: 10px; cursor: pointer; border-radius: 4px; font-size: 13px; }
.btn-close-modal:hover { background-color: #7f8c8d; }

/* PRINT MEDIA */
@media print {
    body * { visibility: hidden; }
    .thermal-receipt, .thermal-receipt * { visibility: visible; }
    .thermal-receipt { position: absolute; left: 0; top: 0; width: 100%; }
}

/* CATEGORY TABS */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background-color: white;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow-x: auto;
    white-space: nowrap;
}

.tab-btn {
    background-color: #f1f3f5;
    border: 1px solid #dcdde1;
    color: #2c3e50;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tab-btn:hover { background-color: #e2e6ea; border-color: #bdc3c7; }
.tab-btn.active { background-color: #1a252f; color: white; border-color: #1a252f; }

/* SUBSCRIPTION LOCK OVERLAY */
.lock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(14, 22, 33, 0.98);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.lock-box {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: fadeInLock 0.3s ease-in-out;
}

.lock-icon { font-size: 50px; display: block; margin-bottom: 15px; }
.lock-box h2 { color: #e74c3c; margin-bottom: 10px; font-size: 24px; }
.lock-box p { color: #555; font-size: 14px; margin-bottom: 25px; line-height: 1.5; }
.contact-card { background-color: #f8f9fa; border: 2px solid #34495e; border-radius: 8px; padding: 20px; }
.contact-card h3 { color: #2c3e50; font-size: 18px; margin-bottom: 5px; }
.subscribe-text { font-size: 16px; font-weight: bold; color: #2ecc71 !important; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px !important; }
.contact-details { font-family: 'Courier New', monospace; font-size: 13px !important; color: #333 !important; line-height: 1.8 !important; }

@keyframes fadeInLock {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================
   UPDATES FOR OPTIONS A, B, AND C
   ========================================== */

/* OPTION B: Quick Cash Shortcut Buttons */
.quick-cash-container {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 5px;
    width: 61%;
    margin-left: auto; /* Para nakalinya sa ilalim ng Amt Tendered input */
}

.btn-quick-cash {
    flex: 1;
    min-width: 45px;
    background-color: #f1f2f6;
    border: 1px solid #ced6e0;
    border-radius: 4px;
    padding: 4px 2px;
    font-size: 11px;
    font-weight: bold;
    color: #2c3e50;
    cursor: pointer;
    text-align: center;
    transition: all 0.1s ease;
}

.btn-quick-cash:hover {
    background-color: #74b9ff;
    color: white;
    border-color: #74b9ff;
}

/* OPTION C: Sales History Modal Base Layout */
.history-modal-content {
    background-color: #ffffff;
    color: #2c3e50;
    max-width: 500px; /* Mas malapad ng konti para sa tables */
    width: 95%;
    padding: 25px;
    border-radius: 8px;
}

.history-table-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dfe4ea;
    border-radius: 4px;
    margin-top: 10px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.history-table th {
    background-color: #f1f2f6;
    padding: 10px;
    color: #2c3e50;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.history-table td {
    padding: 10px;
    border-bottom: 1px solid #f1f2f6;
}

/* Premium Teaser Lock Features */
.premium-teaser-box {
    position: relative;
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px dashed #ff7675;
    border-radius: 6px;
    overflow: hidden;
}

.premium-blur-content {
    filter: blur(4px);
    pointer-events: none;
    opacity: 0.6;
}

.premium-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10px;
}

.premium-lock-tag {
    background-color: #d63031;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    margin-bottom: 5px;
}

.premium-lock-overlay p {
    font-size: 12px;
    font-weight: bold;
    color: #2c3e50;
}

/* ==========================================
   UPDATES FOR UPGRADES 1, 2, AND 3
   ========================================== */

/* UPGRADE 1: Search Bar Styling */
.search-container {
    margin-bottom: 15px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    transition: border-color 0.15s;
}

.search-input:focus {
    border-color: #1a252f;
}

/* UPGRADE 2: Custom Discount Extra Row */
#customDiscountBox {
    transition: all 0.2s ease;
}

.custom-disc-input {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    color: #2c3e50;
    outline: none;
}

/* UPGRADE 3: Clean, Single-Box Compact Toast System */
.toast-container {
    position: fixed;
    bottom: 15px;
    left: 15px;
    z-index: 999999;
}

.toast-alert {
    background-color: rgba(26, 37, 47, 0.95); /* Medyo transparent para classy */
    color: #fff;
    padding: 6px 12px; /* Pinaliit ang padding */
    border-radius: 4px; /* Mas flat ang kanto */
    font-size: 11px; /* Mas maliit na font */
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 5px;
    border-left: 3px solid #2ecc71; /* Mas manipis na indicator */
    white-space: nowrap;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast-fade-out {
    animation: toastSlideOut 0.2s ease-in forwards;
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

/* ADMIN & HOLD/RECALL UI */
.admin-link {
    cursor: pointer;
    font-size: 10px;
    color: #95a5a6;
    text-decoration: underline;
    margin-top: 10px;
}

.hold-btn {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.hold-btn:hover { background-color: #d68910; }

.modal-overlay {
    position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.8); display: none; /* Hidden by default */
    justify-content: center; align-items: center; z-index: 9999;
}
.modal-content {
    background: white; padding: 20px; border-radius: 8px;
    text-align: center; width: 300px;
}
.ad-placeholder {
    width: 100%; height: 150px; background: #eee;
    display: flex; align-items: center; justify-content: center;
    border: 2px dashed #999; margin: 15px 0;
}

/* QR ADVERTISEMENT SECTION */
.receipt-qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    margin-top: 10px;
    border-top: 1px dashed #ccc; /* Separator para malinis */
    flex-shrink: 0; /* Importante: Hindi ito dapat liliit o lalaki */
}


/* Siguraduhin na ang image sa loob ay hindi lalampas */
#receiptQrCode img {
    width: 80px !important;
    height: 80px !important;
    display: block !important;
}

/* CREDIT SYSTEM BADGE */
.credit-badge {
    background-color: #f39c12;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #d68910;
    cursor: default;
}