/* ==========================================================================
   Nexfood Restaurant page (Website Panel redesign, phase 3)
   Linked after the page's own <style> block in restaurant.blade.php so it wins
   at equal specificity. Builds on nf-theme.css.
   ========================================================================== */

.vendor-page.nf-rpage {
    background: var(--nf-page) !important;
    font-family: var(--nf-font-body) !important;
    color: var(--nf-ink);
}
body { background: var(--nf-page) !important; }
/* The page's own sheet sets overflow-x: hidden on html/body, which turns body into a
   scroll box and breaks the sticky header and bag. clip hides overflow without that. */
html, body { overflow-x: clip !important; }
.nf-rpage a { text-decoration: none; }

.nf-rwrap {
    max-width: var(--nf-max);
    margin-inline: auto;
    padding: 8px var(--nf-gutter) 80px;
    display: flex; flex-direction: column; gap: 28px;
    box-sizing: border-box;
}
/* The old Bootstrap .container holds the controls, dine-in blocks and menu */
.nf-rpage .nf-rwrap > .container { max-width: none; width: auto; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 28px; }

/* Hero -------------------------------------------------------------------- */
.nf-rhero {
    position: relative; overflow: hidden;
    border-radius: var(--nf-radius-stage);
    background: var(--nf-stage); color: #fff;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
    gap: 24px; padding: 44px;
}
.nf-rhero__copy {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-width: 0;
}
.nf-rhero__id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.nf-rhero__logo {
    flex: none; width: 76px; height: 76px; border-radius: 24px; overflow: hidden;
    background: var(--nf-rating);
}
.nf-rhero__logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nf-rhero__meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nf-rhero__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nf-rchip {
    height: 26px; padding: 0 10px; border-radius: 99px;
    background: #2A2A2A; color: #fff;
    font-size: 12px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.nf-rchip.available, .nf-rchip.open { background: var(--nf-open); font-weight: 700; }
.nf-rchip.closed { background: #B91C1C; font-weight: 700; }
.nf-rhero #vendor_open_time { direction: ltr; unicode-bidi: isolate; } /* "12:00 AM - 11:59 PM" reads right in Arabic too */
.nf-rhero #vendor_open_time br { display: none; }
.nf-rhero #vendor_open_time .margine { margin: 0 !important; }
.nf-rhero #vendor_open_time .margine::before { content: ' · '; }
.nf-rhero #vendor_open_time:empty { display: none; }
.nf-rhero__address {
    margin: 0; font-size: 14px; color: var(--nf-line-strong);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nf-rhero__address .fa { display: none; }
.nf-rhero__next { margin: 0; font-size: 13px; color: var(--nf-accent-soft); }
.nf-rhero__next:empty { display: none; }

.nf-rhero h1 { margin: 0; line-height: .92; }
.nf-rhero h1 .nf-head {
    display: block;
    font-size: clamp(44px, 6vw, 84px); font-weight: 800; letter-spacing: -3px;
    overflow-wrap: anywhere;
}
.nf-rhero h1 .nf-serif {
    display: block; margin-top: 6px;
    font-size: clamp(26px, 3.4vw, 46px); color: var(--nf-accent-soft);
}
html[dir="rtl"] .nf-rhero h1 { line-height: 1.15; }
html[dir="rtl"] .nf-rhero h1 .nf-head { letter-spacing: 0; }

.nf-rhero__stats { display: flex; flex-wrap: wrap; gap: 10px; }
.nf-rstat {
    display: flex; flex-direction: column;
    padding: 12px 18px; border-radius: 20px;
    background: #222; font-size: 12px; color: var(--nf-line-strong);
}
.nf-rstat b { font: 800 22px/1.15 var(--nf-font-head); color: #fff; white-space: nowrap; }
.nf-rstat b .fa-star { color: var(--nf-rating); font-size: 16px; }

/* Coupon (shown by getCouponDetails() only when the vendor has a valid one) */
.nf-rpage .nxf-figma-promo-card.nf-rcoupon {
    display: flex; align-items: center; gap: 14px;
    margin: 0; padding-block: 10px; padding-inline: 18px 10px;
    border-radius: 20px; border: 0; box-shadow: none;
    background: var(--nf-accent); color: var(--nf-ink);
}
.nf-rcoupon .nxf-promo-card-left { display: flex; flex-direction: column; font-size: 12px; min-width: 0; }
.nf-rcoupon .nxf-promo-title { margin: 0; font: 700 15px/1.2 var(--nf-font-body); color: var(--nf-ink); }
.nf-rcoupon .nxf-promo-desc { margin: 0; font-size: 12px; color: var(--nf-ink); opacity: .8; }
.nf-rcoupon .nxf-promo-btn {
    flex: none; height: 44px; padding: 0 16px;
    border: 0; border-radius: var(--nf-radius-pill);
    background: var(--nf-ink); color: #fff;
    font: 700 13px var(--nf-font-body); box-shadow: none;
}

.nf-rhero__art { position: relative; min-height: 340px; }
.nf-rhero__photo {
    position: absolute; object-fit: cover; border-radius: 50%; background: #222;
}
.nf-rhero__photo--main { inset-inline-end: 40px; top: 0; width: 300px; height: 300px; border: 10px solid #222; }
.nf-rhero__photo--side { inset-inline-start: 10px; bottom: -10px; width: 190px; height: 190px; border: 8px solid #222; }
.nf-rhero__photo[src=""] { visibility: hidden; }
.nf-rhero__actions {
    position: absolute; inset-inline-end: 0; bottom: 0;
    display: flex; gap: 10px;
}
.nf-rhero__actions .nf-icon-btn { width: 56px; height: 56px; color: var(--nf-accent-text); }
.nf-rhero__actions .nf-icon-btn i { font-size: 20px; }

/* Controls: order type + categories --------------------------------------- */
.nf-rcontrols { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.nf-rpage .nxf-order-mode-wrapper { margin: 0; padding: 0; }
.nf-rpage .nxf-modern-toggle-bar {
    display: flex; gap: 0; padding: 6px;
    border-radius: var(--nf-radius-pill);
    background: var(--nf-surface); border: 0; box-shadow: none; width: auto;
}
.nf-rpage .nxf-mode-btn {
    height: 44px; padding: 0 22px;
    border: 0; border-radius: var(--nf-radius-pill);
    background: transparent; color: var(--nf-ink);
    font: 600 14px var(--nf-font-body);
    display: inline-flex; align-items: center; gap: 8px;
    box-shadow: none; transform: none;
}
.nf-rpage .nxf-mode-btn i { font-size: 14px; color: inherit; }
.nf-rpage .nxf-mode-btn:hover:not(.active) { background: var(--nf-page); color: var(--nf-ink); }
.nf-rpage .nxf-mode-btn.active { background: var(--nf-accent); color: var(--nf-ink); box-shadow: none; }

.nf-rcats {
    display: flex; gap: 8px; overflow-x: auto; min-width: 0; max-width: 100%;
    scrollbar-width: none; padding: 2px;
}
.nf-rcats::-webkit-scrollbar { display: none; }
.nf-rcats .category-item.nf-chip { height: 48px; padding: 0 22px; flex: none; }
.nf-rcats .category-item.active { background: var(--nf-ink); color: #fff; }

/* Menu + bag -------------------------------------------------------------- */
.nf-rmenu { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.nf-rmenu__list { flex: 999 1 560px; min-width: 0; }
.nf-rmenu__list .nf-food-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.nf-food__desc {
    margin: 0; font-size: 13px; line-height: 1.5; color: var(--nf-muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nf-rempty {
    margin: 0; padding: 48px 24px; text-align: center;
    background: var(--nf-surface); border-radius: 30px; color: var(--nf-muted);
}

.nf-bag {
    flex: 1 1 320px; max-width: 360px;
    position: sticky; top: 96px;
    background: var(--nf-stage); color: #fff;
    border-radius: 32px; padding: 24px;
    display: flex; flex-direction: column; gap: 18px;
}
.nf-bag__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.nf-bag__head h2 { margin: 0; font: 800 24px/1 var(--nf-font-head); color: #fff; }
.nf-bag__mode { font-size: 13px; color: var(--nf-line-strong); }
.nf-bag__lines { display: flex; flex-direction: column; gap: 14px; max-height: 340px; overflow-y: auto; }
.nf-bag__line { display: flex; align-items: center; gap: 12px; }
.nf-bag__line img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; background: #222; }
.nf-bag__line-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nf-bag__line-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nf-bag__line-price { font-size: 13px; color: var(--nf-accent-soft); font-weight: 600; }
.nf-bag__qty {
    flex: none; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 99px;
    background: #222; font-weight: 700; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
}
.nf-bag__sum {
    display: flex; flex-direction: column; gap: 8px;
    padding-top: 16px; border-top: 1px dashed #3A3A3A;
    font-size: 14px; color: var(--nf-line-strong);
}
.nf-bag__sum div { display: flex; justify-content: space-between; gap: 12px; }
.nf-bag__sum small { font-size: 12px; color: var(--nf-muted-on-dark); }
.nf-bag__total { color: #fff; font-weight: 700; font-size: 18px; padding-top: 4px; }
.nf-bag__checkout {
    height: 56px; border-radius: var(--nf-radius-pill);
    background: var(--nf-surface); color: var(--nf-ink);
    font-weight: 700; font-size: 15px;
    display: flex; align-items: center; justify-content: space-between;
    padding-block: 0; padding-inline: 22px 8px;
}
.nf-bag__checkout:hover { color: var(--nf-ink); background: var(--nf-surface-2); }
.nf-bag__checkout span {
    height: 42px; padding: 0 16px; border-radius: 99px;
    background: var(--nf-accent); display: flex; align-items: center;
}
.nf-bag__edit {
    border: 0; background: transparent; color: var(--nf-line-strong);
    font: 600 13px var(--nf-font-body); text-decoration: underline; cursor: pointer; align-self: center;
}
.nf-bag__edit:hover { color: #fff; }
.nf-bag__empty { margin: 0; padding: 28px 8px; text-align: center; font-size: 14px; color: var(--nf-line-strong); }

/* Phone bag bar (sits above the floating dock) */
.nf-bagbar {
    position: fixed; z-index: 990;
    inset-inline: 16px; bottom: 84px;
    height: 68px; border-radius: var(--nf-radius-pill);
    background: var(--nf-stage); color: #fff;
    display: none; align-items: center; justify-content: space-between;
    padding-block: 0; padding-inline: 24px 8px;
    box-shadow: 0 14px 34px rgba(17, 17, 17, .3);
    border: 0; width: auto; font-family: var(--nf-font-body); cursor: pointer;
}
.nf-bagbar__count { font-size: 15px; font-weight: 600; }
.nf-bagbar__right { display: flex; align-items: center; gap: 12px; }
.nf-bagbar__right b { font: 800 17px var(--nf-font-head); }
.nf-bagbar__go {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--nf-accent); color: var(--nf-ink);
    display: flex; align-items: center; justify-content: center;
}

/* Hidden legacy targets the scripts still write to */
.nf-legacy { display: none !important; }

/* Dine-in blocks keep their layout; align their look a little */
.nf-rpage .nxf-dinein-floating-bar .nxf-float-checkout-btn { background: var(--nf-accent); color: var(--nf-ink); }

/* Tablet ------------------------------------------------------------------ */
@media (max-width: 1100px) {
    .nf-bag { display: none; }
    .nf-bagbar.has-items { display: flex; }
}

/* Phone ------------------------------------------------------------------- */
@media (max-width: 640px) {
    .nf-rwrap { padding-inline: 0; padding-top: 0; gap: 16px; padding-bottom: 170px; }
    .nf-rwrap > :not(.nf-rhero) { margin-inline: var(--nf-gutter); }
    .nf-rhero {
        border-radius: 0 0 44px 44px;
        padding: 20px 20px 28px; display: block;
    }
    .nf-rhero__copy { gap: 18px; }
    .nf-rhero__id { padding-inline-end: 150px; }
    .nf-rhero__logo { width: 56px; height: 56px; border-radius: 18px; }
    .nf-rhero__address { white-space: normal; font-size: 13px; }
    .nf-rhero h1 .nf-head { font-size: 40px; letter-spacing: -1.5px; }
    .nf-rhero h1 .nf-serif { font-size: 24px; }
    .nf-rhero__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .nf-rstat { padding: 10px; border-radius: 18px; font-size: 11px; }
    .nf-rstat b { font-size: 17px; }
    .nf-rpage .nxf-figma-promo-card.nf-rcoupon { border-radius: var(--nf-radius-pill); grid-column: 1 / -1; }

    .nf-rhero__art { position: absolute; inset: 0; min-height: 0; pointer-events: none; }
    .nf-rhero__photo--main { width: 170px; height: 170px; top: 24px; inset-inline-end: -36px; border-width: 7px; }
    .nf-rhero__photo--side { display: none; }
    .nf-rhero__actions { top: 16px; bottom: auto; inset-inline-end: 16px; pointer-events: auto; }
    .nf-rhero__actions .nf-icon-btn { width: 44px; height: 44px; }

    .nf-rcontrols { flex-direction: column; align-items: stretch; gap: 12px; }
    .nf-rpage .nxf-modern-toggle-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .nf-rpage .nxf-mode-btn { justify-content: center; padding: 0 8px; font-size: 13px; }
    .nf-rcats { margin-inline: calc(var(--nf-gutter) * -1); padding-inline: var(--nf-gutter); }
    .nf-rcats .category-item.nf-chip { height: 42px; padding: 0 16px; font-size: 13px; }
    .nf-rmenu__list .nf-food-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nf-food__desc { display: none; }
    .nf-bagbar { bottom: 80px; height: 60px; padding-inline: 20px 6px; }
    .nf-bagbar__go { width: 48px; height: 48px; }
}
