// live-sections.jsx — interactive content sections for the Bôn Lê site

/* Service catalog (with type filter tags) */
const SERVICES = [
  { route: "Huế — Đà Nẵng",   from: "Huế", to: "Đà Nẵng",     type: "Xe ghép 7 chỗ",       desc: "1 vé ghép xe Fortuner",    price: "150.000đ", tag: "ghep", hot: true },
  { route: "Huế — Đà Nẵng",   from: "Huế", to: "Đà Nẵng",     type: "Xe ghép Limousine",   desc: "1 vé ghép xe Limousine",   price: "180.000đ", tag: "limo" },
  { route: "Huế — Đà Nẵng",   from: "Huế", to: "Đà Nẵng",     type: "Bao xe 4 chỗ",        desc: "Đi riêng",         price: "700.000đ", tag: "bao" },
  { route: "Huế — Đà Nẵng",   from: "Huế", to: "Đà Nẵng",     type: "Bao xe 7 chỗ",        desc: "Đi riêng — Fortuner",      price: "900.000đ", tag: "bao" },
  { route: "Huế — Đà Nẵng",   from: "Huế", to: "Đà Nẵng",     type: "Bao Limousine 9 chỗ", desc: "Đoàn lớn, VIP",            price: "1.500.000đ", tag: "limo" },
  { route: "Huế — Hội An",    from: "Huế", to: "Hội An",      type: "Bao xe 4 chỗ",        desc: "Đi riêng",         price: "900.000đ", tag: "bao" },
  { route: "Huế — Hội An",    from: "Huế", to: "Hội An",      type: "Bao xe 7 chỗ",        desc: "Đi riêng — Fortuner",      price: "1.100.000đ", tag: "bao" },
  { route: "Đà Nẵng — Hội An",from: "Đà Nẵng", to: "Hội An",   type: "Bao xe 4 chỗ",        desc: "Sân bay → Phố cổ",         price: "250.000đ", tag: "bao" },
  { route: "Đà Nẵng — Hội An",from: "Đà Nẵng", to: "Hội An",   type: "Bao xe 7 chỗ",        desc: "Đi nhóm, gia đình",        price: "300.000đ", tag: "bao" },
];

const FILTERS = [
  { key: "all",  label: "Tất cả" },
  { key: "ghep", label: "Xe ghép" },
  { key: "limo", label: "Limousine" },
  { key: "bao",  label: "Bao xe" },
];

const FAQ_DATA = [
  { q: "Bôn Lê có đón tận nhà không?", a: "Có. Bôn Lê đón và trả khách tại địa chỉ trong nội thành 3 tỉnh (Huế, Đà Nẵng, Quảng Nam). Khu vực ngoại thành báo trước 1 giờ để sắp xếp tài xế." },
  { q: "Thanh toán bằng cách nào?", a: "Tiền mặt khi xuống xe, chuyển khoản trước, hoặc quét QR (Momo, ZaloPay, VietQR)." },
  { q: "Có thể huỷ chuyến không?", a: "Miễn phí huỷ trước giờ khởi hành 2 tiếng. Các bạn nhớ báo trước cho tài xế càng sớm càng tốt nhé!" },
  { q: "Trẻ em có tính phí riêng không?", a: "Trẻ dưới 5 tuổi đi cùng người lớn miễn phí (ngồi chung ghế). Trẻ từ 5 tuổi tính như người lớn để đảm bảo chỗ ngồi riêng và an toàn." },
  { q: "Có hỗ trợ hành lý không?", a: "Mỗi khách 1 vali ≤ 20kg + 1 ba lô tay. Hành lý dư báo trước. Limousine và Bao xe có khoang chứa rộng hơn." },
  { q: "Có nhận giao hàng hộ giữa các tỉnh không?", a: "Có. Bôn Lê nhận giao hàng nhỏ giữa Huế · Đà Nẵng · Hội An theo từng chuyến xe. Phí chỉ từ 80.000đ/kiện. Liên hệ hotline để báo trước kích thước." },
];

const GALLERY = [
  "Kia Carnival – Đen", "Toyota Fortuner – Trắng", "Kia Carnival – Sau",
  "Fortuner – Hậu", "Fortuner – Trước trắng", "Fortuner – Đen",
  "Limousine Dcar nội thất", "Văn phòng Huế", "Ford Transit limousine",
];

