﻿/* ================= ROOT ================= */
.billdesk {
    padding: 20px;
    background: #f6f7f9;
    max-width: 100%;
    overflow-x: hidden;
}

/* ================= HEADER ================= */
.billdesk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

    .billdesk-header h2 {
        margin: 0;
        font-size: 22px;
    }

.billdesk-subtitle {
    font-size: 13px;
    color: #777;
}

.btn-add-order {
    background: #000;
    color: #fff;
    padding: 8px 14px;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
}

/* ================= BODY ================= */
.billdesk-body {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 15px;
    max-width: 100%;
}

/* ================= PANELS ================= */
.billdesk-left,
.billdesk-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

.billdesk-left {
    width: 100%;
    overflow-x: auto;
}

/* ================= COMMON ================= */
.section-header {
    border-bottom: 1px solid #ddd;
    margin-bottom: 8px;
}

    .section-header h3 {
        margin: 0 0 6px 0;
        font-size: 16px;
    }

/* ================= ACTIVE ORDERS ================= */
.orders-table {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    min-width: 600px;
}

.orders-header,
.orders-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr 1.5fr;
    padding: 10px;
    gap: 10px;
}

.orders-header {
    background: #efefef;
    font-weight: 600;
}

.orders-row {
    border-top: 1px solid #eee;
    cursor: pointer;
}

/* ================= STATUS ================= */
.status-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
}

    .status-pill.preparing {
        background: #fff3cd;
        color: #856404;
    }

    .status-pill.ready {
        background: #d4edda;
        color: #155724;
    }

    .status-pill.placed {
        background: #cce5ff;
        color: #004085;
    }

    .status-pill.completed {
        background: #d1ecf1;
        color: #0c5460;
    }

    .status-pill.done {
        background: #d4edda;
        color: #155724;
    }

    .status-pill.cancelled {
        background: #fdecea;
        color: #d32f2f;
    }

    .status-pill.updated {
        background: #f3e8ff;
        color: #6b21a8;
    }

    .status-pill.serving {
        background: #ffedd5;
        color: #9a3412;
    }

    .status-pill.cleaning {
        background: #cffafe;
        color: #155e75;
    }
/* ================= TABLE SELECTION ================= */
.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}

.table-card {
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
}

    .table-card.available {
        background: #e6f7ff;
    }

    .table-card.occupied {
        background: #fdecea;
    }

