/* ============================================
   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-red-1968) is a descendant of
   .green_d0d4 (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.picture-first-45ee)
   and the redesigned template (header.modal_47d2). Keep both selectors. */
header.picture-first-45ee,
header.modal_47d2 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".breadcrumb-simple-56a1" 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.hover_mini_97cb so it can't cause
   horizontal overflow anyway. */
.tabs_4214,
.south_a51e,
.active-7257,
.table-da2d,
.accordion-down-e8ff,
.card_last_61f6,
.accordion-dynamic-bfa9,
.huge_84aa,
.link-1dfc,
.logo_9b5a,
.breadcrumb-pro-d5ec {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hero-west-49cf {
    padding: 8px 0;
  }
  
  .button-a57a img {
    height: 28px;
    width: auto;
  }
  
  .progress-fixed-5740 {
    display: none !important;
  }
  
  .breadcrumb-1a6b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .breadcrumb-1a6b svg {
    width: 14px;
    height: 14px;
  }
  
  .caption_93a5 {
    padding: 6px;
  }
  
  .blue_edc7 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .active-7257,
  .south_a51e,
  .table-da2d,
  .accordion-down-e8ff,
  .tag_huge_dd51,
  .mask_dim_b4ae,
  .list-919f,
  .feature_ba65,
  .active-2513,
  .disabled_rough_2597,
  .black-8e38,
  .plasma-4a7b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .narrow_41fc,
  .title_gas_6fbf {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .fast_49a5,
  .stale_9cac,
  .progress-dirty-2a83,
  .table-ca8b,
  .wrapper-motion-68d8,
  .carousel_9ecb,
  .complex_b3d6 {
    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 */
  .center_c54a,
  .large_88bf,
  .left_89cb,
  .form-warm-5878,
  .card-smooth-3160 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hero-smooth-5103,
  .hot_5f6d,
  .overlay-f434,
  .background_a361 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .silver_f6f6,
  .link_b8b4 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .middle_cd2c,
  .complex-6bc6,
  .alert-light-9445,
  .module_b9d2 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .thick_af77,
  .pagination_lite_3bf1,
  .gradient_upper_5613,
  .cool-95c7,
  .basic_229d,
  .shade-ba8b {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .center_c54a,
  .large_88bf,
  .form-warm-5878 {
    max-width: none !important;
  }
  
  .breadcrumb-simple-56a1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hero-smooth-5103 {
    font-size: 1.5rem !important;
  }
  
  .hot_5f6d {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .block_fixed_77ac,
  .hard-c804 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .overlay-f434 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .easy_e520 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .search_right_3de5 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .center_c54a,
  .form-warm-5878 {
    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 */
.soft-1201 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 60ba */
.ghost-box-b1 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.3;
}
