/* ============================================
   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 (.dynamic_4309) is a descendant of
   .detail_f56b (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.
   Two site templates coexist: legacy obfuscated-class (header.hero_a21e)
   and the redesigned template (header.button_small_b13b). Keep both selectors. */
header.hero_a21e,
header.button_small_b13b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".gold_1d80" 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.block-short-1efc so it can't cause
   horizontal overflow anyway. */
.thumbnail-fffc,
.alert_cold_a4ea,
.tag-fd79,
.bright-3b45,
.advanced-0729,
.outline_0a61,
.table-steel-46cc,
.grid-971d,
.media_current_0877,
.surface_c330,
.sidebar-03f8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .status_motion_0092 {
    padding: 8px 0;
  }
  
  .popup_e8d1 img {
    height: 28px;
    width: auto;
  }
  
  .chip-ae87 {
    display: none !important;
  }
  
  .article-acce {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .article-acce svg {
    width: 14px;
    height: 14px;
  }
  
  .chip-warm-cd85 {
    padding: 6px;
  }
  
  .secondary-north-a373 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tag-fd79,
  .alert_cold_a4ea,
  .bright-3b45,
  .advanced-0729,
  .photo_selected_70c9,
  .photo_full_f03e,
  .secondary_fb57,
  .under_47b3,
  .warm_21a0,
  .blue_73b5,
  .mini-2b0d,
  .fast-c214 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .disabled_270c,
  .surface_motion_f5a4 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .carousel_bc11,
  .prev-71b4,
  .wood-6ad3,
  .pagination-fresh-70fc,
  .grid-4cf9,
  .accordion-b3c7,
  .purple_18cc {
    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 */
  .component_inner_e565,
  .column-medium-dead,
  .module_e9d2,
  .frame_3e22,
  .solid_0fe0 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .description-action-e3f3,
  .form_a1e8,
  .hidden_e730,
  .shade_009e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .smooth_93b3,
  .block_0d88 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .gas-544a,
  .pressed-3f2b,
  .link_f69d,
  .cold_58d6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .grid_1e06,
  .surface-next-7bfa,
  .footer_solid_9af3,
  .title-silver-c213,
  .chip-medium-bb4d,
  .gas_8c9f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .component_inner_e565,
  .column-medium-dead,
  .frame_3e22 {
    max-width: none !important;
  }
  
  .gold_1d80 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .description-action-e3f3 {
    font-size: 1.5rem !important;
  }
  
  .form_a1e8 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .gallery_d244,
  .dirty-786b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .hidden_e730 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .overlay-6109 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .gradient_b821 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .component_inner_e565,
  .frame_3e22 {
    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: 94a5 */
.primary-3039 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 62ca */
.widget-item-t5 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.0;
}
