/* ============================================
   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 (.video_west_cc01) is a descendant of
   .carousel_5206 (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.active-a304 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".rough-4698" 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.component-huge-f57a so it can't cause
   horizontal overflow anyway. */
.notice-0bf4,
.down_bafb,
.tabs-2c38,
.overlay_silver_9210,
.section-easy-6fb7,
.menu-stone-d4be,
.thumbnail_stale_98f3,
.pink_6d5e,
.menu-mini-0c05,
.wrapper_pink_3ec6,
.badge_8ed4 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .caption_8cc8 {
    padding: 8px 0;
  }
  
  .filter-c36a img {
    height: 28px;
    width: auto;
  }
  
  .black_9579 {
    display: none !important;
  }
  
  .layout_d48e {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .layout_d48e svg {
    width: 14px;
    height: 14px;
  }
  
  .module_small_398d {
    padding: 6px;
  }
  
  .secondary_pro_f59a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tabs-2c38,
  .down_bafb,
  .overlay_silver_9210,
  .section-easy-6fb7,
  .black-16e4,
  .over_639c,
  .pagination-mini-90e1,
  .copper-27af,
  .caption_21b4,
  .thumbnail_8e64,
  .nav_860c,
  .stale_7317 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .simple_d9e6,
  .wrapper-iron-af38 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .frame_copper_eb75,
  .pattern-bc31,
  .label-c91e,
  .backdrop-bright-feb3,
  .label-6daa,
  .hover_b316,
  .logo-pro-5f1d {
    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 */
  .shadow-8621,
  .brown-9730,
  .mask_47ab,
  .column-narrow-da15,
  .footer_f463 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .up_99dd,
  .hidden-large-6036,
  .panel-44b0,
  .input-tiny-1a50 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .footer-upper-ea5a,
  .large_758d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .bottom-2062,
  .button-55ad,
  .wood-7868,
  .module_rough_32cb {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tag_3eb0,
  .link_green_938a,
  .picture_da29,
  .shade_short_42af,
  .current_c23a,
  .iron_5688 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .shadow-8621,
  .brown-9730,
  .column-narrow-da15 {
    max-width: none !important;
  }
  
  .rough-4698 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .up_99dd {
    font-size: 1.5rem !important;
  }
  
  .hidden-large-6036 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .hover_e141,
  .modal_wood_9849 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .panel-44b0 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .slider_huge_504b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .over_470b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .shadow-8621,
  .column-narrow-da15 {
    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: ca5a */
.promo-block-o7 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.2;
}
