/* ============================================================
   MeTravel — Chuẩn bị cho chuyến đi
   Tất cả class đều bắt đầu bằng cb- để không đụng style cũ.
   ============================================================ */

.cb-trang,
.cb-chan {   /* .cb-chan: khung chân trang ở base.html, cùng bề rộng + lề ngang */
    --muc: var(--ink);
    --nen: var(--bg);
    --teal: var(--brand);
    --teal-nhat: var(--tint);
    --vien: var(--line);
    --cam: var(--mt-note-text);
    --trang: #FFFFFF;

    max-width: 860px;
    margin: 0 auto;
    padding: 32px 20px 96px;
    color: var(--muc);
    font-family: var(--font-body);
}

.cb-so {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
}

/* ---------- Đầu trang ---------- */

.cb-dau h1 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 5vw, 38px);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}

.cb-chuyen {
    margin: 6px 0 0;
    color: rgba(14, 42, 37, 0.65);
    font-size: 15px;
}

/* ---------- Thẻ hành lý (khối tiến độ) ---------- */

.cb-the {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin: 22px 0 28px;
    padding: 22px 24px 22px 38px;
    background: var(--trang);
    border: 1px solid var(--vien);
    border-left: 6px solid var(--teal);
    border-radius: 4px 14px 14px 4px;
    transition: border-left-color 0.35s ease;
}

.cb-the::before {
    /* lỗ xỏ dây của thẻ hành lý */
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    width: 9px;
    height: 9px;
    margin-top: -4.5px;
    border-radius: 50%;
    background: var(--nen);
    box-shadow: inset 0 0 0 1px var(--vien);
}

.cb-the.cb-du .cb-the-thanh i { background: var(--teal); }

.cb-the-trai { flex: 1 1 320px; min-width: 240px; }

.cb-the-nhan {
    margin: 0;
    font-size: 13px;
    color: rgba(14, 42, 37, 0.6);
}

.cb-the-so {
    margin: 2px 0 10px;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.1;
}

.cb-the-so small {
    font-size: 16px;
    font-weight: 400;
    color: rgba(14, 42, 37, 0.5);
}

.cb-the-thanh {
    height: 7px;
    border-radius: 99px;
    background: var(--mt-surface);
    overflow: hidden;
}

.cb-the-thanh i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: var(--mt-gold);   /* thanh tiến độ: gold (tokens.css); xong thì primary */
    transition: width 0.4s ease, background 0.35s ease;
}

.cb-the-phu {
    margin: 9px 0 0;
    font-size: 13px;
    color: rgba(14, 42, 37, 0.6);
}

.cb-luu-y {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: rgba(14, 42, 37, 0.45);
}

.cb-the-phai {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.cb-moc {
    display: none;
    padding: 7px 12px;
    border: 1.5px solid var(--teal);
    border-radius: 4px;
    color: var(--teal);
    font-size: 13px;
    font-weight: 600;
    transform: rotate(-4deg);
}

.cb-the.cb-du .cb-moc {
    display: block;
    animation: cb-dong-dau 0.45s cubic-bezier(0.2, 1.5, 0.4, 1);
}

@keyframes cb-dong-dau {
    from { opacity: 0; transform: rotate(-4deg) scale(1.6); }
    to   { opacity: 1; transform: rotate(-4deg) scale(1); }
}

.cb-nut {
    padding: 10px 16px;
    border: 1px solid var(--vien);
    border-radius: 8px;
    background: var(--trang);
    color: var(--muc);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.cb-nut:hover { border-color: var(--teal); color: var(--teal); }
.cb-nut:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- Dòng điều kiện lọc ---------- */

.cb-loc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 26px;
    font-size: 13px;
    color: rgba(14, 42, 37, 0.6);
}

.cb-chip {
    padding: 5px 11px;
    border-radius: 99px;
    background: var(--teal-nhat);
    color: var(--teal);
    font-weight: 600;
}

/* ---------- Nhóm ---------- */

.cb-nhom {
    margin-bottom: 14px;
    background: var(--trang);
    border: 1px solid var(--vien);
    border-radius: 12px;
    overflow: hidden;
}

.cb-nhom-dau {
    display: flex;
    gap: 12px;
    align-items: baseline;
    width: 100%;
    padding: 16px 20px;
    border: 0;
    background: none;
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.cb-nhom-dau:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }

.cb-nhom-ten {
    flex: 1;
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 600;
}

.cb-nhom-dem {
    font-size: 14px;
    color: rgba(14, 42, 37, 0.55);
}

.cb-mui {
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(14, 42, 37, 0.45);
    border-bottom: 2px solid rgba(14, 42, 37, 0.45);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.cb-nhom[data-dong="1"] .cb-mui { transform: rotate(-45deg); }
.cb-nhom[data-dong="1"] .cb-than { display: none; }

.cb-than { padding: 0 20px 8px; }

/* ---------- Một mục ---------- */

.cb-muc {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 13px 0;
    border-top: 1px solid var(--mt-surface);
}

.cb-than .cb-muc:first-child { border-top: 0; }

.cb-nhan {
    display: flex;
    flex: 1;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
}

.cb-nhan input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cb-o {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border: 1.5px solid var(--mt-border);
    border-radius: 6px;
    background: var(--trang);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.cb-nhan input:checked + .cb-o {
    border-color: var(--teal);
    background: var(--teal)
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M4 10.5l4 4 8-9'/></svg>")
        center / 15px no-repeat;
}

.cb-nhan input:focus-visible + .cb-o { outline: 2px solid var(--teal); outline-offset: 2px; }

.cb-ten {
    display: block;
    font-size: 15.5px;
    line-height: 1.45;
}

.cb-nhan input:checked ~ .cb-chu .cb-ten {
    color: rgba(14, 42, 37, 0.45);
    text-decoration: line-through;
    text-decoration-color: rgba(14, 42, 37, 0.3);
}

.cb-bb {
    margin-left: 7px;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--mt-note-bg);
    color: var(--cam);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.cb-ghi {
    display: block;
    margin-top: 3px;
    max-width: 62ch;
    font-size: 13.5px;
    line-height: 1.5;
    color: rgba(14, 42, 37, 0.62);
}

.cb-mua {
    flex: 0 0 auto;
    align-self: center;
    padding: 6px 12px;
    border: 1px solid var(--vien);
    border-radius: 99px;
    color: var(--teal);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.cb-mua:hover { background: var(--teal-nhat); border-color: var(--teal-nhat); }

/* ---------- Trống ---------- */

.cb-trong {
    padding: 40px 24px;
    background: var(--trang);
    border: 1px dashed var(--vien);
    border-radius: 12px;
    text-align: center;
}

.cb-trong p { margin: 0 0 14px; color: rgba(14, 42, 37, 0.7); }

/* ---------- Màn nhỏ ---------- */

@media (max-width: 640px) {
    .cb-trang, .cb-chan { padding: 22px 16px 80px; }
    .cb-the { padding: 18px 18px 18px 32px; }
    .cb-the-phai { width: 100%; }
    .cb-nut { flex: 1; text-align: center; }
    .cb-mua { align-self: flex-start; margin-top: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    .cb-the, .cb-the-thanh i, .cb-mui, .cb-o { transition: none; }
    .cb-the.cb-du .cb-moc { animation: none; }
}
