/* ============================================
   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 (.border_4a4c) is a descendant of
   .action-27d9 (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.image_top_0c4c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".background-4450" 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.popup-9e9f so it can't cause
   horizontal overflow anyway. */
.carousel-b512,
.upper-610f,
.carousel-complex-469e,
.black-3237,
.static_739a,
.accordion-ce9e,
.photo_warm_31ab,
.video_selected_d8af,
.alert-pressed-af5e,
.progress-white-86b4,
.old_32aa {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .outer-1a60 {
    padding: 8px 0;
  }
  
  .tooltip_2a2e img {
    height: 28px;
    width: auto;
  }
  
  .modal_soft_8887 {
    display: none !important;
  }
  
  .fast_5abb {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .fast_5abb svg {
    width: 14px;
    height: 14px;
  }
  
  .hard-5026 {
    padding: 6px;
  }
  
  .video-5267 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .carousel-complex-469e,
  .upper-610f,
  .black-3237,
  .static_739a,
  .active-843c,
  .tabs_red_db3f,
  .picture-brown-7a44,
  .current_dbde,
  .lower_4607,
  .footer-052a,
  .red_89dc {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .panel_yellow_a3c7,
  .thumbnail-7b06 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .detail_b5c2,
  .dropdown-upper-3b93,
  .focused-322c,
  .item_tiny_c668,
  .element-bright-ea6c,
  .in_0440,
  .hard-56c6 {
    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 */
  .grid-easy-7274,
  .container_a132,
  .carousel_wide_684c,
  .menu-pro-0133,
  .motion-6e4d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .row_2fbc,
  .panel-orange-58d9,
  .inner-571c,
  .image-7311 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .frame-3a04,
  .picture_be87 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .north_5616,
  .aside-top-c6a5,
  .message-full-e6ea,
  .cold-21f6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .picture-79ec,
  .iron-125e,
  .bottom-171c,
  .menu_d86b,
  .left_523e,
  .item_095d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .grid-easy-7274,
  .container_a132,
  .menu-pro-0133 {
    max-width: none !important;
  }
  
  .background-4450 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .row_2fbc {
    font-size: 1.5rem !important;
  }
  
  .panel-orange-58d9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .bottom-1234,
  .link_1a75 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .inner-571c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .gradient_8075 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .accordion-static-3d07 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .grid-easy-7274,
  .menu-pro-0133 {
    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: fecb */
.widget-item-p9 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.3;
}
