/* ============================================
   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 (.layout-south-9b2a) is a descendant of
   .fresh_4993 (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.column-small-d271 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".basic_0aa8" 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.iron-fe76 so it can't cause
   horizontal overflow anyway. */
.surface_09f2,
.media_b299,
.sort-large-ce8f,
.label_static_f2f5,
.surface_prev_a6b5,
.carousel-yellow-b456,
.active_2477,
.dark_d609,
.carousel-0639,
.button_down_af16,
.slider_e550 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .section_hovered_1004 {
    padding: 8px 0;
  }
  
  .mask_c7b8 img {
    height: 28px;
    width: auto;
  }
  
  .info_wide_b627 {
    display: none !important;
  }
  
  .label_in_4950 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .label_in_4950 svg {
    width: 14px;
    height: 14px;
  }
  
  .fixed_dc5f {
    padding: 6px;
  }
  
  .solid-8172 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .sort-large-ce8f,
  .media_b299,
  .label_static_f2f5,
  .surface_prev_a6b5,
  .background-bright-0d7b,
  .preview-new-5e9f,
  .breadcrumb-silver-473b,
  .badge-east-ba0d,
  .large_dbc2,
  .small_d4fa,
  .hard-d353,
  .widget-down-e767 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .wide_afa4,
  .popup_98c5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tooltip_5853,
  .tall-c7c1,
  .selected-0df7,
  .photo_2681,
  .detail_light_59fa,
  .link_up_6dc6,
  .tag-d6da {
    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 */
  .texture_f00f,
  .old-936c,
  .background_f2eb,
  .picture-north-cd5a,
  .wide-90fe {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .section-4129,
  .detail_595c,
  .fresh_50d5,
  .tertiary-58ac {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .preview-large-7e0e,
  .detail-7107 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .disabled_1c0f,
  .surface_lite_87ed,
  .bottom-08b2,
  .heading-ae7b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .wrapper_fbac,
  .sidebar_green_8cbe,
  .active-883f,
  .button_bc40,
  .active-dd8b,
  .text_8cd7 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .texture_f00f,
  .old-936c,
  .picture-north-cd5a {
    max-width: none !important;
  }
  
  .basic_0aa8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .section-4129 {
    font-size: 1.5rem !important;
  }
  
  .detail_595c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pattern_233e,
  .photo_357f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .fresh_50d5 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .huge-cfb0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .hover_iron_ea20 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .texture_f00f,
  .picture-north-cd5a {
    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: d3b2 */
.phantom-card-n2 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.0;
}
