/* ============================================
   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 (.background-motion-e958) is a descendant of
   .row-13de (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.border_upper_f5bf {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".media-a500" 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.widget-7c7b so it can't cause
   horizontal overflow anyway. */
.caption-42e2,
.widget_d363,
.glass-f4ac,
.texture_3736,
.component-110f,
.notice-1343,
.icon-left-2bb5,
.footer_d7b3,
.slow_a621,
.surface_9296,
.image_stone_98cd {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .old_2e8c {
    padding: 8px 0;
  }
  
  .small-f9de img {
    height: 28px;
    width: auto;
  }
  
  .soft-3dc2 {
    display: none !important;
  }
  
  .description-aeff {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .description-aeff svg {
    width: 14px;
    height: 14px;
  }
  
  .tabs-basic-8638 {
    padding: 6px;
  }
  
  .highlight_106e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .glass-f4ac,
  .widget_d363,
  .texture_3736,
  .component-110f,
  .selected_2b4d,
  .avatar_9f5a,
  .highlight-pro-a3d7,
  .gas-309a,
  .block_wood_4f38,
  .gallery_motion_2c42,
  .carousel-306c,
  .dim-2949 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .image-up-3c90,
  .tiny-7de1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .item_615f,
  .link-current-0a9c,
  .lower-f7e2,
  .menu-2032,
  .box_982c,
  .cold_88c4,
  .gradient-d06c {
    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 */
  .paragraph-basic-50dd,
  .tag_5ff3,
  .nav-9c60,
  .status-4d1b,
  .steel_3d2d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .progress_4f94,
  .inner-a369,
  .shade_b060,
  .label-f46f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .rough_a174,
  .next-bc43 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .paragraph_smooth_30d2,
  .lower-96a0,
  .sort-narrow-82e5,
  .outline-next-1ef0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tertiary_old_20b2,
  .info_fe30,
  .footer_small_d6a8,
  .tag_06b8,
  .full-e8ca,
  .modal-narrow-a8a4 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .paragraph-basic-50dd,
  .tag_5ff3,
  .status-4d1b {
    max-width: none !important;
  }
  
  .media-a500 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .progress_4f94 {
    font-size: 1.5rem !important;
  }
  
  .inner-a369 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .layout-easy-11be,
  .video-silver-aa02 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .shade_b060 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pressed-2845 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .input_5cd0 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .paragraph-basic-50dd,
  .status-4d1b {
    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: 91dd */
.ghost-box-c9 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.0;
}
