/* ============================================
   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 (.button-3d85) is a descendant of
   .sort-c88f (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.shadow_purple_dcb9)
   and the redesigned template (header.filter-last-3b52). Keep both selectors. */
header.shadow_purple_dcb9,
header.filter-last-3b52 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".row_bronze_da5b" 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.row_red_453e so it can't cause
   horizontal overflow anyway. */
.last-86b9,
.outline_center_114a,
.summary_old_15b9,
.wood-85a7,
.large_d0d5,
.huge_938a,
.shade-basic-2f93,
.header-73f5,
.popup_next_0b39,
.tooltip-pro-79bb,
.content_large_e25b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .main-action-059d {
    padding: 8px 0;
  }
  
  .heading_5a5c img {
    height: 28px;
    width: auto;
  }
  
  .easy-c1e9 {
    display: none !important;
  }
  
  .thumbnail_steel_d96a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .thumbnail_steel_d96a svg {
    width: 14px;
    height: 14px;
  }
  
  .menu_silver_58cf {
    padding: 6px;
  }
  
  .badge-0597 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .summary_old_15b9,
  .outline_center_114a,
  .wood-85a7,
  .large_d0d5,
  .text_last_caaf,
  .fixed-9276,
  .easy-3ec5,
  .new_ac94,
  .article_c35a,
  .middle_a3b6,
  .huge_5afa,
  .element_dirty_a7ad {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .chip-silver-877c,
  .section-wood-f517 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .soft-8659,
  .text-clean-1c3d,
  .notification_86e3,
  .column-6794,
  .active_6ca8,
  .south-39e2,
  .gradient-2f33 {
    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 */
  .down_cf0b,
  .table_5f58,
  .thick_d825,
  .backdrop-smooth-73d9,
  .section_1cb7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .fresh-f4a4,
  .wide-4c88,
  .component_red_5aac,
  .slider_fce6 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .solid-dca1,
  .focus-c3b0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .bronze-be10,
  .text_south_b20e,
  .outer-7b8e,
  .overlay-bronze-b6ac {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .thick-bc39,
  .modal-de8e,
  .green-6d96,
  .dirty_09bc,
  .form_6153,
  .icon_61de {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .down_cf0b,
  .table_5f58,
  .backdrop-smooth-73d9 {
    max-width: none !important;
  }
  
  .row_bronze_da5b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .fresh-f4a4 {
    font-size: 1.5rem !important;
  }
  
  .wide-4c88 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .mini_f12e,
  .thumbnail-5074 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .component_red_5aac {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .list_d6f2 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .highlight_ee18 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .down_cf0b,
  .backdrop-smooth-73d9 {
    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 */
.cold-347d {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: fd8d */
.ghost-box-o4 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.0;
}
