/* AutoPilot V25.41 — mobile detail width, engine readability, photo frame and working hamburger menu */

@media (max-width: 860px){
  /* V25.38 introduced a :has() two-column bottom layout later in the cascade.
     On mobile that rule overrode older single-column media rules. Force one column. */
  body .detail-shell.container{
    width:calc(100% - 20px)!important;
    max-width:none!important;
    margin-left:auto!important;
    margin-right:auto!important;
    padding-left:0!important;
    padding-right:0!important;
    box-sizing:border-box!important;
  }
  body .detail-grid,
  body .detail-grid:has(> .audience-card){
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
    max-width:100%!important;
  }
  body .detail-grid > *,
  body .detail-grid > .detail-card,
  body .detail-grid > .wide,
  body .engines-card,
  body .market-detail-card,
  body .issues-card,
  body .repairs-card,
  body .buy-card,
  body .audience-card,
  body .overview-pros-card,
  body .buy-verdict-card{
    grid-column:1 / -1!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  body .detail-hero{
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  body .detail-photo{
    display:block!important;
    position:relative!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:clamp(230px,58vw,390px)!important;
    min-height:230px!important;
    max-height:390px!important;
    overflow:hidden!important;
    border-radius:14px!important;
    background:#0b1115!important;
  }
  body .detail-photo img{
    display:block!important;
    width:100%!important;
    height:100%!important;
    min-width:100%!important;
    min-height:100%!important;
    object-fit:cover!important;
  }
  body .detail-main{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
}

@media (max-width: 600px){
  body .engines-card{
    padding:18px 14px!important;
    overflow:hidden!important;
  }
  body .engines-card .engine-section-title{
    display:block!important;
  }
  body .engines-card .engine-section-title h2{
    margin-bottom:5px!important;
  }
  body .engines-card .table-scroll{
    overflow:visible!important;
    width:100%!important;
  }
  body .engines-card .detail-table{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    table-layout:auto!important;
  }
  body .engines-card .detail-table thead{
    display:none!important;
  }
  body .engines-card .detail-table tbody{
    display:grid!important;
    gap:10px!important;
    width:100%!important;
  }
  body .engines-card .detail-table tr{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:10px 12px!important;
    width:100%!important;
    padding:13px!important;
    border:1px solid rgba(255,255,255,.09)!important;
    border-radius:11px!important;
    background:rgba(255,255,255,.018)!important;
    box-sizing:border-box!important;
  }
  body .engines-card .detail-table tr[hidden]{display:none!important}
  body .engines-card .detail-table td{
    display:block!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    padding:0!important;
    border:0!important;
    text-align:left!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }
  body .engines-card .detail-table td:first-child{
    grid-column:1 / -1!important;
    padding-bottom:10px!important;
    border-bottom:1px solid rgba(255,255,255,.07)!important;
  }
  body .engines-card .detail-table td::before{
    content:attr(data-mobile-label);
    display:block!important;
    margin-bottom:4px!important;
    color:#7f8a92!important;
    font-size:9px!important;
    font-weight:800!important;
    line-height:1.2!important;
    letter-spacing:.08em!important;
    text-transform:uppercase!important;
  }
  body .engines-card .detail-table td:first-child::before{display:none!important}
  body .engines-card .engine-cell,
  body .engines-card .engine-meta{
    width:100%!important;
    max-width:100%!important;
  }
  body .engines-card .engine-name{
    display:block!important;
    font-size:16px!important;
    line-height:1.25!important;
    margin-bottom:8px!important;
  }
  body .engines-card .engine-meta{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:5px!important;
    font-size:10px!important;
    line-height:1.35!important;
  }
  body .engines-card .engine-meta span{
    display:inline-flex!important;
    max-width:100%!important;
    padding:4px 7px!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
}

/* Working mobile hamburger. The nav stays attached to the canonical header. */
@media (max-width: 760px){
  body .header.header-v153{
    position:sticky!important;
    top:0!important;
    z-index:1000!important;
  }
  body .header.header-v153 .header-layout-v2251{
    position:relative!important;
  }
  body .header.header-v153 .menu-btn{
    cursor:pointer!important;
  }
  body .header.header-v153.mobile-menu-open .menu-btn{
    background:rgba(231,255,69,.10)!important;
    border-color:rgba(231,255,69,.55)!important;
    color:#e7ff45!important;
  }
  body .header.header-v153.mobile-menu-open .header-nav-v2251{
    display:flex!important;
    position:absolute!important;
    top:112px!important;
    left:12px!important;
    right:12px!important;
    width:auto!important;
    max-width:none!important;
    padding:10px!important;
    margin:0!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:4px!important;
    border:1px solid #293238!important;
    border-radius:14px!important;
    background:#0b1014!important;
    box-shadow:0 18px 48px rgba(0,0,0,.45)!important;
    z-index:1002!important;
  }
  body .header.header-v153.mobile-menu-open .header-nav-v2251 a{
    display:flex!important;
    width:100%!important;
    min-height:42px!important;
    padding:0 12px!important;
    align-items:center!important;
    border-radius:9px!important;
    box-sizing:border-box!important;
    font-size:14px!important;
  }
  body .header.header-v153 .mobile-language-menu-v2541{
    display:none;
  }
  body .header.header-v153.mobile-menu-open .mobile-language-menu-v2541{
    display:grid!important;
    grid-template-columns:repeat(3,1fr)!important;
    gap:6px!important;
    padding-top:8px!important;
    margin-top:6px!important;
    border-top:1px solid rgba(255,255,255,.08)!important;
  }
  body .header.header-v153 .mobile-language-menu-v2541 button{
    min-height:38px!important;
    border:1px solid #303a40!important;
    border-radius:9px!important;
    background:#11181d!important;
    color:#d9dee1!important;
    font:800 12px/1 Inter,system-ui,sans-serif!important;
  }
  body .header.header-v153 .mobile-language-menu-v2541 button.active{
    border-color:#e7ff45!important;
    color:#e7ff45!important;
  }
}
