/* VGOOD responsive layer — overrides the legacy fixed 1200px layout.
   Loaded last from en/_css.php and cn/_css.php so phones render the desktop
   templates directly; the legacy /m/ and /men/ templates are no longer used. */

/* 1. Kill the hard 1200px viewport lock */
/* overflow-x:hidden on body creates a scroll container that breaks position:sticky.
   clip prevents horizontal overflow without creating a scroll container. */
html, body { width: auto !important; max-width: 100%; overflow-x: clip; }
.center { width: min(1200px, calc(100% - 40px)) !important; }

/* 2. Images and media never overflow */
img, video, iframe, .swiper-container, .swiper-wrapper, .swiper-slide { max-width: 100%; }
img { height: auto; }

/* 3. Header: stack and shrink */
.header { height: auto !important; min-height: 72px; padding: 12px 0; flex-wrap: wrap; }
.header img { max-height: 48px; width: auto; }
.header .search { max-width: 100%; }
.language { flex-wrap: wrap; }

/* 4. Navigation: click-to-open on small screens, horizontal scroll on large */
.nav { flex-wrap: wrap; }
nav .nav > .center > ul { flex-wrap: wrap; }
.nav .nav_pro_list, .nav .nav_type_list { max-width: 100%; }

/* 5. Common multi-column grids collapse to one column */
.index_video, .video_item, .info_wrap, .data_row, .toggle_section { flex-wrap: wrap; }
.pro_characteristic ul, .product_list ul, .video_list, .news_list_section ul,
.data_list, .culture_list { display: flex; flex-wrap: wrap; }
/* Section tabs (Data Download / Video Display) must stay on ONE row —
   the legacy .technology box has a fixed height and wrapping overflows the list. */
.technology_list { display: flex; flex-wrap: nowrap; }
.technology_list li { width: 50%; }

/* 6. Fixed-width columns become fluid */
.product_list li, .video_list li, .news_list_section li, .data_list li { max-width: 100%; }

/* 7. Tables scroll horizontally instead of breaking layout */
table { width: 100%; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media screen and (max-width: 980px) {
  .center { width: calc(100% - 32px) !important; padding: 0 !important; }

  /* Header */
  .header { justify-content: space-between; gap: 12px; }
  .header .search { width: 100% !important; margin-top: 6px; }
  .language { margin-left: auto; }

  /* Nav: hide dropdowns by default, show when JS adds .open */
  nav .nav > .center > ul { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav > .center > ul > li { flex: 0 0 auto; }
  .nav .nav_pro_list, .nav .nav_type_list {
    position: static !important; display: none !important; width: 100% !important;
    box-shadow: none; border: 0; background: transparent; padding: 0 0 0 12px;
  }
  .nav .nav-item.open > .nav_pro_list,
  .nav .nav-item.open > .nav_pro_list .nav_pro_item.open > .nav_type_list { display: block !important; }
  .nav .nav_pro_list .nav_pro_item { position: static; line-height: 2; }
  .nav .nav_pro_list .nav_pro_item > a::after { content: ' +'; }

  /* Section titles */
  .index-main h3, .product_list_title, .news_title, .xg_section h3 { font-size: 26px; }
  .index-main h3::before { width: 80px; }

  /* Homepage product rows */
  .index-main .index_pro_item {
    height: auto !important; min-height: 240px; padding: 30px 24px !important;
    background-size: 100% 100% !important;
  }
  .index_video { display: block; }
  .index_video > * { width: 100% !important; margin-bottom: 20px; }

  /* Product grid: 3 columns on tablet */
  .product_list ul { display: flex; flex-wrap: wrap; }
  .product_list li { width: 30% !important; margin: 20px 3% 0 0 !important; float: none !important; }
  .product_list li:nth-child(n) { margin-right: 3% !important; }
  .product_list li:nth-child(3n) { margin-right: 0 !important; }
  .product_list li .pro_img { width: 100% !important; max-width: 175px; height: auto !important; aspect-ratio: 175/115; }

  /* News / video / download: side-by-side to stacked */
  .video_item > div, .info_wrap > div, .data_row > div,
  .left_video, .right_describe, .main2_left, .main2_right { width: 100% !important; float: none !important; }
  .right_describe, .main2_right { padding-left: 0 !important; margin-top: 16px; }
  .data_row { gap: 12px; padding: 16px 0; }

  /* Company culture grid */
  .culture_list li { width: 48% !important; margin: 1% !important; }

  /* Detail page */
  .pro_detail_section .content-item, .news_details-main .content { font-size: 15px; line-height: 1.8; }
}

@media screen and (max-width: 560px) {
  .center { width: calc(100% - 24px) !important; }

  .header { padding: 10px 0; }
  .header img { max-height: 40px; }
  .header .search input, .header .search button { height: 32px; }

  nav .nav > .center > ul > li > a { font-size: 13px; padding: 0 10px; }

  .index-main h3, .product_list_title, .news_title, .xg_section h3 { font-size: 22px; }
  .index-main .index_pro_item { padding: 24px 16px !important; min-height: 200px; }

  /* Product grid: 2 columns on phone */
  .product_list li { width: 48% !important; margin: 16px 4% 0 0 !important; }
  .product_list li:nth-child(n) { margin-right: 4% !important; }
  .product_list li:nth-child(2n) { margin-right: 0 !important; }
  .product_list li .pro_img { max-width: 100%; }
  .product_list li .name, .product_list li .text { font-size: 13px; }

  .culture_list li { width: 100% !important; margin: 8px 0 !important; }

  .paging a, .paging span { padding: 6px 9px; font-size: 12px; }

  .footer { flex-wrap: wrap; text-align: center; }
  .footer_list { flex-wrap: wrap; justify-content: center; }
}
