/* BODS Responsive Universal 2.346.5 (phủ toàn bộ loại trang)
 * Lớp CSS bổ sung: tương thích điện thoại nhỏ, điện thoại gập, tablet (dọc/ngang), laptop, màn hình lớn/TV,
 * cảm ứng + chuột, tai thỏ (safe-area), chế độ ít chuyển động, in ấn.
 * Nạp SAU frontend.css; chỉ bổ sung, không thay đổi màu sắc/thương hiệu.
 *
 * Mốc chuẩn:  xs <=359 | sm 360-599 | md 600-899 (tablet dọc) | lg 900-1199 (tablet ngang/laptop nhỏ)
 *             xl 1200-1599 (desktop) | xxl >=1600 (màn hình lớn/TV)
 */

/* 1. Nền tảng ------------------------------------------------------------ */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:84px}
.bods-storefront{overflow-x:clip;min-width:320px;
  padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
.bods-storefront img,.bods-storefront video,.bods-storefront svg,.bods-storefront iframe,.bods-embed img{max-width:100%}
.bods-storefront .entry-content img,.bods-storefront .bods-content img,.bods-storefront video{height:auto}
.bods-storefront iframe{border:0}
.bods-storefront h1,.bods-storefront h2,.bods-storefront h3,.bods-storefront p,.bods-storefront li,.bods-storefront a{overflow-wrap:anywhere}
.bods-storefront table{max-width:100%}
.bods-storefront .bods-table-scroll,.bods-storefront .bods-attr-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.bods-storefront .entry-content table,.bods-storefront .bods-content table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}

/* Container co giãn theo viền màn hình (thay cho 36px cố định) */
.bods-container{width:min(1240px,100% - clamp(20px,4vw,48px))}

/* Chữ co giãn mượt, không nhảy cấp */
.bods-storefront{font-size:clamp(14px,.35vw + 13.3px,16px)}
.bods-section-heading h2,.bods-section h2{font-size:clamp(19px,1.2vw + 15px,28px);line-height:1.25}
.bods-single-info h1{font-size:clamp(21px,1.4vw + 16px,32px)}
.bods-single-price{font-size:clamp(21px,1vw + 17px,28px)}

/* 2. Điện thoại rất nhỏ (<=359px: iPhone SE cũ, Galaxy Fold ngoài) ---------- */
@media (max-width:359px){
  .bods-container{width:calc(100% - 20px)}
  .bods-logo{font-size:22px;letter-spacing:-1px}
  .bods-header-row{gap:8px}
  .bods-product-grid{gap:7px}
  .bods-product-info{padding:8px}
  .bods-product-info h3{font-size:12px}
  .bods-category-grid{grid-template-columns:repeat(2,1fr)}
  .bods-footer-grid{grid-template-columns:1fr}
  .bods-hero{padding:28px 18px;min-height:260px}
  .bods-trust-row{grid-template-columns:1fr}
}

/* 3. Điện thoại (360-599px) ------------------------------------------------ */
@media (max-width:599px){
  .bods-main{padding:16px 0 40px}
  .bods-section{margin:26px 0}
  .bods-hero{border-radius:14px;padding:32px 20px;min-height:280px}
  .bods-hero:not(.bods-hero-no-image)::before{background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(255,255,255,.5))}
  .bods-hero-cta,.bods-buy-button,.bods-outline-button{width:100%}
  .bods-hero-cta{width:auto}
  .bods-trust-row{grid-template-columns:1fr;gap:8px}
  .bods-search{max-width:none;order:3;flex:1 1 100%;width:100%}
  .bods-sticky-buy{padding-left:max(14px,env(safe-area-inset-left,0px));padding-right:max(14px,env(safe-area-inset-right,0px))}
  /* Ô nhập >=16px để iOS không tự phóng to khi chạm */
  .bods-storefront input,.bods-storefront select,.bods-storefront textarea{font-size:16px}
}

/* 4. Tablet dọc (600-899px) ----------------------------------------------- */
@media (min-width:600px) and (max-width:899px){
  .bods-product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .bods-category-grid{grid-template-columns:repeat(4,1fr)}
  .bods-footer-grid{grid-template-columns:repeat(2,1fr)}
  .bods-single-layout{grid-template-columns:minmax(0,1fr);gap:24px}
  .bods-single-main img{height:min(60vw,460px)}
}

/* 5. Tablet ngang / laptop nhỏ (900-1199px) ---------------------------------- */
@media (min-width:900px) and (max-width:1199px){
  .bods-product-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .bods-single-layout{gap:28px}
  .bods-header-row{gap:18px}
  .bods-nav-inner{gap:20px;overflow-x:auto;scrollbar-width:none}
  .bods-nav-inner::-webkit-scrollbar{display:none}
}