const REVIEWS = [
  { name: "Chị Ngọc Anh",  role: "Khách thường xuyên", stars: 5,
    text: "Đợt đi công tác Đà Nẵng – Huế mình đã đồng hành với em này 4 lượt. Xe êm, sạch sẽ, tài xế thì khỏi chê — luôn vui vẻ nhiệt tình. Khi nào có dịp nhất định mình cũng sẽ đồng hành cùng em ý." },
  { name: "Chị Trang Xinh",role: "Du khách Hà Nội",    stars: 5,
    text: "Lần đầu vào Huế chơi cùng gia đình, đặt xe Bôn Lê qua Zalo. Tài xế đúng giờ, biết đường, biết chỗ ăn ngon. Bé nhà mình 3 tuổi đi suốt 3 tiếng không quấy khóc." },
  { name: "Anh Minh Quân", role: "Doanh nhân ĐN",      stars: 5,
    text: "Tuần nào cũng phải đi sân bay Đà Nẵng 1-2 lần, đặt Bôn Lê Limousine rồi yên tâm ngủ trên xe. Đáng đồng tiền bát gạo. Đặc biệt thích chỗ luôn có nước suối lạnh." },
  { name: "Chị Mỹ Linh",   role: "Khách Hội An",       stars: 5,
    text: "Xe ghép đi Đà Nẵng giá rẻ hơn taxi nhiều mà chất lượng vẫn ổn. Tài xế anh Tâm rất tận tâm, dừng nghỉ giữa đường cho khách. Đặt qua web tiện cực." },
  { name: "Anh Đức",       role: "Khách quốc tế",      stars: 5,
    text: "Tour Huế – Đà Nẵng – Hội An 3 ngày, đoàn 9 người. Limousine của Bôn Lê quá ổn. Anh tài nói được chút tiếng Anh, lễ phép, biết chiều khách. 10/10 sẽ quay lại." },
];

const NEWS = [
  { tag: "Dịch vụ", title: "Dịch vụ xe ghép Huế — Đà Nẵng — Hội An | Nhà Xe Bôn Lê", date: "24.05.2026", time: "8:25", read: "5 phút", excerpt: "Tổng hợp các tuyến và bảng giá mới nhất 2026, mẹo chọn dịch vụ phù hợp cho từng nhu cầu di chuyển." },
  { tag: "Du lịch", title: "Khám phá hành trình du lịch Huế — Đà Nẵng", date: "24.05.2026", time: "8:26", read: "8 phút", excerpt: "Cẩm nang 3 ngày 2 đêm xuyên ba thành phố — điểm đến không thể bỏ qua, quán ăn địa phương và lưu ý đi xe." },
  { tag: "Vận chuyển", title: "Dịch vụ nhận gửi hàng hoá an toàn, nhanh chóng và tiện lợi", date: "24.05.2026", time: "8:25", read: "4 phút", excerpt: "Bôn Lê mở rộng dịch vụ gửi hàng kèm chuyến — bảng giá theo kích thước, cam kết giao đúng giờ." },
];

/* ── Section heading reused ───────────────────────────────────── */
function SectionHead({ eyebrow, title, sub, light }) {
  const m = useIsMobile();
  return (
    <div style={{ textAlign: "center" }}>
      <div style={{ display: "inline-flex", alignItems: "center", gap: 8, padding: "6px 14px", borderRadius: 999,
        background: light ? "rgba(232,155,74,0.18)" : "rgba(232,155,74,0.14)",
        color: light ? "var(--c-accent)" : "var(--c-accent-deep)",
        fontSize: 11, fontWeight: 800, letterSpacing: "0.12em", textTransform: "uppercase" }}>
        <span style={{ width: 5, height: 5, borderRadius: "50%", background: light ? "var(--c-accent)" : "var(--c-accent-deep)" }}/>{eyebrow}
      </div>
      <h2 style={{ fontSize: m ? 28 : 48, fontWeight: 800, color: light ? "#fff" : "var(--c-navy)", letterSpacing: "-0.03em", lineHeight: 1.15, marginTop: 14, padding: m ? "0 6px" : 0 }}>{title}</h2>
      {sub && <p style={{ fontSize: m ? 14 : 16, color: light ? "rgba(255,255,255,0.65)" : "var(--c-ink-soft)", marginTop: 12, maxWidth: 640, margin: "12px auto 0", padding: m ? "0 6px" : 0 }}>{sub}</p>}
    </div>
  );
}

