/* ============================================
   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 (.chip_huge_1d6e) is a descendant of
   .list_dbd9 (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.title-tall-5543 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".banner-first-c503" 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.active_ff16 so it can't cause
   horizontal overflow anyway. */
.accordion-dynamic-1ef4,
.south_44cc,
.blue_cbb1,
.current-d301,
.element_be49,
.logo_d607,
.current-bf01,
.link_9c0a,
.border_9961,
.primary_white_0e50,
.video_925d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .link_888b {
    padding: 8px 0;
  }
  
  .backdrop-d681 img {
    height: 28px;
    width: auto;
  }
  
  .backdrop-liquid-fc3d {
    display: none !important;
  }
  
  .tooltip_6470 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tooltip_6470 svg {
    width: 14px;
    height: 14px;
  }
  
  .video_down_14c2 {
    padding: 6px;
  }
  
  .list-a52c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .blue_cbb1,
  .south_44cc,
  .current-d301,
  .element_be49,
  .texture-c1a3,
  .item_orange_9c1c,
  .tabs-out-5292,
  .disabled_db0b,
  .dropdown-outer-129f,
  .sort-large-dcdd,
  .pattern_00ee,
  .link-adfa {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .status_aed2,
  .shade_smooth_3998 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .shade-453f,
  .element-be51,
  .content_gold_04c2,
  .component_ad90,
  .photo-outer-3e4d,
  .form-small-a9ac,
  .detail_b6ec {
    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 */
  .description-6275,
  .layout-bottom-23d5,
  .logo_5e6c,
  .popup_in_48a4,
  .focused_8627 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .card_45c9,
  .media_7f36,
  .gas-8797,
  .title_335b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .logo_inner_9b44,
  .badge-dark-3f92 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .detail_active_8939,
  .video-ed02,
  .logo_b676,
  .sidebar_yellow_f2fa {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .current-7000,
  .soft_b3e7,
  .footer-e6ff,
  .progress_fast_7748,
  .overlay-217b,
  .white_e207 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .description-6275,
  .layout-bottom-23d5,
  .popup_in_48a4 {
    max-width: none !important;
  }
  
  .banner-first-c503 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .card_45c9 {
    font-size: 1.5rem !important;
  }
  
  .media_7f36 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .copper-3307,
  .feature-4aaa {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .gas-8797 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .solid_e3a5 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .backdrop_motion_8161 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .description-6275,
  .popup_in_48a4 {
    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: 8790 */
.widget-item-j6 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.3;
}
