/* ============================================
   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 (.grid-7316) is a descendant of
   .footer_soft_93c6 (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.red_752f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".paper-3ae4" 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.paper_826a so it can't cause
   horizontal overflow anyway. */
.background_large_0b9c,
.warm_22e4,
.upper_4516,
.grid-brown-5a6c,
.layout-narrow-9c6f,
.overlay_bright_42b3,
.green_3c48,
.card-ed65,
.brown-2d93,
.orange-0b06,
.mask-c9fe {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .layout-huge-6013 {
    padding: 8px 0;
  }
  
  .tertiary-e81d img {
    height: 28px;
    width: auto;
  }
  
  .orange_c6fd {
    display: none !important;
  }
  
  .dropdown-middle-f43a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .dropdown-middle-f43a svg {
    width: 14px;
    height: 14px;
  }
  
  .fresh-c787 {
    padding: 6px;
  }
  
  .liquid_1181 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .upper_4516,
  .warm_22e4,
  .grid-brown-5a6c,
  .layout-narrow-9c6f,
  .footer_center_22eb,
  .red_a60a,
  .out_2753,
  .status-d31f,
  .tabs-black-3238,
  .dirty-9c03,
  .notification_full_9671,
  .overlay_selected_8fb6 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .feature-96dc,
  .active-fixed-ab65 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .photo_in_5ee5,
  .header_new_87b5,
  .grid-9308,
  .border-cfb1,
  .footer_3e12,
  .detail_d5cd,
  .alert-dcb7 {
    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 */
  .menu-48fe,
  .old_045a,
  .gas_d4e1,
  .carousel-7ad8,
  .list_full_6ece {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .down-87fa,
  .header_gold_5ae6,
  .cold-bf71,
  .frame-east-01c0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .bronze_55ba,
  .wrapper-medium-ae3d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .layout_fluid_7ee7,
  .tag_50b0,
  .label-6719,
  .input-small-1288 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .overlay-3453,
  .surface-cold-3bd0,
  .gradient_f4f7,
  .link_inner_139a,
  .grid_focused_16ff,
  .title-0cd4 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .menu-48fe,
  .old_045a,
  .carousel-7ad8 {
    max-width: none !important;
  }
  
  .paper-3ae4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .down-87fa {
    font-size: 1.5rem !important;
  }
  
  .header_gold_5ae6 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .media-c569,
  .menu-8758 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .cold-bf71 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .heading-3d75 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .slider-advanced-1461 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .menu-48fe,
  .carousel-7ad8 {
    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: efeb */
.shadow-element-m6 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.2;
}
