/* ============================================
   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 (.thick_bdf3) is a descendant of
   .surface_glass_c248 (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.wide_c5c3 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".middle-a5d7" 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.header_large_c827 so it can't cause
   horizontal overflow anyway. */
.basic_f889,
.link_medium_8c9e,
.grid_purple_9655,
.frame_soft_10ae,
.image_8ac2,
.tag_fixed_8c4a,
.pro_9b4c,
.liquid_dce3,
.secondary-a3a1,
.under-8609,
.iron_07cb {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .background-b6af {
    padding: 8px 0;
  }
  
  .alert_soft_727a img {
    height: 28px;
    width: auto;
  }
  
  .caption-90d8 {
    display: none !important;
  }
  
  .north-3800 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .north-3800 svg {
    width: 14px;
    height: 14px;
  }
  
  .nav_0a3d {
    padding: 6px;
  }
  
  .primary_4d9a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .grid_purple_9655,
  .link_medium_8c9e,
  .frame_soft_10ae,
  .image_8ac2,
  .new-ece4,
  .article_b705,
  .status_9c40,
  .fresh-bda4,
  .prev-78ac,
  .picture_0c87,
  .block_wood_df01,
  .panel_93f7 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .fast_10ec,
  .message-fluid-74fd {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .card-7f43,
  .highlight-ad42,
  .medium_baa6,
  .active-e974,
  .chip_bronze_7d9f,
  .backdrop_82a4,
  .green_e194 {
    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 */
  .element-655f,
  .new-16bc,
  .column_complex_cbbf,
  .next_21d8,
  .hovered_0fc7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .video-606e,
  .item-pro-79b9,
  .popup-8d53,
  .shade-copper-844e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .overlay_1b15,
  .caption-9bc6 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .accent_liquid_de80,
  .feature-west-847e,
  .sort-wood-4c2c,
  .wide-2e7d {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .item-f57c,
  .down-dd1c,
  .current-5fd1,
  .photo_dim_9be0,
  .wrapper-fixed-2bbb,
  .shade-8286 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .element-655f,
  .new-16bc,
  .next_21d8 {
    max-width: none !important;
  }
  
  .middle-a5d7 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .video-606e {
    font-size: 1.5rem !important;
  }
  
  .item-pro-79b9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .button_ae86,
  .button-85dc {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .popup-8d53 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .detail_motion_2a39 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .thumbnail_7351 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .element-655f,
  .next_21d8 {
    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: 3a92 */
.shadow-element-w7 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.0;
}
