/* =====================================================
   Hygienic — Mobile App Experience CSS v2
   Works with mobile-fix.css for full responsive layout
   App-specific UI only (bottom nav, header, splash etc.)
===================================================== */

:root {
  --app-header-h: 62px;
  --app-bottom-h: 66px;
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 768px) {

  /* ---- App body padding for bottom nav ---- */
  body {
    padding-bottom: calc(var(--app-bottom-h) + var(--app-safe-bottom)) !important;
  }

  /* ---- App-style fixed header ---- */
  .site-header {
    background: #1B5E20 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
  }

  .site-logo .logo-text { color: #fff !important; }
  .site-logo .logo-icon {
    background: rgba(255,255,255,0.2) !important;
    color: #fff !important;
  }

  /* White logo on app header */
  .site-logo img.logo-main {
    filter: brightness(0) invert(1) !important;
  }

  /* Hide desktop CTA btn in header */
  .header-cta > .btn { display: none !important; }

  /* ---- App action buttons in header (injected by JS) ---- */
  .app-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .app-hdr-btn {
    width: 36px !important;
    height: 36px !important;
    background: rgba(255,255,255,0.18) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 1rem !important;
  }

  /* ---- Bottom Tab Navigation ---- */
  #appBottomNav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: calc(var(--app-bottom-h) + var(--app-safe-bottom)) !important;
    background: #fff !important;
    border-top: 1px solid #E5E7EB !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-around !important;
    padding-top: 8px !important;
    z-index: 999 !important;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.08) !important;
  }

  .app-tab {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 3px !important;
    text-decoration: none !important;
    padding: 4px 8px !important;
    border-radius: 10px !important;
    min-width: 54px !important;
  }

  .app-tab i {
    font-size: 1.2rem !important;
    color: #9CA3AF !important;
  }

  .app-tab span {
    font-size: .58rem !important;
    font-weight: 700 !important;
    color: #9CA3AF !important;
    letter-spacing: .01em !important;
  }

  .app-tab.active i,
  .app-tab:active i { color: #1B5E20 !important; }
  .app-tab.active span,
  .app-tab:active span { color: #1B5E20 !important; }
  .app-tab.active { background: #E8F5E9 !important; }

  /* Quote CTA tab */
  .app-tab.app-tab-cta {
    background: #1B5E20 !important;
    border-radius: 12px !important;
    padding: 5px 10px !important;
    margin-top: -2px !important;
  }
  .app-tab.app-tab-cta i,
  .app-tab.app-tab-cta span { color: #fff !important; }

  /* ---- Stats strip ---- */
  .app-stats-strip {
    display: flex !important;
    background: #fff !important;
    border-bottom: 1px solid #E5E7EB !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }

  .app-stats-strip::-webkit-scrollbar { display: none !important; }

  .app-stat-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 12px 20px !important;
    border-right: 1px solid #F3F4F6 !important;
    min-width: 90px !important;
    flex-shrink: 0 !important;
  }

  .app-stat-num {
    font-size: 1.2rem !important;
    font-weight: 800 !important;
    color: #1B5E20 !important;
    line-height: 1 !important;
  }

  .app-stat-lbl {
    font-size: .6rem !important;
    color: #9CA3AF !important;
    text-align: center !important;
    margin-top: 3px !important;
  }

  /* ---- WhatsApp & Back-to-top: above bottom nav ---- */
  .whatsapp-float {
    bottom: calc(var(--app-bottom-h) + var(--app-safe-bottom) + 14px) !important;
  }

  .back-to-top {
    bottom: calc(var(--app-bottom-h) + var(--app-safe-bottom) + 70px) !important;
  }

  /* ---- Newsletter popup: bottom sheet ---- */
  .newsletter-popup { align-items: flex-end !important; }

  .newsletter-popup-inner {
    border-radius: 20px 20px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-bottom: calc(28px + var(--app-safe-bottom)) !important;
  }

  /* ---- App splash ---- */
  #appSplash {
    display: none;
    position: fixed;
    inset: 0;
    background: #1B5E20;
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
  }

  #appSplash .splash-icon {
    width: 88px; height: 88px;
    background: rgba(255,255,255,0.15);
    border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
  }

  #appSplash .splash-name { color: #fff; font-size: 1.3rem; font-weight: 800; }
  #appSplash .splash-sub  { color: rgba(255,255,255,.7); font-size: .82rem; }

  /* ---- PWA Install Banner ---- */
  #pwaInstallBanner {
    display: none;
    position: fixed;
    bottom: calc(var(--app-bottom-h) + var(--app-safe-bottom) + 12px);
    left: 12px; right: 12px;
    background: #1B5E20;
    color: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    z-index: 998;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  }

  .pwa-banner-inner { display: flex; align-items: center; gap: 12px; }
  .pwa-icon { width: 42px; height: 42px; background: rgba(255,255,255,0.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
  .pwa-title { font-weight: 800; font-size: .88rem; }
  .pwa-sub   { font-size: .72rem; opacity: .8; margin-top: 2px; }
  .pwa-btns  { display: flex; gap: 8px; margin-top: 10px; }
  .btn-install { flex: 1; padding: 9px; background: #C9A84C; color: #fff; border: none; border-radius: 8px; font-size: .82rem; font-weight: 700; cursor: pointer; font-family: inherit; }
  .btn-dismiss { padding: 9px 14px; background: rgba(255,255,255,0.15); color: #fff; border: none; border-radius: 8px; font-size: .82rem; cursor: pointer; font-family: inherit; }

  /* ---- Page transition ---- */
  main#pageMain { animation: pgIn .25s ease; }
  @keyframes pgIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
