/* ============================================
   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 (.dirty_c75d) is a descendant of
   .border_49fb (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.main-fc42 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".icon-middle-c7df" 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.modal-copper-6cf3 so it can't cause
   horizontal overflow anyway. */
.photo_warm_0717,
.bottom_f119,
.right_087a,
.thumbnail_liquid_760e,
.message-simple-7657,
.form_a401,
.short_be29,
.thumbnail-3cac,
.breadcrumb_7641,
.basic-a24a,
.rough-35c7 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .first-37a7 {
    padding: 8px 0;
  }
  
  .texture-86d5 img {
    height: 28px;
    width: auto;
  }
  
  .warm_47de {
    display: none !important;
  }
  
  .item-d2a8 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .item-d2a8 svg {
    width: 14px;
    height: 14px;
  }
  
  .summary-30f0 {
    padding: 6px;
  }
  
  .hero-4a14 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .right_087a,
  .bottom_f119,
  .thumbnail_liquid_760e,
  .message-simple-7657,
  .element_6ad5,
  .east_8869,
  .active_7771,
  .table-next-41ed,
  .east_7049,
  .down-da8f,
  .component-0f95 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .column_bright_c186,
  .red-dfab {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .secondary-2fd0,
  .background_east_3641,
  .highlight-1080,
  .feature_hard_a839,
  .breadcrumb-082b,
  .gallery_9dd9,
  .steel-b9df {
    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 */
  .tabs_gold_541c,
  .image_1016,
  .bright_8a74,
  .old_ac16,
  .block-bbc8 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .mini_f965,
  .large-6129,
  .outer_0a7c,
  .gradient_240e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .grid-full-8755,
  .layout-479d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .info-wide-c842,
  .text-green-89a8,
  .top-67c2,
  .shade-static-a50e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tag_stone_9c89,
  .link-tall-3ebe,
  .background-rough-cbc3,
  .popup_upper_8d8a,
  .sort-f9f8,
  .liquid_ca82 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .tabs_gold_541c,
  .image_1016,
  .old_ac16 {
    max-width: none !important;
  }
  
  .icon-middle-c7df {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .mini_f965 {
    font-size: 1.5rem !important;
  }
  
  .large-6129 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pattern_35d0,
  .tooltip-1d72 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .outer_0a7c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .border-25e2 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .row_white_4d75 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .tabs_gold_541c,
  .old_ac16 {
    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: e35c */
.widget-item-x7 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.2;
}
