/*
 * Responsive layer for the public site (loaded last). Desktop (≥1200px) is unchanged;
 * below that the fixed 1200px legacy layout becomes fluid and stacks.
 * Breakpoints: 1199 (laptop/tablet landscape), 991 (tablet), 767 (large phone), 575 (phone).
 */

/* always-on helpers */
.main-menu .mm-toggle, .main-menu .mm-caret { display: none; }
img { max-width: 100%; }

/* ======================================================================= ≤1199px */
@media (max-width: 1199px) {
	html, body { overflow-x: hidden; }
	body { background-size: cover; }

	/* page frame */
	body > #page { width: 100%; max-width: 100%; margin: 0; }
	#page, #page_body, #refesh_body { width: 100% !important; max-width: 100%; display: block !important; }
	#content_body { display: block; }
	.site-topbar, #top_menu_div.main-menu, .page-hero, .site-footer, .news_whyml_postion,
	.product_animation_postion, .product-scroller, #header_postion { width: 100% !important; box-sizing: border-box; }

	/* banner: fluid 3:1, rotator replaced by a cross-fading background (see banner partial) */
	#header_postion { position: relative; height: auto !important; aspect-ratio: 3 / 1; overflow: hidden; background: #fff; }
	#header_postion .container { position: absolute; inset: 0; width: auto !important; height: auto !important;
		background-size: cover !important; background-position: center top !important; background-repeat: no-repeat;
		transition: background-image .8s ease; }
	#header_postion .wt-rotator { display: none !important; }
	#main { position: absolute; left: 0; right: 0; top: auto; bottom: -1px; margin: 0; width: 100% !important; height: 50% !important;
		background-size: 100% 100% !important; z-index: 2; pointer-events: none; }
	#logo { position: absolute; right: 3%; bottom: 5%; top: auto; margin: 0 !important; width: 16% !important; height: auto !important; z-index: 3; }
	#logo img { width: 100% !important; height: auto; }

	/* inner pages: sidebar + content side by side, fluid */
	#refesh_body #content_body { display: flex; gap: 24px; width: 100% !important; box-sizing: border-box; padding: 0 16px; }
	#refesh_body .left_side_content { flex: 0 0 270px; width: 270px !important; margin: 0 !important; float: none; }
	#refesh_body .right_side_content_body { flex: 1 1 auto; min-width: 0; width: auto !important; margin: 0 !important; float: none; }
	#refesh_body .section-nav, #refesh_body .side-box { width: 100% !important; box-sizing: border-box; }
	#refesh_body .side-box .image_box img { object-fit: contain; }

	/* page hero */
	.page-hero { padding: 0 24px; }
	.page-hero .ph-title { font-size: 28px; }

	/* classic home: Why / News strip + product scroller */
	.news_whyml_postion { display: flex; height: auto !important; }
	.news_whyml_postion .part { flex: 1 1 50%; width: auto !important; height: auto; padding-bottom: 10px; }
	#whyml_header, .whyml_text_box, .ne_text_box, #news-container, .news_whyml_postion .part > div[style] { width: auto !important; }

	/* footer */
	.site-footer .sf-inner { flex-wrap: wrap; gap: 30px; padding: 36px 24px 40px; }
	.site-footer .sf-col { flex: 1 1 calc(50% - 30px) !important; }

	/* rich content */
	.rich-body iframe { max-width: 100%; }

	/* ---- home v2 ---- */
	.hv2 { width: 100% !important; }
	.hv2 .hv2-stats { width: auto; margin: -50px 24px 0 24px; }
	.hv2-section { padding: 56px 24px; }
	.hv2-wn { margin: 0 24px 48px; }
	.hv2-cta { margin: 0 24px 48px; }
	.hv2-car-item { flex-basis: calc((100% - (var(--pv, 4) - 1) * 20px) / var(--pv, 4)) !important; }
	.hv2-car-prev { left: -6px; } .hv2-car-next { right: -6px; }
}

