/* ==========================================================
   ThaiQROrder Business — Custom CSS (replaces Tabler)
   ========================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--c-dark);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
button { font-family: inherit; }
a { color: var(--c-primary); text-decoration: none; }
[x-cloak] { display: none !important; }

/* ---------- Tokens ---------- */
:root {
    --c-primary: #ff6b35;
    --c-primary-dark: #e85a28;
    --c-primary-lt: #fff0e9;
    --c-dark: #1e293b;
    --c-gray: #64748b;
    --c-gray-lt: #e2e8f0;
    --c-gray-50: #f8fafc;
    --c-bg: #f3f4f6;
    --c-white: #ffffff;
    --c-success: #10b981;
    --c-success-lt: #d1fae5;
    --c-danger: #ef4444;
    --c-danger-lt: #fee2e2;
    --c-warning: #f59e0b;
    --c-warning-lt: #fef3c7;
    --c-info: #3b82f6;
    --c-info-lt: #dbeafe;
    --radius: 14px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow: 0 4px 12px rgba(0, 0, 0, .08);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, .15);
    --t: .15s ease;
}

/* ==========================================================
   DESKTOP LAYOUT — phone mockup + project info side panel
   ========================================================== */
@media (min-width: 1024px) {
    body {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        min-height: 100vh;
    }
    .app-shell {
        display: flex;
        min-height: 100vh;
        align-items: center;
        justify-content: center;
        padding: 40px 60px;
        gap: 100px;
    }
    .desktop-info {
        max-width: 520px;
        color: #f8fafc;
        flex-shrink: 0;
    }
    .desktop-info h1 {
        font-size: 56px;
        font-weight: 800;
        line-height: 1.1;
        margin: 0 0 18px;
        background: linear-gradient(135deg, #ff6b35, #f7c948);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    .desktop-info .tagline {
        font-size: 20px;
        opacity: .8;
        margin: 0 0 32px;
    }
    .desktop-info .features {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .desktop-info .features li {
        display: flex;
        align-items: flex-start;
        gap: 14px;
        padding: 12px 0;
        font-size: 15px;
        opacity: .85;
    }
    .desktop-info .features li i {
        color: var(--c-primary);
        font-size: 22px;
        flex-shrink: 0;
    }
    .desktop-info .foot {
        margin-top: 32px;
        padding-top: 24px;
        border-top: 1px solid rgba(255, 255, 255, .1);
        font-size: 13px;
        opacity: .6;
    }

    /* Phone mockup */
    .phone {
        width: 390px;
        height: 844px;
        background: #1a1a1a;
        border-radius: 54px;
        padding: 14px;
        box-shadow:
            0 50px 100px rgba(0, 0, 0, .5),
            0 0 0 2px #2a2a2a,
            inset 0 0 0 3px #0a0a0a;
        flex-shrink: 0;
        position: relative;
    }
    .phone::before {
        content: '';
        position: absolute;
        top: 22px;
        left: 50%;
        transform: translateX(-50%);
        width: 126px;
        height: 32px;
        background: #000;
        border-radius: 18px;
        z-index: 20;
    }
    .phone-screen {
        width: 100%;
        height: 100%;
        background: var(--c-bg);
        border-radius: 40px;
        overflow: hidden;
        position: relative;
    }
}

/* ==========================================================
   MOBILE LAYOUT — full screen, no mockup
   ========================================================== */
@media (max-width: 1023px) {
    .app-shell { display: block; }
    .desktop-info { display: none; }
    .phone {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background: transparent;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
    }
    .phone::before { display: none; }
    .phone-screen {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* ==========================================================
   STATUS BAR (top)
   ========================================================== */
.status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    padding: 0 20px;
    background: var(--c-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    z-index: 100;
}
.status-bar .title {
    flex: 1;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Breathing room so long restaurant names don't crowd the language picker
       on the right or the back/menu button on the left. */
    padding: 0 12px;
}
.status-bar .title.store-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: #fff;
}
.status-bar .left,
.status-bar .right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 32px;
}
.status-bar .icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .15);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
}
.status-bar .icon-btn:active { background: rgba(255, 255, 255, .3); }
@media (min-width: 1024px) {
    .status-bar { padding-top: 14px; height: 64px; }
}

