/* MenuHub public menu – themed through CSS variables injected per restaurant */
:root {
    --m-primary: #E4572E; --m-primary-rgb: 228,87,46; --m-secondary: #29335C; --m-bg: #F7F7F9; --m-surface: #fff;
    --m-text: #1F2333; --m-muted: #6B7085; --m-on-primary: #fff; --m-on-secondary: #fff; --m-radius: 14px; --m-btn-radius: 10px;
    --m-font: 'Cairo', system-ui, sans-serif; --m-slider-h: 220px; --m-border: rgba(0,0,0,.07);
}
* { -webkit-tap-highlight-color: transparent; }
body { font-family: var(--m-font); background: var(--m-bg); color: var(--m-text); }
a { color: var(--m-primary); }
.container-menu { max-width: 1100px; margin: 0 auto; padding-inline: 14px; }
.min-w-0 { min-width: 0; }
.btn-theme { background: var(--m-primary); color: var(--m-on-primary); border: 0; border-radius: var(--m-btn-radius); font-weight: 600; }
.btn-theme:hover, .btn-theme:focus { background: var(--m-primary); color: var(--m-on-primary); filter: brightness(.93); }
.btn-outline-theme { border: 1.5px solid var(--m-border); color: var(--m-text); border-radius: var(--m-btn-radius); background: var(--m-surface); }
.btn-check:checked + .btn-outline-theme { background: var(--m-primary); color: var(--m-on-primary); border-color: var(--m-primary); }
.btn-whatsapp { background: #25D366; color: #fff; border: 0; border-radius: var(--m-btn-radius); font-weight: 700; }
.btn-whatsapp:hover, .btn-whatsapp:focus { background: #1ebe5b; color: #fff; }
.btn-whatsapp:disabled { background: #9ad8b0; color: #fff; }
.form-control, .form-select { background-color: var(--m-surface); color: var(--m-text); border-color: var(--m-border); border-radius: calc(var(--m-btn-radius) * .8); }
.form-control:focus { border-color: var(--m-primary); box-shadow: 0 0 0 .2rem rgba(var(--m-primary-rgb), .15); background-color: var(--m-surface); color: var(--m-text); }
.preview-ribbon { position: sticky; top: 0; z-index: 1100; background: #f4b942; color: #222; text-align: center; font-size: .8rem; font-weight: 700; padding: 4px; }

/* ---------------- Header */
.r-header { position: relative; margin-bottom: 8px; }
.r-cover { height: 210px; background: linear-gradient(135deg, var(--m-secondary), var(--m-primary)); background-size: cover; background-position: center; }
.r-cover::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 210px; background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 45%); pointer-events: none; }
.r-topbar { position: absolute; top: 12px; left: 0; right: 0; display: flex; justify-content: space-between; z-index: 2; }
.r-top-btn { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.92); color: #222; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.r-identity { display: flex; gap: 14px; align-items: flex-end; margin-top: -46px; position: relative; z-index: 2; }
.r-logo { width: 92px; height: 92px; border-radius: calc(var(--m-radius) + 4px); background: var(--m-surface); border: 4px solid var(--m-surface); box-shadow: 0 4px 16px rgba(0,0,0,.12); overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.r-logo img { width: 100%; height: 100%; object-fit: cover; }
.r-logo span { font-size: 2.4rem; font-weight: 800; color: var(--m-primary); }
.r-info { padding-bottom: 2px; min-width: 0; }
.r-name { font-size: 1.45rem; font-weight: 800; margin: 0; line-height: 1.25; }
.r-tagline { color: var(--m-muted); margin: 2px 0 6px; font-size: .92rem; }
.r-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.r-badge { font-size: .76rem; padding: 3px 9px; border-radius: 999px; background: var(--m-surface); border: 1px solid var(--m-border); color: var(--m-text); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.r-badge-open { color: #148a3b; } .r-badge-open i, .r-badge-closed i { font-size: .5rem; }
.r-badge-closed { color: #c0392b; }
.header-compact .r-cover, .header-compact .r-cover::after { height: 120px; }
.header-compact .r-logo { width: 72px; height: 72px; }
.header-compact .r-identity { margin-top: -36px; }
.header-centered .r-identity { flex-direction: column; align-items: center; text-align: center; }
.header-centered .r-meta { justify-content: center; }
@media (min-width: 768px) { .r-cover, .r-cover::after { height: 280px; } .r-logo { width: 110px; height: 110px; } .r-identity { margin-top: -55px; } .r-name { font-size: 1.8rem; } }

/* ---------------- Promotions */
.promo-slider { border-radius: var(--m-radius); overflow: hidden; box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.promo-slide { position: relative; height: var(--m-slider-h); background: var(--m-secondary); }
.promo-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-caption { position: absolute; inset: auto 0 0 0; padding: 26px 16px 28px; background: linear-gradient(0deg, rgba(0,0,0,.65), transparent); color: #fff; }
.promo-caption h2 { font-size: 1.15rem; font-weight: 800; margin: 0; }
.promo-caption p { margin: 2px 0 0; font-size: .85rem; opacity: .92; }
@media (min-width: 768px) { .promo-slide { height: calc(var(--m-slider-h) * 1.5); } }

/* ---------------- Sticky search + categories */
.menu-sticky { position: sticky; top: 0; z-index: 1020; background: var(--m-bg); padding: 10px 0 6px; margin-top: 6px; }
.menu-search { position: relative; margin-bottom: 8px; }
.menu-search i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--m-muted); }
.menu-search input { width: 100%; border: 1px solid var(--m-border); background: var(--m-surface); color: var(--m-text); border-radius: 999px; padding: 10px 16px; padding-inline-start: 40px; outline: none; }
.menu-search input:focus { border-color: var(--m-primary); }
.cat-nav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-link { white-space: nowrap; text-decoration: none; color: var(--m-text); display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; transition: all .15s; }
.cats-pills .cat-link { padding: 7px 15px; border-radius: 999px; background: var(--m-surface); border: 1px solid var(--m-border); }
.cats-pills .cat-link.active { background: var(--m-primary); color: var(--m-on-primary); border-color: var(--m-primary); }
.cats-underline .cat-nav { border-bottom: 1px solid var(--m-border); gap: 18px; }
.cats-underline .cat-link { padding: 8px 2px; border-bottom: 3px solid transparent; color: var(--m-muted); }
.cats-underline .cat-link.active { color: var(--m-primary); border-bottom-color: var(--m-primary); }
.cats-images .cat-link { flex-direction: column; font-size: .78rem; gap: 4px; min-width: 70px; max-width: 84px; color: var(--m-muted); white-space: normal; text-align: center; line-height: 1.25; }
.cat-thumb { width: 58px; height: 58px; border-radius: 50%; background: var(--m-surface); border: 2px solid var(--m-border); display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 1.4rem; color: var(--m-primary); }
.cat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cats-images .cat-link.active { color: var(--m-primary); }
.cats-images .cat-link.active .cat-thumb { border-color: var(--m-primary); }

/* ---------------- Sections */
.menu-section { padding-top: 18px; scroll-margin-top: 120px; }
.section-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--m-primary); }
.section-desc { color: var(--m-muted); font-size: .88rem; margin-bottom: 10px; }
.sub-section { margin-top: 16px; }
.sub-title { font-size: 1rem; font-weight: 700; color: var(--m-secondary); margin-bottom: 8px; padding-inline-start: 10px; border-inline-start: 3px solid var(--m-primary); }
.theme-dark .sub-title { color: var(--m-text); }

/* ---------------- Product cards (shared) */
.p-grid { display: grid; gap: 12px; margin-top: 10px; }
.p-card { background: var(--m-surface); border-radius: var(--m-radius); overflow: hidden; border: 1px solid var(--m-border); cursor: pointer; position: relative; display: flex; transition: transform .15s, box-shadow .15s; outline: none; }
.p-card:hover, .p-card:focus-visible { box-shadow: 0 6px 20px rgba(0,0,0,.08); transform: translateY(-1px); }
.p-card.is-unavailable { opacity: .6; }
.p-img { position: relative; background: rgba(var(--m-primary-rgb), .08); flex-shrink: 0; }
.p-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: rgba(var(--m-primary-rgb), .35); font-size: 1.8rem; }
.p-body { padding: 10px 12px; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.p-name { font-size: .98rem; font-weight: 700; margin: 0 0 3px; line-height: 1.35; }
.p-desc { font-size: .8rem; color: var(--m-muted); margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; }
.p-price { font-weight: 800; color: var(--m-primary); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.p-price del { color: var(--m-muted); font-weight: 500; font-size: .78rem; }
.p-rating { font-size: .75rem; color: var(--m-muted); white-space: nowrap; }
.p-rating i { color: #f4b942; }
.p-add { margin-inline-start: auto; width: 34px; height: 34px; border-radius: var(--m-btn-radius); border: 0; background: var(--m-primary); color: var(--m-on-primary); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .15s; }
.p-add.bump, .cart-fab.bump { transform: scale(1.18); }
.p-badge { position: absolute; top: 8px; inset-inline-start: 8px; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--m-secondary); color: var(--m-on-secondary); }
.p-badge-inline { font-size: .65rem; padding: 1px 6px; border-radius: 999px; background: var(--m-secondary); color: var(--m-on-secondary); vertical-align: middle; }
.badge-spicy { background: #d63031 !important; color: #fff !important; } .badge-vegan, .badge-vegetarian, .badge-healthy { background: #27ae60 !important; color: #fff !important; }
.badge-offer { background: #f39c12 !important; color: #fff !important; } .badge-new { background: #0984e3 !important; color: #fff !important; }
.p-soldout { position: absolute; inset: 0; background: rgba(0,0,0,.45); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }

/* grid style */
.cards-grid .p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-grid .p-card { flex-direction: column; }
.cards-grid .p-img { aspect-ratio: 4 / 3; }
@media (min-width: 768px) { .cards-grid .p-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cards-grid .p-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* list style */
.cards-list .p-grid { grid-template-columns: 1fr; }
.cards-list .p-card { flex-direction: row-reverse; }
.cards-list .p-img { width: 112px; min-height: 112px; }
@media (min-width: 768px) { .cards-list .p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cards-list .p-img { width: 140px; } }
/* compact style (no images) */
.cards-compact .p-grid { grid-template-columns: 1fr; gap: 0; background: var(--m-surface); border-radius: var(--m-radius); border: 1px solid var(--m-border); overflow: hidden; }
.cards-compact .p-card { border: 0; border-radius: 0; border-bottom: 1px dashed var(--m-border); }
.cards-compact .p-card:last-child { border-bottom: 0; }
.cards-compact .p-card:hover { transform: none; box-shadow: none; background: rgba(var(--m-primary-rgb), .04); }
@media (min-width: 768px) { .cards-compact .p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* overlay style */
.cards-overlay .p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-overlay .p-card { aspect-ratio: 1 / 1.08; border: 0; }
.cards-overlay .p-img { position: absolute; inset: 0; }
.cards-overlay .p-body { position: relative; margin-top: auto; background: linear-gradient(0deg, rgba(0,0,0,.85), rgba(0,0,0,.0)); color: #fff; padding-top: 34px; }
.cards-overlay .p-desc { color: rgba(255,255,255,.8); -webkit-line-clamp: 1; }
.cards-overlay .p-price { color: #fff; } .cards-overlay .p-rating { color: rgba(255,255,255,.85); }
@media (min-width: 768px) { .cards-overlay .p-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cards-overlay .p-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* popular horizontal scroller */
.popular-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 8px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.popular-item { flex: 0 0 170px; scroll-snap-align: start; display: flex; }
.popular-item .p-card { flex-direction: column !important; width: 100%; }
.popular-item .p-img { aspect-ratio: 4 / 3; width: 100% !important; min-height: 0 !important; position: relative !important; }
.cards-overlay .popular-item .p-card { aspect-ratio: auto; }
.cards-overlay .popular-item .p-body { background: var(--m-surface); color: var(--m-text); padding-top: 10px; }
.cards-overlay .popular-item .p-price { color: var(--m-primary); }
@media (min-width: 768px) { .popular-item { flex-basis: 220px; } }

/* ---------------- Product modal */
.product-modal { background: var(--m-surface); color: var(--m-text); border: 0; border-radius: var(--m-radius); overflow: hidden; }
.pm-close { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 5; background-color: rgba(255,255,255,.9); border-radius: 50%; padding: 10px; opacity: 1; }
.pm-gallery.d-none + div .pm-head { padding-inline-end: 46px; }
.pm-gallery img { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.pm-name { font-size: 1.25rem; font-weight: 800; margin: 0; }
.pm-price { font-weight: 800; color: var(--m-primary); font-size: 1.15rem; white-space: nowrap; }
.pm-price del { color: var(--m-muted); font-size: .85rem; font-weight: 500; }
.pm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pm-tag { font-size: .75rem; padding: 2px 9px; border-radius: 999px; background: rgba(var(--m-primary-rgb), .1); color: var(--m-primary); }
.pm-tag-danger { background: #fdecea; color: #c0392b; }
.pm-desc { color: var(--m-muted); white-space: pre-line; }
.pm-group { border: 1px solid var(--m-border); border-radius: calc(var(--m-radius) * .8); padding: 10px 12px; margin-bottom: 12px; }
.pm-group legend { float: none; width: auto; font-size: .95rem; font-weight: 700; margin-bottom: 4px; padding: 0; }
.pm-group legend small { font-weight: 500; font-size: .75rem; color: var(--m-muted); }
.pm-group legend small.req { color: var(--m-primary); }
.pm-option { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--m-border); cursor: pointer; }
.pm-option:first-of-type { border-top: 0; }
.pm-option input { width: 18px; height: 18px; accent-color: var(--m-primary); }
.pm-option-price { font-size: .85rem; color: var(--m-muted); }
.pm-footer { border-top: 1px solid var(--m-border); background: var(--m-surface); gap: 10px; flex-wrap: nowrap; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--m-border); border-radius: 999px; overflow: hidden; }
.qty-stepper button { border: 0; background: transparent; width: 38px; height: 38px; color: var(--m-text); }
.qty-stepper span { min-width: 26px; text-align: center; font-weight: 700; }
.qty-sm button { width: 30px; height: 30px; } .qty-sm span { min-width: 20px; font-size: .9rem; }
.pm-reviews .review { padding: 8px 0; border-top: 1px dashed var(--m-border); font-size: .88rem; }
.star-input button { border: 0; background: none; font-size: 1.6rem; color: #f4b942; padding: 0 3px; }
.stars { color: #f4b942; }

/* ---------------- Cart */
.cart-fab { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 1030; border: 0; background: var(--m-primary); color: var(--m-on-primary); border-radius: 999px; padding: 12px 18px; display: flex; align-items: center; gap: 12px; font-weight: 700; box-shadow: 0 8px 24px rgba(var(--m-primary-rgb), .45); width: min(92vw, 440px); justify-content: space-between; transition: transform .15s; }
.cart-fab.bump { transform: translateX(-50%) scale(1.05); }
.cart-fab-count { background: var(--m-on-primary); color: var(--m-primary); border-radius: 999px; min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; padding: 0 6px; }
.cart-panel { height: 88vh !important; border-radius: 20px 20px 0 0; background: var(--m-surface); color: var(--m-text); max-width: 720px; margin: 0 auto; }
.cart-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--m-border); }
.fulfillment-options { display: flex; gap: 8px; flex-wrap: wrap; }
.fulfillment-options .btn { flex: 1; }
.cart-totals > div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--m-muted); }
.cart-totals .cart-total { color: var(--m-text); font-weight: 800; font-size: 1.1rem; border-top: 1px solid var(--m-border); margin-top: 4px; padding-top: 8px; }
.menu-toast { position: fixed; top: 16px; left: 50%; transform: translate(-50%, -80px); background: #1f2333; color: #fff; padding: 9px 18px; border-radius: 999px; z-index: 2000; transition: transform .25s; font-size: .9rem; }
.menu-toast.show { transform: translate(-50%, 0); }
.theme-dark .modal-content, .theme-dark .offcanvas { color: var(--m-text); }
.theme-dark .btn-close { filter: invert(1); }
.theme-dark .pm-close { filter: none; }

/* ---------------- About / contact / footer */
.r-card { background: var(--m-surface); border: 1px solid var(--m-border); border-radius: var(--m-radius); padding: 18px; margin-bottom: 14px; }
.r-card h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 10px; }
.hours-table td { padding: 5px 0; border-bottom: 1px dashed var(--m-border); }
.hours-table tr.today td { color: var(--m-primary); font-weight: 700; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.gallery-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: calc(var(--m-radius) * .7); }
@media (min-width: 768px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }
.contact-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--m-border); text-decoration: none; color: var(--m-text); }
.contact-line i { width: 38px; height: 38px; border-radius: 50%; background: rgba(var(--m-primary-rgb), .1); color: var(--m-primary); display: inline-flex; align-items: center; justify-content: center; }
.r-footer { text-align: center; padding: 24px 14px 110px; color: var(--m-muted); }
.r-footer a { color: var(--m-muted); }
.r-social { width: 40px; height: 40px; border-radius: 50%; background: var(--m-surface); border: 1px solid var(--m-border); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--m-text) !important; text-decoration: none; }

/* ---------------- Platform pages */
.platform-hero { background: linear-gradient(135deg, #29335C, #E4572E); color: #fff; padding: 56px 0 70px; }
.platform-hero h1 { font-weight: 800; }
.r-dir-card { background: #fff; border-radius: 16px; border: 1px solid rgba(0,0,0,.06); overflow: hidden; display: block; text-decoration: none; color: inherit; height: 100%; transition: transform .15s, box-shadow .15s; }
.r-dir-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.r-dir-cover { height: 110px; background: linear-gradient(135deg, #29335C, #E4572E); background-size: cover; background-position: center; }
.r-dir-logo { width: 60px; height: 60px; border-radius: 14px; border: 3px solid #fff; margin: -30px 14px 0; background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #E4572E; font-size: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.r-dir-logo img { width: 100%; height: 100%; object-fit: cover; }
