/* VisiFood Website v3 — Modern Food App UI */
:root {
    --vf-primary: #e63946;
    --vf-primary-dark: #c1121f;
    --vf-secondary: #1d3557;
    --vf-bg: #f4f4f6;
    --vf-card: #ffffff;
    --vf-radius: 14px;
    --vf-radius-sm: 8px;
    --vf-shadow: 0 2px 12px rgba(0,0,0,.09);
    --vf-shadow-md: 0 4px 24px rgba(0,0,0,.13);
    --vf-text: #1a1a2e;
    --vf-muted: #6b7280;
    --vf-border: #e5e7eb;
    --vf-header-h: 60px;
}

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

.vf-app {
    background: var(--vf-bg);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--vf-text);
}

/* ── HEADER ────────────────────────────────────────────────────── */
.vf-header {
    position: sticky;
    top: 0;
    z-index: 800;
    background: #fff;
    height: var(--vf-header-h);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    box-shadow: 0 1px 0 var(--vf-border), 0 2px 8px rgba(0,0,0,.06);
}
.vf-header-logo {
    height: 36px;
    width: 36px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.vf-header-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--vf-secondary);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vf-header-tagline {
    font-size: .72rem;
    color: var(--vf-muted);
    font-weight: 400;
    display: block;
    margin-top: 1px;
}
.vf-cart-btn {
    position: relative;
    background: var(--vf-primary);
    border: none;
    border-radius: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, transform .1s;
}
.vf-cart-btn:hover { background: var(--vf-primary-dark); transform: scale(1.03); }
.vf-cart-btn .vf-badge {
    background: #fff;
    color: var(--vf-primary);
    border-radius: 20px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 800;
    padding: 0 5px;
    line-height: 1;
}

/* ── FILTER / CATEGORY NAV ─────────────────────────────────────── */
.vf-nav-wrap {
    position: sticky;
    top: var(--vf-header-h);
    z-index: 700;
    background: #fff;
    border-bottom: 1px solid var(--vf-border);
}
.vf-nav-scroll {
    display: flex;
    gap: 4px;
    padding: 10px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
}
.vf-nav-scroll::-webkit-scrollbar { display: none; }

.vf-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: var(--vf-radius-sm);
    border: 1.5px solid var(--vf-border);
    background: #fff;
    color: var(--vf-text);
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    flex-shrink: 0;
}
.vf-cat-chip:hover { border-color: var(--vf-primary); color: var(--vf-primary); }
.vf-cat-chip.active {
    background: var(--vf-primary);
    border-color: var(--vf-primary);
    color: #fff;
}

.vf-filter-wrap {
    background: #fafafa;
    border-bottom: 1px solid var(--vf-border);
    padding: 7px 12px;
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.vf-filter-wrap::-webkit-scrollbar { display: none; }

.vf-diet-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 11px;
    border-radius: 6px;
    border: 1.5px solid var(--vf-border);
    background: #fff;
    color: var(--vf-muted);
    font-size: .76rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    flex-shrink: 0;
}
.vf-diet-chip:hover { border-color: #aaa; color: var(--vf-text); }
.vf-diet-chip[data-filter="all"].active       { color: var(--vf-secondary); background: #f0f4ff; border-color: var(--vf-secondary); }
.vf-diet-chip[data-filter="vegetarian"].active { color: #16a34a; background: #f0fdf4; border-color: #16a34a; }
.vf-diet-chip[data-filter="vegan"].active      { color: #15803d; background: #f0fdf4; border-color: #15803d; }
.vf-diet-chip[data-filter="gluten_free"].active{ color: #d97706; background: #fffbeb; border-color: #d97706; }
.vf-diet-chip[data-filter="spicy"].active      { color: #dc2626; background: #fef2f2; border-color: #dc2626; }

/* ── MENU GRID ─────────────────────────────────────────────────── */
.vf-section { padding: 20px 0 4px; }
.vf-section-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--vf-secondary);
    padding: 0 14px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.vf-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--vf-border);
    margin-left: 6px;
}

.vf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 10px;
}
@media (min-width: 580px)  { .vf-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0 14px; } }
@media (min-width: 900px)  { .vf-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .vf-grid { grid-template-columns: repeat(5, 1fr); } }

.vf-card {
    background: var(--vf-card);
    border-radius: var(--vf-radius);
    box-shadow: var(--vf-shadow);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .18s, transform .15s;
    position: relative;
    display: flex;
    flex-direction: column;
}
.vf-card:hover { box-shadow: var(--vf-shadow-md); transform: translateY(-2px); }

.vf-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    background: #f0f0f0;
}
@media (min-width: 580px)  { .vf-card-img { height: 170px; } }
@media (min-width: 900px)  { .vf-card-img { height: 185px; } }

