/* ============================================
   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 (.accordion-purple-6797) is a descendant of
   .gas_d71d (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.banner_smooth_462d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".motion-aad2" 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.secondary_last_8b99 so it can't cause
   horizontal overflow anyway. */
.wood_054f,
.full-a48c,
.accordion_wood_0e07,
.grid-hard-2a28,
.border_soft_92bb,
.north_cf11,
.east_8512,
.complex_00d7,
.top_b904,
.photo_1b02,
.hard_bf46 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .table_static_38c8 {
    padding: 8px 0;
  }
  
  .button_center_d6a0 img {
    height: 28px;
    width: auto;
  }
  
  .tag-053a {
    display: none !important;
  }
  
  .video-9264 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .video-9264 svg {
    width: 14px;
    height: 14px;
  }
  
  .steel-3324 {
    padding: 6px;
  }
  
  .main_c182 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .accordion_wood_0e07,
  .full-a48c,
  .grid-hard-2a28,
  .border_soft_92bb,
  .large_23eb,
  .badge_738e,
  .row_out_4bdd,
  .popup-gas-6447,
  .tooltip-bb9b,
  .detail_hard_447e,
  .accordion-d9b5,
  .table_17cc {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .easy_e731,
  .status_deb9 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .fresh-d66e,
  .container-huge-5883,
  .grid-8a3a,
  .text-5f9a,
  .notification_0173,
  .tertiary-west-da2f,
  .notification_bright_9c1e {
    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 */
  .message_ca40,
  .button-88a3,
  .notice_gas_931e,
  .surface-yellow-b0dc,
  .gold-a573 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .photo-slow-b5d9,
  .description-da96,
  .caption-blue-283c,
  .video_action_cd11 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .selected_f937,
  .rough-7ad0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .fluid_8f8b,
  .static-088a,
  .description_prev_a323,
  .card_bb76 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .form_outer_ba3d,
  .dropdown_755a,
  .dark-c3ef,
  .full-119f,
  .component_8136,
  .article_d623 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .message_ca40,
  .button-88a3,
  .surface-yellow-b0dc {
    max-width: none !important;
  }
  
  .motion-aad2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .photo-slow-b5d9 {
    font-size: 1.5rem !important;
  }
  
  .description-da96 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .top_bbba,
  .overlay_684e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .caption-blue-283c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .sidebar_ae6c {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .surface_3969 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .message_ca40,
  .surface-yellow-b0dc {
    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: c5e9 */
.phantom-card-n8 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.3;
}