/* ==========================================================
   TAB BAR (bottom)
   ========================================================== */
.tab-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    background: #fff;
    border-top: 1px solid var(--c-gray-lt);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab-bar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    color: var(--c-gray);
    font-size: 10.5px;
    font-weight: 500;
    text-decoration: none;
    gap: 3px;
    transition: color var(--t);
}
.tab-bar a i { font-size: 22px; line-height: 1; }
.tab-bar a.active { color: var(--c-primary); }
.tab-bar a:active { opacity: .7; }

/* ==========================================================
   PAGE CONTENT
   ========================================================== */
.page-content {
    position: absolute;
    top: 50px;
    bottom: 68px;
    left: 0;
    right: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--c-bg);
}
@media (min-width: 1024px) {
    .page-content { top: 64px; }
}
.page-content.no-tabs { bottom: 0; }
.page-content.no-header { top: 0; }
.page-inner { padding: 16px; }

/* ==========================================================
   TYPOGRAPHY HELPERS
   ========================================================== */
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; font-weight: 700; color: var(--c-dark); }
h1 { font-size: 24px; }
h2, .h2 { font-size: 20px; }
h3, .h3 { font-size: 18px; }
h4, .h4 { font-size: 16px; }
h5, .h5 { font-size: 14px; }
.text-muted, .text-secondary { color: var(--c-gray); }
.text-primary { color: var(--c-primary); }
.text-danger { color: var(--c-danger); }
.text-success { color: var(--c-success); }
.text-warning { color: var(--c-warning); }
.text-white { color: #fff; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-start { text-align: left; }
.fw-bold { font-weight: 700; }
.fw-medium { font-weight: 600; }
.fw-normal { font-weight: 400; }
.small, .fs-sm { font-size: 12px; }
.fs-lg { font-size: 17px; }

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    background: var(--c-gray-lt);
    color: var(--c-dark);
    text-decoration: none;
    transition: all var(--t);
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); }
.btn-outline-primary { background: transparent; color: var(--c-primary); border-color: var(--c-primary); }
.btn-outline-primary:hover { background: var(--c-primary); color: #fff; }
.btn-outline-secondary { background: transparent; color: var(--c-gray); border-color: var(--c-gray-lt); }
.btn-outline-secondary:hover { background: var(--c-gray-lt); }
.btn-outline-success { background: transparent; color: var(--c-success); border-color: var(--c-success); }
.btn-outline-danger { background: transparent; color: var(--c-danger); border-color: var(--c-danger); }
.btn-success { background: var(--c-success); color: #fff; border-color: var(--c-success); }
.btn-danger { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }
.btn-warning { background: var(--c-warning); color: #fff; border-color: var(--c-warning); }
.btn-dark { background: var(--c-dark); color: #fff; border-color: var(--c-dark); }
.btn-white { background: #fff; color: var(--c-dark); border-color: #fff; }
.btn-ghost-primary { background: transparent; color: var(--c-primary); border-color: transparent; }
.btn-ghost-secondary { background: transparent; color: var(--c-gray); border-color: transparent; }
.btn-ghost-danger { background: transparent; color: var(--c-danger); border-color: transparent; }
.btn-ghost-light { background: transparent; color: rgba(255, 255, 255, .9); border-color: transparent; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .1); }
.btn-outline-light { background: transparent; color: rgba(255, 255, 255, .9); border-color: rgba(255, 255, 255, .3); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); }
.btn-lg { padding: 14px 24px; font-size: 16px; border-radius: 10px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }
.btn.w-100, .w-100 { width: 100%; }
.btn-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* ==========================================================
   FORMS
   ========================================================== */
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--c-dark);
    background: #fff;
    border: 1.5px solid var(--c-gray-lt);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--t), box-shadow var(--t);
    -webkit-appearance: none;
    appearance: none;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-lt);
}
.form-control::placeholder { color: #94a3b8; }
.form-control-lg { padding: 14px 16px; font-size: 17px; }
.form-control-sm { padding: 7px 10px; font-size: 13px; }
.form-select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 36px;
}
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-dark);
}
.form-label.required::after { content: ' *'; color: var(--c-danger); }
.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--c-gray);
}
textarea.form-control { resize: vertical; min-height: 80px; }

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
    font-size: 14px;
}
.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--c-primary);
}
.form-check-label { user-select: none; }
.form-switch .form-check-input {
    width: 36px;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--c-gray-lt);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background var(--t);
}
.form-switch .form-check-input::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--t);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.form-switch .form-check-input:checked { background: var(--c-primary); }
.form-switch .form-check-input:checked::after { transform: translateX(16px); }

