:root{
  --bg:#f5f7fb;
  --text:#0b1324;
  --muted:#6b7280;
  --primary:#ffb200;
  --brand:#0d3b57;
  --card:#ffffff;
  --line:#e5e7eb;
  --green:#199a5b;

  /* Tham số điều khiển form chồng banner */
  --overlap-lift: 0.33;           /* nâng lên 1/3 chiều cao form => 2/3 form nằm dưới banner */
  --form-est-desktop: 300px;      /* ước lượng chiều cao form desktop */
  --form-est-mobile: 360px;       /* ước lượng chiều cao form mobile */
}
@media(max-width:768px){
  :root{ --overlap-lift: 0.33; }
}

/* ==== Reset & Base ==== */
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font:400 16px/1.5 system-ui,-apple-system,Segoe UI,Roboto}
a{color:inherit;text-decoration:none}
.wrap{width:min(1120px,92%);margin-inline:auto}

/* ==== Topbar ==== */
.topbar{position:sticky;top:0;z-index:2000;background:#fff;border-bottom:1px solid var(--line)}
.topbar .wrap{display:flex;align-items:center;gap:16px;padding:10px 0}
.brand{font-weight:800;color:#143249;font-size:18px}
.hotline{margin-left:auto;display:flex;align-items:center;gap:8px;color:#e48a25;font-weight:800}
.hamburger{margin-left:6px;width:34px;height:30px;display:inline-grid;gap:5px;background:transparent;border:0;cursor:pointer}
.hamburger span{display:block;height:3px;background:#111;border-radius:2px}

/* ==== Drawer Menu + Overlay ==== */
.drawer-overlay{position:fixed;inset:0;background:rgba(0,0,0,.35);opacity:0;visibility:hidden;transition:.2s;z-index:1990}
.drawer-overlay.show{opacity:1;visibility:visible}
.drawer{position:fixed;top:0;right:-320px;width:min(80%,320px);height:100vh;background:#fff;box-shadow:-8px 0 24px rgba(0,0,0,.18);padding:18px;display:flex;flex-direction:column;gap:14px;z-index:2001;transition:right .25s}
.drawer.open{right:0}
.drawer a{padding:12px 4px;border-bottom:1px solid var(--line)}
.drawer-close{position:absolute;top:8px;left:8px;border:0;background:#f1f3f6;width:34px;height:34px;border-radius:8px;cursor:pointer}

/* ==== Page spacing ==== */
.page{padding-bottom:72px}

/* ==== HERO + FORM ==== */
.hero{
  position:relative;
  overflow:visible;               /* cho phép form tràn khỏi banner */
  /* chừa khoảng phía dưới theo phần 2/3 form */
  padding-bottom: calc(var(--form-est-desktop) * (1 - (1 - var(--overlap-lift))));
  margin-bottom:0;
}
@media(max-width:768px){
  .hero{padding-bottom: calc(var(--form-est-mobile) * (1 - (1 - var(--overlap-lift))))}
}

/* Banner bo tròn góc */
.hero-bg{
  width:100%;
  height:clamp(260px,40vw,420px);
  object-fit:cover;
  display:block;
  border-bottom-left-radius:24px;
  border-bottom-right-radius:24px;
}

/* Form nổi – CĂN THEO MÉP TRÊN của form so với mép dưới banner
   - Đặt top:100% (đặt mép trên form tại mép dưới banner)
   - translateY(-33%) -> kéo ngược lên 1/3 chiều cao form (=> 2/3 nằm dưới) */
.search-card.light.fc{
  position:absolute;
  left:50%;
  top:100%;
  transform:translate(-50%, calc(-1 * var(--overlap-lift) * 100%));
  width:min(960px,92%);
  background:#fff;
  border-radius:16px;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
  padding:16px 14px 18px;
  z-index:1500;                   /* dưới header (2000), trên banner */
}
@media(max-width:768px){
  .search-card.light.fc{width:calc(100% - 24px);border-radius:14px}
}

/* ==== FORM STYLES ==== */
.fc-title{margin:0 0 8px;font-size:18px;font-weight:800;color:#1c2731}
.fc-row{margin:8px 0}
.fc-two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.fc-2col-mobile{grid-template-columns:1fr 1fr}
@media(max-width:360px){.fc-2col-mobile{grid-template-columns:1fr}}

.fc-field label,.fc-counter label{display:block;margin:0 0 6px;font-weight:700;color:#2b3a48}
.fc-field input[list],.fc-field input[type="date"]{width:100%;height:44px;border:1px solid #e7ebf0;background:#f8fafc;border-radius:12px;padding:0 12px;font-size:15px}

.fc-inline{display:flex;gap:18px;align-items:center}
.fc-radio{display:flex;gap:8px;align-items:center;font-weight:600;color:#2b3a48}
.fc-radio input{width:18px;height:18px}

/* Bộ đếm: rút gọn để KHÔNG vỡ layout trên mobile */
.fc-ctrbox{
  display:inline-grid;
  grid-template-columns:40px minmax(48px,1fr) 40px; /* nút gọn, ô số co giãn */
  gap:8px;align-items:center;
  max-width:220px;               /* khóa độ rộng cụm đếm */
}
@media(max-width:480px){
  .fc-ctrbox{grid-template-columns:36px minmax(44px,1fr) 36px;max-width:200px}
}
.fc-ctr{
  height:44px;width:100%;
  border:1px solid #e7ebf0;background:#f8fafc;border-radius:12px;
  font-size:20px;font-weight:800;cursor:pointer;line-height:1;
}
.fc-ctrval{
  height:44px;border:1px solid #e7ebf0;background:#fff;border-radius:12px;
  text-align:center;font-weight:800;font-size:16px;min-width:56px;max-width:100%;
}

.fc-check{display:flex;align-items:center;gap:10px;font-weight:600}
.fc-check input{width:18px;height:18px}
.btn-primary{display:inline-flex;align-items:center;justify-content:center;background:var(--primary);border:0;color:#111;font-weight:800;border-radius:12px;padding:12px 16px;cursor:pointer}
.btn-primary.big{width:100%;font-size:16px}

/* ==== Benefit Strip ==== */
.benefits{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:18px auto}
@media(max-width:800px){.benefits{grid-template-columns:repeat(2,1fr)}}
.b-item{background:#fff;border-radius:14px;padding:12px;display:flex;gap:10px;align-items:center;justify-content:center;box-shadow:0 1px 3px rgba(16,24,40,.06);text-align:center;font-weight:600}
.g-ic{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;color:#199a5b;font-size:18px}

/* ==== Sections ==== */
.section{margin:8px 0 18px}
.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.section h3{margin:0;font-size:20px}
.h-scroll{display:flex;gap:12px;overflow:auto;padding-bottom:4px}
.cards .card{min-width:220px;background:#fff;border:1px solid var(--line);border-radius:14px;overflow:hidden}
.cards img{width:100%;height:130px;object-fit:cover;display:block}
.card-body{padding:10px}
.route-title{font-weight:800}
.route-meta{color:var(--muted);font-size:13px}
.news h4{margin:0 0 4px;font-size:15px}

/* ==== Platform ==== */
.platform{background:#fff;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:16px;border-radius:16px}
.platform h3{margin:0 0 8px}
.features{list-style:none;margin:8px 0 0;padding:0;display:grid;grid-template-columns:1fr;gap:12px}
.features li{display:flex;gap:12px;align-items:flex-start}
.fi{width:28px;height:28px;border-radius:8px;background:#eef4ff;text-align:center;line-height:28px}
.fi.bus::before{content:"🚌"}
.fi.star::before{content:"⭐️"}
.fi.shield::before{content:"🛡️"}
.fi.tag::before{content:"🏷️"}

/* ==== App promo ==== */
.app-promo{display:grid;grid-template-columns:1.2fr .8fr;gap:16px;align-items:center;margin:18px auto}
.store-badges img{height:40px;margin-right:8px}
.app-illu{width:100%;border-radius:16px}

/* ==== Trust & Social ==== */
.trust{display:flex;flex-wrap:wrap;gap:14px;align-items:center;justify-content:center;margin:14px auto}
.trust img{filter:grayscale(1);opacity:.9}
.social h3{margin:6px 0}
.chip{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:999px;padding:8px 12px;background:#fff;margin-right:8px}

/* ==== Bottom nav ==== */
.bottom-nav{position:fixed;left:0;right:0;bottom:0;display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid var(--line);background:#fff;z-index:2000}
.bn-item{padding:10px 6px;display:flex;flex-direction:column;align-items:center;color:#475569;font-weight:600}
.bn-item svg{width:22px;height:22px;margin-bottom:4px}

/* ==== Footer ==== */
.site-footer{padding:40px 0 92px;color:var(--muted);text-align:center}

/* ==== Responsive tweaks ==== */
@media(min-width:900px){ .hero-bg{height:360px} .features{grid-template-columns:repeat(2,1fr)} }
@media(min-width:1200px){ .features{grid-template-columns:repeat(4,1fr)} }

/* ==== Loại bỏ override cũ làm sai mép căn ==== */
/* (KHÔNG dùng top: calc(100% - 2px) hay --drop nữa) */

/* ==== OVERLAP TUNING (form trồi lên nhiều hơn) ==== */
:root{
  /* Nâng lên ~2/3 chiều cao form  -> chỉ còn ~1/3 nằm dưới banner */
  --overlap-lift: 0.66;           /* desktop */
  --overlap-lift-mobile: 0.70;    /* mobile đẩy cao hơn chút cho cân */
  --form-est-desktop: 320px;      /* ước lượng chiều cao form desktop */
  --form-est-mobile: 380px;       /* ước lượng chiều cao form mobile */
  --form-gap: 12px;               /* khoảng cách an toàn dưới form */
}

/* Banner + Form */
.hero{
  position: relative;
  overflow: visible;
  /* CHỪA CHỖ CHO PHẦN FORM NẰM DƯỚI BANNER
     (1 - overlap) * form-height + gap  => không đè lên section kế tiếp */
  padding-bottom: calc((1 - var(--overlap-lift)) * var(--form-est-desktop) + var(--form-gap));
  margin-bottom: 0;
}
@media (max-width: 768px){
  .hero{
    padding-bottom: calc((1 - var(--overlap-lift-mobile)) * var(--form-est-mobile) + var(--form-gap));
  }
}

/* Banner bo tròn (nhắc lại cho chắc) */
.hero-bg{
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

/* Form nổi – đặt mép TRÊN form tại mép dưới banner, rồi kéo lên theo tỉ lệ */
.search-card.light.fc{
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, calc(-1 * var(--overlap-lift) * 100%));
  z-index: 1500;
}
@media (max-width: 768px){
  .search-card.light.fc{
    transform: translate(-50%, calc(-1 * var(--overlap-lift-mobile) * 100%));
  }
}



/* =========

/* ===== CLEARANCE dưới form: áp vào section liền sau .hero ===== */
:root{
  /* phần form còn nằm dưới banner + đệm */
  --clearance-desktop: calc((1 - var(--overlap-lift)) * var(--form-est-desktop) + 24px);
  --clearance-mobile:  calc((1 - var(--overlap-lift-mobile)) * var(--form-est-mobile) + 24px);
}

/* section đầu tiên sau hero (thường là .benefits) */
.hero + * { margin-top: var(--clearance-desktop) !important; }
@media (max-width:768px){
  .hero + * { margin-top: var(--clearance-mobile) !important; }
}

/* đảm bảo .hero không chặn sự tính toán margin của sibling */
.hero{ position:relative; overflow:visible; }

/* Căn mép nội dung sát hơn ở mobile để 'Tất cả' không bị lọt vào */
@media (max-width:768px){
  .wrap{ width: min(1120px, 96%); }  /* từ 92% -> 96% */
  .section-head{ padding-inline: 2px; }
  .section-head .see-all{ margin-right: 0; }
}

/* ==== FULL-BLEED cho 2 section: Tuyến đường phổ biến & Tin tức (mobile) ==== */
@media (max-width: 768px){
  /* Chọn đúng 2 khối sau "benefits" */
  .benefits + .section.wrap,
  .benefits + .section.wrap + .section.wrap{
    /* full chiều ngang màn hình */
    width: 100vw;
    max-width: 100vw;

    /* đẩy container ra khỏi giới hạn .wrap để bám mép 2 bên */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);

    /* đệm trong để chữ/ảnh không dính sát mép kính */
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Header của section (tiêu đề + "Tất cả") bám đều 2 mép */
  .benefits + .section.wrap .section-head,
  .benefits + .section.wrap + .section.wrap .section-head{
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
  }

  /* Dãy thẻ scroll bên trong giữ đệm mép nhỏ cho đẹp */
  .benefits + .section.wrap .h-scroll,
  .benefits + .section.wrap + .section.wrap .h-scroll{
    padding-left: 2px;
    padding-right: 2px;
  }
}



/* ==== APP PROMO + TRUST + SOCIAL GỌN GÀNG ==== */
@media (max-width:768px){
  /* Bố cục app-promo: chia 2 hàng rõ ràng */
  .app-promo{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:12px;
    margin:16px auto;
    padding:0 12px;
  }

  .app-text{
    width:100%;
  }

  /* Đưa badge qua phải, gọn lại một hàng ngang */
  .store-badges{
    display:flex;
    justify-content:flex-end;  /* sang phải */
    align-items:center;
    gap:8px;
    width:100%;
    margin-top:6px;
  }
  .store-badges img{
    height:34px;
    width:auto;
  }

  /* Nhóm logo trust nhỏ gọn đều hàng */
  .trust{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(80px,1fr));
    gap:10px;
    justify-items:center;
    margin:12px auto;
  }
  .trust img{
    height:32px;
    width:auto;
    filter:grayscale(1);
    opacity:.85;
  }

  /* Dãy mạng xã hội 1 hàng ngang giữa màn hình */
  .social{
    text-align:center;
    padding:0 8px;
  }
  .social-row{
    display:flex;
    justify-content:center;
    flex-wrap:nowrap;
    overflow-x:auto;
    gap:8px;
  }
  .chip{
    white-space:nowrap;
    flex-shrink:0;
  }

  /* Giảm khoảng trống dưới cùng cho sát footer */
  .site-footer{
    padding:20px 0 80px;
  }
}
/* ==== FIX căn giữa app badges + cắt sát footer ==== */
@media (max-width: 768px){

  /* Căn giữa 2 ảnh App Store / Google Play */
  .store-badges{
    display: flex;
    justify-content: center;      /* căn giữa ngang */
    align-items: center;
    gap: 10px;                    /* khoảng cách giữa 2 ảnh */
    width: 100%;
    margin: 8px auto 0;           /* sát nội dung trên */
  }
  .store-badges img{
    height: 40px;
    width: auto;
  }

  /* Thu gọn khối trust (logo thanh toán) */
  .trust{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 12px auto 8px;
  }
  .trust img{
    height: 30px;
    opacity: .9;
    filter: grayscale(1);
  }

  /* Các nút mạng xã hội trên 1 hàng, căn giữa */
  .social{
    text-align: center;
    padding: 0;
    margin-top: 8px;
  }
  .social-row{
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
  }

  /* Cắt bớt khoảng trống thừa cuối trang */
  .site-footer{
    padding: 12px 0 72px;   /* trước là 40px 0 92px */
  }
}

/* ==== Fancy select for Điểm đi / Điểm đến ==== */
.fc .fc-field select,
.fc-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  width: 100%;
  height: 48px;
  padding: 0 44px 0 14px;         /* chừa chỗ cho mũi tên bên phải */
  border: 1px solid #e7ebf0;
  border-radius: 12px;
  background: #fff;
  color: #1b2430;
  font-size: 16px;
  line-height: 48px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  box-shadow: inset 0 1px 0 rgba(16,24,40,.02);
}

/* Mũi tên custom (data-uri SVG) */
.fc .fc-field select,
.fc-select {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2392A1B2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px 20px;
}

/* Hover + Focus */
.fc .fc-field select:hover,
.fc-select:hover {
  border-color: #cfd7e3;
}
.fc .fc-field select:focus,
.fc-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* Disabled */
.fc .fc-field select:disabled,
.fc-select:disabled {
  background-color: #f3f5f8;
  color: #9aa6b2;
  border-color: #e5eaf1;
  cursor: not-allowed;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23C5CFDA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}

/* Nhãn + khoảng cách cho 2 cột select hàng đầu */
.fc .fc-two .fc-field label {
  margin-bottom: 6px;
  font-weight: 700;
  color: #2b3a48;
}

/* Tối ưu iOS (loại bỏ viền xanh mặc định) */
select::-ms-expand { display: none; }   /* IE/Edge cũ */


/* ===== Drawer 2.0 (style giống ảnh) ===== */
.drawer-v2{
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
}
.drawer-v2.open{ pointer-events: auto; }
.drawer-v2 .drawer-backdrop{
  position: absolute; inset: 0; background: rgba(15,23,42,.36);
  opacity: 0; transition: opacity .2s ease;
}
.drawer-v2.open .drawer-backdrop{ opacity: 1; }

.drawer-v2 .drawer-panel{
  position: absolute; top: 0; left: 0; height: 100%; width: min(86%, 380px);
  background: #fff; box-shadow: 6px 0 24px rgba(0,0,0,.12);
  transform: translateX(-100%); transition: transform .25s ease;
  display: flex; flex-direction: column; outline: none;
}
.drawer-v2.open .drawer-panel{ transform: none; }

/* Header */
.drawer-v2 .drawer-head{
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid #eef2f6;
}
.drawer-v2 .drawer-close{
  background: transparent; border: 0; font-size: 22px; line-height: 1; cursor: pointer;
}
.drawer-v2 .lang{ display: flex; gap: 10px; }
.drawer-v2 .lang-item{
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 999px; border: 1px solid #e5e7eb; background: #fff; cursor: pointer;
  font-weight: 600; color: #0f172a;
}
.drawer-v2 .lang-item.active{ border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* Body */
.drawer-v2 .drawer-scroller{ padding: 6px 10px 20px; overflow: auto; }
.drawer-v2 .drawer-group-title{
  margin: 14px 6px 8px; color: #475569; font-weight: 800; font-size: 13px; text-transform: none;
}
.drawer-v2 .drawer-section{ list-style: none; margin: 0; padding: 0; }
.drawer-v2 .drawer-section .item{
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px; border-radius: 10px; color: #0b1324; font-weight: 600;
}
.drawer-v2 .drawer-section .item:hover{ background: #f5f7fb; }
.drawer-v2 .drawer-section .ic{
  width: 22px; height: 22px; color: #2563eb; flex: 0 0 22px;
}

/* --- Fix: đảm bảo menu luôn nổi trên form, topbar, bottom-nav --- */
.drawer-v2{
  z-index: 3001 !important; /* > 2000 (topbar/bottom-nav) và > 1500 (form) */
}
.drawer-v2 .drawer-backdrop{
  z-index: 3001;
}
.drawer-v2 .drawer-panel{
  z-index: 3002; /* panel nằm trên backdrop */
}

/* Kết quả lịch chuyến */
.results .result-note{background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px;margin:8px 0}
.table-scroll{overflow:auto;background:#fff;border:1px solid var(--line);border-radius:12px}
.result-table{width:100%;border-collapse:collapse;min-width:720px}
.result-table th,.result-table td{padding:10px 12px;border-bottom:1px solid #eef2f6;text-align:left;white-space:nowrap}
.result-table thead th{background:#f8fafc;font-weight:800}
.result-table tbody tr:nth-child(even){background:#fafbff}
.policy{margin-top:10px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px}
.policy h4{margin:0 0 6px}
.policy ul{margin:0 0 0 18px}