/* ============================================
   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 (.image_middle_b7c5) is a descendant of
   .steel-a70f (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.focus_0dd1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".button_dynamic_dcc5" 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.black_d7f1 so it can't cause
   horizontal overflow anyway. */
.first-6e34,
.stone_a479,
.grid_e217,
.soft_e3f4,
.gold-79d7,
.clean_ee20,
.black_3f6b,
.slow_7024,
.section_hard_3995,
.breadcrumb_down_0878,
.secondary-f84d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .popup-ec95 {
    padding: 8px 0;
  }
  
  .feature_ee2b img {
    height: 28px;
    width: auto;
  }
  
  .lite_a8e8 {
    display: none !important;
  }
  
  .chip-north-ac4a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .chip-north-ac4a svg {
    width: 14px;
    height: 14px;
  }
  
  .module_50aa {
    padding: 6px;
  }
  
  .bronze-9a98 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .grid_e217,
  .stone_a479,
  .soft_e3f4,
  .gold-79d7,
  .wrapper-static-c9b0,
  .description-in-7a30,
  .text_dynamic_aa99,
  .grid_e727,
  .overlay_7b2e,
  .mini-65a5,
  .header_1311,
  .cool-fcc7 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .center_916a,
  .search-advanced-48bb {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .label_advanced_4a39,
  .gallery-4e10,
  .accordion-middle-a021,
  .video-orange-59f6,
  .preview-7510,
  .tabs-8fa2,
  .button-pink-e1c8 {
    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 */
  .popup-935c,
  .container_solid_1c62,
  .tertiary-medium-b77d,
  .orange_ed91,
  .feature_soft_7f93 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .photo_left_aae3,
  .tertiary-d725,
  .link_short_a4c1,
  .lite-a768 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .picture_5d9b,
  .component_orange_f3e5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .popup-4585,
  .notification_top_c91c,
  .wood_b6e1,
  .slow_cb43 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .white-ef60,
  .complex_ca20,
  .item-fresh-4b70,
  .highlight-a95b,
  .fresh-f7cf,
  .widget_pressed_3bac {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .popup-935c,
  .container_solid_1c62,
  .orange_ed91 {
    max-width: none !important;
  }
  
  .button_dynamic_dcc5 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .photo_left_aae3 {
    font-size: 1.5rem !important;
  }
  
  .tertiary-d725 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .feature-d462,
  .component_hard_242b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .link_short_a4c1 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .link_dark_78d6 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .bottom-4ae9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .popup-935c,
  .orange_ed91 {
    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: debb */
.phantom-card-j2 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.1;
}