/* ── 5. Services — filterable ─────────────────────────────────── */
function Services({ onBook }) {
  const [filter, setFilter] = React.useState("all");
  const m = useIsMobile();
  const visible = SERVICES
    .map((s, origIdx) => ({ ...s, origIdx }))
    .filter(s => filter === "all" || s.tag === filter);

  return (
    <section id="dich-vu" style={{ padding: m ? "60px 16px" : "100px 56px" }}>
      <SectionHead eyebrow="Dịch vụ" title="Lựa chọn phù hợp cho mọi hành trình" sub="Giá niêm yết. Đón tận nơi miễn phí trong nội thành ba tỉnh."/>

      {/* Filter tabs */}
      <div style={{ display: "flex", justifyContent: m ? "flex-start" : "center", gap: 8, marginTop: m ? 24 : 36, overflowX: m ? "auto" : "visible", padding: m ? "4px 4px" : 0, scrollbarWidth: "none" }}>
        {FILTERS.map(f => {
          const on = filter === f.key;
          const count = f.key === "all" ? SERVICES.length : SERVICES.filter(s => s.tag === f.key).length;
          return (
            <button key={f.key} onClick={() => setFilter(f.key)} style={{
              padding: m ? "8px 14px" : "10px 20px", borderRadius: 999, fontSize: m ? 12 : 13, fontWeight: 700, cursor: "pointer",
              border: on ? "1px solid var(--c-navy)" : "1px solid var(--c-line-strong)",
              background: on ? "var(--c-navy)" : "transparent",
              color: on ? "#fff" : "var(--c-ink)",
              display: "inline-flex", alignItems: "center", gap: 8, transition: "all .2s", flex: "0 0 auto"
            }}>
              {f.label}
              <span style={{
                padding: "2px 8px", borderRadius: 999, fontSize: 11, fontWeight: 800,
                background: on ? "rgba(255,255,255,0.15)" : "rgba(11,37,69,0.06)",
                color: on ? "rgba(255,255,255,0.85)" : "var(--c-mute)"
              }}>{count}</span>
            </button>
          );
        })}
      </div>

      {/* Grid */}
      <div style={{ display: "grid", gridTemplateColumns: m ? "1fr" : "repeat(3, 1fr)", gap: m ? 16 : 22, marginTop: m ? 24 : 36 }}>
        {visible.map((s, i) => (
          <Reveal key={s.origIdx} delay={(i % 3) * 0.08 + Math.floor(i / 3) * 0.05}>
          <article onClick={() => { window.location.href = "tel:+84886075075"; }} style={{
            background: "var(--c-paper)", borderRadius: 18, overflow: "hidden",
            border: "1px solid var(--c-line)", cursor: "pointer", transition: "transform .2s, box-shadow .2s",
          }}
          onMouseEnter={(e) => { e.currentTarget.style.transform = "translateY(-4px)"; e.currentTarget.style.boxShadow = "0 24px 50px rgba(11,37,69,0.12)"; }}
          onMouseLeave={(e) => { e.currentTarget.style.transform = ""; e.currentTarget.style.boxShadow = ""; }}>
            <ImageSlot src={SITE_IMAGES.services[s.origIdx]} alt={`Phong cảnh ${s.route}`} fallbackLabel={`PHONG CẢNH — ${s.route.toUpperCase()}`} style={{ height: 220, borderRadius: 0, position: "relative", fontSize: 11 }}>
              <div style={{ position: "absolute", top: 14, left: 14, display: "flex", gap: 6 }}>
                <span style={{ background: s.hot ? "var(--c-accent)" : "var(--c-paper)", color: s.hot ? "var(--c-navy-deep)" : "var(--c-navy)", padding: "5px 10px", borderRadius: 999, fontSize: 10, fontWeight: 800, letterSpacing: "0.06em", boxShadow: "0 2px 8px rgba(0,0,0,0.1)" }}>{s.type.toUpperCase()}</span>
                {s.hot && <span style={{ background: "var(--c-paper)", color: "var(--c-accent-deep)", padding: "5px 10px", borderRadius: 999, fontSize: 10, fontWeight: 800, letterSpacing: "0.06em", boxShadow: "0 2px 8px rgba(0,0,0,0.1)" }}>★ NỔI BẬT</span>}
              </div>
            </ImageSlot>
            <div style={{ padding: "22px 24px 24px" }}>
              <h3 style={{ fontSize: 22, fontWeight: 800, color: "var(--c-navy)", letterSpacing: "-0.02em" }}>{s.route}</h3>
              <p style={{ fontSize: 13, color: "var(--c-ink-soft)", marginTop: 6 }}>{s.desc}</p>
              <div style={{ display: "flex", alignItems: "baseline", justifyContent: "space-between", marginTop: 18, paddingTop: 16, borderTop: "1px dashed var(--c-line-strong)" }}>
                <div>
                  <div style={{ fontSize: 10, fontWeight: 700, color: "var(--c-mute)", letterSpacing: "0.1em", textTransform: "uppercase" }}>Giá</div>
                  <div style={{ fontSize: 26, fontWeight: 800, color: "var(--c-accent-deep)", letterSpacing: "-0.02em", marginTop: 2 }}>{s.price}</div>
                </div>
                <a href="tel:+84886075075" onClick={(e) => e.stopPropagation()} style={{ background: "var(--c-navy)", color: "#fff", border: 0, padding: "10px 16px", borderRadius: 10, fontSize: 13, fontWeight: 700, display: "flex", alignItems: "center", gap: 8, cursor: "pointer", textDecoration: "none" }}>
                  <Ico.phone className="ico" style={{ width: 13, height: 13 }}/> Đặt ngay
                </a>
              </div>
            </div>
          </article>
          </Reveal>
        ))}
      </div>

      {visible.length === 0 && (
        <div style={{ textAlign: "center", padding: "60px 0", color: "var(--c-mute)", fontSize: 15 }}>
          Không có dịch vụ phù hợp với bộ lọc này.
        </div>
      )}
    </section>
  );
}

