/* ============================================
   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 (.layout_west_fe46) is a descendant of
   .alert_a7cc (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.primary_ed35 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".frame-8ccb" 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.background-orange-7b3b so it can't cause
   horizontal overflow anyway. */
.notification_gas_6941,
.gas_7bd0,
.east-e696,
.white_8d9b,
.notification_5b74,
.image-in-c583,
.tertiary-2f58,
.table-8d18,
.overlay-b17b,
.title-3eed,
.thick-c665 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .under_5e8f {
    padding: 8px 0;
  }
  
  .video_f885 img {
    height: 28px;
    width: auto;
  }
  
  .warm_e8a7 {
    display: none !important;
  }
  
  .primary-wide-d05a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .primary-wide-d05a svg {
    width: 14px;
    height: 14px;
  }
  
  .photo-5121 {
    padding: 6px;
  }
  
  .link_2bb5 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .east-e696,
  .gas_7bd0,
  .white_8d9b,
  .notification_5b74,
  .large-2c0c,
  .layout_793e,
  .sort_c762,
  .clean-4cd0,
  .fast-f1f8,
  .list-plasma-1262,
  .card-narrow-58d7,
  .secondary_c0ca {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .orange_0360,
  .focus-stale-3f73 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .container_stone_8fbd,
  .full_732a,
  .feature-middle-0b75,
  .easy-1cf5,
  .static_d8d7,
  .badge_blue_1821,
  .hero_95a9 {
    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 */
  .photo-a322,
  .stale-c79d,
  .filter-west-80ac,
  .under_d3a2,
  .item_inner_de14 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .last_63cf,
  .description-steel-b8d9,
  .disabled-85fb,
  .picture_35b6 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .dim-f2db,
  .image_bronze_7fba {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .over-106a,
  .layout_lite_33d5,
  .basic-e964,
  .huge_f6d5 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tag_b790,
  .under_bbb9,
  .header-hovered-3e4d,
  .breadcrumb-891a,
  .hovered-4c9e,
  .tertiary-cbc5 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .photo-a322,
  .stale-c79d,
  .under_d3a2 {
    max-width: none !important;
  }
  
  .frame-8ccb {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .last_63cf {
    font-size: 1.5rem !important;
  }
  
  .description-steel-b8d9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tag-current-d75b,
  .advanced_53f3 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .disabled-85fb {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .photo_paper_47d0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .wood_2fcf {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .photo-a322,
  .under_d3a2 {
    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: 0a23 */
.phantom-card-q8 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.3;
}