.vf-card-no-img {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, #fde8e8 0%, #fce4e4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
}

.vf-card-body {
    padding: 10px 11px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.vf-card-name {
    font-size: .88rem;
    font-weight: 700;
    color: var(--vf-text);
    line-height: 1.3;
}
.vf-card-desc {
    font-size: .73rem;
    color: var(--vf-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    margin-top: 2px;
}
.vf-card-meta {
    font-size: .68rem;
    color: #9ca3af;
    margin-top: 3px;
}
.vf-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
}
.vf-badge-tag {
    font-size: .62rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
}
.vf-badge-veg   { background: #dcfce7; color: #15803d; }
.vf-badge-vegan { background: #bbf7d0; color: #166534; }
.vf-badge-gf    { background: #fef9c3; color: #92400e; }
.vf-badge-spicy { background: #fee2e2; color: #991b1b; }

.vf-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}
.vf-card-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--vf-primary);
}
.vf-add-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--vf-primary);
    border: none;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
    box-shadow: 0 2px 8px rgba(230,57,70,.3);
}
.vf-add-circle:hover { background: var(--vf-primary-dark); transform: scale(1.12); }

.vf-popular-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--vf-primary);
    color: #fff;
    font-size: .63rem;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    z-index: 1;
}

/* ── CART MODAL ────────────────────────────────────────────────── */
.vf-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 2000;
    align-items: flex-end;
    justify-content: center;
}
.vf-modal-overlay.open { display: flex; animation: vfFadeIn .18s ease; }
@keyframes vfFadeIn { from { opacity: 0; } to { opacity: 1; } }

.vf-modal-sheet {
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 560px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    animation: vfSlideUp .22s ease;
}
@keyframes vfSlideUp {
    from { transform: translateY(60px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.vf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--vf-border);
}
.vf-modal-title { font-size: 1.05rem; font-weight: 800; }
.vf-modal-close {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--vf-bg);
    cursor: pointer;
    font-size: 1rem;
    color: var(--vf-muted);
    display: flex; align-items: center; justify-content: center;
}
.vf-modal-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.vf-cart-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--vf-border);
}
.vf-cart-line:last-child { border-bottom: none; }
.vf-cart-line-name { flex: 1; font-size: .88rem; font-weight: 600; }
.vf-cart-line-price {
    font-size: .84rem;
    color: var(--vf-muted);
    font-weight: 500;
    min-width: 54px;
    text-align: right;
}
.vf-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--vf-bg);
    border-radius: 8px;
    padding: 2px 4px;
}
.vf-qty-btn {
    width: 26px; height: 26px;
    border: none; background: transparent;
    cursor: pointer; font-size: 1rem;
    color: var(--vf-text); border-radius: 6px;
    transition: background .1s;
    display: flex; align-items: center; justify-content: center;
}
.vf-qty-btn:hover { background: #e5e7eb; }
.vf-qty-num { font-size: .9rem; font-weight: 700; min-width: 18px; text-align: center; }

.vf-modal-footer { padding: 12px 20px 20px; border-top: 1px solid var(--vf-border); }
.vf-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: .88rem;
}
.vf-price-row.total {
    font-weight: 800;
    font-size: 1rem;
    border-top: 1px solid var(--vf-border);
    margin-top: 6px;
    padding-top: 8px;
}

