/* ══════════════════════════════════════════════════════════════════════════
   XCORP — LỚP TỐI ƯU DI ĐỘNG  (Thanh 11/10/2026)

   Sếp Long: "Trang chủ trên mobile chưa tối ưu, 1 số phần nên để slide sẽ
   tinh gọn hơn. Hiện tại đang thô quá."

   Số đo thật trên iPhone 390px TRƯỚC khi sửa (Playwright, không phải ước
   lượng): trang cao 22.867px = **27 màn hình**; riêng khối sản phẩm
   10.487px (19 thẻ xếp dọc) = 12 màn; 176 chỗ chữ dưới 13px; 46 nút/liên
   kết nhỏ hơn 40px (chuẩn chạm tay là 44px).

   Toàn bộ tệp này nằm trong @media (max-width: 767px) — máy tính KHÔNG đổi
   một pixel nào. Gỡ tệp ra là về nguyên trạng.
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {

  /* ── 1. Chữ nền: 176 chỗ dưới 13px, đọc trên tay rất mỏi ─────────────── */
  body { -webkit-text-size-adjust: 100%; }
  .text-xs  { font-size: 13px !important; line-height: 1.55 !important; }
  .text-\[10px\], .text-\[11px\] { font-size: 13px !important; }
  .text-sm  { font-size: 14px !important; line-height: 1.6 !important; }

  /* ── 2. Hero: đang chiếm 1,5 màn chỉ để nói một câu ──────────────────── */
  .hero-title {
    font-size: 26px !important;
    line-height: 1.22 !important;
    letter-spacing: -.015em !important;
    margin-bottom: 14px !important;
    text-wrap: balance;
  }
  /* 10 dòng chữ căn giữa đọc rất mỏi mắt — chuyển sang căn trái, dòng ngắn */
  .hero-desc {
    font-size: 15px !important;
    line-height: 1.62 !important;
    text-align: left !important;
    margin-bottom: 18px !important;
  }
  /* viên badge dài quá nên xuống 2 dòng, chấm tròn lạc hẳn sang mép trái */
  .hero-title { text-align: left !important; }
  .hero-title ~ *, .hero-desc { text-align: left !important; }
  section:first-of-type .inline-flex.rounded-full {
    align-items: flex-start !important;
    padding: 9px 14px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    text-align: left !important;
  }
  section:first-of-type .inline-flex.rounded-full > span:first-child { margin-top: 4px; }
  /* khung minh hoạ "Digital Operations Center" chỉ để trang trí, thu nhỏ lại */
  section:first-of-type .rounded-2xl img,
  section:first-of-type .rounded-3xl img { max-height: 190px !important; object-fit: cover !important; }

  /* ── 3. Chạm tay: tối thiểu 44px theo chuẩn của Apple/Google ─────────── */
  /* 🔴 Bản đầu em viết `display: inline-flex !important` cho mọi a/button
     trong header. Tailwind ẩn nút "Tư Vấn Hợp Tác" bằng lớp `hidden`
     (display:none), mà !important của em ĐÈ LÊN nó ⇒ nút hiện ra trên
     điện thoại, chữ bẻ thành 4 dòng, đầu trang phình từ 79px lên 143px.
     Chỉ đặt chiều cao tối thiểu, tuyệt đối không động vào `display`. */
  header a:not(.hidden), header button:not(.hidden),
  [data-category] { min-height: 44px; }
  header button[id*="menu"] { min-height: 44px; min-width: 44px; }
  /* Nút VI/EN: bộ chuyển ngôn ngữ nay là `.lang-switch` chứ không còn mang
     lớp `rounded-xl` của Tailwind, nên quy tắc cũ bám vào `[class*="rounded"]`
     đã không còn trúng đích. Nhắm thẳng vào `.lang-btn`. */
  .lang-switch { align-self: center; }
  .lang-btn { padding-top: 11px !important; padding-bottom: 11px !important; }

  /* Thu gọn nhận diện thương hiệu cho vừa màn hình hẹp */
  .brand-mark { height: 38px; width: 38px; }
  .brand-wordmark { font-size: 20px; }
  .brand-slogan { font-size: 9px; letter-spacing: .12em; margin-top: 4px; }
  .brand-lockup { gap: 9px; }

  /* ── 4. Giãn cách: mỗi khối đang cách nhau cả màn hình ───────────────── */
  section { padding-top: 34px !important; padding-bottom: 34px !important; }
  section h2 { font-size: 23px !important; line-height: 1.25 !important; }
  section > div > p.text-center { font-size: 14.5px !important; }
  .mt-16 { margin-top: 26px !important; }
  .mb-16 { margin-bottom: 26px !important; }
  .gap-7, .gap-6 { gap: 14px !important; }

  /* ── 5. SLIDE NGANG — đúng ý Sếp, và là chỗ ăn nhiều màn hình nhất ──── */
  /* Dùng scroll-snap thuần CSS: không thêm thư viện, không thêm JS nặng,
     vuốt bằng ngón tay mượt như ứng dụng. */
  .xc-slide {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-padding-left: 16px;
    gap: 12px !important;
    padding: 2px 16px 14px 16px;
    margin-left: -16px;
    margin-right: -16px;
    scrollbar-width: none;
  }
  .xc-slide::-webkit-scrollbar { display: none; }
  .xc-slide > * {
    flex: 0 0 80% !important;
    max-width: 80% !important;
    scroll-snap-align: start;
    margin: 0 !important;
  }
  .xc-slide > *:last-child { margin-right: 16px !important; }

  /* thanh chỉ vị trí + lời nhắc vuốt */
  .xc-slide-hint {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 12px; color: #64748b; margin-top: 2px;
  }
  .xc-dots { display: flex; justify-content: center; gap: 5px; margin-top: 10px; }
  .xc-dots i {
    width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1;
    transition: width .2s, background .2s; display: block;
  }
  .xc-dots i.on { width: 18px; background: #1d4ed8; }

  /* ── 6. Lưới 2 cột ở màn 390px: mỗi ô chỉ còn 175px, chữ bị bóp ─────── */
  #about .grid.grid-cols-2 > * { padding: 14px 10px !important; }
  #about .grid.grid-cols-2 .text-3xl,
  #about .grid.grid-cols-2 .text-4xl { font-size: 26px !important; }

  /* ── 7. Bộ lọc danh mục sản phẩm: cuộn ngang thay vì xuống 4 dòng ───── */
  .xc-filter-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 8px;
    padding: 2px 16px 10px 16px;
    margin-left: -16px; margin-right: -16px;
    scrollbar-width: none;
  }
  .xc-filter-row::-webkit-scrollbar { display: none; }
  .xc-filter-row > * { flex: 0 0 auto !important; white-space: nowrap; }
  /* 🔴 Hàng lọc bị cuộn sẵn sang giữa vì trang tự `scrollIntoView` nút đang
     chọn. Neo lại để luôn bắt đầu từ nút đầu tiên. */
  .xc-filter-row { scroll-snap-type: x proximity; scroll-padding-left: 16px; }
  .xc-filter-row > *:first-child { scroll-snap-align: start; margin-left: 0 !important; }

  /* ── 8. Chân trang 844px = đúng một màn hình chỉ để xem liên kết ────── */
  footer { padding-top: 28px !important; padding-bottom: 24px !important; }
  footer .grid { gap: 18px !important; }

  /* ── 9. Ba khối còn dài sau khi đã cắt: đội ngũ 2.092px, liên hệ 1.629px ─ */
  #team .grid, #contact .grid, #faq .grid { gap: 12px !important; }
  #team .grid > *, #contact .grid > * { padding: 14px !important; }
  #faq details, #faq .faq-item { padding: 12px 14px !important; }
  #team h3, #contact h3 { font-size: 15px !important; }

  /* ── 10. Ẩn bớt trên điện thoại (Sếp yêu cầu 11/10 tối) ──────────────── */
  /* "Những Điều Cần Biết Về XCORP" = khối #faq, cao 1.154px trên màn 390px.
     Trên máy tính vẫn giữ nguyên, chỉ ẩn ở điện thoại cho gọn. */
  #faq { display: none !important; }
  /* liên kết tới nó trong menu/chân trang cũng ẩn theo, kẻo bấm vào không tới đâu */
  a[href="#faq"] { display: none !important; }

  /* Ảnh/khối trang trí chỉ tốn chiều cao trên điện thoại */
  .xc-an-didong { display: none !important; }

  /* ── 11. Siết tiếp các khối còn dài ──────────────────────────────────── */
  /* Đội ngũ & Lịch sử: 1.985px. Mốc thời gian xếp dọc, mỗi mốc một thẻ to. */
  #team .grid > *, #team li { padding: 12px 14px !important; }
  #team p { font-size: 13.5px !important; line-height: 1.55 !important; }
  #team .text-3xl, #team .text-4xl { font-size: 22px !important; }

  /* Liên hệ: 1.718px — hai ô địa chỉ và biểu mẫu đều rất thoáng */
  #contact .grid > * { padding: 14px !important; }
  #contact input, #contact textarea, #contact select {
    padding: 11px 13px !important; font-size: 15px !important;  /* 15px: iOS không tự phóng to */
  }
  #contact textarea { min-height: 96px !important; }
  #contact label { font-size: 13px !important; margin-bottom: 4px !important; }

  /* Chân trang.
     🔴 Quy tắc cũ ép `grid-template-columns: repeat(2, …) !important` để bẻ
     chân trang về 2 cột. Chân trang dựng lại 12/10 đã dùng lưới 12 cột và tự
     khai `col-span-12` cho khối thương hiệu / `col-span-6` cho mỗi nhóm liên
     kết, tức ĐÃ là 2 cột trên điện thoại. Giữ quy tắc cũ thì `span 12` rơi vào
     lưới chỉ có 2 rãnh ⇒ vỡ bố cục. Bỏ hẳn, để lưới 12 cột tự lo. */
  footer li { line-height: 1.7 !important; }
  footer h4, footer h3 { margin-bottom: 7px !important; }
  /* Thông tin liên hệ: thu lại cho vừa màn hẹp */
  .ft-contact { font-size: 11.5px !important; max-width: none !important; gap: 6px !important; }
  .ft-company { margin-top: 13px !important; }
  .ft-list { gap: 5px !important; }
  /* 🔴 Liên kết "Lên đầu trang" ở thanh đáy nằm ĐÚNG dưới nút tròn nổi cùng
     chức năng, bị nó che mất một nửa. Trên điện thoại bỏ chữ, giữ nút nổi. */
  .ft-top { display: none !important; }
  .ft-bottom { padding-top: 14px !important; padding-right: 58px; }

  /* Khoảng trắng giữa tiêu đề mục và nội dung */
  section > div > .text-center { margin-bottom: 18px !important; }

  /* ── 12. Vòng siết thứ hai (Sếp: "vẫn chưa ưng") ─────────────────────── */
  /* Số đo trước vòng này: đội ngũ 1.938px · liên hệ 1.719px · chân trang 925px.

     Đội ngũ: 4 thẻ vai trò (Chuyên Gia SEO, UI/UX…) đang xếp MỘT CỘT, mỗi
     thẻ ~350px chỉ để chứa một biểu tượng + hai dòng chữ. Xếp hai cột là
     vừa đẹp ở 390px mà cắt được gần nửa chiều cao. */
  #team .grid.grid-cols-1 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  #team .grid.grid-cols-1 > * { padding: 14px 10px !important; text-align: center; }
  #team .grid.grid-cols-1 h3 { font-size: 13.5px !important; line-height: 1.3 !important; }
  #team .grid.grid-cols-1 p  { font-size: 13px !important; line-height: 1.5 !important; }
  /* biểu tượng tròn to 64px -> 44px */
  #team .grid.grid-cols-1 .w-14, #team .grid.grid-cols-1 .w-16 { width: 44px !important; height: 44px !important; }

  /* Cột mốc phát triển: mỗi mốc đang chiếm gần một màn */
  #team .border-l, #team ol, #team ul { padding-left: 14px !important; }
  #team li { padding-bottom: 14px !important; }

  /* Liên hệ: danh sách thông tin giãn quá, biểu mẫu thì ô nào cũng cao */
  #contact li, #contact .flex.items-start { margin-bottom: 10px !important; }
  #contact li p, #contact .flex.items-start p { line-height: 1.5 !important; }
  #contact form > div, #contact form label + * { margin-bottom: 10px !important; }
  #contact form label { margin-bottom: 3px !important; display: block; }
  #contact input, #contact textarea, #contact select {
    padding: 10px 12px !important;
    font-size: 16px !important;   /* 16px: iOS KHÔNG tự phóng to khi gõ */
    line-height: 1.35 !important;
  }
  #contact textarea { min-height: 84px !important; }

  /* Chân trang trên màn rất hẹp */
  footer { padding-top: 22px !important; padding-bottom: 18px !important; }
  footer li, footer a { font-size: 12.5px !important; line-height: 1.65 !important; }
  /* Khối liên hệ cố tình nhỏ hơn danh sách liên kết — đừng để quy tắc
     `footer a` ở trên kéo email/điện thoại to ngược trở lại. */
  .ft-contact, .ft-contact li, .ft-contact .ft-a { font-size: 11.5px !important; }
  footer .space-y-3 > * + *, footer .space-y-4 > * + * { margin-top: 4px !important; }

  /* Hero: khung minh hoạ "Digital Operations Center" chỉ để trang trí */
  section:first-of-type .rounded-2xl, section:first-of-type .rounded-3xl { margin-top: 14px !important; }

  /* Nút "lên đầu trang" đang che mất nội dung góc phải */
  [class*="fixed"][class*="bottom-"] { bottom: 14px !important; right: 14px !important; }

  /* ── 13. Khối "Về XCORP": hai thẻ 612px và 635px xếp dọc ─────────────── */
  /* `p-8` = 32px đệm bốn phía trên màn 390px là quá rộng tay. */
  #about .editorial-card, .editorial-card { padding: 16px !important; }
  #about .editorial-card p, .editorial-card p { font-size: 13.5px !important; line-height: 1.6 !important; }
  #about .editorial-card h3, .editorial-card h3 { font-size: 15px !important; }
  #about .editorial-card li, .editorial-card li { line-height: 1.6 !important; }
  #about .space-y-6 > * + *, #about .space-y-8 > * + * { margin-top: 12px !important; }
  #about .mb-16 { margin-bottom: 20px !important; }
}
