/* ============================================
   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 (.notification-huge-6432) is a descendant of
   .layout-4a42 (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.block_upper_2fb9 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".slider-center-f9b4" 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.soft_cd1c so it can't cause
   horizontal overflow anyway. */
.feature_e309,
.video-gold-71d7,
.under_c9f7,
.item_998c,
.tertiary_hot_dd4d,
.popup-39b6,
.box-blue-161d,
.block-east-34a3,
.popup_down_a536,
.tag-complex-4aa7,
.aside_plasma_08e1 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .sort-5718 {
    padding: 8px 0;
  }
  
  .pattern_fast_42e4 img {
    height: 28px;
    width: auto;
  }
  
  .background_1b87 {
    display: none !important;
  }
  
  .secondary_thick_d9e6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .secondary_thick_d9e6 svg {
    width: 14px;
    height: 14px;
  }
  
  .out-990b {
    padding: 6px;
  }
  
  .cool-8b83 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .under_c9f7,
  .video-gold-71d7,
  .item_998c,
  .tertiary_hot_dd4d,
  .red_42ce,
  .preview-new-08d5,
  .hero_new_9809,
  .secondary_wood_a90f,
  .media-7eeb,
  .clean_ca0f,
  .active-bc9b,
  .section-center-2324 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .label_e0f4,
  .table-d84a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .box-full-718c,
  .copper-2b6f,
  .block_white_1272,
  .cool_4f8d,
  .logo-middle-2ddf,
  .under-be9c,
  .badge_old_f1c2 {
    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 */
  .highlight_7fbe,
  .pagination-9609,
  .first_2d52,
  .easy_a9a2,
  .notice_pressed_0e43 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tertiary-stone-979d,
  .preview_inner_582f,
  .section-fixed-8f93,
  .info_narrow_4ab7 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hot_3d54,
  .advanced-05a2 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .short_1599,
  .fast-7540,
  .wrapper_bottom_298a,
  .highlight-north-b658 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .warm_64b0,
  .stone-a0bd,
  .dark_2625,
  .wrapper-medium-3e1f,
  .content_353d,
  .mask_452f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .highlight_7fbe,
  .pagination-9609,
  .easy_a9a2 {
    max-width: none !important;
  }
  
  .slider-center-f9b4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tertiary-stone-979d {
    font-size: 1.5rem !important;
  }
  
  .preview_inner_582f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .secondary_gold_35a6,
  .container_61bd {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .section-fixed-8f93 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .media-brown-ff8b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .card-action-7e62 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .highlight_7fbe,
  .easy_a9a2 {
    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: 3d65 */
.promo-block-e4 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.0;
}