/* ── CHECKOUT ──────────────────────────────────────────────────── */
.vf-checkout-card {
    background: #fff;
    border-radius: var(--vf-radius);
    box-shadow: var(--vf-shadow);
    padding: 20px;
}
.vf-checkout-card h5 {
    font-size: .95rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--vf-secondary);
}
.vf-form-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--vf-muted);
    display: block;
    margin-bottom: 4px;
}
.vf-input {
    border-radius: var(--vf-radius-sm) !important;
    border: 1.5px solid var(--vf-border) !important;
    font-size: .88rem;
    padding: 9px 12px;
    transition: border-color .15s;
}
.vf-input:focus {
    border-color: var(--vf-primary) !important;
    box-shadow: 0 0 0 3px rgba(230,57,70,.12) !important;
    outline: none;
}
.vf-order-type-btn {
    flex: 1;
    padding: 12px 8px;
    border-radius: var(--vf-radius-sm);
    border: 2px solid var(--vf-border);
    background: #fff;
    color: var(--vf-muted);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}
.vf-order-type-btn:hover { border-color: var(--vf-primary); color: var(--vf-primary); }
.vf-order-type-btn.active { border-color: var(--vf-primary); background: #fff5f5; color: var(--vf-primary); }

.vf-submit-btn {
    width: 100%;
    padding: 13px;
    border-radius: var(--vf-radius-sm);
    border: none;
    font-size: .95rem;
    font-weight: 800;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    letter-spacing: .02em;
}
.vf-submit-btn:hover { opacity: .92; transform: scale(1.01); }
.vf-submit-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.vf-link { color: var(--vf-primary); text-decoration: none; font-weight: 600; font-size: .85rem; }
.vf-link:hover { text-decoration: underline; }
.vf-link-cancel { color: var(--vf-muted); }
.vf-link-cancel:hover { color: var(--vf-primary); }

/* ── CONFIRM / TRACK ───────────────────────────────────────────── */
.vf-confirm-card {
    background: #fff;
    border-radius: var(--vf-radius);
    box-shadow: var(--vf-shadow-md);
    padding: 48px 32px;
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}
.vf-confirm-icon { font-size: 3rem; }

.vf-tracking-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}
.vf-tracking-steps::before {
    content: '';
    position: absolute;
    top: 12px; left: 12px; right: 12px;
    height: 2px;
    background: var(--vf-border);
    z-index: 0;
}
.vf-step { text-align: center; flex: 1; position: relative; z-index: 1; }
.vf-step-circle {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid var(--vf-border);
    background: #fff;
    margin: 0 auto 5px;
    transition: all .2s;
}
.vf-step.done .vf-step-circle   { background: #22c55e; border-color: #22c55e; }
.vf-step.active .vf-step-circle  { background: var(--vf-primary); border-color: var(--vf-primary); }
.vf-step-label { font-size: .68rem; color: var(--vf-muted); font-weight: 600; }
.vf-step.active .vf-step-label { color: var(--vf-primary); }
.vf-step.done .vf-step-label   { color: #22c55e; }

/* ── DELIVERY STAFF PANEL ──────────────────────────────────────── */
.vf-delivery-pin-wrap {
    min-height: 100vh; display: flex; align-items: center;
    justify-content: center; background: #f4f4f6; padding: 20px;
}
.vf-delivery-pin-box {
    background: #fff; border-radius: 20px; padding: 40px 32px;
    width: 100%; max-width: 360px;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
    text-align: center;
}
.vf-delivery-pin-logo { margin-bottom: 24px; }
.vf-delivery-pin-logo h2 { font-size: 1.4rem; font-weight: 800; margin: 8px 0 4px; }
.vf-pin-form { display: flex; flex-direction: column; gap: 12px; }
.vf-pin-input {
    border: 2px solid #e5e7eb; border-radius: 12px;
    padding: 14px 16px; font-size: 1.5rem; text-align: center;
    letter-spacing: 6px; outline: none; width: 100%;
    transition: border-color .2s;
}
.vf-pin-input:focus { border-color: #e63946; }
.vf-pin-btn {
    background: #e63946; color: #fff; border: none;
    border-radius: 12px; padding: 14px; font-size: 1rem;
    font-weight: 700; cursor: pointer; transition: background .2s;
}
.vf-pin-btn:hover { background: #c1121f; }

.vf-delivery-wrap {
    min-height: 100vh; background: #f4f4f6;
    display: flex; flex-direction: column;
}
.vf-delivery-header {
    background: #fff; padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,.08); position: sticky; top: 0; z-index: 100;
}
.vf-delivery-logout {
    font-size: .82rem; color: #6b7280; text-decoration: none; font-weight: 600;
}
.vf-delivery-logout:hover { color: #e63946; }
.vf-delivery-list {
    flex: 1; padding: 12px 12px 80px;
    display: flex; flex-direction: column; gap: 12px;
    max-width: 560px; margin: 0 auto; width: 100%;
}
.vf-delivery-empty {
    text-align: center; padding: 60px 20px;
    display: flex; flex-direction: column; align-items: center;
}
.vf-delivery-card {
    background: #fff; border-radius: 16px;
    padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.vf-delivery-card-top {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 8px;
}
.vf-delivery-ref { font-weight: 800; font-size: 1rem; margin-right: 8px; }
.vf-delivery-total { font-weight: 800; color: #e63946; font-size: 1rem; }
.vf-delivery-state {
    font-size: .7rem; font-weight: 700; padding: 2px 8px;
    border-radius: 20px; text-transform: uppercase;
}
.vf-state-new,.vf-state-confirmed { background: #dbeafe; color: #1d4ed8; }
.vf-state-preparing { background: #fef9c3; color: #a16207; }
.vf-state-ready { background: #dcfce7; color: #15803d; }
.vf-delivery-customer {
    font-size: .9rem; margin-bottom: 6px;
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}
.vf-delivery-phone { font-size: .85rem; color: #e63946; text-decoration: none; }
.vf-delivery-address {
    font-size: .88rem; color: #374151; background: #f8f9fb;
    border-radius: 8px; padding: 8px 10px; margin: 6px 0;
}
.vf-delivery-items {
    display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0;
}
.vf-delivery-item {
    background: #f3f4f6; border-radius: 6px;
    padding: 3px 8px; font-size: .82rem; color: #374151;
}
.vf-delivery-notes {
    font-size: .82rem; color: #6b7280; font-style: italic;
    margin-bottom: 8px;
}
.vf-delivery-done-btn {
    width: 100%; background: #22c55e; color: #fff; border: none;
    border-radius: 12px; padding: 13px; font-size: 1rem;
    font-weight: 700; cursor: pointer; margin-top: 8px;
    transition: background .2s, transform .1s;
}
.vf-delivery-done-btn:hover { background: #16a34a; }
.vf-delivery-done-btn:active { transform: scale(.97); }
.vf-delivery-done-btn:disabled { background: #9ca3af; cursor: default; }
.vf-delivery-footer {
    text-align: center; padding: 10px; font-size: .78rem;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(244,244,246,.9);
}

/* ── FLOATING CART BAR ─────────────────────────────────────────── */
.vf-cart-bar {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 1500;
    pointer-events: none;
    display: flex;
    justify-content: center;
}
.vf-cart-bar-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--vf-primary);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 14px 20px;
    width: 100%;
    max-width: 520px;
    cursor: pointer;
    box-shadow: 0 6px 28px rgba(230,57,70,.45);
    font-weight: 700;
    font-size: .92rem;
    pointer-events: all;
    transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s ease, box-shadow .15s;
}
.vf-cart-bar-btn:hover { box-shadow: 0 8px 32px rgba(230,57,70,.55); transform: translateY(-2px); }
.vf-cart-bar-btn.vf-cart-bar-empty {
    opacity: 0;
    pointer-events: none;
    transform: translateY(32px);
}
.vf-cart-bar-left  { display: flex; align-items: center; gap: 8px; }
.vf-cart-bar-right { display: flex; align-items: center; gap: 8px; font-size: .88rem; opacity: .92; }
.vf-cart-bar-badge {
    background: rgba(255,255,255,.25);
    border-radius: 20px;
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .76rem;
    font-weight: 800;
    padding: 0 7px;
}

/* ── TOAST ─────────────────────────────────────────────────────── */
.vf-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--vf-secondary);
    color: #fff;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: .83rem;
    font-weight: 600;
    z-index: 9999;
    box-shadow: var(--vf-shadow-md);
    animation: vfToastIn .18s ease;
    white-space: nowrap;
    pointer-events: none;
}
@keyframes vfToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.92); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
