/* ============================================================
   Royal Masala — Mobile "Flutter app" look
   Active ONLY: (a) on screens <= 1024px (phones + tablets) AND (b) when body has
   .rm-mobile-app (set by the admin Mobile View master switch).
   Desktop/laptop (>=1025px) are never affected.
   ============================================================ */
:root {
  --nav-bg: #FFFDEC;
  --nav-text: #1E4E5A;
  --nav-text-hover: #00404E;
}

@media (max-width: 1024px) {

  /* ---------- Bottom navigation bar ---------- */
  body.rm-mobile-app { padding-bottom: 72px; }
  .rm-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: var(--nav-bg);
    border-top: 1px solid rgba(30, 78, 90, 0.2);
    box-shadow: 0 -6px 24px rgba(0, 22, 28, 0.22);
    display: flex;
    z-index: 300;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .rm-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(30, 78, 90, 0.6);
    font-family: 'Inter', 'Calibri', system-ui, sans-serif;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s, transform 0.1s;
  }
  .rm-bottom-nav a:active { transform: scale(0.94); }
  .rm-bottom-nav a .rm-nav-ico { font-size: 1.32rem; line-height: 1; filter: grayscale(0.45) brightness(0.95); transition: filter 0.15s, transform 0.15s; }
  .rm-bottom-nav a.active { color: var(--nav-text-hover); font-weight: 700; }
  .rm-bottom-nav a.active .rm-nav-ico { filter: none; transform: scale(1.12); }

  /* Hide bottom nav by default when master switch off (no body class) */
  body:not(.rm-mobile-app) .rm-bottom-nav { display: none; }
  body:not(.rm-mobile-app) .rm-drawer,
  body:not(.rm-mobile-app) .rm-drawer-backdrop { display: none; }

  /* Back-to-top is desktop/tablet only */
  .scroll-top { display: none !important; }

  /* In-nav menu tab: ☰ icon is text, slightly bolder */
  .rm-bottom-nav .rm-nav-menu .rm-nav-ico { filter: none; font-weight: 700; }
  .rm-bottom-nav .rm-nav-menu.active { color: var(--nav-text-hover); }

  /* ---------- Right slide-in drawer ---------- */
  .rm-drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 22, 28, 0.6);
    backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
    z-index: 400;
  }
  .rm-drawer-backdrop.open { opacity: 1; visibility: visible; }
  .rm-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 78%; max-width: 320px;
    background: var(--nav-bg);
    border-left: 1px solid rgba(30, 78, 90, 0.2);
    box-shadow: -14px 0 40px rgba(0, 22, 28, 0.6);
    z-index: 410;
    transform: translateX(105%);
    transition: transform 0.38s cubic-bezier(0.22, 0.9, 0.3, 1);
    display: flex; flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .rm-drawer.open { transform: translateX(0); }
  .rm-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(30, 78, 90, 0.15);
  }
  .rm-drawer-logo {
    font-family: 'Playfair Display', 'Glitten', Georgia, serif;
    font-weight: 900; font-size: 1.1rem; color: var(--nav-text);
  }
  .rm-drawer-logo { display: inline-flex; align-items: center; gap: 8px; }
  .rm-drawer-logo img { height: 42px; width: auto; display: block; }
  .rm-drawer-logo img.rm-drawer-fav { height: 32px; border-radius: 6px; }
  .rm-drawer-head button { font-size: 1.2rem; color: var(--nav-text); padding: 6px; }
  .rm-drawer-nav { padding: 12px 10px; overflow-y: auto; display: flex; flex-direction: column; }
  .rm-drawer-nav a, .rm-drawer-logout {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--nav-text);
    font-family: 'Inter', 'Calibri', system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .rm-drawer-nav a:active, .rm-drawer-logout:active { background: rgba(30, 78, 90, 0.1); color: var(--nav-text-hover); }
  .rm-drawer-sep { height: 1px; background: rgba(30, 78, 90, 0.15); margin: 10px 14px; }
  .rm-drawer-logout { color: #c0392b; }

  /* ---------- Homepage: app shell ---------- */
  body.rm-mobile-app .footer { display: none; }
  body.rm-mobile-app .nav,
  body.rm-mobile-app .menu-toggle,
  body.rm-mobile-app .auth-buttons { display: none !important; }
  body.rm-mobile-app .header-inner { justify-content: center; padding: 9px 16px; }
  body.rm-mobile-app .logo-img { height: 38px; }
  body.rm-mobile-app .logo-fav { height: 32px; margin-right: 8px; }
  body.rm-mobile-app .topbar { font-size: 0.74rem; padding: 6px 10px; }
  body.rm-mobile-app .hero-slide { min-height: 350px; padding: 34px 22px; }
  body.rm-mobile-app .hero-title { font-size: 1.65rem; }
  body.rm-mobile-app .hero-subtitle { font-size: 0.92rem; }
  body.rm-mobile-app .hero-cta { padding: 13px 26px; font-size: 0.9rem; }
  body.rm-mobile-app .section { padding: 30px 0; }
  body.rm-mobile-app .section-head { margin-bottom: 18px; }
  body.rm-mobile-app .category-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  body.rm-mobile-app .category-card { padding: 16px 6px; border-radius: 16px; }
  body.rm-mobile-app .category-icon { font-size: 1.8rem; margin-bottom: 6px; }
  body.rm-mobile-app .category-name { font-size: 0.74rem; }
  body.rm-mobile-app .category-count { display: none; }
  body.rm-mobile-app .product-card { flex: 0 0 168px; border-radius: 18px; }
  body.rm-mobile-app .product-image { height: 112px; font-size: 2.6rem; }
  body.rm-mobile-app .newsletter { padding: 38px 18px; }

  /* ---------- Customer dashboard: app shell ---------- */
  body.rm-mobile-app .topbar-strip { display: none; }
  body.rm-mobile-app .cust-sidebar { display: none; }
  body.rm-mobile-app .cust-shell { padding: 14px 14px 84px; gap: 14px; }
  body.rm-mobile-app .cust-header-inner { padding: 10px 14px; }
  body.rm-mobile-app .cust-header .logo { font-size: 1.35rem; }
  body.rm-mobile-app .hero-card { padding: 22px 20px; border-radius: 20px; }
  body.rm-mobile-app .hero-card h1 { font-size: 1.4rem; }
  body.rm-mobile-app .stat-grid { grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 16px; }
  body.rm-mobile-app .stat-card { padding: 14px; gap: 10px; border-radius: 16px; }
  body.rm-mobile-app .stat-card .stat-ico { width: 38px; height: 38px; font-size: 17px; border-radius: 10px; }
  body.rm-mobile-app .stat-card .value { font-size: 1.2rem; }
  body.rm-mobile-app .stat-card .label { font-size: 0.66rem; }
  body.rm-mobile-app .panel { padding: 18px 16px; border-radius: 20px; overflow-x: auto; }
  body.rm-mobile-app .section-row { gap: 14px; }
  body.rm-mobile-app .data-table { font-size: 0.8rem; min-width: 480px; }
  body.rm-mobile-app .btn-solid { width: 100%; border-radius: 999px; padding: 14px; }
  body.rm-mobile-app .card-grid { grid-template-columns: 1fr; }
  body.rm-mobile-app .user-pill { font-size: 0.8rem; padding: 4px 10px 4px 4px; }
  body.rm-mobile-app .logout-link { padding: 7px 12px; font-size: 0.78rem; }

  /* ---------- Auth pages: full-screen app screens ---------- */
  body.rm-mobile-app .auth-wrap { padding: 0; align-items: stretch; }
  body.rm-mobile-app .auth-card {
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    border: none;
    padding: 46px 24px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  body.rm-mobile-app .auth-card { padding-bottom: 96px; }
  body.rm-mobile-app .auth-card .btn { border-radius: 999px; padding: 15px 18px; }
  body.rm-mobile-app .auth-brand .logo { font-size: 2.1rem; }
}

/* ============================================================
   Desktop / tablet (>=768px): mobile app elements never visible
   ============================================================ */
@media (min-width: 1025px) {
  .rm-bottom-nav,
  .rm-drawer,
  .rm-drawer-backdrop {
    display: none !important;
  }
}
