/* Hide offcanvas drawer content on desktop — critical fix */
#bmbMobileNav,
.bmb-mobile-trigger,
.bmb-backdrop {
  display: none !important;
}

/* Re-enable only on mobile */
@media (max-width: 767px) {
  #bmbMobileNav {
    display: flex !important;
    flex-direction: column;
  }
  .bmb-mobile-trigger {
    display: flex !important;
  }
  .bmb-backdrop.bmb-open {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
  }
}

/* ============================================================
   BookMyBuffet — Mobile Overrides
   ------------------------------------------------------------
   Scope:    Mobile only (max-width: 767px)
   Touches:  Nothing on desktop. Every rule is inside the
             @media query OR uses .bmb-* prefixed classes that
             do not exist anywhere else in the codebase.
   Revert:   Delete this file and remove its <link> tag in
             application/views/site/include/header.php plus the
             three injected HTML blocks (mobile trigger, drawer,
             hero CTA). Zero impact on desktop.
   Brand:    Aligned with assets/css/style.css design tokens
             (--colorPrimary #37B5FE, Manrope, Barlow).
   ============================================================ */

/* ---------- Layer 1: Brand tokens (mobile-only fallback) ---------- */
@media (max-width: 767px) {
  :root {
    --bmb-m-primary: #37B5FE;
    --bmb-m-primary-dark: #1d97e0;
    --bmb-m-ink: #231f40;
    --bmb-m-muted: #6b7280;
    --bmb-m-line: #e5e7eb;
    --bmb-m-bg: #ffffff;
    --bmb-m-bg-soft: #f8fbff;
    --bmb-m-radius: 12px;
    --bmb-m-shadow: 0 8px 28px rgba(35, 31, 64, 0.12);
    --bmb-m-font: 'Manrope', system-ui, -apple-system, sans-serif;
    --bmb-m-heading: 'Barlow', system-ui, sans-serif;
  }
}

/* ---------- Layer 2: Hide desktop nav bits we replace ---------- */
@media (max-width: 767px) {
  /* Existing FontAwesome-bars toggler is replaced by our hamburger */
  .navbar.main_menu .navbar-toggler { display: none !important; }
  /* Existing right-side icon list is replaced by our login pill */
  .navbar.main_menu .menu_icon { display: none !important; }
  /* Collapse the desktop dropdown menu so it never flashes */
  .navbar.main_menu .navbar-collapse { display: none !important; }
}

/* ---------- Layer 3: Mobile trigger row (login + hamburger) ---------- */
@media (max-width: 767px) {
  .bmb-mobile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
  }
}

/* ---------- Layer 4: Login pill (mobile only) ---------- */
@media (max-width: 767px) {
  .bmb-login-mobile {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--bmb-m-primary);
    border-radius: 999px;
    color: var(--bmb-m-primary);
    font-family: var(--bmb-m-font);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    background: #fff;
    transition: background .15s ease, color .15s ease;
  }
  .bmb-login-mobile:active {
    background: var(--bmb-m-primary);
    color: #fff;
  }
}

/* ---------- Layer 5: Hamburger button ---------- */
@media (max-width: 767px) {
  .bmb-burger-mobile {
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--bmb-m-line);
    border-radius: 8px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
  }
  .bmb-burger-mobile span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--bmb-m-ink);
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
  }
  .bmb-burger-mobile[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .bmb-burger-mobile[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .bmb-burger-mobile[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ---------- Layer 6: Offcanvas drawer container ---------- */
@media (max-width: 767px) {
  .bmb-offcanvas {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 86%;
    max-width: 340px;
    background: var(--bmb-m-bg);
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform .28s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--bmb-m-shadow);
    overflow: hidden;
  }
  .bmb-offcanvas.bmb-open {
    transform: translateX(0);
  }
}

/* ---------- Layer 7: Backdrop ---------- */
@media (max-width: 767px) {
  .bmb-oc-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  .bmb-oc-backdrop.bmb-open {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ---------- Layer 8: Drawer header (logo + close) ---------- */
@media (max-width: 767px) {
  .bmb-oc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bmb-m-line);
    flex-shrink: 0;
  }
  .bmb-oc-header img {
    height: 30px !important;
    width: auto !important;
    object-fit: contain !important;
  }
  .bmb-oc-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bmb-m-bg-soft);
    border-radius: 50%;
    color: var(--bmb-m-ink);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ---------- Layer 9: Drawer body — sections + links ---------- */
@media (max-width: 767px) {
  .bmb-oc-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0 12px;
  }
  .bmb-oc-section {
    margin: 18px 20px 6px;
    font-family: var(--bmb-m-heading);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bmb-m-muted);
  }
  .bmb-oc-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    color: var(--bmb-m-ink);
    font-family: var(--bmb-m-font);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    min-height: 44px;
  }
  .bmb-oc-link:active { background: var(--bmb-m-bg-soft); }
  .bmb-oc-link.active { color: var(--bmb-m-primary); font-weight: 600; }
  .bmb-oc-link .bmb-chev {
    font-size: 12px;
    color: var(--bmb-m-muted);
    transition: transform .25s ease;
  }
  .bmb-oc-link[aria-expanded="true"] .bmb-chev {
    transform: rotate(180deg);
  }
}