/* ================= MENU ================= */
.menu-category h4 {
    margin: 10px 0 6px;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #fff;
    border-radius: 5px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .menu-item.selected {
        background: #e6f0ff;
        border-left: 4px solid #007bff;
    }

.item-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Tax Badges ── */
.tax-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.gst-badge {
    background: #e8f5e9;
    color: #2e7d32;
}

.vat-badge {
    background: #fff3e0;
    color: #e65100;
}

.notax-badge {
    background: #f0f0f0;
    color: #888;
}

/* ── Tax Mode Badge (Incl. / Excl.) ── */
.tax-mode-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.incl-mode {
    background: #e3f2fd;
    color: #1565c0;
}

.excl-mode {
    background: #fce4ec;
    color: #b71c1c;
}

/* ── Customization indicator dot on menu item ── */
.custom-dot {
    font-size: 9px;
    color: #9c27b0;
    margin-left: 3px;
    vertical-align: super;
    line-height: 1;
}

/* ================= RIGHT PANEL ================= */
.billdesk-right input {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* ================= SUMMARY ================= */
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.summary-total {
    border-top: 1px solid #ddd;
    padding-top: 8px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.summary-subtotal {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 6px 0 4px;
    color: #555;
    font-size: 13px;
}

.summary-divider {
    border-top: 1px dashed #ddd;
    margin: 4px 0;
}

.tax-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 3px 0;
    font-size: 13px;
    color: #555;
}

/* Inclusive tax row — muted style since it's already in price */
.inclusive-tax-row {
    opacity: 0.75;
}

.tax-label-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tax-incl-pill {
    font-size: 9px;
    font-weight: 600;
    background: #e3f2fd;
    color: #1565c0;
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.3px;
}

.tax-loading,
.tax-error {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 3px 0;
    font-size: 13px;
    color: #999;
    font-style: italic;
}

/* ================= DISPATCH ================= */
.dispatch-panel {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.dispatch-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

    .dispatch-btn.dinein {
        background: #007bff;
        color: #fff;
    }

    .dispatch-btn.takeaway {
        background: #28a745;
        color: #fff;
    }

    .dispatch-btn.selected {
        box-shadow: inset 0 0 0 2px #000;
    }

/* ================= PLACE ORDER ================= */
.place-order-panel {
    margin-top: 5px;
}

.btn-place-order {
    width: 100%;
    padding: 12px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
}

/* ================= UTIL ================= */
.hidden {
    display: none;
}

/* ===== FULL WIDTH MODE (NO RIGHT PANEL) ===== */
.billdesk-body.full-width {
    grid-template-columns: 1fr;
}

/* ===== ORDER SUMMARY ITEMS ===== */
.summary-item {
    display: grid;
    grid-template-columns: 1fr auto 50px auto auto;
    align-items: start;
    gap: 8px;
    padding: 6px 0;
}

/* Summary item info: name + customization tags stacked */
.summary-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.summary-name {
    font-size: 13px;
    font-weight: 500;
}

/* ── Customization Tags in order summary ── */
.cust-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cust-tag {
    display: inline-block;
    font-size: 10px;
    background: #f3e8ff;
    color: #7b1fa2;
    border: 1px solid #e1bee7;
    border-radius: 3px;
    padding: 1px 5px;
    font-weight: 500;
    white-space: nowrap;
}

.item-qty {
    width: 48px;
    height: 28px;
    text-align: center;
    font-size: 13px;
    padding: 2px;
}

.summary-price {
    font-weight: 600;
    text-align: right;
    padding-top: 2px;
}

.order-summary {
    margin-bottom: 16px;
}

/* ===== ACTIVE ORDERS ROW HOVER ===== */
.orders-row {
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

    .orders-row:hover {
        background-color: #f0f6ff;
        box-shadow: inset 4px 0 0 #007bff;
        cursor: pointer;
    }

.bill-no-container {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.bill-value {
    background: #e7f1ff;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===============================================================
   CUSTOMIZATION MODAL
   Slide-up bottom sheet for selecting item customizations
=============================================================== */

/* Dim overlay */
.cust-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The sheet itself */
.cust-modal-sheet {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding: 0 0 20px 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
    animation: slideUpSheet 0.22s ease-out;
}

@keyframes slideUpSheet {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Drag handle */
.cust-modal-handle {
    width: 36px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 10px auto 0;
}

/* Header */
.cust-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 18px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.cust-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #111;
}

.cust-modal-subtitle {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.cust-modal-close {
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 13px;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .cust-modal-close:hover {
        background: #eee;
    }

/* Options list */
.cust-modal-body {
    padding: 8px 18px;
    max-height: 260px;
    overflow-y: auto;
}

/* Each customization option row */
.cust-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
    margin-bottom: 2px;
}

    .cust-option:hover {
        background: #faf5ff;
    }

.cust-option-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Custom checkbox */
.cust-check-box {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 5px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    position: relative;
}

    .cust-check-box.checked {
        background: #7b1fa2;
        border-color: #7b1fa2;
    }

        .cust-check-box.checked::after {
            content: "✓";
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 12px;
            font-weight: 700;
        }

.cust-option-name {
    font-size: 14px;
    color: #222;
}

.cust-option-price {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

/* Footer */
.cust-modal-footer {
    padding: 12px 18px 0;
    border-top: 1px solid #f0f0f0;
}

.cust-modal-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
}

    .cust-modal-total-row span:last-child {
        font-weight: 700;
        color: #111;
    }

.cust-modal-add-btn {
    width: 100%;
    padding: 12px;
    background: #7b1fa2;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .cust-modal-add-btn:hover {
        background: #6a1791;
    }

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 1200px) {
    .billdesk-body {
        grid-template-columns: 1.5fr 1fr;
    }
}

@media (max-width: 992px) {
    .billdesk-body {
        grid-template-columns: 1fr;
    }

    .orders-table {
        min-width: 500px;
    }
}

@media (max-width: 768px) {
    .billdesk {
        padding: 10px;
    }

    .billdesk-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .orders-header,
    .orders-row {
        grid-template-columns: 1.5fr 1.5fr 1fr 1fr;
        font-size: 13px;
        padding: 8px;
    }

    .orders-table {
        min-width: 450px;
    }

    .cust-modal-sheet {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
    }
}

@media (max-width: 576px) {
    .billdesk-header h2 {
        font-size: 18px;
    }

    .orders-header,
    .orders-row {
        grid-template-columns: 1fr 1fr 0.8fr 0.8fr;
        font-size: 12px;
        padding: 6px;
    }

    .orders-table {
        min-width: 400px;
    }

    .table-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}

/* ================= CONTAINER WRAPPER FIX ================= */
.active-orders,
.table-selection,
.menu-section {
    width: 100%;
    overflow-x: auto;
}


.order-action-menu {
    position: absolute;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    padding: 8px;
    width: fit-content;
    white-space: nowrap;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

    .order-action-menu .action-btn {
        width: 100%;
        background: transparent;
        border: none;
        padding: 10px 12px;
        text-align: left;
        font-size: 14px;
        border-radius: 6px;
        cursor: pointer;
    }

        .order-action-menu .action-btn:hover {
            background: #f2f6ff;
        }

    .order-action-menu .edit {
        color: #333;
    }

    .order-action-menu .ready {
        color: #1e7bff;
        font-weight: 600;
    }

.d-none {
    display: none;
}

.order-type-selection {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
}

#takeawayAddressBox input {
    margin-top: 8px;
}

.btn-continue {
    width: 100%;
    padding: 12px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
}

#txtTakeawayAddress {
    width: 100%;
    font-size: 16px;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
    resize: none;
}

    #txtTakeawayAddress::placeholder {
        font-size: 15px;
        color: #888;
    }

/* ================= REMOVE ITEM BUTTON ================= */
.btn-remove-item {
    background: #fff0f0;
    border: 1px solid #ffcccc;
    color: #e53935;
    font-size: 14px;
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
    align-self: center;
    flex-shrink: 0;
}

    .btn-remove-item:hover {
        background: #e53935;
        border-color: #e53935;
        color: #fff;
        transform: scale(1.1);
    }

    .btn-remove-item:active {
        transform: scale(0.95);
    }