.input-group {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--c-gray-lt);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
    transition: border-color var(--t), box-shadow var(--t);
}
.input-group:focus-within {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-lt);
}
.input-group .form-control {
    flex: 1;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.input-group .form-control:focus {
    box-shadow: none;
    border: 0;
}
.input-group-text {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-gray);
    background: var(--c-gray-50);
    border: 0;
    border-right: 1.5px solid var(--c-gray-lt);
}

/* ==========================================================
   CARDS
   ========================================================== */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 12px;
}
.card-body { padding: 16px; }
.card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--c-gray-lt);
}
.card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}
.card-sm .card-body { padding: 12px; }
.card-md .card-body { padding: 20px; }

/* ==========================================================
   ALERTS
   ========================================================== */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.alert-success { background: var(--c-success-lt); color: #065f46; }
.alert-danger { background: var(--c-danger-lt); color: #991b1b; }
.alert-warning { background: var(--c-warning-lt); color: #92400e; }
.alert-info { background: var(--c-info-lt); color: #1e40af; }
.alert-dismissible { padding-right: 36px; position: relative; }
.btn-close {
    background: none;
    border: 0;
    font-size: 20px;
    line-height: 1;
    opacity: .5;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 10px;
}
.btn-close::before { content: '×'; }
.btn-close:hover { opacity: 1; }

/* ==========================================================
   BADGES
   ========================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.3;
}
.badge.bg-primary { background: var(--c-primary); color: #fff; }
.badge.bg-success, .badge.bg-green { background: var(--c-success); color: #fff; }
.badge.bg-danger, .badge.bg-red { background: var(--c-danger); color: #fff; }
.badge.bg-warning, .badge.bg-yellow { background: var(--c-warning); color: #fff; }
.badge.bg-info, .badge.bg-blue { background: var(--c-info); color: #fff; }
.badge.bg-secondary, .badge.bg-orange { background: #f97316; color: #fff; }
.badge.bg-dark { background: var(--c-dark); color: #fff; }
.badge.bg-success-lt, .badge.bg-green-lt { background: var(--c-success-lt); color: #065f46; }
.badge.bg-danger-lt, .badge.bg-red-lt { background: var(--c-danger-lt); color: #991b1b; }
.badge.bg-warning-lt, .badge.bg-yellow-lt { background: var(--c-warning-lt); color: #92400e; }
.badge.bg-primary-lt { background: var(--c-primary-lt); color: var(--c-primary); }
.badge.bg-blue-lt { background: var(--c-info-lt); color: #1e40af; }
.badge.bg-orange-lt { background: #fed7aa; color: #9a3412; }

/* ==========================================================
   MODALS (Alpine-driven)
   Positioned absolute so they're contained within the phone-screen
   on desktop, and full-screen on mobile (where phone-screen = viewport).
   ========================================================== */
.modal {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn .15s ease;
    padding: 16px;
}
.modal-dialog {
    width: 100%;
    max-width: 360px;
    margin: 0;
    animation: slideUp .2s ease;
}
.modal-content {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    max-height: calc(100% - 32px);
    display: flex;
    flex-direction: column;
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-gray-lt);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { margin: 0; font-size: 17px; font-weight: 700; }
.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--c-gray-lt);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.modal-backdrop { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ==========================================================
   DROPDOWN (Alpine-driven)
   ========================================================== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 6px 0;
    z-index: 500;
    margin-top: 4px;
}
.dropdown-menu.show { display: block; }
.dropdown-menu-end { left: auto; right: 0; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 14px;
    color: var(--c-dark);
    text-decoration: none;
    cursor: pointer;
}
.dropdown-item:hover { background: var(--c-gray-50); }
.dropdown-item.text-danger { color: var(--c-danger); }
.dropdown-divider { height: 1px; margin: 6px 0; background: var(--c-gray-lt); }

/* ==========================================================
   TABLES
   ========================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th,
.table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--c-gray-lt);
}
.table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-gray);
    text-transform: uppercase;
    letter-spacing: .03em;
    background: var(--c-gray-50);
}
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ==========================================================
   UTILITIES
   ========================================================== */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-none { display: none; }
.d-inline-block { display: inline-block; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-fill { flex: 1 1 auto; }
.flex-shrink-0 { flex-shrink: 0; }
.justify-content-start { justify-content: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.align-items-stretch { align-items: stretch; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }

.m-0 { margin: 0; }
.m-1 { margin: 4px; } .m-2 { margin: 8px; } .m-3 { margin: 12px; } .m-4 { margin: 16px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 24px; }
.ms-1 { margin-left: 4px; } .ms-2 { margin-left: 8px; } .ms-3 { margin-left: 12px; } .ms-auto { margin-left: auto; }
.me-1 { margin-right: 4px; } .me-2 { margin-right: 8px; } .me-3 { margin-right: 12px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-2 { margin-top: 8px; margin-bottom: 8px; } .my-3 { margin-top: 12px; margin-bottom: 12px; }

.p-0 { padding: 0; }
.p-1 { padding: 4px; } .p-2 { padding: 8px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; }
.pt-2 { padding-top: 8px; } .pt-3 { padding-top: 12px; } .pt-4 { padding-top: 16px; }
.pb-2 { padding-bottom: 8px; } .pb-3 { padding-bottom: 12px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 24px; padding-bottom: 24px; }

.rounded { border-radius: var(--radius-sm); }
.rounded-circle { border-radius: 50%; }
.border { border: 1px solid var(--c-gray-lt); }
.border-top { border-top: 1px solid var(--c-gray-lt); }
.border-bottom { border-bottom: 1px solid var(--c-gray-lt); }

.bg-white { background: #fff; }
.bg-light { background: var(--c-gray-50); }
.bg-primary { background: var(--c-primary); }
.bg-primary-lt { background: var(--c-primary-lt); }

.w-100 { width: 100%; }
.h-100 { height: 100%; }
.min-width-0 { min-width: 0; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }

/* Row / col fallback (simplified Bootstrap grid) */
.row { display: flex; flex-wrap: wrap; margin: -6px; }
.row > [class*="col-"] { padding: 6px; }
.row.g-2 { margin: -4px; } .row.g-2 > [class*="col-"] { padding: 4px; }
.row.g-3 { margin: -6px; } .row.g-3 > [class*="col-"] { padding: 6px; }
.row.g-4 { margin: -8px; } .row.g-4 > [class*="col-"] { padding: 8px; }
.col, .col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
@media (min-width: 640px) {
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
}

/* Spinner */
.spinner-border {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .75s linear infinite;
}
.spinner-border-sm { width: 14px; height: 14px; border-width: 1.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Loading overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Notification toast */
.toast-wrap {
    position: absolute;
    top: 60px;
    left: 12px;
    right: 12px;
    z-index: 1500;
    pointer-events: none;
}
.toast-wrap .alert {
    pointer-events: auto;
    box-shadow: var(--shadow-lg);
}

/* Page header */
.page-header { margin-bottom: 16px; }
.page-title { font-size: 22px; font-weight: 800; margin: 0; }
.page-pretitle { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--c-gray); margin-bottom: 4px; }

/* Container utilities (Tabler alias) */
.container, .container-xl, .container-fluid, .container-tight {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    margin-left: auto;
    margin-right: auto;
}
.container-tight { max-width: 420px; }

/* ==========================================================
   SUB-NAV (Shopee/Grab style icon grid)
   Use for page-level sub-tabs (e.g. Store Info / Images / Hours).
   ========================================================== */
.sub-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    /* Bleed past .page-inner padding so the row touches the phone screen edges
       and there's clearly more content to scroll to. */
    margin: 0 -16px 12px;
    padding: 8px 16px 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}
.sub-nav::-webkit-scrollbar { display: none; }
.sub-nav .sub-nav-item {
    flex: 0 0 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 76px;
    padding: 10px 6px;
    background: #fff;
    border: 1.5px solid transparent;
    border-radius: 12px;
    color: var(--c-gray);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--t);
    gap: 6px;
    scroll-snap-align: start;
}
.sub-nav .sub-nav-item i,
.sub-nav .sub-nav-item svg {
    font-size: 22px;
    width: 24px;
    height: 24px;
    line-height: 1;
}
.sub-nav .sub-nav-item .label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}
.sub-nav .sub-nav-item.active {
    color: var(--c-primary);
    background: var(--c-primary-lt);
    border-color: var(--c-primary);
}
.sub-nav .sub-nav-item:active { transform: scale(.97); }

/* Nav tabs fallback (for any leftover Tabler markup that still uses .nav-tabs) */
.nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 4px;
}
.nav-tabs {
    border-bottom: 1px solid var(--c-gray-lt);
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
}
.nav-item { list-style: none; }
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    color: var(--c-gray);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
}
.nav-link.active {
    color: var(--c-primary);
    border-bottom-color: var(--c-primary);
}

/* Editable pill (inline edit used for menu categories) */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1.5px solid var(--c-gray-lt);
    border-radius: 999px;
    color: var(--c-dark);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t);
    white-space: nowrap;
}
.pill:active { transform: scale(.97); }
.pill.active {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}
.pill .pill-edit-input {
    background: transparent;
    border: 0;
    outline: none;
    color: inherit;
    font: inherit;
    width: 100px;
    padding: 0;
}
.pill .pill-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    font-size: 12px;
    color: inherit;
    border: 0;
    cursor: pointer;
}
.pill.active .pill-icon:hover { background: rgba(255, 255, 255, .35); }
.pill.add-pill {
    background: transparent;
    border-style: dashed;
    color: var(--c-primary);
    border-color: var(--c-primary);
}
.pill-row {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px 0 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.pill-row::-webkit-scrollbar { display: none; }

/* ==========================================================
   IMAGE THUMBNAIL with delete-X overlay (square, R2-uploaded)
   ========================================================== */
.image-thumb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    /* Extra padding so the X button doesn't get clipped by the grid container */
    padding: 8px 8px 0;
    margin: -8px -8px 0;
}
.image-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* No overflow:hidden — X button needs to extend past the corner.
       The image itself is rounded so the visual still has rounded corners. */
}
.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-sm);
    background: var(--c-gray-50);
    box-shadow: var(--shadow-sm);
}
.image-thumb .x-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--c-danger);
    color: #fff;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
    padding: 0;
    line-height: 1;
}
.image-thumb .x-btn:active { transform: scale(.9); }
.image-thumb.add-thumb {
    border: 2px dashed var(--c-gray-lt);
    border-radius: var(--radius-sm);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-gray);
    cursor: pointer;
    font-size: 24px;
}
.image-thumb.add-thumb:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* ==========================================================
   QR LAYOUT (store QR large + table QR grid)
   ========================================================== */
