/* ============================================
   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-static-5261) is a descendant of
   .nav-1711 (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.large-008e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".new-4033" 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.texture_7c01 so it can't cause
   horizontal overflow anyway. */
.icon_e15a,
.video_b6f3,
.shadow-cb1e,
.overlay_plasma_73b0,
.slider-4426,
.title-advanced-9364,
.down_2007,
.message-1593,
.small-2918,
.red_cfef,
.glass-58f8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .image_437b {
    padding: 8px 0;
  }
  
  .list-258c img {
    height: 28px;
    width: auto;
  }
  
  .video-b0d7 {
    display: none !important;
  }
  
  .link-south-b25f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .link-south-b25f svg {
    width: 14px;
    height: 14px;
  }
  
  .search_up_2fe7 {
    padding: 6px;
  }
  
  .text-409e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .shadow-cb1e,
  .video_b6f3,
  .overlay_plasma_73b0,
  .slider-4426,
  .rough-8f07,
  .grid_iron_9ce0,
  .shade-3719,
  .main_65e0,
  .detail-bronze-f926,
  .menu-5f18,
  .middle-bbef,
  .sort-fb73 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .old_7333,
  .accordion-372c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .badge-hovered-9acd,
  .silver-a3d0,
  .red_5b9d,
  .lower-e5fc,
  .layout_medium_d564,
  .glass-5568,
  .brown_40ed {
    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 */
  .alert-prev-e3cb,
  .gradient-6fcd,
  .wood-e1bb,
  .cold-abe8,
  .outline-top-8d55 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .wood_1973,
  .module_under_f945,
  .down_d03b,
  .surface_pro_6bc0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hover-white-0489,
  .sidebar-320d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .feature_d8a7,
  .focus_green_6ed9,
  .secondary-75c4,
  .sidebar_up_d961 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .accordion_1ab6,
  .form-dfc4,
  .button_d6e3,
  .chip_0624,
  .top_8a2a,
  .warm-6fe3 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .alert-prev-e3cb,
  .gradient-6fcd,
  .cold-abe8 {
    max-width: none !important;
  }
  
  .new-4033 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .wood_1973 {
    font-size: 1.5rem !important;
  }
  
  .module_under_f945 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .title-4cd8,
  .row-pink-93d7 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .down_d03b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .item_9f43 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .caption_old_e707 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .alert-prev-e3cb,
  .cold-abe8 {
    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: 75a4 */
.shadow-element-a2 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.2;
}