/* 6. Màn hình lớn / TV (>=1600px) -------------------------------------------- */
@media (min-width:1600px){
  .bods-container{width:min(1480px,100% - 96px)}
  .bods-product-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:18px}
  .bods-category-grid{grid-template-columns:repeat(8,1fr)}
}
@media (min-width:2200px){
  .bods-container{width:min(1760px,100% - 160px)}
  .bods-storefront{font-size:18px}
}

/* 7. Điện thoại nằm ngang (chiều cao thấp) --------------------------------------- */
@media (orientation:landscape) and (max-height:500px){
  .bods-hero{min-height:0;padding:24px 6%}
  .bods-header-row{min-height:56px}
  .bods-sticky-buy{padding-top:6px;padding-bottom:calc(6px + env(safe-area-inset-bottom,0px))}
  .bods-single-main img{height:min(70vh,300px)}
}

/* 8. Cảm ứng: vùng chạm tối thiểu 44px ------------------------------------------------- */
@media (pointer:coarse){
  .bods-menu-toggle,.bods-search button,.bods-cats-toggle,.bods-header-link,
  .bods-hero-cta,.bods-buy-button,.bods-outline-button,.bods-category-menu a,
  .bods-nav-inner>a{min-height:44px;display:inline-flex;align-items:center;justify-content:center}
  .bods-search button{width:56px}
  .bods-nav-inner>a{padding-inline:4px}
  .bods-product-info .bods-buy-button{min-height:44px;font-size:13px}
  .bods-gallery-thumbs>*{min-width:56px;min-height:56px}
  .bods-storefront a,.bods-storefront button{-webkit-tap-highlight-color:rgba(36,75,58,.12);touch-action:manipulation}
}

/* 9. Chuột/bàn phím: chỉ hiệu ứng hover khi thật sự có hover ------------------------------ */
@media (hover:none){
  .bods-product-card:hover{transform:none;box-shadow:none}
}

/* 10. Thiết bị gập / màn hình chia đôi ------------------------------------------------------- */
@media (horizontal-viewport-segments:2){
  .bods-container{width:min(1240px,100% - 48px)}
}

/* 11. Tương phản cao, ít chuyển động ------------------------------------------------------------------ */
@media (prefers-reduced-motion:reduce){
  .bods-storefront *,.bods-storefront *::before,.bods-storefront *::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}
