/* ==========================================================================
   LITTLE HEADS - MOBILE APP EXPERIENCE (PWA & 9:16 OPTIMIZED)
   Keeps website experience 100% intact on desktop/tablets (> 768px).
   ========================================================================== */

:root {
  --mobile-app-gap: 12px;
  --mobile-top-height: 56px;
  --mobile-cats-height: 46px;
  --mobile-bottom-height: 64px;
}

/* ==========================================================================
   1. TWO-STAGE ANIMATED SPLASH SCREEN (2s Logo 1 + 2s Logo 2 = 4s)
   ========================================================================== */
#mobile-splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#mobile-splash-overlay.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.splash-stage-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.splash-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.92);
  transition: opacity 0.35s ease-out, transform 0.35s ease-out, visibility 0.35s;
  pointer-events: none;
  padding: 32px 20px;
}

.splash-stage.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
}

.splash-brand-logo {
  width: 82vw;
  max-width: 360px;
  max-height: 55vh;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.07));
  animation: splashSoftPop 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes splashSoftPop {
  0% { transform: scale(0.90); opacity: 0.2; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   2. DESKTOP PRESERVATION (Screens > 768px)
   Keep website experience 100% intact on desktop.
   ========================================================================== */
@media (min-width: 769px) {
  #mobile-app-header,
  #mobile-top-categories,
  #mobile-bottom-nav,
  .mobile-location-hero-card {
    display: none !important;
  }
}

/* ==========================================================================
   3. MOBILE APP SHELL & NAVIGATION (Screens <= 768px / 9:16 mobile)
   ========================================================================== */
@media (max-width: 768px) {
  /* Hide top black contact strip on mobile app (phone, student login/signup, admission message) */
  #top-contact-strip {
    display: none !important;
  }

  /* Hide full footer on mobile app */
  .site-footer {
    display: none !important;
  }

  /* Hide desktop navbar on mobile */
  #main-nav-strip {
    display: none !important;
  }

  /* Body safe area and bottom nav padding */
  body {
    padding-bottom: calc(var(--mobile-bottom-height, 64px) + env(safe-area-inset-bottom, 0px) + 16px) !important;
  }

  /* Mobile Top App Header: Navbar [Item 1 (Left)], [Item 2 (Right)] */
  #mobile-app-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    height: var(--mobile-top-height);
    padding: 0 14px;
    background: #FFFFFF;
    border-bottom: 1px solid #F1F5F9;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  }

  .mobile-navbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
  }

  .mobile-navbar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
  }

  .mobile-navbar-title-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
  }

  .mobile-navbar-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1E3A8A;
  }

  .mobile-navbar-sub {
    font-size: 0.68rem;
    font-weight: 700;
    color: #FF6633;
    letter-spacing: 0.2px;
  }

  .mobile-navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-partner-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #FFF7ED;
    border: 1px solid #FFEDD5;
    padding: 4px 8px;
    border-radius: 20px;
    text-decoration: none;
    cursor: pointer;
  }

  .mobile-partner-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
  }

  .mobile-partner-text {
    font-size: 0.68rem;
    font-weight: 700;
    color: #C2410C;
    display: none;
  }
  @media (min-width: 380px) {
    .mobile-partner-text { display: inline; }
  }

  .mobile-header-call-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #16A34A;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
  }

  /* Top 4-Icon Quick Category Navbar */
  #mobile-top-categories {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    background: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    position: sticky;
    top: var(--mobile-top-height);
    z-index: 999;
    padding: 6px 8px;
    gap: 4px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.02);
  }

  .mobile-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .mobile-cat-item:active {
    transform: scale(0.96);
  }

  .mobile-cat-icon {
    font-size: 1.15rem;
    line-height: 1;
    margin-bottom: 2px;
  }

  .mobile-cat-label {
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
  }

  .mobile-cat-item.active {
    background: #FFF7ED;
    color: #EA580C;
  }

  .mobile-cat-item.active .mobile-cat-label {
    color: #EA580C;
    font-weight: 800;
  }

  /* Fixed Bottom Navigation Bar (5 Icons) */
  #mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--mobile-bottom-height, 64px) !important;
    background: #FFFFFF !important;
    border-top: 1px solid #E2E8F0 !important;
    z-index: 999999 !important;
    visibility: visible !important;
    opacity: 1 !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: 4px 6px max(8px, env(safe-area-inset-bottom, 0px)) 6px !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
    pointer-events: auto !important;
  }

  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #64748B;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    padding: 2px;
    transition: all 0.15s ease;
  }

  .mobile-nav-btn:active {
    transform: scale(0.92);
  }

  .mobile-nav-icon {
    font-size: 1.3rem;
    line-height: 1;
    margin-bottom: 3px;
    transition: transform 0.2s ease;
  }

  .mobile-nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: -0.2px;
  }

  .mobile-nav-btn.active {
    color: #EA580C;
  }

  .mobile-nav-btn.active .mobile-nav-icon {
    transform: translateY(-2px);
  }

  .mobile-nav-btn.active::after {
    content: '';
    position: absolute;
    top: 2px;
    width: 18px;
    height: 3px;
    background: #EA580C;
    border-radius: 3px;
  }

  /* ==========================================================================
     5. LOCATION FIRST REVIEWS COMPONENT WITH GOOGLE MAPS NAVIGATION
     ========================================================================== */
  .mobile-location-hero-card {
    display: block !important;
    background: #FFFFFF;
    border: 1px solid #FED7AA;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(234, 88, 12, 0.08);
  }

  .mobile-location-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
  }

  .mobile-location-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #FFF7ED;
    border: 1px solid #FDBA74;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
  }

  .mobile-location-info {
    flex: 1;
  }

  .mobile-location-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    color: #EA580C;
    background: #FFF7ED;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 4px;
  }

  .mobile-location-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 2px 0;
    line-height: 1.25;
  }

  .mobile-location-address {
    font-size: 0.78rem;
    color: #64748B;
    line-height: 1.35;
    margin: 0;
  }

  .mobile-location-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
  }

  .mobile-location-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease;
  }

  .mobile-location-btn:active {
    transform: scale(0.97);
  }

  .mobile-location-btn.navigate {
    background: #16A34A;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.25);
  }

  .mobile-location-btn.call {
    background: #FFF7ED;
    color: #EA580C;
    border: 1px solid #FDBA74;
  }

  /* Floating WhatsApp on mobile */
  #whatsapp-float {
    bottom: calc(var(--mobile-bottom-height) + env(safe-area-inset-bottom) + 12px) !important;
    right: 14px !important;
    width: 48px !important;
    height: 48px !important;
  }
}
