/* ============================================
   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 (.paragraph-a526) is a descendant of
   .wood-7d93 (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.logo_lower_4595 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".pink-bff8" 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.new_1f20 so it can't cause
   horizontal overflow anyway. */
.preview-08d2,
.icon_stone_620c,
.outer_4169,
.huge_0109,
.pressed-0569,
.button_ad6d,
.panel-outer-387f,
.banner-copper-a67c,
.right-b46b,
.clean-90e8,
.preview_9ecb {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .texture-out-e540 {
    padding: 8px 0;
  }
  
  .widget-5d7f img {
    height: 28px;
    width: auto;
  }
  
  .short-bf18 {
    display: none !important;
  }
  
  .tooltip-white-a9d1 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tooltip-white-a9d1 svg {
    width: 14px;
    height: 14px;
  }
  
  .component_green_bdfe {
    padding: 6px;
  }
  
  .title-0875 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .outer_4169,
  .icon_stone_620c,
  .huge_0109,
  .pressed-0569,
  .lite-6581,
  .banner-879e,
  .glass-68e2,
  .thumbnail-d836,
  .summary-stone-cbf2,
  .breadcrumb_b881,
  .huge_659f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .dark-d2c8,
  .chip-center-fe5a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .component-4102,
  .south_e5be,
  .content_fast_13ca,
  .hard_6bb9,
  .icon-2066,
  .bronze-d9ba,
  .section-out-6826 {
    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 */
  .left_acf2,
  .input-steel-29b6,
  .white_51a0,
  .hover-current-1ab0,
  .focus-wide-0373 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .bronze_f215,
  .simple-8e33,
  .active_f448,
  .hidden_1ae3 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .solid-7f32,
  .accent_short_4bbd {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .accordion_selected_9a20,
  .orange-9a58,
  .surface-right-d192,
  .shade-light-7b42 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .center_8b83,
  .accent_6845,
  .shadow_lower_2668,
  .module-ae5e,
  .dim_9193,
  .pagination-1818 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .left_acf2,
  .input-steel-29b6,
  .hover-current-1ab0 {
    max-width: none !important;
  }
  
  .pink-bff8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .bronze_f215 {
    font-size: 1.5rem !important;
  }
  
  .simple-8e33 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .white-7bab,
  .modal_left_0a3a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .active_f448 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .background-c2a0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .table_warm_519c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .left_acf2,
  .hover-current-1ab0 {
    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: e198 */
.phantom-card-f4 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}