/* ---------- Layer 10: Drawer submenu (collapsible) ---------- */
@media (max-width: 767px) {
  .bmb-oc-submenu {
    max-height: 0;
    overflow: hidden;
    background: var(--bmb-m-bg-soft);
    transition: max-height .3s ease;
  }
  .bmb-oc-submenu.open {
    max-height: 600px;
  }
  .bmb-oc-submenu .bmb-oc-link {
    padding-left: 36px;
    font-size: 14px;
    font-weight: 400;
  }
}

/* ---------- Layer 11: Drawer footer (CTA + contact) ---------- */
@media (max-width: 767px) {
  .bmb-oc-footer {
    padding: 16px 20px 20px;
    border-top: 1px solid var(--bmb-m-line);
    background: var(--bmb-m-bg);
    flex-shrink: 0;
  }
  .bmb-oc-cta {
    display: block;
    width: 100%;
    padding: 13px 16px;
    background: var(--bmb-m-primary);
    color: #fff;
    text-align: center;
    border-radius: var(--bmb-m-radius);
    font-family: var(--bmb-m-font);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
  }
  .bmb-oc-contact {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
  }
  .bmb-oc-contact a {
    font-size: 12px;
    color: var(--bmb-m-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .bmb-oc-contact .bmb-ic-phone { color: var(--bmb-m-primary); }
  .bmb-oc-contact .bmb-ic-wa    { color: #25d366; }
}

/* ---------- Layer 12: Lock body scroll when drawer open ---------- */
@media (max-width: 767px) {
  body.bmb-oc-open {
    overflow: hidden;
    touch-action: none;
  }
}

/* ---------- Layer 13: Hero mobile CTA strip ---------- */
@media (max-width: 767px) {
  .bmb-hero-mobile-cta {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bmb-m-bg);
    border-bottom: 1px solid var(--bmb-m-line);
  }
  .bmb-cta-primary,
  .bmb-cta-outline {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 14px;
    border-radius: var(--bmb-m-radius);
    font-family: var(--bmb-m-font);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    line-height: 1.1;
  }
  .bmb-cta-primary {
    background: var(--bmb-m-primary);
    color: #fff;
    border: 1px solid var(--bmb-m-primary);
  }
  .bmb-cta-primary:active { background: var(--bmb-m-primary-dark); }
  .bmb-cta-outline {
    background: #fff;
    color: var(--bmb-m-primary);
    border: 1px solid var(--bmb-m-primary);
  }
}

/* ---------- Layer 14: Touch target safety net ---------- */
@media (max-width: 767px) {
  .bmb-mobile-trigger a,
  .bmb-mobile-trigger button,
  .bmb-offcanvas a,
  .bmb-offcanvas button {
    min-height: 36px;
  }
}

/* ---------- Layer 15: Reduced motion ---------- */
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .bmb-offcanvas,
  .bmb-oc-backdrop,
  .bmb-oc-submenu,
  .bmb-burger-mobile span {
    transition: none !important;
  }
}

/* ============================================================
   END mobile-overrides.css
   ============================================================ */