/* ======================================================================= ≤991px */
@media (max-width: 991px) {
	/* top bar */
	.site-topbar { flex-wrap: wrap; justify-content: center; padding: 8px 12px; gap: 8px; }
	.site-topbar .st-contact { justify-content: center; gap: 14px; font-size: 12.5px; }
	.site-topbar .st-notices { justify-content: center; }
	.site-topbar .st-notice { font-size: 12px; padding: 4px 9px; }

	/* main menu → button + accordion */
	#top_menu_div.main-menu { box-shadow: 0 2px 8px rgba(0, 38, 102, .08); }
	.main-menu .mm-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 18px; border: 0; background: #fff;
		color: #002666; font-size: 16px; font-weight: 700; cursor: pointer; }
	.main-menu .mm-toggle .bi { font-size: 22px; }
	.main-menu .mm-bar { display: none; flex-direction: column; flex-wrap: nowrap; padding: 0 0 8px; border-top: 1px solid #e4eaf3; max-height: 75vh; overflow-y: auto; }
	.main-menu.open .mm-bar { display: flex; }
	.main-menu .mm-item { position: relative; }
	.main-menu .mm-top > .mm-link { line-height: 1.3; padding: 13px 56px 13px 18px; border-bottom: 1px solid #f0f3f8; white-space: normal; }
	.main-menu .mm-top > .mm-link::after, .main-menu .mm-top.has-sub > .mm-link::before { display: none; }
	.main-menu .mm-top.in-path > .mm-link, .main-menu .mm-top > .mm-link.current { color: #1e88e5; }
	.main-menu .mm-caret { display: flex; align-items: center; justify-content: center; position: absolute; right: 6px; top: 4px;
		width: 42px; height: 38px; border: 0; border-radius: 8px; background: #f2f6fd; color: #002666; cursor: pointer; }
	.main-menu .mm-caret .bi { transition: transform .2s; }
	.main-menu .mm-item.open > .mm-caret .bi { transform: rotate(180deg); }

	.main-menu .mm-sub, .main-menu .mm-sub .mm-sub { position: static; display: none; min-width: 0; max-width: none; padding: 0 0 0 14px;
		opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; border-radius: 0; background: #f8fafd; }
	.main-menu .mm-item.open > .mm-sub { display: block; }
	.main-menu .mm-sub .mm-link { padding: 11px 56px 11px 14px; border-left: 3px solid transparent; }
	.main-menu .mm-sub .has-sub > .mm-link::after { display: none; }

	/* inner pages: content first, sidebar below */
	#refesh_body #content_body { flex-direction: column; gap: 28px; }
	#refesh_body .left_side_content { flex: none; width: 100% !important; order: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
	#refesh_body .left_side_content > script { display: none; }
	#refesh_body .left_side_content .side-box, #refesh_body .left_side_content .section-nav { margin: 0 !important; }
	#refesh_body .right_side_content_body { order: 1; }

	.page-hero { height: auto; min-height: 130px; padding: 26px 20px 30px; }
	.page-hero .ph-logo { display: none; }
	.page-hero .ph-inner { max-width: none; }

	.pdf-box iframe { height: 75vh; min-height: 460px; }

	/* contact page: stack the fixed-width columns */
	#refesh_body .right_side_content_body div[style*="float: left"],
	#refesh_body .right_side_content_body div[style*="float:left"] { float: none !important; width: auto !important; display: block !important; margin-left: 0 !important; }
	#refesh_body .right_side_content_body div[style*="width: 2px"] { display: none !important; }
	#contact, #contact_form input, #contact_form select, #contact_form textarea { max-width: 100%; box-sizing: border-box; }
	#contact { width: auto !important; }

	/* guest book / career forms: label above field, full width */
	#refesh_body form { width: auto !important; box-sizing: border-box; padding: 14px !important; }
	.guest_book fieldset { min-width: 0; }
	#refesh_body form div[style*="display: table"] { display: block !important; }
	.guest_book table { max-width: 100%; }
	.guest_book fieldset > label, .guest_book fieldset label[style] { float: none !important; display: block; min-width: 0; margin-left: 0 !important; line-height: 1.6; }
	.guest_book fieldset > input[type="text"], .guest_book fieldset > textarea, .guest_book fieldset > select,
	.guest_book fieldset > input.effect { float: none !important; display: block; width: 100% !important; max-width: 100%; box-sizing: border-box; height: auto; padding: 7px 9px; margin-bottom: 8px; }
	.guest_book #radio { float: none !important; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 8px; }
	.guest_book #radio input, .guest_book #radio label { float: none !important; width: auto !important; }
	.guest_book table { display: block; overflow-x: auto; }

	/* board / about */
	.bd-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bd-feature { flex-direction: column; text-align: center; padding: 26px 20px; }
	.bd-feature-photo { flex: none; width: 200px; }
	.bd-feature-body { text-align: center; }
	.rich-body .bd-feature .bd-rep { justify-content: center; }
	.ab-intro { grid-template-columns: 1fr; }
	.ab-stats { grid-template-columns: repeat(2, 1fr); }

	/* home v2 */
	.hv2 .hv2-stats { grid-template-columns: repeat(2, 1fr); margin-top: -30px; }
	.hv2 .hv2-stat + .hv2-stat::before { display: none; }
	.hv2-about { grid-template-columns: 1fr; gap: 30px; }
	.hv2-wn { grid-template-columns: 1fr; }
	.hv2-wn-col + .hv2-wn-col { border-left: 0; border-top: 1px solid var(--line); }
	.hv2-inv-grid { grid-template-columns: 1fr; }
	.hv2-head-row { flex-wrap: wrap; gap: 14px; }
	.hv2-steps { grid-template-columns: repeat(4, 1fr); row-gap: 26px; }
	.hv2-steps::before { display: none; }
	.hv2-cta { flex-direction: column; align-items: flex-start; padding: 32px 28px; }
	.hv2-cta-actions { flex-wrap: wrap; }
	.hv2-head h2, .hv2-about h2 { font-size: 28px; }

	/* classic home strip: stack */
	.news_whyml_postion { flex-direction: column; }
}

/* ======================================================================= ≤767px */
@media (max-width: 767px) {
	#refesh_body #content_body { padding: 0 12px; }
	#refesh_body .left_side_content { grid-template-columns: 1fr; }

	.page-hero .ph-title { font-size: 23px; }
	.page-hero .ph-crumbs { font-size: 12px; }

	.rich-body { font-size: 15px; }
	.rich-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.rich-body .lead-in { font-size: 16.5px; }

	.pdf-box-bar { flex-wrap: wrap; }
	.pdf-box-name { flex: 1 1 100%; white-space: normal; }
	.pdf-box iframe { height: 70vh; min-height: 400px; }

	.site-footer .sf-col { flex: 1 1 100% !important; }
	.site-footer .sf-bottom { padding: 14px 24px; }

	.bd-grid-2, .bd-grid-3 { grid-template-columns: minmax(0, 320px); }
	.rich-body .bd-title { font-size: 24px; }
	.bd-download { flex-direction: column; align-items: stretch; text-align: center; }
	.bd-download-actions { justify-content: center; }

	.ab-mv { grid-template-columns: 1fr; }
	.ab-since { right: 8px; bottom: -16px; }

	.hv2 .hv2-stats { margin: 16px 12px 0; }
	.hv2-section { padding: 44px 16px; }
	.hv2-wn, .hv2-cta { margin-left: 12px; margin-right: 12px; }
	.hv2-wn-col { padding: 22px 12px; gap: 14px; }
	.hv2-wn-num { font-size: 60px; }
	.hv2-steps { grid-template-columns: repeat(2, 1fr); }
	.hv2-car-btn { width: 40px; height: 40px; }

	/* product scroller arrows a bit narrower */
	.product-scroller .ps-item, .product-scroller .ps-item img { width: 130px; height: 123px; }
	.product-scroller, .product-scroller .ps-arrow, .product-scroller .ps-arrow img, .product-scroller .ps-track { height: 123px; }
	.product_animation_postion { height: auto; }
}

/* ======================================================================= ≤575px */
@media (max-width: 575px) {
	.site-topbar .st-contact a { display: none; }        /* keep phone, hide long e-mail */
	.site-topbar .st-notices { width: 100%; }
	.site-topbar .st-notice { flex: 1 1 auto; text-align: center; }

	#logo { width: 22% !important; }
	.page-hero { padding: 22px 16px 26px; }
	.page-hero .ph-title { font-size: 21px; }

	.hv2 .hv2-stats { grid-template-columns: 1fr; }
	.hv2 .hv2-stat { padding: 14px 16px; }
	.hv2-head h2, .hv2-about h2 { font-size: 24px; }
	.hv2-wn-col { flex-direction: column; }
	.ab-stats { grid-template-columns: 1fr; }
}

/* Career page */
@media (max-width: 991px) {
	.cr-hero { flex-direction: column; align-items: flex-start; padding: 24px 22px; }
	.cr-perks { grid-template-columns: 1fr; }
	#refesh_body form.cr-form { padding: 0 !important; }
	.cr-row { grid-template-columns: 1fr 1fr; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
	.cr-row-head { display: none; }
}
@media (max-width: 575px) {
	.cr-grid { grid-template-columns: 1fr; }
	.cr-span-2 { grid-column: auto; }
	.cr-grid > span:empty { display: none; }
	.cr-card { padding: 18px 14px 20px; }
	.cr-row { grid-template-columns: 1fr; }
	.cr-actions { flex-direction: column-reverse; }
	.cr-btn { justify-content: center; }
}

/* Contact page */
@media (max-width: 991px) {
	.ct-main { grid-template-columns: 1fr; }
	#refesh_body form.ct-form { padding: 18px 16px 20px !important; }
}
@media (max-width: 575px) {
	.ct-captcha { flex-wrap: wrap; }
	.ct-captcha input { max-width: none; flex: 1 1 100%; }
}
@media (max-width: 575px) { .ct-cards { grid-template-columns: 1fr; } .ct-captcha input[type="text"] { max-width: none; } }
@media (max-width: 767px) { .ct-map iframe { height: 320px; } }
@media (max-width: 767px) { .gb-list { grid-template-columns: 1fr; } }
@media (max-width: 991px) { #refesh_body form.gb-form { padding: 18px 16px 20px !important; } }
@media (max-width: 991px) { .nw-grid { grid-template-columns: repeat(2, 1fr); } .nw-cols { grid-template-columns: 1fr; } }
@media (max-width: 575px) { .nw-grid { grid-template-columns: 1fr; } }
