/* ============================================
   CRITICAL MOBILE FIXES
   Additional layer to ensure perfect mobile display
   ============================================ */

/* Prevent horizontal scroll at all costs */
html {
  width: 100%;
  scroll-behavior: smooth;
  /* NO position:relative - it breaks sticky! */
  /* NO overflow-x here either - mixed with body's overflow-x: hidden
     it makes <html> its own scroll container and breaks sticky too! */
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  /* NO position:relative - it breaks sticky! */
}

/* Ensure all major containers respect viewport */
/* NOTE: "nav" is intentionally excluded here. Giving a <nav> element
   overflow-x: hidden makes its overflow-y auto-compute to "auto" (per the
   CSS overflow spec), turning it into a clipping/scroll container. Since
   the header's dropdown submenu (.complex_85c6) is a descendant of
   .cool-ba99 (a <nav>), it was getting clipped and forced into a tiny
   internal scrollbar instead of opening naturally below the nav link. */
main,
section,
article,
footer {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header must NOT have max-width restriction for sticky to work */
header.accordion-4ba9 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".under-ec16" is intentionally excluded here for the same reason as
   "nav" above — the header's <div class="container"> wraps the nav and
   must not clip the dropdown submenu with an auto-computed overflow-y.
   It's already width-capped via max-width in style.north-e47d so it can't cause
   horizontal overflow anyway. */
.solid-0bda,
.avatar_left_76db,
.element-3c59,
.paper_990f,
.hovered-4170,
.active_wood_0767,
.section-5a5e,
.pattern-0011,
.detail-white-abbe,
.message_5965,
.fluid_cf62 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .gallery_4994 {
    padding: 8px 0;
  }
  
  .focus-d972 img {
    height: 28px;
    width: auto;
  }
  
  .hot_6b40 {
    display: none !important;
  }
  
  .main-soft-feed {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .main-soft-feed svg {
    width: 14px;
    height: 14px;
  }
  
  .wrapper_5264 {
    padding: 6px;
  }
  
  .narrow_634f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .element-3c59,
  .avatar_left_76db,
  .paper_990f,
  .hovered-4170,
  .hero-medium-9b71,
  .background-f684,
  .overlay_32e3,
  .outer_11d4,
  .video-middle-c925,
  .inner-757b,
  .background_bottom_e885,
  .focus_over_7ac5 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .hovered_9b01,
  .west-eaca {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .warm_e25f,
  .slider_copper_3c55,
  .clean_d2a4,
  .paragraph-8120,
  .hovered_eda3,
  .shade-purple-e96f,
  .large-d133 {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  
  /* Ensure images are responsive */
  img,
  svg,
  picture {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Better padding for mobile */
  .border_pressed_c97f,
  .form_4d86,
  .layout-9723,
  .grid-cd3e,
  .west_fbce {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .column_last_3881,
  .breadcrumb-slow-320a,
  .grid-2782,
  .progress_33dc {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .thick-d6e0,
  .hero_hovered_2d00 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .feature-white-c930,
  .accent-wide-620d,
  .aside-warm-8124,
  .main-east-1fe9 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .steel_cdf2,
  .thumbnail-up-be32,
  .menu-last-816d,
  .grid_dark_95a5,
  .image-fd2b,
  .link_thick_e8f0 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .border_pressed_c97f,
  .form_4d86,
  .grid-cd3e {
    max-width: none !important;
  }
  
  .under-ec16 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .column_last_3881 {
    font-size: 1.5rem !important;
  }
  
  .breadcrumb-slow-320a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tooltip-prev-0c85,
  .feature_soft_6c2d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .grid-2782 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .feature_hot_845e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .silver-b853 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .border_pressed_c97f,
  .grid-cd3e {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

/* iPhone X and notch devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

/* css-noise: 339c */
.shadow-element-l1 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.0;
}