.qr-store-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.qr-store-card img {
    max-width: 240px;
    width: 100%;
    margin: 0 auto 12px;
}
.qr-store-card .qr-label {
    font-weight: 700;
    color: var(--c-dark);
    margin-bottom: 4px;
}
.qr-table-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.qr-table-card {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 8px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.qr-table-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}
.qr-table-card .qr-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--c-gray);
    margin-top: 4px;
}

/* ==========================================================
   CLIENT-SPECIFIC COMPONENTS
   ========================================================== */
.lang-selector { position: relative; }
.lang-btn {
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 8px;
    color: #fff;
    padding: 6px 12px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.lang-btn .ti { font-size: 12px; }
.lang-btn:hover { background: rgba(255, 255, 255, .25); }
.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 200;
    overflow: hidden;
}
.lang-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: var(--c-dark);
    text-decoration: none;
    font-size: 13px;
    transition: background var(--t);
}
.lang-dropdown a:hover { background: var(--c-gray-50); }
.lang-dropdown a.active {
    background: var(--c-primary-lt);
    color: var(--c-primary);
    font-weight: 600;
}
.scan-page { text-align: center; padding: 60px 24px; }
.scan-page .scan-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    background: var(--c-primary-lt);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-primary);
    font-size: 60px;
}
.store-header {
    position: relative;
    margin: -16px -16px 16px;
    height: 180px;
    background: linear-gradient(135deg, #ff6b35, #f7c948);
    overflow: hidden;
}
.store-header img { width: 100%; height: 100%; object-fit: cover; }
.store-header .store-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,.5));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    color: #fff;
}
.store-header h1 { color: #fff; font-size: 22px; margin: 0 0 4px; }
.store-header .meta { font-size: 12px; opacity: .9; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-item {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform var(--t);
    display: flex;
    flex-direction: column;
}
.menu-item:active { transform: scale(.97); }
.menu-item .item-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--c-gray-50);
    object-fit: cover;
}
.menu-item .item-image-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: var(--c-gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-gray-lt);
    font-size: 32px;
}
.menu-item .item-info {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.menu-item .item-name {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.menu-item .item-price {
    color: var(--c-primary);
    font-weight: 700;
    font-size: 14px;
    margin-top: auto;
}

/* Horizontal menu rows: thumbnail | name+desc | price+add button.
   Replaces the older 2-col grid for the customer-facing menu page. */
.menu-list { display: flex; flex-direction: column; gap: 10px; }
.menu-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 10px;
    cursor: pointer;
    transition: transform var(--t);
}
.menu-row:active { transform: scale(.985); }
.menu-row .row-image,
.menu-row .row-image-placeholder {
    width: 84px;
    height: 84px;
    flex: 0 0 84px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--c-gray-50);
}
.menu-row .row-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-gray-lt);
    font-size: 28px;
}
.menu-row .row-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.menu-row .row-name {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
    color: var(--c-dark);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.menu-row .row-desc {
    font-size: 12px;
    color: var(--c-gray);
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.menu-row .row-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
}
.menu-row .row-price {
    color: var(--c-primary);
    font-weight: 800;
    font-size: 15px;
    white-space: nowrap;
}
.menu-row .row-add-btn {
    background: var(--c-primary);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}
.menu-row .row-add-btn:active { transform: scale(.96); }
.menu-row .row-add-btn .ti { font-size: 14px; }
.floating-cart {
    position: absolute;
    bottom: 80px;
    left: 16px;
    right: 16px;
    background: var(--c-primary);
    color: #fff;
    border: 0;
    border-radius: var(--radius);
    padding: 14px 18px;
    box-shadow: 0 8px 24px rgba(255, 107, 53, .35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    cursor: pointer;
    z-index: 50;
}
.floating-cart .badge {
    background: #fff;
    color: var(--c-primary);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    margin-right: 8px;
}
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--c-gray-lt);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item .qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--c-gray-50);
    border-radius: 999px;
    padding: 4px;
}
.cart-item .qty-control button {
    width: 28px;
    height: 28px;
    border: 0;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
}
.order-success-icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 20px;
    background: var(--c-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 56px;
    animation: scaleIn .4s ease;
}
@keyframes scaleIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Home search & results */
.home-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 14px;
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.home-divider::before,
.home-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-gray-lt);
}
.home-search {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}
.home-results {
    width: 100%;
    max-width: 420px;
    margin: 16px auto 0;
    text-align: left;
}
.result-card {
    display: block;
    background: #fff;
    border: 1px solid var(--c-gray-lt);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.result-card:hover,
.result-card:active {
    border-color: #ff6b35;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255,107,53,.12);
}
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.result-name {
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
}
.result-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .3px;
    flex-shrink: 0;
}
.result-badge.open { background: #d1fae5; color: #065f46; }
.result-badge.closed { background: #fee2e2; color: #991b1b; }
.result-meta {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}
.result-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.result-tags span {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
}
