/* ============================================
   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 (.backdrop-39bc) is a descendant of
   .warm_223c (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.gradient_new_1f58 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".up_d796" 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.hero_under_821c so it can't cause
   horizontal overflow anyway. */
.modal-blue-d136,
.detail-8661,
.block_915d,
.photo_steel_2a31,
.video-pressed-4d0f,
.search-medium-fdf7,
.fast_3ecc,
.backdrop-940d,
.info-1bdf,
.over-5da0,
.fresh-d18c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .prev_d74d {
    padding: 8px 0;
  }
  
  .message-dynamic-8fac img {
    height: 28px;
    width: auto;
  }
  
  .progress-e721 {
    display: none !important;
  }
  
  .hard-cd67 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hard-cd67 svg {
    width: 14px;
    height: 14px;
  }
  
  .accent-4a24 {
    padding: 6px;
  }
  
  .silver-62c8 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .block_915d,
  .detail-8661,
  .photo_steel_2a31,
  .video-pressed-4d0f,
  .video_5dd1,
  .full-e7bb,
  .icon_first_aae0,
  .glass-a835,
  .logo-new-2c5d,
  .cool-7d4a,
  .feature_copper_25a2,
  .white-144f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .icon-c43d,
  .article-full-1f2a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .modal_west_a19f,
  .up_9cb6,
  .frame_a388,
  .right_d94b,
  .focus_yellow_e95e,
  .pro_50e8,
  .tertiary-a87e {
    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 */
  .carousel_green_048e,
  .box-1bc7,
  .main_solid_706f,
  .primary_17cc,
  .thumbnail-in-0368 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .surface_pink_8021,
  .black_2ab2,
  .accordion_yellow_3002,
  .media_b3bf {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .selected-1e3c,
  .content-979f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .background_bottom_38ad,
  .article_fa3f,
  .card_hard_8da0,
  .layout-outer-5b58 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .summary-2344,
  .logo-prev-4151,
  .description_4364,
  .status-6a05,
  .column-huge-ec13,
  .container_upper_fd6a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .carousel_green_048e,
  .box-1bc7,
  .primary_17cc {
    max-width: none !important;
  }
  
  .up_d796 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .surface_pink_8021 {
    font-size: 1.5rem !important;
  }
  
  .black_2ab2 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pagination-b6e6,
  .mask-acd8 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .accordion_yellow_3002 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .thick_1f03 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .picture-ce50 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .carousel_green_048e,
  .primary_17cc {
    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: 7373 */
.ghost-box-f2 {
  padding: 0.5rem;
  font-size: 11px;
  line-height: 1.2;
}
