/* ============================================================
   AstroKamya™ — GLOBAL MOBILE OPTIMIZATIONS v2
   mobile-global-v2.css — 2026 Modern Mobile-First Enhancements
   ============================================================
   Applied globally to all pages via Layout.astro
   Complements existing pages-base-mobile-v1.css
   ============================================================ */

/* ══════════════════════════════════════════════════
   0. BASELINE FIXES — ALL PAGES
   ══════════════════════════════════════════════════ */

/* Prevent horizontal scroll everywhere */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Better tap targets throughout */
a, button, [role="button"] {
  min-height: 44px;
  min-width: 44px;
}

/* iOS safe area support */
:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ══════════════════════════════════════════════════
   1. MOBILE NAVBAR — FIXES
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Prevent CTA from overlapping profile icon on very small screens */
  .ak-nav-actions {
    gap: 6px !important;
  }
  
  /* Hide "Reveal My Future" CTA on mobile — too cluttered */
  .ak-nav-cta {
    display: none !important;
  }
  
  /* Profile button — correct sizing */
  .ak-nav-profile-btn {
    width: 38px !important;
    height: 38px !important;
    flex-shrink: 0;
  }
  
  /* Hamburger — ensure visibility */
  .ak-hamburger {
    display: flex !important;
    flex-shrink: 0;
  }
}

/* ══════════════════════════════════════════════════
   2. MOBILE DRAWER — FONT & SPACING
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Drawer scroll */
  .ak-nav-drawer {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Bottom padding for safe area + extra breathing room */
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
  }
  
  /* Larger touch targets for drawer links */
  .ak-drawer-link {
    min-height: 52px !important;
    display: flex !important;
    align-items: center !important;
  }
  
  /* CTA button — full width, proper safe area */
  .ak-drawer-footer {
    padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
  }
  
  /* Prevent drawer label from being too small */
  .ak-drawer-section-label {
    font-size: 10px !important;
  }
}

/* ══════════════════════════════════════════════════
   3. HOMEPAGE (INDEX) — MOBILE
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Hero input on homepage */
  #birth-input, .birth-form, .hero-form {
    padding: 0 16px !important;
  }
  
  /* Section headings */
  h1, .hero-title {
    font-size: clamp(28px, 7.5vw, 44px) !important;
    line-height: 1.12 !important;
  }
  
  h2 {
    font-size: clamp(22px, 6vw, 34px) !important;
  }
  
  h3 {
    font-size: clamp(18px, 5vw, 26px) !important;
  }
  
  /* Feature/bento grids — single column on mobile */
  .feature-grid,
  .bento-grid,
  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  
  /* Sections — tighter padding on mobile */
  section {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* ══════════════════════════════════════════════════
   4. FOOTER — MOBILE
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Footer grid — single column */
  footer .footer-grid,
  .footer-columns,
  .ak-footer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  
  /* Footer links — larger tap targets */
  footer a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
  
  /* Footer bottom — stack on mobile */
  .footer-bottom {
    flex-direction: column !important;
    gap: 10px !important;
    text-align: center !important;
  }
}

/* ══════════════════════════════════════════════════
   5. MODAL & DRAWER IMPROVEMENTS — ALL PAGES
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Auth modal — full screen on mobile */
  .auth-modal,
  #auth-modal,
  .modal-container {
    width: 100vw !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
  }
  
  /* Payment/cart modals — safe area padding */
  .pay-modal,
  .cart-drawer {
    padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
  }
}

/* ══════════════════════════════════════════════════
   6. BLOG PAGE — MOBILE
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .blog-grid,
  .posts-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  .blog-card,
  .post-card {
    border-radius: 14px !important;
  }
  
  /* Blog hero */
  .blog-hero,
  .blog-header {
    padding: 40px 16px 24px !important;
    text-align: center;
  }
}

/* ══════════════════════════════════════════════════
   7. ABOUT PAGE — MOBILE
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Team grid — 2 columns on mobile */
  .team-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  
  /* About hero */
  .about-hero {
    padding-top: 60px !important;
    text-align: center;
  }
  
  /* Stats row — 2x2 on mobile */
  .stats-row, .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}

/* ══════════════════════════════════════════════════
   8. CONTACT PAGE — MOBILE
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .contact-form {
    padding: 24px 16px !important;
    border-radius: 16px !important;
  }
  
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  
  /* Input fields — full width */
  .contact-form input,
  .contact-form textarea,
  .contact-form select {
    width: 100% !important;
    font-size: 16px !important; /* Prevent iOS zoom on focus */
    padding: 14px 16px !important;
    border-radius: 10px !important;
  }
  
  /* Submit button */
  .contact-form button[type="submit"] {
    width: 100% !important;
    padding: 15px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
  }
}

/* ══════════════════════════════════════════════════
   9. ACCOUNT PAGE — MOBILE
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Account sidebar → top tabs on mobile */
  .account-layout {
    flex-direction: column !important;
    gap: 0 !important;
  }
  
  .account-sidebar {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Account cards */
  .account-card {
    border-radius: 12px !important;
    padding: 16px !important;
  }
  
  /* Order items */
  .order-card {
    padding: 16px !important;
    border-radius: 12px !important;
  }
}

/* ══════════════════════════════════════════════════
   10. SOULSYNC PAGE — MOBILE
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Ensure SoulSync form is touch-friendly */
  .ss-input, 
  .ss-form input,
  .soulsync-input {
    font-size: 16px !important; /* Prevent iOS auto-zoom */
    padding: 14px 16px !important;
  }
  
  /* Action buttons */
  .ss-btn, .soulsync-cta {
    width: 100% !important;
    padding: 15px !important;
    font-size: 16px !important;
  }
}

/* ══════════════════════════════════════════════════
   11. IMPROVED SCROLLING PERFORMANCE
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Momentum scrolling everywhere */
  * {
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Scrollable containers */
  .v3-marquee-track,
  .v3-cat-row,
  .v3-reels-scroll,
  #v3-intents,
  .ak-cart-scroll {
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
  }
  
  /* Better image rendering */
  img {
    image-rendering: auto;
    max-width: 100%;
    height: auto;
  }
}

/* ══════════════════════════════════════════════════
   12. FONT SIZE INPUTS — PREVENT IOS ZOOM
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ══════════════════════════════════════════════════
   13. COOKIE CONSENT — MOBILE
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .cookie-consent,
  #cookie-consent,
  .ak-cookie-banner {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 20px 16px max(20px, env(safe-area-inset-bottom)) !important;
  }
  
  .cookie-consent-buttons {
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .cookie-consent-buttons button {
    width: 100% !important;
  }
}

/* ══════════════════════════════════════════════════
   14. BACK-TO-TOP BUTTON — MOBILE
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .back-to-top,
  #back-to-top {
    bottom: max(80px, calc(64px + env(safe-area-inset-bottom))) !important;
    right: 16px !important;
    width: 44px !important;
    height: 44px !important;
  }
}