/* ── 6. Price table — searchable ──────────────────────────────── */
function PriceTable({ onBook }) {
  const [q, setQ] = React.useState("");
  const m = useIsMobile();
  const rows = SERVICES.filter(s => {
    const blob = `${s.route} ${s.type} ${s.desc}`.toLowerCase();
    return blob.includes(q.toLowerCase());
  });
  return (
    <section id="bang-gia" style={{ padding: m ? "60px 16px" : "100px 56px", background: "var(--c-cream)" }}>
      <SectionHead eyebrow="Bảng giá" title="Bảng giá xe Huế — Đà Nẵng — Hội An" sub="Áp dụng từ 05/2026. Đón tận nơi miễn phí trong nội thành ba tỉnh."/>

      <div style={{ maxWidth: 1180, margin: m ? "28px auto 0" : "48px auto 0" }}>
        {/* Search */}
        <div style={{ display: "flex", alignItems: "center", gap: 12, marginBottom: 18, flexWrap: "wrap" }}>
          <div style={{ flex: 1, position: "relative", minWidth: m ? "100%" : "auto" }}>
            <input
              type="search"
              placeholder="Tìm theo tuyến hoặc loại xe…"
              value={q} onChange={(e) => setQ(e.target.value)}
              style={{
                width: "100%", padding: "14px 16px 14px 44px",
                border: "1px solid var(--c-line-strong)", borderRadius: 12,
                fontSize: 14, background: "var(--c-paper)", outline: "none", fontFamily: "inherit"
              }}
            />
            <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="var(--c-mute)" strokeWidth="1.8" strokeLinecap="round" style={{ position: "absolute", left: 16, top: "50%", transform: "translateY(-50%)" }}>
              <circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/>
            </svg>
          </div>
          <div style={{ fontSize: 13, color: "var(--c-mute)", fontWeight: 600 }}>
            {rows.length} / {SERVICES.length} dịch vụ
          </div>
        </div>

        {/* Mobile: cards. Desktop: table. */}
        {m ? (
          <div style={{ display: "grid", gap: 12 }}>
            {rows.length === 0 && (
              <div style={{ padding: "40px 20px", textAlign: "center", color: "var(--c-mute)", background: "var(--c-paper)", borderRadius: 16 }}>
                Không tìm thấy dịch vụ khớp với "{q}".
              </div>
            )}
            {rows.map((r, i) => (
              <div key={i} style={{ background: "var(--c-paper)", borderRadius: 14, padding: 16, border: "1px solid var(--c-line)", display: "grid", gap: 8 }}>
                <div style={{ fontSize: 15, fontWeight: 800, color: "var(--c-navy)" }}>{r.route}</div>
                <div style={{ fontSize: 13, color: "var(--c-ink-soft)" }}>{r.type} · <span style={{ color: "var(--c-mute)" }}>{r.desc}</span></div>
                <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", marginTop: 4 }}>
                  <div style={{ fontSize: 20, fontWeight: 800, color: "var(--c-accent-deep)" }}>{r.price}</div>
                  <a href="tel:+84886075075" style={{ padding: "9px 16px", background: "var(--c-navy)", color: "#fff", border: 0, borderRadius: 10, fontSize: 12, fontWeight: 800, cursor: "pointer", display: "flex", alignItems: "center", gap: 6, textDecoration: "none" }}>
                    <Ico.phone className="ico" style={{ width: 12, height: 12 }}/> Đặt
                  </a>
                </div>
              </div>
            ))}
          </div>
        ) : (
          <div style={{ background: "var(--c-paper)", borderRadius: 20, overflow: "hidden", boxShadow: "0 20px 40px rgba(11,37,69,0.08), 0 0 0 1px var(--c-line)" }}>
            <div style={{ display: "grid", gridTemplateColumns: "1.2fr 1.4fr 1fr 140px", background: "var(--c-navy)", color: "#fff" }}>
              {["Hành trình", "Loại dịch vụ", "Giá / VND", ""].map((h, i) => (
                <div key={i} style={{ padding: "20px 24px", fontSize: 12, fontWeight: 800, letterSpacing: "0.12em", textTransform: "uppercase", borderLeft: i > 0 && i < 3 ? "1px solid rgba(255,255,255,0.1)" : "none" }}>{h}</div>
              ))}
            </div>
            {rows.length === 0 && (
              <div style={{ padding: "60px 20px", textAlign: "center", color: "var(--c-mute)" }}>
                Không tìm thấy dịch vụ khớp với "{q}".
              </div>
            )}
            {rows.map((r, i) => (
              <div key={i} style={{ display: "grid", gridTemplateColumns: "1.2fr 1.4fr 1fr 140px", borderTop: "1px solid var(--c-line)", background: i % 2 === 1 ? "var(--c-cream)" : "transparent", alignItems: "center" }}>
                <div style={{ padding: "18px 24px", fontSize: 14, fontWeight: 700, color: "var(--c-navy)" }}>{r.route}</div>
                <div style={{ padding: "18px 24px", fontSize: 14, color: "var(--c-ink)", borderLeft: "1px solid var(--c-line)" }}>{r.type} <span style={{ color: "var(--c-mute)", fontSize: 12 }}>· {r.desc}</span></div>
                <div style={{ padding: "18px 24px", fontSize: 16, fontWeight: 800, color: "var(--c-accent-deep)", borderLeft: "1px solid var(--c-line)" }}>{r.price}</div>
                <div style={{ padding: "12px 18px" }}>
                  <a href="tel:+84886075075" style={{ width: "100%", padding: "10px 14px", background: "var(--c-navy)", color: "#fff", border: 0, borderRadius: 10, fontSize: 12, fontWeight: 800, cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", gap: 6, textDecoration: "none", boxSizing: "border-box" }}>
                    <Ico.phone className="ico" style={{ width: 12, height: 12 }}/> Đặt
                  </a>
                </div>
              </div>
            ))}
          </div>
        )}
      </div>
    </section>
  );
}

/* ── 7. Why us ───────────────────────────────────────────────── */
function WhyUs() {
  const m = useIsMobile();
  const items = [
    { icon: "shield", t: "Uy Tín Và Đúng Giờ",       d: "Cam kết mang đến quý khách trải nghiệm an toàn và luôn đúng lịch trình." },
    { icon: "check",  t: "Giá Cả Cạnh Tranh",         d: "Mức giá tối ưu nhất, phù hợp với mọi nhu cầu di chuyển của bạn." },
    { icon: "car",    t: "Xe Mới, Sạch Sẽ, Êm Ái",    d: "Xe đời mới, nội thất sạch sẽ, chạy êm như ru — chỉ cần ngồi và tận hưởng." },
    { icon: "user",   t: "Đội Ngũ Tài Xế",             d: "Đội ngũ tài xế thân thiện, sẵn sàng hỗ trợ khách hàng tận tâm và chu đáo." },
  ];
  return (
    <section id="tai-sao" style={{ padding: m ? "60px 16px" : "100px 56px", background: "var(--c-navy)", color: "#fff", position: "relative", overflow: "hidden" }}>
      <div style={{ position: "absolute", right: -160, top: -160, width: 520, height: 520, borderRadius: "50%", background: "radial-gradient(circle, rgba(232,155,74,0.18), transparent 70%)" }}/>
      <div style={{ position: "relative" }}>
        <SectionHead light eyebrow="Tại sao chọn" title="Tại sao chọn Nhà Xe Bôn Lê" sub="Sự hài lòng của quý khách là niềm vui của chúng tôi."/>
        <div style={{ display: "grid", gridTemplateColumns: m ? "1fr 1fr" : "repeat(4, 1fr)", gap: m ? 12 : 20, marginTop: m ? 32 : 56 }}>
          {items.map((it, i) => {
            const I = Ico[it.icon];
            return (
              <Reveal key={i} delay={i * 0.1}>
              <div style={{ background: "rgba(255,255,255,0.06)", border: "1px solid rgba(255,255,255,0.12)", borderRadius: 18, padding: m ? 18 : 32, backdropFilter: "blur(8px)", height: "100%" }}>
                <div style={{ width: m ? 48 : 60, height: m ? 48 : 60, borderRadius: 16, background: "var(--c-accent)", color: "var(--c-navy-deep)", display: "flex", alignItems: "center", justifyContent: "center", boxShadow: "0 8px 20px rgba(232,155,74,0.35)" }}>
                  <I className="ico" style={{ width: m ? 22 : 28, height: m ? 22 : 28 }}/>
                </div>
                <h3 style={{ fontSize: m ? 15 : 20, fontWeight: 800, color: "#fff", marginTop: m ? 14 : 22, letterSpacing: "-0.015em" }}>{it.t}</h3>
                <p style={{ fontSize: m ? 12 : 14, color: "rgba(255,255,255,0.7)", lineHeight: 1.55, marginTop: 8 }}>{it.d}</p>
              </div>
              </Reveal>
            );
          })}
        </div>
      </div>
    </section>
  );
}

/* ── 8. Process ─────────────────────────────────────────────── */
function Process() {
  const m = useIsMobile();
  const steps = [
    { icon: "car",   t: "Liên hệ: Gọi/Zalo", d: "Đặt xe dễ dàng qua hotline hoặc Zalo. Tổng đài xác nhận ngày giờ đón." },
    { icon: "check", t: "Xác nhận", d: "Tài xế Bôn Lê gọi xác nhận trước giờ đón 15–30 phút." },
    { icon: "shield",t: "Thanh toán", d: "Thanh toán khi xuống xe bằng tiền mặt, QR hoặc chuyển khoản." },
  ];
  return (
    <section id="quy-trinh" style={{ padding: m ? "60px 16px" : "100px 56px" }}>
      <SectionHead eyebrow="Quy trình" title="Quy trình đặt xe đơn giản" sub="Chỉ 3 bước để có chuyến đi an toàn, đúng giờ."/>
      <div style={{ display: "grid", gridTemplateColumns: m ? "1fr" : "1fr 60px 1fr 60px 1fr", alignItems: "stretch", gap: m ? 28 : 0, marginTop: m ? 36 : 56, maxWidth: 1280, margin: m ? "36px auto 0" : "56px auto 0" }}>
        {steps.map((s, i) => {
          const I = Ico[s.icon];
          return (
            <React.Fragment key={i}>
              <Reveal delay={i * 0.15} style={{ height: "100%" }}>
              <div style={{ background: "var(--c-paper)", border: "1px solid var(--c-accent-soft)", borderRadius: 20, padding: m ? 24 : 36, textAlign: "center", position: "relative", height: "100%" }}>
                <div style={{ position: "absolute", top: -20, left: "50%", transform: "translateX(-50%)", padding: "4px 14px", borderRadius: 999, background: "var(--c-accent)", color: "var(--c-navy-deep)", fontSize: 11, fontWeight: 800, letterSpacing: "0.12em" }}>BƯỚC {i+1}</div>
                <div style={{ width: m ? 60 : 72, height: m ? 60 : 72, borderRadius: 18, background: "var(--c-cream)", border: "1px solid var(--c-accent-soft)", color: "var(--c-accent-deep)", display: "flex", alignItems: "center", justifyContent: "center", margin: "0 auto" }}>
                  <I className="ico" style={{ width: m ? 26 : 32, height: m ? 26 : 32 }}/>
                </div>
                <h3 style={{ fontSize: m ? 17 : 20, fontWeight: 800, color: "var(--c-navy)", marginTop: m ? 16 : 22, letterSpacing: "-0.015em" }}>{s.t}</h3>
                <p style={{ fontSize: m ? 13 : 14, color: "var(--c-ink-soft)", lineHeight: 1.6, marginTop: 10 }}>{s.d}</p>
              </div>
              </Reveal>
              {i < steps.length - 1 && !m && (
                <Reveal delay={i * 0.15 + 0.08} style={{ display: "flex", alignItems: "center", justifyContent: "center" }}>
                <div style={{ display: "flex", alignItems: "center", justifyContent: "center", color: "var(--c-accent-deep)" }}>
                  <svg viewBox="0 0 32 32" width="40" height="40" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
                    <path d="M6 16h20M18 8l8 8-8 8"/>
                  </svg>
                </div>
                </Reveal>
              )}
            </React.Fragment>
          );
        })}
      </div>
    </section>
  );
}

/* ── 9. Gallery — click to lightbox ──────────────────────────── */
function Gallery({ onOpen }) {
  const m = useIsMobile();
  return (
    <section id="thu-vien" style={{ padding: m ? "60px 16px" : "100px 56px", background: "var(--c-cream)" }}>
      <SectionHead eyebrow="Hình ảnh" title="Hình ảnh thực tế xe" sub="Một số hình ảnh thực tế của đội xe Bôn Lê."/>
      <div style={{ display: "grid", gridTemplateColumns: m ? "1fr 1fr" : "repeat(3, 1fr)", gap: m ? 10 : 16, marginTop: m ? 28 : 48 }}>
        {GALLERY.map((t, i) => (
          <Reveal key={i} delay={(i % 3) * 0.08 + Math.floor(i / 3) * 0.05}>
            <ImageSlot src={SITE_IMAGES.gallery[i]} alt={t} fallbackLabel={`ẢNH — ${t.toUpperCase()}`} onClick={() => onOpen(i)} style={{ height: m ? 140 : 240, borderRadius: m ? 12 : 16, fontSize: 11, cursor: "pointer", transition: "transform .25s" }}
              onMouseEnter={(e) => { e.currentTarget.style.transform = "scale(1.02)"; }}
              onMouseLeave={(e) => { e.currentTarget.style.transform = ""; }}/>
          </Reveal>
        ))}
      </div>
    </section>
  );
}

/* ── 10. Reviews — carousel with autoplay ────────────────────── */
function Reviews() {
  const [idx, setIdx] = React.useState(0);
  const [paused, setPaused] = React.useState(false);
  const m = useIsMobile();
  const visible = m ? 1 : 3;
  const max = REVIEWS.length;

  React.useEffect(() => {
    if (paused) return;
    const id = setInterval(() => setIdx(i => (i + 1) % max), 5000);
    return () => clearInterval(id);
  }, [paused, max]);

  const shown = Array.from({ length: visible }, (_, off) => REVIEWS[(idx + off) % max]);

  return (
    <section id="danh-gia" style={{ padding: m ? "60px 16px" : "100px 56px" }}
      onMouseEnter={() => setPaused(true)} onMouseLeave={() => setPaused(false)}>
      <div style={{ display: "flex", alignItems: m ? "flex-start" : "end", justifyContent: "space-between", flexDirection: m ? "column" : "row", gap: m ? 18 : 0 }}>
        <div style={{ width: m ? "100%" : "auto" }}>
          <SectionHead eyebrow="Đánh giá" title="Khách hàng nói gì về chúng tôi?" sub="Đánh giá thật từ những hành khách đã đồng hành cùng Bôn Lê."/>
        </div>
        <div style={{ display: "flex", gap: 8, alignSelf: m ? "center" : "auto" }}>
          <button onClick={() => setIdx((i) => (i - 1 + max) % max)} style={carouselBtn()} aria-label="Trước">‹</button>
          <button onClick={() => setIdx((i) => (i + 1) % max)} style={carouselBtn()} aria-label="Tiếp">›</button>
        </div>
      </div>

      <div style={{ display: "grid", gridTemplateColumns: m ? "1fr" : "repeat(3, 1fr)", gap: m ? 14 : 22, marginTop: m ? 24 : 36 }}>
        {shown.map((r, i) => (
          <div key={`${idx}-${i}`} style={{ background: "var(--c-paper)", border: "1px solid var(--c-line)", borderRadius: 20, padding: m ? 22 : 32, position: "relative", animation: "fadeIn .4s ease" }}>
            <svg viewBox="0 0 32 24" width="36" height="28" fill="var(--c-accent)" style={{ marginBottom: 14 }}>
              <path d="M0 24V12C0 5.4 4.4 0 11 0v4c-3.8 0-7 3.2-7 7v1h7v12H0Zm18 0V12c0-6.6 4.4-12 11-12v4c-3.8 0-7 3.2-7 7v1h7v12H18Z"/>
            </svg>
            <p style={{ fontSize: m ? 14 : 15, color: "var(--c-ink)", lineHeight: 1.65 }}>{r.text}</p>
            <div style={{ display: "flex", gap: 3, marginTop: 16 }}>
              {[...Array(r.stars)].map((_, i2) => <Ico.star key={i2} className="ico" style={{ width: 14, height: 14, color: "var(--c-accent)" }}/>)}
            </div>
            <div style={{ display: "flex", alignItems: "center", gap: 12, marginTop: 18, paddingTop: 18, borderTop: "1px dashed var(--c-line-strong)" }}>
              <ImageSlot src={SITE_IMAGES.reviews[(idx + i) % REVIEWS.length]} alt={r.name} fallbackLabel="AVT" style={{ width: 44, height: 44, borderRadius: "50%", fontSize: 8, flex: "0 0 auto" }}/>
              <div>
                <div style={{ fontSize: 15, fontWeight: 800, color: "var(--c-navy)" }}>{r.name}</div>
                <div style={{ fontSize: 12, color: "var(--c-mute)" }}>{r.role}</div>
              </div>
            </div>
          </div>
        ))}
      </div>

      {/* Dots */}
      <div style={{ display: "flex", justifyContent: "center", gap: 6, marginTop: m ? 22 : 28 }}>
        {REVIEWS.map((_, i) => (
          <button key={i} onClick={() => setIdx(i)} style={{
            width: i === idx ? 26 : 8, height: 8, borderRadius: 999, border: 0, cursor: "pointer", padding: 0,
            background: i === idx ? "var(--c-navy)" : "var(--c-line-strong)", transition: "all .2s"
          }} aria-label={`Đánh giá ${i+1}`}/>
        ))}
      </div>
    </section>
  );
}

function carouselBtn() {
  return { width: 44, height: 44, borderRadius: "50%", background: "var(--c-paper)", border: "1px solid var(--c-line-strong)", color: "var(--c-navy)", fontSize: 20, cursor: "pointer", fontWeight: 700 };
}

/* ── FAQ accordion ──────────────────────────────────────────── */
function FAQ() {
  const [open, setOpen] = React.useState(0);
  const m = useIsMobile();
  return (
    <section id="faq" style={{ padding: m ? "60px 16px" : "100px 56px", background: "var(--c-cream)" }}>
      <div style={{ display: "grid", gridTemplateColumns: m ? "1fr" : "1fr 1.6fr", gap: m ? 28 : 80, maxWidth: 1280, margin: "0 auto" }}>
        <div>
          <div style={{ display: "inline-flex", alignItems: "center", gap: 8, padding: "6px 14px", borderRadius: 999, background: "rgba(232,155,74,0.14)", color: "var(--c-accent-deep)", fontSize: 11, fontWeight: 800, letterSpacing: "0.12em", textTransform: "uppercase" }}>
            <span style={{ width: 5, height: 5, borderRadius: "50%", background: "var(--c-accent-deep)" }}/>FAQ
          </div>
          <h2 style={{ fontSize: m ? 26 : 44, fontWeight: 800, color: "var(--c-navy)", marginTop: 14, letterSpacing: "-0.025em", lineHeight: 1.15 }}>Câu hỏi thường gặp.</h2>
          <p style={{ fontSize: m ? 14 : 15, color: "var(--c-ink-soft)", marginTop: 12, lineHeight: 1.7 }}>
            Không thấy câu trả lời? Gọi tổng đài <a href="tel:+84886075075" style={{ color: "var(--c-navy)", fontWeight: 800, textDecoration: "none" }}>0886.075.075</a> hoặc nhắn Zalo — phản hồi trong 5 phút.
          </p>
          <a href="tel:+84886075075" style={{ marginTop: 20, background: "var(--c-navy)", color: "#fff", padding: "12px 20px", borderRadius: 10, fontSize: 13, fontWeight: 800, display: "inline-flex", alignItems: "center", gap: 10, textDecoration: "none" }}>
            <Ico.phone className="ico" style={{ width: 14, height: 14 }}/> Gọi ngay
          </a>
        </div>
        <div>
          {FAQ_DATA.map((f, i) => {
            const on = open === i;
            return (
              <div key={i} style={{
                marginBottom: 12, background: on ? "var(--c-paper)" : "transparent",
                border: on ? "1px solid var(--c-line)" : "1px solid transparent",
                borderBottom: "1px solid var(--c-line-strong)",
                borderRadius: on ? 14 : 0, overflow: "hidden", transition: "background .2s"
              }}>
                <button onClick={() => setOpen(on ? -1 : i)} style={{
                  width: "100%", textAlign: "left", padding: "20px 22px", background: "transparent", border: 0, cursor: "pointer",
                  display: "flex", alignItems: "center", justifyContent: "space-between", gap: 20, font: "inherit"
                }}>
                  <h3 style={{ fontSize: 16, fontWeight: 800, color: "var(--c-navy)", letterSpacing: "-0.01em", lineHeight: 1.4 }}>{f.q}</h3>
                  <div style={{ width: 28, height: 28, borderRadius: 8, background: on ? "var(--c-navy)" : "var(--c-cream)", color: on ? "#fff" : "var(--c-ink)", display: "flex", alignItems: "center", justifyContent: "center", flex: "0 0 auto", transition: "all .2s" }}>
                    {on ? <Ico.minus className="ico" style={{ width: 14, height: 14 }}/> : <Ico.plus className="ico" style={{ width: 14, height: 14 }}/>}
                  </div>
                </button>
                {on && <p style={{ fontSize: 14, color: "var(--c-ink-soft)", lineHeight: 1.7, padding: "0 22px 22px" }}>{f.a}</p>}
              </div>
            );
          })}
        </div>
      </div>
    </section>
  );
}

/* ── 12. News ───────────────────────────────────────────────── */
function News() {
  const m = useIsMobile();
  return (
    <section id="tin-tuc" style={{ padding: m ? "60px 16px" : "100px 56px" }}>
      <SectionHead eyebrow="Tin tức" title="Tin tức & cẩm nang đi miền Trung" sub="Cập nhật mới nhất từ đội ngũ Bôn Lê."/>
      <div style={{ display: "grid", gridTemplateColumns: m ? "1fr" : "repeat(3, 1fr)", gap: m ? 16 : 24, marginTop: m ? 28 : 56 }}>
        {NEWS.map((p, i) => (
          <Reveal key={i} delay={i * 0.1}>
          <article style={{ background: "var(--c-paper)", borderRadius: 18, overflow: "hidden", border: "1px solid var(--c-line)", cursor: "pointer", transition: "transform .2s, box-shadow .2s" }}
            onMouseEnter={(e) => { e.currentTarget.style.transform = "translateY(-4px)"; e.currentTarget.style.boxShadow = "0 24px 50px rgba(11,37,69,0.12)"; }}
            onMouseLeave={(e) => { e.currentTarget.style.transform = ""; e.currentTarget.style.boxShadow = ""; }}>
            <ImageSlot src={SITE_IMAGES.news[i]} alt={p.title} fallbackLabel={`ẢNH BÀI VIẾT — ${p.tag.toUpperCase()}`} style={{ height: m ? 180 : 220, borderRadius: 0, position: "relative", fontSize: 11 }}>
              <span style={{ position: "absolute", top: 14, left: 14, background: "var(--c-accent)", color: "var(--c-navy-deep)", padding: "5px 12px", borderRadius: 999, fontSize: 11, fontWeight: 800, letterSpacing: "0.06em" }}>{p.tag.toUpperCase()}</span>
            </ImageSlot>
            <div style={{ padding: 26 }}>
              <div style={{ display: "flex", alignItems: "center", gap: 14, fontSize: 12, color: "var(--c-mute)", fontWeight: 600 }}>
                <span style={{ display: "inline-flex", alignItems: "center", gap: 6 }}><Ico.cal className="ico" style={{ width: 13, height: 13 }}/>{p.date}</span>
                <span style={{ display: "inline-flex", alignItems: "center", gap: 6 }}><Ico.clock className="ico" style={{ width: 13, height: 13 }}/>{p.read}</span>
              </div>
              <h3 style={{ fontSize: 19, fontWeight: 800, color: "var(--c-navy)", marginTop: 12, lineHeight: 1.3, letterSpacing: "-0.015em" }}>{p.title}</h3>
              <p style={{ fontSize: 13, color: "var(--c-ink-soft)", marginTop: 10, lineHeight: 1.6 }}>{p.excerpt}</p>
              <div style={{ marginTop: 18, display: "flex", alignItems: "center", gap: 6, color: "var(--c-accent-deep)", fontSize: 13, fontWeight: 700 }}>
                Đọc tiếp <Ico.arrowR className="ico" style={{ width: 14, height: 14 }}/>
              </div>
            </div>
          </article>
          </Reveal>
        ))}
      </div>
    </section>
  );
}

Object.assign(window, { Services, PriceTable, WhyUs, Process, Gallery, Reviews, FAQ, News, SectionHead, GALLERY, SERVICES });