@media (prefers-contrast:more){
  .bods-storefront{--bods-muted:#3d463f;--bods-line:#c9cfc8}
}

/* 12. In ấn ------------------------------------------------------------------------------------------------------ */
@media print{
  .bods-topbar,.bods-nav,.bods-sticky-buy,.bods-footer,.bods-ai-launcher,.bods-search{display:none!important}
  .bods-storefront{background:#fff;font-size:12pt}
  .bods-container{width:100%}
  .bods-product-grid{grid-template-columns:repeat(3,1fr)}
  a[href^="http"]:not(.bods-buy-button)::after{content:" (" attr(href) ")";font-size:9pt;color:#555}
}


/* =====================================================================
 * PHẦN B - PHỦ TẤT CẢ CÁC LOẠI TRANG
 * Trang chủ, danh mục/tìm kiếm, chi tiết sản phẩm, du lịch (+danh mục),
 * người bán/VIP, bảng giá tài trợ, hướng dẫn mua, 402/403/404, trợ lý AI.
 * ===================================================================== */

/* B1. Bảng dữ liệu (thuộc tính sản phẩm, biểu đồ giá, so sánh) cuộn ngang thay vì tràn */
@media (max-width:719px){
  .bods-storefront table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .bods-storefront table th,.bods-storefront table td{white-space:normal;min-width:84px}
}

/* B2. Trang chủ (home-redesign, home-v3, kệ sản phẩm cuộn ngang) */
@media (max-width:899px){
  .bods-ai-shop{grid-template-columns:minmax(0,1fr)}
  .bods-why-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:479px){
  .bods-why-grid{grid-template-columns:minmax(0,1fr)}
  .bods-home-shelves:not(.is-grid) .bods-product-grid{scroll-padding-inline:10px;margin-inline:-2px}
}
@media (min-width:1600px){.bods-why-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* B3. Danh mục / tìm kiếm / bộ lọc nhanh / hướng dẫn mua */
.bods-shop-grid,.bods-np-grid,.bods-np-grid-full,.bods-guide-grid,.bods-ch-grid,.bods-af-grid,.bods-ov-grid{min-width:0}
.bods-guide-grid,.bods-ch-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr))}
@media (max-width:599px){
  .bods-np-grid,.bods-np-grid-full{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bods-guide-grid,.bods-ch-grid{grid-template-columns:minmax(0,1fr)}
}
/* Bộ lọc nhanh (bods-qf-*) và thanh sắp xếp: nhãn xếp trên chip, chip cuộn ngang, chạm dễ */
@media (max-width:599px){
  .bods-qf-group{grid-template-columns:minmax(0,1fr);gap:6px}
  .bods-qf-chips{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding-bottom:2px}
  .bods-qf-chips::-webkit-scrollbar{display:none}
  .bods-qf-chip{flex:0 0 auto}
}
@media (pointer:coarse){.bods-qf-chip,.bods-qf-clear,.bods-sort a,.bods-np-sort a,.bods-tv-sort a{min-height:40px;display:inline-flex;align-items:center}}
.bods-sort,.bods-np-sort,.bods-tv-sort{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
@media (max-width:599px){.bods-sort,.bods-np-sort,.bods-tv-sort{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}.bods-sort>*,.bods-np-sort>*,.bods-tv-sort>*{flex:0 0 auto}}

/* B4. Chi tiết sản phẩm: thư viện ảnh, thông số, so sánh giá, bố cục theo ngành */
.bods-single-gallery,.bods-single-main,.bods-single-info{min-width:0}
.bods-gallery-thumbs{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
.bods-gallery-thumbs>*{flex:0 0 auto}
@media (min-width:600px){.bods-gallery-thumbs{flex-wrap:wrap}}
@media (max-width:899px){
  .bods-single[class*="bods-pl--"] .bods-single-layout{grid-template-columns:minmax(0,1fr)}
  .bods-keyfacts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bods-proscons{grid-template-columns:minmax(0,1fr)}
  .bods-skin-mediamart .bods-single-layout{grid-template-columns:minmax(0,1fr)}
}
@media (min-width:1600px){.bods-single-main img{height:560px}}

/* B5. Du lịch (bods-tv-*) và danh mục du lịch (bods-tvc-*) */
.bods-tv-hero{padding:clamp(22px,4vw,36px) clamp(16px,4vw,32px)}
.bods-tv-hero::after{max-width:50vw}
@media (max-width:899px){.bods-tv-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:599px){
  .bods-tv-fields{grid-template-columns:minmax(0,1fr)}
  .bods-tv-fields .bods-tv-btn,.bods-tv-fields button{width:100%;min-height:48px}
  .bods-tv-grid,.bods-tvc-grid{grid-template-columns:minmax(0,1fr)}
  .bods-tv-dests,.bods-tvc-dests{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bods-tv-tabs{scroll-snap-type:x proximity;margin-inline:calc(-1 * clamp(10px,2vw,24px));padding-inline:clamp(10px,2vw,24px)}
}
@media (max-width:359px){.bods-tv-dests,.bods-tvc-dests{grid-template-columns:minmax(0,1fr)}}
@media (min-width:1600px){.bods-tv-grid,.bods-tvc-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.bods-tvc-dests{grid-template-columns:repeat(8,minmax(0,1fr))}}
/* Thanh tab dưới (du lịch): tai thỏ hai bên + trợ lý AI không đè lên */
.bods-tv-tabbar{padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
body.bods-has-tabbar .bods-sticky-buy{bottom:calc(66px + env(safe-area-inset-bottom,0px))}

/* B6. Người bán / gian hàng VIP (seller-redesign, seller-hh) */
.bods-seller-grid,.bods-seller-hero>*{min-width:0}
@media (max-width:899px){.bods-seller-hero{grid-template-columns:minmax(0,1fr)}.bods-seller-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:479px){.bods-seller-stats,.bods-hh-points{grid-template-columns:minmax(0,1fr)}}
@media (min-width:1024px) and (max-width:1199px){.bods-hh-points{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* B7. Bảng giá tài trợ (bods-sp-*) và khối tài trợ (bods-spb-*) */
@media (min-width:721px) and (max-width:1100px){.bods-sp-plans{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (min-width:1101px) and (max-width:1279px){.bods-sp-plans{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:479px){.bods-spb-actions{grid-template-columns:minmax(0,1fr)}}

/* B8. Trang lỗi 402/403/404 và nội dung trang tĩnh */
.bods-storefront .entry-content,.bods-storefront .bods-content{max-width:min(100%,820px);margin-inline:auto}
.bods-storefront .entry-content :where(pre,code){overflow-x:auto;max-width:100%;white-space:pre-wrap}
.bods-storefront .entry-content :where(img,figure,video,iframe){max-width:100%;height:auto}
.bods-storefront .entry-content iframe[src*="youtube"],.bods-storefront .entry-content iframe[src*="youtu.be"]{width:100%;aspect-ratio:16/9;height:auto}

/* B9. Trợ lý AI nổi (giarequa-ai-*): tai thỏ, không đè thanh mua, hộp chat vừa màn hình */
.giarequa-ai-wrapper{right:max(16px,env(safe-area-inset-right,0px));bottom:max(16px,env(safe-area-inset-bottom,0px))}
.giarequa-ai-box{max-height:calc(100dvh - 96px)}
/* Thanh Mua cố định hiện từ 900px trở xuống: chừa chỗ ở chân trang và nâng nút AI lên trên nó */
@media (max-width:900px){
  .bods-storefront:has(.bods-sticky-buy) .bods-footer{padding-bottom:calc(84px + env(safe-area-inset-bottom,0px))}
  .bods-storefront:has(.bods-sticky-buy) .giarequa-ai-wrapper{bottom:calc(76px + env(safe-area-inset-bottom,0px))}
}
@media (max-width:599px){
  .giarequa-ai-box{max-width:calc(100vw - 16px)}
}
@media (orientation:landscape) and (max-height:500px){
  .giarequa-ai-box{max-height:calc(100dvh - 72px)}
  .giarequa-ai-wrapper{bottom:max(8px,env(safe-area-inset-bottom,0px))}
}

/* B10. Menu / thanh điều hướng dùng chung */
@media (max-width:899px){
  .bods-nav-inner{overflow-x:auto;gap:18px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .bods-nav-inner::-webkit-scrollbar{display:none}
  .bods-nav-inner>*{flex:0 0 auto;white-space:nowrap}
}
.bods-category-menu{max-width:calc(100vw - 24px);max-height:min(70dvh,520px);overflow:auto}

/* B11. Popup / thông báo (smart-popup, exit-popup, push) vừa mọi màn hình */
.bods-storefront [class*="bods-popup"],.bods-storefront [class*="bods-modal"],.bods-storefront [class*="bods-exit"]{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto}

/* Footer contrast and bottom bar pass 2.346.7 (delete this block to revert).
   frontend.css ".bods-footer a:not(.bods-logo)" (specificity 0,2,1) beat the light footer colours set in us-redesign.css,
   so links and text were dark grey (#4f5c53) on navy (#0b2540). These rules restore readable colours. */
.bods-storefront .bods-footer p,
.bods-storefront .bods-footer a:not(.bods-logo){color:#d5e0ec}
.bods-storefront .bods-footer a:not(.bods-logo):hover,
.bods-storefront .bods-footer a:not(.bods-logo):focus-visible{color:#fff}
.bods-storefront .bods-footer .bods-logo{text-decoration:none}
.bods-storefront .bods-footer .bods-copyright{color:#b9c8d8;border-top-color:rgba(255,255,255,.22)}
/* The personalization line sits under the footer; keep it clear of the fixed Cookie settings and AI Assistant buttons. */
@media (max-width:767px){
  .bods-pz-ctl{padding-bottom:calc(84px + env(safe-area-inset-bottom,0px))}
}

/* Seller hero contrast pass 2.346.9 (delete this block to revert).
   us-redesign.css ".bods-storefront h1" (dark heading colour) and ".bods-disclosure" (light box) were stronger than the seller hero
   rules, so the seller name was dark on dark green and the disclosure was white text on a white box. */
.bods-storefront .bods-seller-hero h1,
.bods-storefront .bods-hh-hero h1{color:#fff}
.bods-storefront .bods-seller-hero .bods-disclosure,
.bods-storefront .bods-hh-hero .bods-disclosure,
.bods-storefront .bods-hh-hero .bods-affiliate-note{background:rgba(255,255,255,.1);border:0;border-left:3px solid rgba(231,207,159,.85);border-radius:8px;padding:10px 14px;color:rgba(255,255,255,.92);font-size:13.5px;line-height:1.55}

/* 2.351.0 Overflow guard (mọi thiết bị). Một phần tử thò ra ngoài màn hình làm Chrome/Samsung Internet trên điện thoại
 * thu nhỏ cả trang (nội dung chỉ chiếm một cột hẹp bên trái). Giải pháp: biến .bods-site thành khung cắt mọi phần tử
 * định vị tuyệt đối, và cho các khối flex/grid cuộn ngang được phép co (min-width:0). Chỉ CSS, không đổi màu sắc/bố cục. */
html{max-width:100%}
.bods-site{position:relative;max-width:100%;overflow-x:clip}
.bods-main,.bods-container,.bods-archive,.bods-section,.bods-seller-sections,.bods-seller-sec,.bods-seller-sec>*{min-width:0;max-width:100%}
.bods-seller-tabs,.bods-cattabs,.bods-seller-grid,.bods-product-grid{min-width:0;max-width:100%}
.bods-product-card,.bods-product-info{min-width:0}
.bods-product-info h3,.bods-product-info a{overflow-wrap:anywhere}
.bods-storefront img,.bods-storefront video,.bods-storefront canvas{max-width:100%;height:auto}
@media (max-width:359px){.bods-storefront{min-width:0}}
