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

/* Fix for any potential overflow elements */
/* NOTE: ".footer-a068" 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.grid_220b so it can't cause
   horizontal overflow anyway. */
.banner-fresh-da5a,
.over_8acd,
.label-hovered-d66e,
.copper_ef5f,
.over-c07b,
.tooltip_in_82f0,
.tabs-up-b5c7,
.pressed-6f01,
.message_lower_f95f,
.clean_38af,
.thick_bc3e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .green_72be {
    padding: 8px 0;
  }
  
  .badge_e518 img {
    height: 28px;
    width: auto;
  }
  
  .icon_36cc {
    display: none !important;
  }
  
  .plasma-ffdb {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .plasma-ffdb svg {
    width: 14px;
    height: 14px;
  }
  
  .photo-up-75ab {
    padding: 6px;
  }
  
  .carousel-brown-fd6d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .label-hovered-d66e,
  .over_8acd,
  .copper_ef5f,
  .over-c07b,
  .tooltip_55d6,
  .detail-inner-7d7e,
  .old_76df,
  .short_370a,
  .main_3b06,
  .list-under-1c48,
  .thumbnail-up-d10c,
  .warm-1991 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .card_3e79,
  .bottom_74d4 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .over_c901,
  .chip-5a7d,
  .gold-e6b0,
  .active-731a,
  .pro_874c,
  .dropdown-478b,
  .filter_7331 {
    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 */
  .hidden-96d3,
  .info-d7e1,
  .background_62c6,
  .active-dfab,
  .pattern-64b4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .element_advanced_36fe,
  .badge-e17a,
  .top_4917,
  .tag-huge-61e9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .column_848f,
  .menu-68b1 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .text-dynamic-5363,
  .right_a747,
  .dropdown-c41d,
  .status-c8b0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .lower-8613,
  .motion_19bf,
  .primary_medium_8df2,
  .aside_bronze_c917,
  .main-motion-5c50,
  .header-b49f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .hidden-96d3,
  .info-d7e1,
  .active-dfab {
    max-width: none !important;
  }
  
  .footer-a068 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .element_advanced_36fe {
    font-size: 1.5rem !important;
  }
  
  .badge-e17a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .chip_wide_0bd0,
  .paragraph_north_3742 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .top_4917 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .box_paper_f775 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .item-medium-8db9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hidden-96d3,
  .active-dfab {
    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: adc7 */
.promo-block-g6 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.0;
}
