/* ============================================
   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 (.silver_f47c) is a descendant of
   .sidebar-prev-443b (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.photo-selected-fa53 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".component_complex_babb" 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.caption_8a87 so it can't cause
   horizontal overflow anyway. */
.footer-first-97bf,
.fresh_40a5,
.sidebar_f7e7,
.blue_c93c,
.box_52e3,
.overlay-2464,
.blue_5947,
.dynamic_004c,
.dynamic-acdd,
.fixed_c32a,
.carousel-aa3a {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .footer-lite-a561 {
    padding: 8px 0;
  }
  
  .glass-4621 img {
    height: 28px;
    width: auto;
  }
  
  .card-9fac {
    display: none !important;
  }
  
  .wrapper_3285 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .wrapper_3285 svg {
    width: 14px;
    height: 14px;
  }
  
  .frame-inner-9383 {
    padding: 6px;
  }
  
  .module_out_0ad5 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .sidebar_f7e7,
  .fresh_40a5,
  .blue_c93c,
  .box_52e3,
  .tabs_1454,
  .item_brown_5b18,
  .block_pro_94a5,
  .panel-0857,
  .slider-hot-05fa,
  .carousel-fluid-1274,
  .right-751c,
  .grid-40b1 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .progress_large_c14c,
  .active-29fb {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .text_medium_0b30,
  .accordion-8c79,
  .tooltip_08bd,
  .gas-ecb3,
  .orange_2fe6,
  .blue_699d,
  .texture-last-7287 {
    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 */
  .surface-8217,
  .surface_paper_8cb5,
  .label_ee4d,
  .feature_focused_9214,
  .layout-8209 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tag_tall_7a99,
  .pink_f50e,
  .widget-8afe,
  .container-medium-a4b4 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .gallery_6990,
  .media_simple_2f8a {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .wood-6b05,
  .title_lite_b57d,
  .in_4dde,
  .short_4efb {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .frame-medium-effc,
  .rough_54ab,
  .status-gas-2a34,
  .feature-e1e1,
  .text_in_b701,
  .pink_bae6 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .surface-8217,
  .surface_paper_8cb5,
  .feature_focused_9214 {
    max-width: none !important;
  }
  
  .component_complex_babb {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tag_tall_7a99 {
    font-size: 1.5rem !important;
  }
  
  .pink_f50e {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .accent_easy_36be,
  .surface-f4db {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .widget-8afe {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .accent-7a05 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tertiary_58de {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .surface-8217,
  .feature_focused_9214 {
    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: f4e1 */
.widget-item-v1 {
  padding: 0.4rem;
  font-size: 14px;
  line-height: 1.3;
}
