/* ============================================
   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 (.texture-steel-4962) is a descendant of
   .right-3ccf (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.fluid_fc4a {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".title_south_fb40" 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.overlay-dirty-0f46 so it can't cause
   horizontal overflow anyway. */
.picture_medium_2a6f,
.gradient_923f,
.message-stone-0c6e,
.block-4433,
.feature-e2b5,
.caption_e3a9,
.slider-e22c,
.layout-c7b0,
.active-396d,
.notice-liquid-dcd5,
.banner-white-8764 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .accent-iron-284e {
    padding: 8px 0;
  }
  
  .photo_16a4 img {
    height: 28px;
    width: auto;
  }
  
  .green_71c8 {
    display: none !important;
  }
  
  .picture-huge-0cd2 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .picture-huge-0cd2 svg {
    width: 14px;
    height: 14px;
  }
  
  .message-4bb8 {
    padding: 6px;
  }
  
  .column_white_14d1 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .message-stone-0c6e,
  .gradient_923f,
  .block-4433,
  .feature-e2b5,
  .gallery_f58c,
  .container_smooth_deda,
  .stale-8d41,
  .modal_green_674f,
  .lower-8e20,
  .thumbnail-7808,
  .huge_de35 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .silver_9eba,
  .gallery_gas_a462 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .icon_ee45,
  .disabled-over-8531,
  .main_10d6,
  .aside_iron_a958,
  .fast_b9cd,
  .right_eb3f,
  .component_99bf {
    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 */
  .picture-full-dd17,
  .light-c170,
  .summary_under_4201,
  .slider-6d12,
  .sort-7613 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .medium_be16,
  .wrapper_d2a8,
  .notice_fresh_f18f,
  .video-76a3 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .section-pink-f68d,
  .pagination_large_5680 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .preview_f352,
  .pattern_65db,
  .surface-soft-e132,
  .component-wide-92bd {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .primary-9819,
  .avatar_730f,
  .sidebar-short-58f1,
  .focus_1705,
  .detail-e394,
  .pagination_938e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .picture-full-dd17,
  .light-c170,
  .slider-6d12 {
    max-width: none !important;
  }
  
  .title_south_fb40 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .medium_be16 {
    font-size: 1.5rem !important;
  }
  
  .wrapper_d2a8 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .bright-6e0c,
  .detail_727e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .notice_fresh_f18f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .aside-gas-608e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .hero_red_d008 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .picture-full-dd17,
  .slider-6d12 {
    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: 483f */
.widget-item-p5 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.1;
}
