/* iPhone specific overrides for HomeEnhancedV2 */
/* Loaded dynamically only when userAgent matches iPhone/iPod */

html.iphone-home .home-enhanced-v2 {
  padding: 1rem 0.85rem 110px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 100vh !important;
  box-sizing: border-box !important;
}

/* Make background container simpler for performance */
html.iphone-home .background-container { height: 120vh !important; }
html.iphone-home .background-image { filter: brightness(.9) !important; }

/* Off‑canvas sidebar base (hidden) */
html.iphone-home .sidenav > .sidenav_wrapper {
  position: fixed !important;
  top: 0 !important;
  left: -260px !important; /* hidden off screen */
  width: 240px !important;
  height: 100vh !important;
  background: rgba(18,18,18,0.97) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 2px 0 14px rgba(0,0,0,0.55) !important;
  transition: left .32s cubic-bezier(.4,0,.2,1) !important;
  display: flex !important;
  flex-direction: column !important;
  padding-bottom: 60px !important; /* leave room for player */
  z-index: 2500 !important;
}

/* Open state */
html.iphone-home .sidenav > .sidenav_wrapper.iphone-open { left: 0 !important; }
html.iphone-home .sidenav > .sidenav_wrapper.iphone-closed { left: -260px !important; }

/* Prevent desktop overlay padding logic */
html.iphone-home .home-enhanced-v2 { padding-left: 1rem !important; }

/* Single column layout adjustments */
html.iphone-home .featured-grid { grid-template-columns: 1fr !important; gap: 1rem !important; }
html.iphone-home .three-column-sections { flex-direction: column !important; gap: 1.25rem !important; }
html.iphone-home .vertical-track-section { min-height: auto !important; backdrop-filter: none !important; background: rgba(255,255,255,0.04) !important; }
html.iphone-home .quick-actions { flex-direction: column !important; gap: .65rem !important; }
html.iphone-home .quick-action-btn { width: 100% !important; justify-content: center !important; }
html.iphone-home .home-header h1 { font-size: 2.1rem !important; line-height: 1.15 !important; }

/* Hide glass effects inside sidebar on iPhone */
html.iphone-home .sidenav > .sidenav_wrapper > .sidenav_header,
html.iphone-home .sidenav > .sidenav_wrapper > .sidenav_footer { background: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

/* Backdrop overlay when menu open */
html.iphone-home .iphone-sidebar-backdrop { 
  position: fixed; inset: 0; z-index: 2400; background: rgba(0,0,0,0.45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
html.iphone-home .iphone-sidebar-backdrop.visible { opacity: 1; pointer-events: auto; }

/* Custom toggle button (only if native hamburger fails) */
html.iphone-home .iphone-menu-toggle { 
  position: fixed; top: 10px; left: 10px; z-index: 2600; 
  background: rgba(30,30,30,0.85); border: 1px solid rgba(255,255,255,0.08); color: #fafafa; 
  padding: .55rem .8rem; border-radius: 10px; font-size: 1rem; line-height: 1; font-weight: 600; 
  display: flex; align-items: center; gap: .45rem; box-shadow: 0 4px 16px -4px rgba(0,0,0,.5);
}
html.iphone-home .iphone-menu-toggle:active { transform: scale(.94); }

/* Ensure player stays above hidden sidebar slide zone */
html.iphone-home .main > .main_footer { position: fixed !important; bottom: 0 !important; left: 0 !important; right: 0 !important; z-index: 2300 !important; }

/* Prevent horizontal scroll due to off-canvas */
html.iphone-home, html.iphone-home body { overflow-x: hidden !important; }
