/* ═══════════════════════════════════════════════════
   SURINAME MARKET POS – COMPLEET NIEUWE CSS
   ═══════════════════════════════════════════════════ */

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

:root {
    --pos-bg:      #0f172a;
    --pos-surface: #1e293b;
    --pos-card:    #111827;
    --pos-border:  #334155;
    --pos-green:   #1a6b3a;
    --pos-gold:    #e8a000;
    --pos-red:     #c0392b;
    --pos-text:    #f1f5f9;
    --pos-muted:   #94a3b8;
    --pos-radius:  10px;
}

body.sm-pos-page {
    background: var(--pos-bg);
    color: var(--pos-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ── Topbar ─────────────────────────────────────── */
.pos-topbar {
    background: var(--pos-card);
    border-bottom: 1px solid var(--pos-border);
    padding: 0 16px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.pos-topbar-logo { font-size: 18px; font-weight: 800; color: #22c55e; display: flex; align-items: center; gap: 6px; }
.pos-topbar-clock { font-size: 20px; font-weight: 800; color: var(--pos-gold); font-variant-numeric: tabular-nums; }
.pos-topbar-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--pos-muted); }
.pos-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pos-dot-green { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.pos-dot-red   { background: #ef4444; }
.pos-topbar-spacer { flex: 1; }
.pos-topbar-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 8px; border: 1px solid var(--pos-border);
    background: var(--pos-surface); color: var(--pos-text);
    font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
    text-decoration: none; transition: .2s;
}
.pos-topbar-btn:hover { border-color: #64748b; }
.pos-topbar-btn-red { background: var(--pos-red); border-color: var(--pos-red); color: #fff; }
.pos-topbar-btn-red:hover { background: #a93226; }

/* ── Tabs (mobiel) ──────────────────────────────── */
.pos-tabs {
    display: none;
    background: var(--pos-card);
    border-bottom: 2px solid var(--pos-border);
}
.pos-tab {
    flex: 1; padding: 12px 8px;
    background: transparent; border: none; border-bottom: 3px solid transparent;
    color: var(--pos-muted); font-size: 14px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-family: inherit; transition: .2s;
}
.pos-tab.active { color: #22c55e; border-bottom-color: #22c55e; background: rgba(34,197,94,.05); }
.pos-tab-badge {
    background: var(--pos-gold); color: #000;
    border-radius: 999px; min-width: 18px; height: 18px;
    display: none; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 900; padding: 0 4px;
}
.pos-tab-badge.show { display: inline-flex; }

/* ── Kassa gesloten overlay ─────────────────────── */
.pos-closed-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(15,23,42,.95);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.pos-closed-box {
    background: var(--pos-surface); border-radius: 16px;
    padding: 32px; max-width: 400px; width: 100%; text-align: center;
    border: 1px solid var(--pos-border);
}
.pos-closed-box h2 { font-size: 1.3rem; margin-bottom: 8px; }
.pos-closed-box p  { color: var(--pos-muted); font-size: 14px; margin-bottom: 20px; }
.pos-closed-input {
    width: 100%; padding: 12px; background: var(--pos-bg);
    border: 1px solid var(--pos-border); border-radius: 8px;
    color: var(--pos-text); font-size: 15px; font-family: inherit;
    margin-bottom: 12px; outline: none; text-align: center;
}
.pos-closed-input:focus { border-color: var(--pos-green); }
.pos-btn-open {
    width: 100%; padding: 14px; background: var(--pos-green);
    border: none; border-radius: 8px; color: #fff;
    font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.pos-btn-open:hover { background: #2d9c56; }

/* ── Hoofd layout ───────────────────────────────── */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    height: calc(100vh - 56px);
    overflow: hidden;
}

/* ── Producten panel ─────────────────────────────── */
.pos-products-panel {
    display: flex; flex-direction: column;
    overflow: hidden; border-right: 1px solid var(--pos-border);
    background: var(--pos-bg);
}
.pos-searchbar {
    padding: 10px 12px;
    border-bottom: 1px solid var(--pos-border);
    display: flex; gap: 8px;
    background: var(--pos-surface);
}
.pos-searchbar-input {
    flex: 1; padding: 9px 14px; border-radius: 8px;
    background: var(--pos-bg); border: 1px solid var(--pos-border);
    color: var(--pos-text); font-size: 14px; font-family: inherit; outline: none;
}
.pos-searchbar-input:focus { border-color: var(--pos-green); }
.pos-scan-btn {
    padding: 9px 14px; background: var(--pos-green); color: #fff;
    border: none; border-radius: 8px; font-size: 15px; cursor: pointer;
}
.pos-products-grid {
    flex: 1; overflow-y: auto; padding: 12px;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.pos-product-card {
    background: var(--pos-surface); border: 1px solid var(--pos-border);
    border-radius: var(--pos-radius); overflow: hidden; cursor: pointer;
    transition: .2s; display: flex; flex-direction: column;
}
.pos-product-card:hover { border-color: var(--pos-green); transform: translateY(-1px); }
.pos-product-card.out-of-stock { opacity: .5; cursor: not-allowed; }
.pos-product-img {
    aspect-ratio: 1; background: var(--pos-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; color: #475569; overflow: hidden; position: relative;
}
.pos-product-img img { width: 100%; height: 100%; object-fit: cover; }
.pos-product-out-badge {
    position: absolute; inset: 0; background: rgba(0,0,0,.7);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff;
}
.pos-product-info { padding: 10px; }
.pos-product-name { font-size: 13px; font-weight: 600; color: var(--pos-text); line-height: 1.3; margin-bottom: 4px; }
.pos-product-price { font-size: 15px; font-weight: 800; color: #22c55e; }
.pos-product-stock { font-size: 11px; color: var(--pos-muted); margin-top: 2px; }
.pos-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--pos-muted); padding: 40px; text-align: center; }
.pos-empty i { font-size: 40px; }

/* ── Cart panel ──────────────────────────────────── */
.pos-cart-panel {
    display: flex; flex-direction: column;
    background: var(--pos-card); overflow: hidden;
}
.pos-cart-header {
    padding: 12px 16px; border-bottom: 1px solid var(--pos-border);
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    background: var(--pos-surface);
}
.pos-cart-header h3 { flex: 1; font-size: 14px; font-weight: 700; }
.pos-back-btn {
    display: none; padding: 7px 10px; border-radius: 8px;
    background: var(--pos-surface); border: 1px solid var(--pos-border);
    color: var(--pos-text); cursor: pointer; font-size: 14px;
}
.pos-clear-btn {
    padding: 7px 10px; border-radius: 8px;
    background: transparent; border: 1px solid var(--pos-border);
    color: var(--pos-muted); cursor: pointer; font-size: 13px;
    font-family: inherit; transition: .2s;
}
.pos-clear-btn:hover { border-color: var(--pos-red); color: var(--pos-red); }
.pos-cart-items { flex: 1; overflow-y: auto; padding: 8px; }
.pos-cart-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 12px; padding: 40px;
    color: var(--pos-muted); text-align: center;
}
.pos-cart-empty i { font-size: 36px; }
.pos-cart-row {
    display: flex; align-items: center; gap: 8px;
    padding: 10px; margin-bottom: 4px;
    background: var(--pos-surface); border-radius: 8px;
    border: 1px solid var(--pos-border);
}
.pos-cart-row-name { font-size: 13px; font-weight: 600; color: var(--pos-text); flex: 1; }
.pos-cart-row-price { font-size: 11px; color: var(--pos-muted); }
.pos-qty-wrap { display: flex; align-items: center; gap: 6px; }
.pos-qty-btn {
    width: 28px; height: 28px; border-radius: 6px;
    background: var(--pos-border); border: none; color: var(--pos-text);
    font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pos-qty-btn:hover { background: var(--pos-green); }
.pos-qty-num { font-size: 14px; font-weight: 700; min-width: 20px; text-align: center; }
.pos-row-total { font-size: 13px; font-weight: 700; color: #22c55e; min-width: 70px; text-align: right; }
.pos-remove-btn {
    width: 26px; height: 26px; border-radius: 6px;
    background: transparent; border: none; color: var(--pos-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.pos-remove-btn:hover { color: var(--pos-red); }

/* ── Checkout sectie ─────────────────────────────── */
.pos-checkout { flex-shrink: 0; border-top: 1px solid var(--pos-border); }
.pos-totals { padding: 12px 16px; background: var(--pos-surface); border-bottom: 1px solid var(--pos-border); }
.pos-total-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; color: var(--pos-muted); }
.pos-total-row.main { font-size: 16px; font-weight: 800; color: var(--pos-gold); margin-top: 6px; }
.pos-discount-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pos-discount-input {
    flex: 1; padding: 8px 10px; background: var(--pos-bg);
    border: 1px solid var(--pos-border); border-radius: 6px;
    color: var(--pos-text); font-size: 13px; font-family: inherit; outline: none;
}

/* Valuta selector */
.pos-currency-wrap { padding: 8px 16px; border-bottom: 1px solid var(--pos-border); }
.pos-currency-label { font-size: 11px; color: var(--pos-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.pos-currency-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.pos-cur-btn {
    flex: 1; padding: 7px 8px; border-radius: 6px;
    background: var(--pos-surface); border: 1px solid var(--pos-border);
    color: var(--pos-muted); font-size: 12px; font-weight: 700; cursor: pointer;
    font-family: inherit; transition: .2s; text-align: center;
}
.pos-cur-btn.active { background: var(--pos-green); border-color: var(--pos-green); color: #fff; }

/* Betaalmethode */
.pos-methods-wrap { padding: 8px 16px; border-bottom: 1px solid var(--pos-border); }
.pos-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pos-method-btn {
    padding: 10px 8px; border-radius: 8px; background: var(--pos-surface);
    border: 1.5px solid var(--pos-border); color: var(--pos-muted);
    font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
    display: flex; flex-direction: column; align-items: center; gap: 4px; transition: .2s;
}
.pos-method-btn i { font-size: 16px; }
.pos-method-btn.active { border-color: var(--pos-green); color: var(--pos-text); background: rgba(26,107,58,.15); }
.pos-method-btn:hover { border-color: #64748b; }

/* Contant panel */
.pos-cash-wrap { padding: 8px 16px; border-bottom: 1px solid var(--pos-border); }
.pos-cash-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pos-cash-label { font-size: 12px; color: var(--pos-muted); min-width: 80px; }
.pos-cash-input {
    flex: 1; padding: 8px 10px; background: var(--pos-bg);
    border: 1px solid var(--pos-border); border-radius: 6px;
    color: var(--pos-text); font-size: 14px; font-family: inherit; outline: none;
}
.pos-cash-change { font-size: 16px; font-weight: 800; color: #22c55e; }
.pos-quick-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pos-quick-btn {
    padding: 7px 12px; background: var(--pos-surface); border: 1px solid var(--pos-border);
    border-radius: 6px; color: var(--pos-text); font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: .2s;
}
.pos-quick-btn:hover { border-color: var(--pos-green); color: #22c55e; }
.pos-bills-btn { font-size: 11px; padding: 5px 8px; }

/* Afrekenen knop */
.pos-checkout-btn {
    width: 100%; padding: 16px; background: var(--pos-green);
    border: none; color: #fff; font-size: 16px; font-weight: 800;
    cursor: pointer; font-family: inherit; transition: .2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.pos-checkout-btn:hover:not(:disabled) { background: #2d9c56; }
.pos-checkout-btn:disabled { background: #334155; color: var(--pos-muted); cursor: not-allowed; }

/* ── Modals ──────────────────────────────────────── */
.pos-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.7);
    z-index: 999; display: none; align-items: center; justify-content: center; padding: 20px;
}
.pos-modal.open { display: flex; }
.pos-modal-box {
    background: var(--pos-surface); border-radius: 16px; padding: 24px;
    max-width: 440px; width: 100%; border: 1px solid var(--pos-border);
    max-height: 90vh; overflow-y: auto;
}
.pos-modal-box h3 { font-size: 1.1rem; margin-bottom: 16px; }
.pos-modal-input {
    width: 100%; padding: 10px; background: var(--pos-bg);
    border: 1px solid var(--pos-border); border-radius: 8px;
    color: var(--pos-text); font-size: 14px; font-family: inherit;
    margin-bottom: 12px; outline: none;
}
.pos-modal-row { display: flex; gap: 8px; }
.pos-btn { padding: 10px 20px; border-radius: 8px; border: none; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.pos-btn-primary { background: var(--pos-green); color: #fff; }
.pos-btn-primary:hover { background: #2d9c56; }
.pos-btn-danger  { background: var(--pos-red); color: #fff; }
.pos-btn-danger:hover { background: #a93226; }
.pos-btn-ghost   { background: var(--pos-surface); color: var(--pos-text); border: 1px solid var(--pos-border); }
.pos-receipt-preview { font-family: 'Courier New', monospace; font-size: 12px; color: #000; background: #fff; padding: 16px; border-radius: 8px; margin-bottom: 16px; }

/* ── Bon ontvangen preview ───────────────────────── */
.pos-receipt-row { display: flex; justify-content: space-between; margin-bottom: 3px; }
.pos-receipt-divider { border: none; border-top: 1px dashed #999; margin: 8px 0; }

/* ════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .pos-tabs { display: flex; }

    .pos-layout {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    .pos-products-panel {
        height: auto;
        overflow: visible;
        border-right: none;
    }

    .pos-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 8px !important;
        max-height: none;
        overflow: visible;
    }

    .pos-cart-panel {
        min-height: 100vh;
        border-left: none;
    }

    .pos-back-btn { display: flex !important; align-items: center; gap: 6px; }

    .pos-topbar { height: 50px; padding: 0 10px; gap: 6px; }
    .pos-topbar-btn .btn-label { display: none; }
    .pos-topbar-clock { font-size: 16px; }

    .pos-checkout-btn { border-radius: 0; }
}

@media (max-width: 400px) {
    .pos-products-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .pos-product-name { font-size: 12px; }
    .pos-product-price { font-size: 13px; }
}
