/* ============================================
   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 (.description-5454) is a descendant of
   .iron_6b95 (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.popup_selected_7494 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".picture-114f" 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.tabs-f409 so it can't cause
   horizontal overflow anyway. */
.tooltip_9223,
.hovered_8a0e,
.gradient-cold-31ff,
.caption_8227,
.focus-silver-bc4d,
.search_bronze_e5f6,
.purple-4a64,
.filter_d70b,
.wrapper_70b0,
.image_3b87,
.in_138d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .image-pro-692c {
    padding: 8px 0;
  }
  
  .menu-motion-e4ee img {
    height: 28px;
    width: auto;
  }
  
  .widget_73e4 {
    display: none !important;
  }
  
  .form-full-cdd1 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .form-full-cdd1 svg {
    width: 14px;
    height: 14px;
  }
  
  .nav_473a {
    padding: 6px;
  }
  
  .detail-00d9 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .gradient-cold-31ff,
  .hovered_8a0e,
  .caption_8227,
  .focus-silver-bc4d,
  .bronze_a7d4,
  .hovered_6d50,
  .cool-0feb,
  .panel_east_b449,
  .basic-c405,
  .nav-pro-0a3f,
  .tooltip-8fea {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .border_295c,
  .static-2d34 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .picture_slow_dab1,
  .north_5f83,
  .hidden-top-2ec2,
  .link_easy_f728,
  .surface-fluid-9040,
  .border-79fd,
  .nav_dynamic_29a2 {
    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 */
  .accent_stone_4022,
  .thumbnail_3b64,
  .heading-b20e,
  .center_7b4e,
  .heading_gas_2881 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .box-dim-17f9,
  .heading-motion-784f,
  .icon-prev-3a3c,
  .media_64d5 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .current_6e61,
  .progress-narrow-09fa {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .block_steel_fe78,
  .shade_072d,
  .liquid-7275,
  .tertiary_1225 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .shade_bright_4617,
  .focused-6645,
  .gas_c550,
  .feature_inner_1797,
  .gallery-b240,
  .form_upper_89fb {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .accent_stone_4022,
  .thumbnail_3b64,
  .center_7b4e {
    max-width: none !important;
  }
  
  .picture-114f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .box-dim-17f9 {
    font-size: 1.5rem !important;
  }
  
  .heading-motion-784f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .in-540d,
  .frame_north_76c4 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .icon-prev-3a3c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .wrapper-f092 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .upper-3944 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .accent_stone_4022,
  .center_7b4e {
    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: aa87 */
.ghost-box-q4 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.2;
}
