/* VGOOD mobile refinements — loaded last, all rules scoped to small screens.
   Uses high-specificity selectors + !important to neutralise both the legacy
   stylesheet and slim-header.css. Desktop layout is untouched. */

@media(max-width:980px){
  /* 0. Hide inner-page banners on mobile — keep the homepage banner only */
  .sl-banner,.inner-banner{display:none!important}

  /* 1. Header: logo left, menu + language pushed to the far right */
  .nav-toggle,.sl-toggle{margin-left:auto!important}

  /* 4. Opened dropdown scrolls instead of overflowing the viewport */
  .nav,.sl-nav{max-height:calc(100vh - 78px)!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain}

  /* 3. Whole-row accordion categories (legacy mobile-site feel) */
  .nav-group{position:relative;border-bottom:1px solid #eee}
  .nav-group>a:first-child{
    display:flex!important;align-items:center;justify-content:space-between;
    min-height:46px!important;padding:12px 16px!important;
    font-size:14px!important;letter-spacing:.02em!important;font-weight:600!important;
    color:#1a1a1a!important;text-transform:none!important;border:0!important;
  }
  /* chevron: whole row is tappable, arrow is only a visual hint */
  .nav-group>a:first-child:after{
    content:"";display:block;width:8px;height:8px;margin-left:12px;flex:0 0 auto;
    border-right:1.5px solid #888;border-bottom:1.5px solid #888;
    transform:rotate(45deg) translateY(-2px);transition:transform .2s;
  }
  .nav-group.open>a:first-child:after{transform:rotate(-135deg) translateY(-1px)}
  /* nested rows: hidden until open, tinted by tier, generous tap target */
  .nav-group>a.sub,.nav-group>a.sl-nested{
    display:none!important;padding:12px 16px 12px 32px!important;
    min-height:42px!important;line-height:1.5!important;font-size:13px!important;
    letter-spacing:.02em!important;text-transform:none!important;border:0!important;
    color:#555!important;background:#f6f6f6!important;
  }
  .nav-group.open>a.sub,.nav-group.open>a.sl-nested{display:block!important}
  .nav-group>a.nav-viewall{color:#1a1a1a!important;font-weight:600!important;background:#f0f0f0!important}
  .sub-toggle{display:none!important}

  /* 5. Download list — stack fields, no more overlap */
  .sl-page .data_list .data_row,
  .data_download-main .download_section .data_row{
    height:auto!important;display:flex!important;flex-wrap:wrap!important;
    flex-direction:row!important;justify-content:flex-start!important;
    align-items:center!important;gap:8px 14px!important;padding:18px 0!important;
  }
  /* legacy line-height:99px applies to EVERY inner div, not just the row children */
  .sl-page .data_list .data_row div,
  .data_download-main .download_section .data_row div{
    line-height:1.5!important;
  }
  .sl-page .data_list .data_row>div,
  .data_download-main .download_section .data_row>div{
    width:auto!important;flex:0 0 auto!important;line-height:1.5!important;
    padding:0!important;font-size:13px!important;color:#707070!important;
  }
  /* keep icon + filename, and label + value, on the same line */
  .sl-page .data_list .data_row div.flex,
  .data_download-main .download_section .data_row div.flex{
    display:flex!important;flex-direction:row!important;align-items:center!important;
    gap:6px!important;white-space:nowrap!important;
  }
  .sl-page .data_list .data_row>div:nth-child(1),
  .data_download-main .download_section .data_row>div:nth-child(1){flex:1 1 100%!important;font-size:15px!important;color:#1a1a1a!important}
  .sl-page .data_list .data_row>div:nth-child(2),
  .sl-page .data_list .data_row>div:nth-child(3),
  .data_download-main .download_section .data_row>div:nth-child(2),
  .data_download-main .download_section .data_row>div:nth-child(3){font-size:11px!important}
  .sl-page .data_list .data_row>div:nth-child(3),
  .data_download-main .download_section .data_row>div:nth-child(3){margin-right:auto!important}
  .sl-page .data_list .data_row .iconfont,
  .data_download-main .download_section .data_row .iconfont{margin-right:8px!important}
  .sl-page .data_list .data_row>div:nth-child(4) a,
  .data_download-main .download_section .data_row>div:nth-child(4) a{
    display:inline-block!important;width:auto!important;height:auto!important;
    line-height:1.4!important;padding:8px 16px!important;font-size:11px!important;
  }

  /* 6. News list — two cards per row, image on top, like the homepage */
  .sl-page .news_section .video_list{display:grid!important;grid-template-columns:repeat(2,1fr)!important;gap:24px 14px!important;margin:0!important}
  .sl-page .news_section .video_item{display:block!important;padding:0!important;margin:0!important;border:0!important}
  .sl-page .news_section .video_item .center{padding:0!important;border:0!important}
  .sl-page .news_section .video_item .center>a.flex{display:block!important}
  .sl-page .news_section .video_item .left_video{width:100%!important}
  .sl-page .news_section .video_item .picture_container{padding-top:60%!important}
  .sl-page .news_section .video_item .picture_container img{object-fit:cover}
  .sl-page .news_section .video_item .right_describe{width:auto!important;margin:0!important;padding:12px 0 0!important}
  .sl-page .news_section .video_item .right_describe h3{font-size:14px!important;line-height:1.45!important;margin:0 0 8px!important;white-space:normal!important}
  .sl-page .news_section .video_item .right_describe p{display:none!important}
  .sl-page .news_section .video_item .article_bottom{margin:0!important;gap:10px!important}
  .sl-page .news_section .video_item .article_bottom .date,
  .sl-page .news_section .video_item .article_bottom .tag{font-size:10px!important}

  /* 7. Product detail #goods_show — stack image on top, specs below on mobile */
  .product-details-main .main2#goods_show{scroll-margin-top:76px!important}
  .product-details-main .main2 h3{
    height:auto!important;line-height:1.5!important;font-size:20px!important;
    padding:16px 18px!important;margin-bottom:24px!important;
  }
  .product-details-main .main2 .flex.flex_row_justify{
    display:block!important;width:100%!important;
  }
  .product-details-main .main2 .swiper-container{
    width:100%!important;margin:0 0 26px!important;
  }
  .product-details-main .main2 .swiper-container .swiper-slide{
    width:100%!important;height:auto!important;
  }
  .product-details-main .main2 .swiper-container .swiper-slide img{
    display:block!important;width:100%!important;height:auto!important;
    max-width:100%!important;object-fit:contain!important;
  }
  .product-details-main .main2 #content{
    width:100%!important;margin-top:0!important;
  }
  .product-details-main .main2 #content .content-item{
    width:100%!important;margin-top:0!important;padding-right:0!important;
  }
  .product-details-main .main2 #content li{
    line-height:2!important;font-size:14px!important;
    border-bottom:1px solid #f0f0f0!important;
  }
  .product-details-main .main2 #content .down{margin-top:22px!important}

  /* 2. Homepage product rows — text left, image right, no empty space.
        Scoped to the whole mobile range (<=980px): the legacy 980px rule put
        specs into a 20px column and made them stack vertically. */
  .spec-row{grid-template-columns:1fr 92px!important;grid-template-areas:"model thumb" "platform thumb" "specs thumb"!important;column-gap:16px!important;row-gap:5px!important;padding:18px 0!important;align-items:start!important}
  .spec-row .model{grid-area:model;font-size:16px!important}
  .spec-row .platform{grid-area:platform;display:block!important;font-size:11px!important;font-family:inherit!important;letter-spacing:0!important}
  .spec-row .specs{grid-area:specs;font-size:11px!important;line-height:1.65!important}
  .spec-row .thumb{grid-area:thumb;width:92px!important;height:86px!important;grid-column:auto!important}
  .spec-row .arrow{display:none!important}
}

@media(max-width:560px){
  /* fine-tune for narrow phones */
  .spec-row{grid-template-columns:1fr 92px!important;column-gap:14px!important}
  .spec-row .model{font-size:16px!important}
}

/* Toggle button is desktop-hidden by default */
.sub-toggle{display:none}
