/* ----------------------------------------------------------------
   Nhận diện TABUKI — port từ bản thiết kế F:\VietThanhShampoo\website.

   Biến đặt ở :root cho gọn, nhưng style nền chỉ áp dưới body.tb và bọc
   :where(): file này còn được _ManageLayout nạp để xem trước widget, và
   :where(.tb) h2 chỉ nặng bằng h2 trần — class của widget (.lp-heading)
   luôn thắng. Mọi class mang tiền tố tb- vì Bootstrap vẫn nạp và trùng
   tên với prototype ở .card, .btn, .nav, .pagination, .toast.
   ---------------------------------------------------------------- */

:root {
    --tb-ground: #EFEFF5;   /* lavender khớp nền ảnh chụp sản phẩm */
    --tb-paper: #FFFFFF;
    --tb-mist: #E4E5EE;
    --tb-ink: #15362A;      /* xanh dược liệu */
    --tb-ink-soft: #4B5C54;
    --tb-muted: #5E6A65;
    --tb-line: #D6D8E2;
    --tb-red: #9E1B1E;      /* đỏ nhãn Gừng Bồ Kết — accent duy nhất cho CTA và giá */
    --tb-red-deep: #7E1417;
    --tb-gold: #A9843A;
    --tb-gold-light: #E9C987;
    --tb-blush: #F3DED8;
    --tb-on-ink: #EEF1EC;
    --tb-on-ink-soft: #A9BAB1;

    --tb-f-display: "Montserrat", "Segoe UI", system-ui, sans-serif;
    --tb-f-logo: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --tb-f-body: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
    --tb-f-script: "Dancing Script", "Brush Script MT", cursive;

    --tb-gutter: clamp(16px, 4vw, 40px);
    --tb-gap: clamp(14px, 2vw, 24px);
    --tb-max: 1240px;
    --tb-shadow: 0 1px 2px rgba(21, 54, 42, .06), 0 8px 24px -12px rgba(21, 54, 42, .18);
}

/* 01 — Nền */

body.tb {
    background: var(--tb-ground);
    color: var(--tb-ink);
    font-family: var(--tb-f-body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

:where(.tb) h1, :where(.tb) h2, :where(.tb) h3, :where(.tb) h4 {
    font-family: var(--tb-f-display);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.02em;
    text-wrap: balance;
}

:where(.tb) a { color: inherit; }
:where(.tb) :focus-visible { outline: 2px solid var(--tb-red); outline-offset: 2px; }

.tb-wrap { max-width: var(--tb-max); margin-inline: auto; padding-inline: var(--tb-gutter); }
.tb-section { padding-block: clamp(56px, 8vw, 104px); }
.tb-eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--tb-ink-soft); }
.tb-script { font-family: var(--tb-f-script); font-weight: 600; letter-spacing: 0; }
.tb-note { margin: 0; font-size: 12.5px; color: var(--tb-muted); }
.tb-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--tb-ink)); flex: none; }

.tb-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 16px 32px;
    margin-bottom: clamp(28px, 4vw, 48px);
}
.tb-section-head h2 { margin: 0; font-size: clamp(26px, 3.2vw, 40px); max-width: 20ch; }
.tb-section-head p { margin: 0; max-width: 44ch; color: var(--tb-ink-soft); }

.tb-link-arrow {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 6px;
}
.tb-link-arrow:hover { color: var(--tb-red); }

.tb-alert { margin: 24px 0 0; padding: 14px 18px; background: var(--tb-blush); border-left: 3px solid var(--tb-red); font-size: 14px; }

/* Nút — pill như bản thiết kế. Cỡ nhỏ vẫn cao 44px: đó là mức tối thiểu cho ngón tay. */
.tb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 26px;
    border-radius: 999px;
    border: 1px solid var(--tb-ink);
    background: var(--tb-ink);
    color: var(--tb-on-ink);
    font: 600 14px/1 var(--tb-f-body);
    letter-spacing: .02em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.tb-btn:hover { background: #0E2A20; color: var(--tb-on-ink); }
.tb-btn:active { transform: translateY(1px); }
.tb-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.tb-btn svg { width: 18px; height: 18px; flex: none; }
.tb-btn--red { background: var(--tb-red); border-color: var(--tb-red); color: #fff; }
.tb-btn--red:hover { background: var(--tb-red-deep); border-color: var(--tb-red-deep); color: #fff; }
.tb-btn--ghost { background: transparent; color: var(--tb-ink); }
.tb-btn--ghost:hover { background: var(--tb-ink); color: var(--tb-on-ink); }
/* Nút chiếm cả hàng thì được xuống dòng: nhãn dài như "Đổi sang thanh toán khi nhận hàng" không đẩy khung ra ngoài màn 375px. */
.tb-btn--block { width: 100%; white-space: normal; }
.tb-btn--sm { min-height: 44px; padding: 0 18px; font-size: 13px; }

/* 02 — Header (chrome chung, cấu hình ở Giao diện chung) */

.tb-announce {
    background: var(--tb-ink);
    color: var(--tb-on-ink);
    font-size: 12.5px;
    letter-spacing: .04em;
    text-align: center;
    padding: 8px var(--tb-gutter);
}

/* Nền mờ nằm ở ::before chứ không ở chính header: backdrop-filter trên phần tử sticky biến nó
   thành khối chứa của mọi con position:fixed — menu trượt ra sẽ bị nhốt trong header. */
.tb-header { position: sticky; top: 0; z-index: 1020; border-bottom: 1px solid var(--tb-line); }
/* Header dính cao 65–77px: nhảy tới neo (#tra-hang, #hoa-don ở trang đơn, từng khối trang tài khoản, mục chính sách)
   mà không chừa chỗ thì tiêu đề nằm khuất dưới nó. Chỉ trong cửa hàng — khu quản trị có thanh riêng (builder.css). */
html:has(> body.tb) { scroll-padding-top: 96px; }
.tb-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(239, 239, 245, .92);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
}

.tb-header__row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: clamp(12px, 2vw, 24px);
    min-height: clamp(64px, 8vw, 76px);
}

.tb-logo { display: inline-flex; align-items: center; gap: 12px; color: var(--tb-ink); text-decoration: none; }
.tb-logo img { height: clamp(36px, 6vw, 48px); width: auto; display: block; }
.tb-emblem { width: clamp(32px, 4vw, 40px); height: auto; flex: none; }
.tb-logo__text { display: grid; line-height: 1; }
.tb-logo__word { font-family: var(--tb-f-logo); font-size: clamp(24px, 3vw, 30px); font-weight: 600; letter-spacing: .2em; margin-right: -.2em; }
.tb-logo__tag { margin-top: 5px; font-size: 10.5px; letter-spacing: .06em; color: var(--tb-ink-soft); white-space: nowrap; }

/* Hiện từ xxl (1400px): số mục menu do người quản lý cấu hình — mốc đã chốt ở đợt sửa nav hai dòng
   (bàn giao 13/09). Dưới mốc đó menu nằm trong ngăn kéo. Hàng header dừng ở 1240px, nên khoảng
   cách không được lớn theo vw: tối đa 18px thì bảy mục mặc định vẫn một dòng ở mọi bề ngang. */
.tb-nav { justify-content: center; flex-wrap: wrap; gap: 4px clamp(12px, 1.2vw, 18px); }
.tb-nav a {
    padding-block: 8px;
    border-bottom: 1.5px solid transparent;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
}
.tb-nav a:hover, .tb-nav a[aria-current="page"] { border-color: var(--tb-red); }

.tb-header__actions { grid-column: 3; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

/* Nút menu chỉ có dưới xxl; khi nó ẩn, logo tự về ô đầu của lưới. Có nó thì logo đứng giữa như
   bản thiết kế trên điện thoại. */
.tb-header__menu { grid-column: 1; }
.tb-header__menu + .tb-logo { justify-self: center; }
@media (min-width: 1400px) {
    .tb-header__menu + .tb-logo { justify-self: start; }
    /* Nav bảy mục cần ~690px. Nút "Đăng nhập" phải giữ chữ (yêu cầu 26/09), nên chữ "Giỏ hàng" nhường
       chỗ: icon túi kèm con số vẫn đủ nghĩa, và aria-label vẫn đọc "Giỏ hàng". */
    .tb-cart__label { display: none; }
}

.tb-account-menu { min-width: 220px; padding: 8px 0; border: 1px solid var(--tb-line); border-radius: 14px; box-shadow: var(--tb-shadow); font-size: 14px; }
.tb-account-menu form { margin: 0; }
.tb-account-menu .dropdown-item { display: flex; align-items: center; min-height: 44px; padding: 0 18px; color: var(--tb-ink); }
.tb-account-menu .dropdown-item:hover { background: var(--tb-mist); color: var(--tb-ink); }
.tb-account-menu__name {
    display: block;
    max-width: 260px;
    padding: 8px 18px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--tb-line);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--tb-ink-soft);
    font-weight: 600;
}

.tb-cart, .tb-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px 0 12px;
    border-radius: 999px;
    color: var(--tb-ink);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.tb-cart:hover, .tb-login:hover { background: var(--tb-mist); color: var(--tb-ink); }
.tb-cart svg, .tb-login svg { width: 22px; height: 22px; }
.tb-cart__count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--tb-red);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.tb-cart__count[data-empty="true"] { background: var(--tb-mist); color: var(--tb-ink-soft); }

.tb-icon-btn {
    display: inline-grid;
    place-items: center;
    /* d-md-inline-flex (Bootstrap 5.1 chưa có inline-grid) đổi display; hai dòng này giữ icon ở giữa. */
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--tb-ink);
    cursor: pointer;
}
.tb-icon-btn:hover { background: var(--tb-mist); }
.tb-icon-btn svg { width: 22px; height: 22px; }

.tb-drawer { width: min(340px, 86vw); background: var(--tb-paper); color: var(--tb-ink); }
.tb-drawer__title { margin: 0; font-size: 18px; }
.tb-drawer__nav a, .tb-drawer__account a, .tb-drawer__account button {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 52px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--tb-line);
    background: none;
    color: var(--tb-ink);
    font: 600 14px/1.2 var(--tb-f-body);
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
}
.tb-drawer__nav a[aria-current="page"] { color: var(--tb-red); }
.tb-drawer__account { margin-top: 24px; }
.tb-drawer__account form { margin: 0; }
.tb-drawer__user { display: block; padding: 12px 0; color: var(--tb-ink-soft); font-weight: 600; }

@media (max-width: 767.98px) {
    .tb-logo__tag, .tb-cart__label, .tb-login__label { display: none; }
    /* Menu, đăng nhập, giỏ và logo phải vừa thanh 360px: hai nút bên phải chỉ còn icon 44px, số trong giỏ
       ngồi lên góc icon túi thay vì đứng cạnh nó. */
    .tb-cart, .tb-login { position: relative; justify-content: center; width: 44px; padding: 0; }
    .tb-cart__count { position: absolute; top: 3px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; }
}

/* 03 — Footer */

.tb-footer { background: var(--tb-ink); color: var(--tb-on-ink); padding-block: clamp(48px, 6vw, 64px) 28px; }
.tb-footer__grid { display: flex; flex-wrap: wrap; gap: 32px 48px; }
.tb-footer__brand { flex: 1 1 280px; }
.tb-footer__col { flex: 1 1 160px; }
.tb-footer .tb-logo { color: var(--tb-on-ink); }
.tb-footer .tb-logo__tag { color: var(--tb-on-ink-soft); display: block; }
.tb-footer__about { margin: 18px 0 0; max-width: 34ch; color: var(--tb-on-ink-soft); font-size: 13.5px; }
.tb-footer__heading {
    margin: 0 0 8px;
    font-family: var(--tb-f-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tb-gold-light);
}
.tb-footer ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.tb-footer ul a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    color: var(--tb-on-ink-soft);
    text-decoration: none;
}
.tb-footer ul a:hover { color: var(--tb-on-ink); }
.tb-footer__contact li { padding-block: 6px; color: var(--tb-on-ink-soft); }
.tb-footer__contact b { display: block; color: var(--tb-on-ink); font-size: 12px; font-weight: 500; letter-spacing: .06em; }
.tb-footer__bottom {
    margin-top: 48px;
    padding-top: 22px;
    border-top: 1px solid rgba(238, 241, 236, .16);
    color: var(--tb-on-ink-soft);
    font-size: 12.5px;
}

/* 04 — Thẻ sản phẩm và lưới */

/* Tối thiểu 150px để điện thoại 375px vẫn hai cột; tối đa 240px nên màn rộng không kéo thẻ thành
   bảng hiệu. --tb-cols (widget trang chủ đặt) chặn số cột tối đa mà không cần media query. */
.tb-grid {
    --tb-cols: 6;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(max(clamp(150px, 22vw, 240px), calc((100% - (var(--tb-cols) - 1) * var(--tb-gap)) / var(--tb-cols))), 1fr));
    gap: var(--tb-gap);
}

.tb-card { position: relative; display: grid; grid-template-rows: auto 1fr; background: var(--tb-paper); transition: box-shadow .25s ease; }
.tb-card:hover { box-shadow: var(--tb-shadow); }
.tb-card__media { position: relative; display: block; overflow: hidden; background: var(--tb-mist); aspect-ratio: 4 / 5; }
.tb-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.tb-card__media img.is-placeholder { object-fit: contain; padding: 18%; opacity: .7; }
.tb-card:hover .tb-card__media img { transform: scale(1.04); }
.tb-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 9px;
    border-radius: 2px;
    background: var(--tb-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
}
.tb-card__badge--muted { background: var(--tb-ink-soft); }
.tb-card__body { display: grid; grid-template-rows: auto auto 1fr auto; gap: 6px; padding: clamp(12px, 1.4vw, 16px); }
.tb-card__cat { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--tb-muted); }
.tb-card__name { margin: 0; font-family: var(--tb-f-body); font-size: clamp(13.5px, 1.1vw, 15px); font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.tb-card__name a { text-decoration: none; }
.tb-card__name a:hover { color: var(--tb-red); }
.tb-card__script { margin: 0; font-family: var(--tb-f-script); font-weight: 600; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.2; color: var(--c); color: color-mix(in srgb, var(--c) 70%, #000); }
.tb-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.tb-card__foot form { margin: 0; }

.tb-price { font-family: var(--tb-f-display); font-size: clamp(16px, 1.4vw, 19px); font-weight: 700; line-height: 1; font-variant-numeric: lining-nums; }
.tb-price-old { margin-left: 6px; font-size: 13px; color: var(--tb-muted); text-decoration: line-through; }

.tb-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--tb-ink);
    border-radius: 999px;
    background: transparent;
    color: var(--tb-ink);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.tb-add:hover:not(:disabled) { background: var(--tb-ink); color: var(--tb-on-ink); }
.tb-add:disabled { opacity: .45; cursor: not-allowed; }
.tb-add svg { width: 16px; height: 16px; }

@media (max-width: 767.98px) {
    .tb-add { padding: 0; }
    .tb-add__text { display: none; }
}

/* 05 — Trang cửa hàng */

.tb-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding-block: 20px; }
.tb-toolbar__left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tb-result-count { font-size: 14px; color: var(--tb-ink-soft); font-variant-numeric: tabular-nums; }
.tb-result-count b { color: var(--tb-ink); }

.tb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--tb-line);
    border-radius: 999px;
    background: var(--tb-paper);
    color: var(--tb-ink);
    font-size: 12.5px;
    text-decoration: none;
}
.tb-chip:hover { border-color: var(--tb-red); color: var(--tb-red); }
.tb-chip--clear { border-style: dashed; background: transparent; }

.tb-sort { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: var(--tb-ink-soft); }
.tb-select {
    min-height: 44px;
    padding: 0 36px 0 14px;
    border: 1px solid var(--tb-line);
    border-radius: 999px;
    background: var(--tb-paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2315362A' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center;
    appearance: none;
    color: var(--tb-ink);
    font-size: 13.5px;
    cursor: pointer;
}

/* Bộ lọc và lưới đứng cạnh nhau khi 220 + 420 còn vừa, tự xuống dòng khi không — mốc đi theo chỗ
   trống thật chứ không theo một con số đặt tay. */
.tb-store { display: flex; flex-wrap: wrap; align-items: flex-start; gap: clamp(24px, 3vw, 44px); padding-bottom: 80px; }
.tb-filters { flex: 1 1 220px; max-width: 100%; }
.tb-store__results { flex: 999 1 420px; min-width: 0; }
@media (min-width: 768px) {
    .tb-filters { position: sticky; top: 100px; }
}

.tb-filters__head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid var(--tb-ink); }
.tb-filters__head h2 { margin: 0; font-size: 19px; }
.tb-filters__head a { font-size: 12.5px; color: var(--tb-muted); }
.tb-search { display: block; margin: 16px 0 4px; }
.tb-search input {
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--tb-line);
    border-radius: 999px;
    background: var(--tb-paper);
    color: var(--tb-ink);
    font-size: 14px;
}
.tb-fgroup { border-bottom: 1px solid var(--tb-line); }
.tb-fgroup summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 52px;
    list-style: none;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.tb-fgroup summary::-webkit-details-marker { display: none; }
.tb-fgroup summary::after { content: "+"; font-size: 18px; font-weight: 400; }
.tb-fgroup[open] summary::after { content: "–"; }
.tb-fgroup__body { display: grid; padding-bottom: 12px; }
.tb-check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; font-size: 14px; cursor: pointer; }
.tb-check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--tb-ink); }
.tb-check__count { margin-left: auto; font-size: 12px; color: var(--tb-muted); font-variant-numeric: tabular-nums; }
.tb-filters > .tb-btn { margin-top: 18px; }

.tb-empty { display: grid; justify-items: center; gap: 14px; padding: 60px 20px; background: var(--tb-paper); text-align: center; }
.tb-empty h3 { margin: 0; font-size: 22px; }
.tb-empty p { margin: 0; color: var(--tb-ink-soft); }

.tb-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 40px; }
.tb-pagination a {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    border: 1px solid var(--tb-line);
    border-radius: 50%;
    background: var(--tb-paper);
    font-size: 14px;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}
.tb-pagination a[aria-current="page"] { border-color: var(--tb-ink); background: var(--tb-ink); color: var(--tb-on-ink); }
.tb-pagination svg { width: 18px; height: 18px; }

/* 06 — Trang chi tiết */

.tb-crumbs--top { padding-top: 24px; }
.tb-section--flush { padding-top: 0; }

.tb-pd { display: grid; gap: clamp(28px, 4vw, 64px); align-items: start; padding-block: clamp(20px, 3vw, 36px) clamp(48px, 6vw, 80px); }
.tb-pd__gallery { display: grid; grid-template-columns: 84px 1fr; gap: 14px; }
.tb-pd__thumbs { display: grid; gap: 10px; align-content: start; }
.tb-pd__thumbs button { min-height: 44px; padding: 0; border: 1px solid transparent; background: var(--tb-mist); opacity: .7; cursor: pointer; transition: opacity .2s, border-color .2s; }
.tb-pd__thumbs button[aria-current="true"] { border-color: var(--tb-ink); opacity: 1; }
.tb-pd__thumbs button:hover { opacity: 1; }
.tb-pd__thumbs img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.tb-pd__main { position: relative; overflow: hidden; background: var(--tb-mist); }
.tb-pd__main img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.tb-pd__nav {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: var(--tb-ink);
    box-shadow: var(--tb-shadow);
    transform: translateY(-50%);
    cursor: pointer;
}
.tb-pd__nav svg { width: 18px; height: 18px; }
.tb-pd__nav--prev { left: 14px; }
.tb-pd__nav--next { right: 14px; }

/* Cạnh nhau từ 768px; gallery chỉ dính khi đứng cạnh phần chữ — xếp chồng mà dính thì nó đè lên
   chính phần chữ bên dưới. */
@media (min-width: 768px) {
    .tb-pd { grid-template-columns: 1.1fr .9fr; }
    .tb-pd__gallery { position: sticky; top: 100px; }
}
@media (max-width: 767.98px) {
    .tb-pd__gallery { grid-template-columns: 1fr; }
    .tb-pd__thumbs { grid-auto-flow: column; grid-auto-columns: 64px; order: 2; overflow-x: auto; }
}

.tb-pd__info { display: grid; gap: 18px; }
.tb-pd__info h1 { margin: 0; font-size: clamp(26px, 2.8vw, 36px); }
.tb-pd__script { margin: -6px 0 0; font-family: var(--tb-f-script); font-size: clamp(24px, 2.4vw, 30px); font-weight: 600; line-height: 1.1; color: var(--c); }
.tb-pd__claim { display: inline-flex; width: fit-content; padding: 6px 12px; border: 1px solid var(--tb-line); background: var(--tb-paper); font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.tb-pd__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding-block: 14px; border-block: 1px solid var(--tb-line); }
.tb-pd__price .tb-price { font-size: clamp(28px, 3vw, 34px); }
.tb-pd__price .tb-price-old { font-size: 16px; }
.tb-save-tag { padding: 3px 8px; border-radius: 2px; background: var(--tb-red); color: #fff; font-size: 12px; font-weight: 700; }
.tb-pd__lede { margin: 0; color: var(--tb-ink-soft); }
.tb-pd__meta { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-pd__meta span { padding: 5px 11px; border-radius: 999px; background: var(--tb-mist); font-size: 12.5px; }
.tb-pd__buy { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin: 0; }
.tb-pd__add { grid-column: 1 / -1; }
.tb-pd__stock { margin: 0; font-size: 13px; font-weight: 600; color: var(--tb-red); }

.tb-qty { display: inline-flex; align-items: center; height: 48px; border: 1px solid var(--tb-ink); border-radius: 999px; }
.tb-qty button { width: 44px; height: 100%; border: 0; border-radius: 999px; background: transparent; color: var(--tb-ink); font-size: 20px; cursor: pointer; }
.tb-qty button:hover { background: var(--tb-mist); }
.tb-qty input { width: 44px; border: 0; background: transparent; color: var(--tb-ink); text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.tb-qty input::-webkit-outer-spin-button, .tb-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tb-qty--sm { height: 44px; }
.tb-qty--sm button { width: 40px; font-size: 17px; }
.tb-qty--sm input { width: 36px; }

.tb-pd__assure { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.tb-pd__assure li { display: grid; gap: 4px; padding: 12px; background: var(--tb-paper); color: var(--tb-ink-soft); font-size: 12.5px; }
.tb-pd__assure b { color: var(--tb-ink); font-size: 13px; }

.tb-accordion { border: 1px solid var(--tb-line); background: var(--tb-paper); }
.tb-accordion summary { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 18px; list-style: none; cursor: pointer; font-size: 14px; font-weight: 600; }
.tb-accordion summary::-webkit-details-marker { display: none; }
.tb-accordion summary::after { content: ""; width: 10px; height: 10px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.tb-accordion[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.tb-accordion ul { display: grid; gap: 6px; margin: 0; padding: 0 18px 18px 36px; color: var(--tb-ink-soft); font-size: 14px; }

.tb-bundle { background: var(--tb-paper); }
.tb-bundle__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.tb-bundle__item { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--tb-line); background: var(--tb-ground); text-decoration: none; }
.tb-bundle__item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.tb-bundle__item div { display: grid; gap: 4px; align-content: start; padding: 14px; }
.tb-bundle__item strong { font-size: 14px; line-height: 1.35; }
.tb-bundle__item span { color: var(--tb-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.tb-bundle__sum { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 8px 28px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--tb-line); color: var(--tb-ink-soft); font-size: 14px; }
.tb-bundle__sum b { color: var(--tb-ink); font-size: 16px; }
.tb-bundle__save { color: var(--tb-red); font-weight: 600; }

.tb-pd-more { padding-bottom: 0; }
.tb-pd-more > .tb-wrap > .tb-eyebrow { margin-bottom: 8px; font-family: var(--tb-f-body); }
.tb-dtabs { display: flex; gap: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--tb-line); overflow-x: auto; }
.tb-dtab { flex: none; min-height: 48px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--tb-muted); font-size: 15px; font-weight: 600; cursor: pointer; }
.tb-dtab[aria-selected="true"] { border-color: var(--tb-red); color: var(--tb-ink); }
.tb-dpanel { display: grid; gap: 14px; max-width: 820px; color: var(--tb-ink-soft); font-size: 15.5px; }
.tb-dpanel p { margin: 0; }
.tb-spec { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tb-spec th, .tb-spec td { padding: 14px 0; border-bottom: 1px solid var(--tb-line); text-align: left; vertical-align: top; }
.tb-spec th { width: 34%; padding-right: 20px; color: var(--tb-muted); font-weight: 500; }
.tb-spec td { color: var(--tb-ink); }
.tb-ship-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.tb-ship-list li { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-bottom: 14px; border-bottom: 1px solid var(--tb-line); }
.tb-ship-list b { flex: 0 0 160px; color: var(--tb-ink); font-weight: 600; }
.tb-ship-list span { flex: 1 1 280px; }

.tb-reviews { display: flex; flex-wrap: wrap; gap: clamp(24px, 4vw, 56px); align-items: flex-start; }
.tb-rating { flex: 1 1 280px; max-width: 360px; display: grid; gap: 16px; padding: 26px; background: var(--tb-paper); }
.tb-rating__score { display: flex; align-items: baseline; gap: 10px; }
.tb-rating__score b { font-family: var(--tb-f-display); font-size: 50px; font-weight: 700; line-height: .9; }
.tb-rating__score span { color: var(--tb-muted); font-size: 14px; }
.tb-stars { display: inline-flex; gap: 2px; color: var(--tb-line); }
.tb-stars .is-on { color: var(--tb-gold); }
.tb-stars svg { width: 16px; height: 16px; }
.tb-bars { display: grid; gap: 7px; }
.tb-bar { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; gap: 10px; color: var(--tb-ink-soft); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tb-bar i { display: block; height: 6px; overflow: hidden; border-radius: 3px; background: var(--tb-mist); }
.tb-bar i::before { content: ""; display: block; width: var(--w, 0%); height: 100%; background: var(--tb-gold); }
.tb-review-list { flex: 999 1 360px; display: grid; gap: 14px; }
.tb-review { display: grid; gap: 8px; padding: 20px 22px; background: var(--tb-paper); }
.tb-review h3 { margin: 0; font-size: 20px; }
.tb-review p { margin: 0; color: var(--tb-ink-soft); font-size: 14.5px; }
.tb-review__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; }
.tb-review__head time { color: var(--tb-muted); font-size: 12.5px; }

/* 07 — Giỏ hàng */

.tb-cart-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: clamp(24px, 3vw, 48px); padding-block: 32px 80px; }
.tb-cart-main { flex: 999 1 520px; min-width: 0; }

.tb-ship-progress { display: grid; gap: 10px; margin-bottom: 16px; padding: 18px 22px; background: var(--tb-paper); font-size: 14px; }
.tb-ship-progress i { display: block; height: 6px; overflow: hidden; border-radius: 3px; background: var(--tb-mist); }
.tb-ship-progress i::before { content: ""; display: block; width: var(--w, 0%); height: 100%; background: var(--tb-red); transition: width .4s ease; }

.tb-cart-table { background: var(--tb-paper); }
.tb-cart-head, .tb-cart-item { display: grid; grid-template-columns: 1fr 140px 110px 44px; align-items: center; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--tb-line); }
.tb-cart-head { color: var(--tb-muted); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.tb-cart-head span:nth-child(3) { text-align: right; }
.tb-cart-item { padding-block: 18px; }
.tb-cart-item.is-unavailable { background: #faf6f6; }
.tb-ci-prod { display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 16px; }
.tb-ci-prod img { width: 88px; aspect-ratio: 1; object-fit: cover; background: var(--tb-mist); }
.tb-ci-prod a { font-size: 14.5px; font-weight: 600; line-height: 1.35; text-decoration: none; }
.tb-ci-prod a:hover { color: var(--tb-red); }
.tb-ci-prod small { display: block; margin-top: 4px; color: var(--tb-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tb-ci-flag { display: inline-block; margin-top: 6px; color: var(--tb-red); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tb-ci-qty form { margin: 0; }
.tb-ci-total { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tb-ci-remove-form { margin: 0; }
.tb-ci-remove { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--tb-muted); cursor: pointer; }
.tb-ci-remove:hover { background: var(--tb-mist); color: var(--tb-red); }
.tb-ci-remove svg { width: 16px; height: 16px; }
.tb-cart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 12px 22px; }

@media (max-width: 767.98px) {
    .tb-cart-head { display: none; }
    .tb-cart-item { grid-template-columns: 1fr auto; grid-template-areas: "p r" "q t"; gap: 12px; padding: 16px; }
    .tb-ci-prod { grid-area: p; grid-template-columns: 72px 1fr; }
    .tb-ci-prod img { width: 72px; }
    .tb-ci-qty { grid-area: q; }
    .tb-ci-total { grid-area: t; }
    .tb-ci-remove-form { grid-area: r; align-self: start; }
}

.tb-summary { flex: 1 1 300px; display: grid; gap: 16px; padding: 26px; background: var(--tb-paper); }
.tb-summary h2 { margin: 0; font-size: 22px; }
.tb-sum-rows { display: grid; gap: 10px; margin: 0; padding-block: 16px; border-block: 1px solid var(--tb-line); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.tb-sum-rows div { display: flex; justify-content: space-between; gap: 12px; }
.tb-sum-rows dt { color: var(--tb-ink-soft); font-weight: 400; }
.tb-sum-rows dd { margin: 0; font-weight: 500; }
/* Khuyến mãi tự áp: cùng màu đỏ của giá để khách thấy ngay mình được giảm bao nhiêu. */
.tb-sum-rows .tb-sum-discount dd, .tb-ci-promo { color: var(--tb-red); }
.tb-ci-promo { display: block; font-size: 13px; font-weight: 500; }
.tb-sum-total { display: flex; justify-content: space-between; align-items: baseline; }
.tb-sum-total span { font-weight: 600; }
.tb-sum-total b { font-family: var(--tb-f-display); font-size: 28px; font-variant-numeric: lining-nums; }

.tb-cart-empty { display: grid; justify-items: center; gap: 14px; margin-block: 32px 80px; padding: 64px 24px; background: var(--tb-paper); text-align: center; }
.tb-cart-empty h2 { margin: 0; font-size: 28px; }
.tb-cart-empty p { margin: 0; color: var(--tb-ink-soft); }

/* 10 — Thanh toán và đơn hàng */

.tb-panel { display: grid; gap: 16px; margin-bottom: 20px; padding: clamp(18px, 2.4vw, 26px); background: var(--tb-paper); }
.tb-panel h2 { margin: 0; font-size: 20px; }
.tb-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.tb-form-grid__full { grid-column: 1 / -1; }

.tb-pay-opts { display: grid; gap: 10px; }
.tb-pay-opt { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 14px 16px; border: 1px solid var(--tb-line); border-radius: 4px; cursor: pointer; }
.tb-pay-opt:has(input:checked) { border-color: var(--tb-ink); background: var(--tb-ground); }
.tb-pay-opt input { width: 18px; height: 18px; margin: 3px 0 0; flex: none; accent-color: var(--tb-ink); }
.tb-pay-opt b { display: block; font-size: 14px; }
.tb-pay-opt small { display: block; color: var(--tb-muted); font-size: 12.5px; }

/* Ô hóa đơn ẩn tới khi khách tích "Xuất hóa đơn VAT". */
.tb-invoice:not(:has(input[type="checkbox"]:checked)) .tb-invoice__fields { display: none; }
.tb-invoice .tb-form-grid { margin-top: 12px; }
/* Chữ đồng ý điều khoản thường xuống hai dòng: ô tích bám dòng đầu thay vì trôi vào giữa. */
.tb-terms { align-items: flex-start; }
.tb-terms input { margin-top: 2px; }

.tb-mini-lines { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.tb-mini-lines li { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; font-size: 13.5px; }
.tb-mini-lines img { width: 52px; aspect-ratio: 1; object-fit: cover; background: var(--tb-mist); }
.tb-mini-lines small { color: var(--tb-muted); }
.tb-mini-lines b { font-variant-numeric: tabular-nums; font-weight: 600; }

.tb-orders { padding-block: 32px 80px; }
.tb-order-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.tb-order-card { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 16px; padding: 16px 18px; background: var(--tb-paper); text-decoration: none; transition: box-shadow .2s; }
.tb-order-card:hover { box-shadow: var(--tb-shadow); }
.tb-order-card img { width: 72px; aspect-ratio: 1; object-fit: cover; background: var(--tb-mist); }
.tb-order-card__body { display: grid; gap: 4px; min-width: 0; }
.tb-order-card__body p { margin: 0; }
.tb-order-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tb-order-card__total { font-family: var(--tb-f-display); font-size: 17px; font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) {
    .tb-order-card { grid-template-columns: 56px 1fr; }
    .tb-order-card img { width: 56px; }
    .tb-order-card__total { grid-column: 2; }
}

.tb-status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.tb-status--wait { background: #FDF3DC; color: #7A5A12; }
.tb-status--go { background: #E3EEF9; color: #1D4F86; }
.tb-status--done { background: #E2F2E7; color: #1F6B3A; }
.tb-status--stop { background: var(--tb-blush); color: var(--tb-red-deep); }

.tb-success { display: flex; align-items: center; gap: 18px; margin-top: 24px; padding: 22px; background: var(--tb-paper); }
.tb-success h2 { margin: 0 0 4px; font-size: 22px; }
.tb-success p { margin: 0; color: var(--tb-ink-soft); }
.tb-success__tick { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--tb-ink); color: var(--tb-on-ink); }
.tb-success__tick svg { width: 24px; height: 24px; }
.tb-alert--ok { background: #E2F2E7; border-color: #2E7A4B; }

.tb-mini-lines--order li { grid-template-columns: 64px 1fr auto; }
.tb-mini-lines--order img { width: 64px; }
.tb-mini-lines--order span { display: grid; gap: 2px; }
.tb-mini-lines--order a { font-weight: 600; text-decoration: none; }

.tb-timeline { display: grid; gap: 14px; margin: 0; padding: 0 0 0 18px; list-style: none; border-left: 2px solid var(--tb-line); }
.tb-timeline li { position: relative; display: grid; gap: 2px; font-size: 14px; }
.tb-timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--tb-ink); border: 2px solid var(--tb-paper); }
.tb-timeline time, .tb-timeline span { color: var(--tb-muted); font-size: 12.5px; }
/* Bước mới nhất đứng đầu (Orders/Details đảo thứ tự) — chấm đỏ cho biết đơn đang ở đây. */
.tb-timeline li:first-child::before { background: var(--tb-red); }

.tb-address { margin: 0; font-size: 14px; line-height: 1.6; }
.tb-cancel { display: grid; gap: 10px; margin: 0; padding-top: 12px; border-top: 1px solid var(--tb-line); }

/* 11 — Thanh toán VietQR */

.tb-paybox { display: grid; gap: 10px; padding: 14px; background: var(--tb-ground); }
.tb-paybox p { margin: 0; font-size: 14px; }
.tb-paybox form { margin: 0; }

.tb-sandbox { display: grid; justify-items: center; gap: 18px; padding-block: 32px 80px; }
.tb-sandbox__warn { max-width: 560px; padding: 14px 18px; border: 1px dashed var(--tb-gold); background: #FBF5E8; font-size: 14px; }
.tb-sandbox__card { display: grid; gap: 16px; width: min(420px, 100%); padding: 26px; background: var(--tb-paper); }
.tb-sandbox__card form { margin: 0; }
.tb-sandbox__qr {
    display: grid;
    place-items: center;
    width: 180px;
    aspect-ratio: 1;
    margin-inline: auto;
    border: 2px dashed var(--tb-line);
    color: var(--tb-muted);
    font: 700 28px/1 var(--tb-f-display);
    letter-spacing: .2em;
}

/* 09 — Trang chữ và form (chính sách, đăng nhập, lỗi) */

/* Thanh báo bảo trì (Views/Shared/Components/MaintenanceBanner) và trang bảo trì (Views/Home/Maintenance). */
.tb-maint-banner { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px clamp(12px, 3vw, 24px); background: var(--tb-ink); color: #fff; font-size: 14px; text-align: center; }
.tb-maint-banner--paused { background: var(--tb-red); }
.tb-maint-banner[hidden] { display: none; }
.tb-maint-banner p { margin: 0; }
.tb-maint-banner__close { flex: none; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.tb-btn--off { opacity: .5; pointer-events: none; }
.tb-maint-body { min-height: 100vh; display: grid; place-items: center; background: var(--tb-paper, #fff); }
/* _BareLayout không nạp Bootstrap nên không có reboot border-box: nút rộng 100% cộng đệm tràn khung (lộ ra khi cửa hàng có hotline). */
.tb-maint-page, .tb-maint-page *, .tb-maint-page *::before, .tb-maint-page *::after { box-sizing: border-box; }
.tb-maint-page { box-sizing: border-box; width: min(100%, 560px); padding: clamp(20px, 6vw, 48px) 16px; }
.tb-maint-page__card { padding: clamp(24px, 6vw, 44px); border: 1px solid var(--tb-line); border-radius: 16px; background: #fff; text-align: center; }
.tb-maint-page__card .tb-emblem { width: 56px; height: 56px; margin-bottom: 12px; color: var(--tb-ink); }
.tb-maint-page__card h1 { margin: 0 0 12px; font-size: clamp(24px, 6vw, 34px); }
.tb-maint-page__help { margin-block: 20px 12px; }
.tb-maint-page__help .tb-btn { margin-top: 8px; }
.tb-page-banner { padding-block: clamp(36px, 5vw, 64px) clamp(24px, 3vw, 36px); border-bottom: 1px solid var(--tb-line); }
.tb-page-banner h1 { margin: 0; font-size: clamp(30px, 4.4vw, 52px); }
.tb-page-banner h1 .tb-script { margin-left: 10px; color: var(--tb-red); font-size: .7em; }
.tb-page-banner p { margin: 12px 0 0; max-width: 60ch; color: var(--tb-ink-soft); }
.tb-page-banner .tb-btn { margin-top: 12px; }

.tb-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: 12.5px; color: var(--tb-muted); }
.tb-crumbs a { text-decoration: none; }
.tb-crumbs a:hover { color: var(--tb-ink); }
.tb-crumbs span[aria-hidden] { opacity: .5; }

.tb-policy { display: grid; gap: clamp(28px, 4vw, 40px); max-width: 820px; padding-block: 40px 80px; }
.tb-policy h2 { margin: 0 0 10px; font-size: clamp(20px, 2vw, 24px); }
.tb-policy p { margin: 0; color: var(--tb-ink-soft); }
.tb-policy p + p { margin-top: 12px; }
.tb-policy ul { margin: 0; padding-left: 1.2em; color: var(--tb-ink-soft); }
.tb-policy li + li { margin-top: 8px; }
.tb-policy a { text-decoration: underline; text-underline-offset: 2px; }
.tb-policy__table { overflow-x: auto; }
.tb-policy table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tb-policy th, .tb-policy td { padding: 10px 12px; border-bottom: 1px solid var(--tb-line, #e3e6e4); text-align: left; vertical-align: top; }
.tb-policy code { font-size: .92em; overflow-wrap: anywhere; color: var(--tb-ink); }
.tb-seller { font-style: normal; line-height: 1.7; color: var(--tb-ink-soft); }

.tb-auth { padding-block: 40px 80px; }
.tb-auth__form { display: grid; gap: 16px; max-width: 440px; padding: clamp(20px, 3vw, 32px); background: var(--tb-paper); }
.tb-field { display: grid; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; }
.tb-field input, .tb-field textarea, .tb-field select {
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--tb-line);
    border-radius: 4px;
    background: var(--tb-ground);
    color: var(--tb-ink);
    font: 400 14.5px/1.4 var(--tb-f-body);
}
.tb-field textarea { min-height: 96px; resize: vertical; }
.tb-field input:focus, .tb-field textarea:focus, .tb-field select:focus { outline: none; border-color: var(--tb-ink); background: var(--tb-paper); }
.tb-field input:focus-visible, .tb-field textarea:focus-visible, .tb-field select:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tb-ink) 28%, transparent); }
.tb-field .tb-note { font-weight: 400; }
.tb-field-error { color: var(--tb-red); font-size: 12.5px; font-weight: 500; }
.tb-field-error ul { margin: 0; padding-left: 18px; }

/* Đăng nhập — cùng một panel trong popup ở header và trên trang /Account/Login. */
.tb-login-modal .modal-content { border: 0; border-radius: 18px; background: var(--tb-paper); color: var(--tb-ink); box-shadow: var(--tb-shadow); }
.tb-login-modal .modal-header { padding: 22px clamp(18px, 4vw, 28px) 0; border: 0; }
.tb-login-modal .modal-title { margin: 0; font-size: 22px; }
.tb-login-modal .modal-body { padding: 10px clamp(18px, 4vw, 28px) 26px; }
.tb-login-tabs { gap: 24px; margin-bottom: 18px; }
.tb-login-form { display: grid; gap: 14px; }
.tb-login-form [hidden] { display: none; }
.tb-login-message { margin: 0; color: var(--tb-red); font-size: 13px; }
.tb-login-message:empty { display: none; }
.tb-login-message.is-ok, .tb-note.is-ok { color: #2E7A4B; }
.tb-login-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.tb-login-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--tb-ink-soft); font-size: 13.5px; text-decoration: underline; cursor: pointer; }
.tb-login-link:disabled { color: var(--tb-muted); text-decoration: none; cursor: default; }
.tb-google { display: flex; justify-content: center; min-height: 44px; }
.tb-google-off code { font-size: 12px; }
.tb-login-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--tb-muted); font-size: 12.5px; }
.tb-login-or::before, .tb-login-or::after { content: ""; flex: 1; height: 1px; background: var(--tb-line); }
.tb-login-foot { margin-top: 18px; text-align: center; }
/* min-width: 0 — hàng này là ô lưới của .tb-field: để mặc định thì lưới không co dưới bề rộng tự nhiên của ô nhập,
   và khi nút đổi thành "Gửi lại (59 giây)" cả hàng lòi khỏi form ở 375px. */
.tb-otp-row { display: flex; gap: 8px; min-width: 0; }
.tb-otp-row input { flex: 1; min-width: 0; }
.tb-otp-row .tb-btn { flex: none; }

/* Khách chưa đăng nhập: nhắc rằng không cần tài khoản, và cách xem lại đơn ở máy khác. */
.tb-guest-note { display: grid; gap: 4px; margin: 24px 0 0; padding: 14px 18px; border-left: 3px solid var(--tb-gold); background: var(--tb-paper); font-size: 14px; }
.tb-guest-note p { margin: 0; }
.tb-cart-main > .tb-guest-note { margin: 0 0 20px; }

/* 08 — Thông báo nổi (thêm vào giỏ không rời trang) */

.tb-toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 1090;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: calc(100vw - 32px);
    padding: 8px 8px 8px 18px;
    border-radius: 999px;
    background: var(--tb-ink);
    color: var(--tb-on-ink);
    box-shadow: 0 20px 40px -12px rgba(21, 54, 42, .5);
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    /* visibility chứ không chỉ opacity: link "Xem giỏ" trong thông báo đang ẩn không được nhận Tab. */
    visibility: hidden;
    transform: translate(-50%, 20px);
    transition: opacity .25s, transform .25s, visibility .25s;
}
.tb-toast.is-shown { opacity: 1; pointer-events: auto; visibility: visible; transform: translate(-50%, 0); }
.tb-toast.is-error { background: var(--tb-red-deep); }
.tb-toast.is-error a { display: none; }
.tb-toast a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: var(--tb-gold-light);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

/* 12 — Nút liên hệ nổi: Facebook, Zalo, gọi hotline (markup ở Shared/_ContactButtons.cshtml; link/số ở Giao diện chung, luật ở API).
   Nằm dưới popup, menu trượt và thông báo nổi; điện thoại chỉ còn icon tròn, tên đọc bằng aria-label. */

.tb-contact {
    position: fixed;
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 1030;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}
.tb-contact__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 6px 18px 6px 6px;
    border-radius: 999px;
    color: #fff;
    box-shadow: 0 12px 28px -10px rgba(21, 54, 42, .55);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.tb-contact__btn:hover,
.tb-contact__btn:focus-visible { color: #fff; filter: brightness(1.1); }
.tb-contact__btn--call { background: var(--tb-red); }
.tb-contact__btn--zalo { background: #0068FF; }
/* Xanh Facebook đậm hơn màu thương hiệu (#1877F2 chỉ đạt 4.2:1 với chữ trắng) để nhãn "Facebook" 14px đạt 4.5:1. */
.tb-contact__btn--facebook { background: #1567D3; }
.tb-contact__btn--facebook .tb-contact__icon { font-size: 22px; line-height: 1; }
.tb-contact__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    font-size: 12px;
    font-weight: 700;
}
.tb-contact__icon svg { width: 20px; height: 20px; }

@media (max-width: 767.98px) {
    /* Ba nút chồng nhau: thu còn 44px (mức tối thiểu cho ngón tay) để cụm cao 148px thay vì 176px. */
    .tb-contact { gap: 8px; }
    .tb-contact__btn { min-height: 44px; padding: 4px; }
    .tb-contact__icon { width: 36px; height: 36px; }
    .tb-contact__text { display: none; }
}

/* 13 — Trả hàng và hóa đơn điện tử ở trang đơn (Orders/Details), trang tra cứu hóa đơn (Orders/Invoice) */

.tb-return { display: grid; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--tb-line); }
.tb-return p { margin: 0; font-size: 14px; }
.tb-return__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tb-return form { margin: 4px 0 0; }
.tb-return-form > summary,
.tb-address-form > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; cursor: pointer; }
.tb-return-form form { display: grid; gap: 14px; margin-top: 10px; }
/* Ô chọn file có bề rộng tối thiểu ~360px của trình duyệt; không cho nó (và khung lưới bọc nó) nong trang điện thoại. */
.tb-return-form, .tb-return-form form, .tb-return-form .tb-field { min-width: 0; }
.tb-return-form input[type="file"] { width: 100%; max-width: 100%; }
.tb-return-line { display: grid; grid-template-columns: 52px 1fr 88px; align-items: center; gap: 12px; font-size: 14px; }
.tb-return-line img { width: 52px; aspect-ratio: 1; object-fit: cover; background: var(--tb-mist); }
.tb-return-line span { display: grid; gap: 2px; }
.tb-return-line small { color: var(--tb-muted); }
.tb-return-line input { width: 100%; min-height: 44px; padding: 0 10px; border: 1px solid var(--tb-line); text-align: center; }
.tb-return-choice { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; border: 0; }
.tb-return-choice legend { width: 100%; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.tb-return-choice label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; }
/* Tài khoản nhận tiền hoàn chỉ cần khi chọn hoàn tiền — ẩn bằng :has, không cần script. */
.tb-refund-account { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.tb-refund-account legend { margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.tb-return-form form:has(input[name="Resolution"][value="REPLACEMENT"]:checked) .tb-refund-account { display: none; }

.tb-invoice { display: grid; gap: 16px; padding-block: 28px 64px; }
.tb-invoice__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.tb-invoice__paper { display: grid; gap: 22px; padding: clamp(18px, 4vw, 40px); background: var(--tb-paper); box-shadow: var(--tb-shadow); }
.tb-invoice__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--tb-ink); }
.tb-invoice__head h1 { margin: 0; font-size: clamp(20px, 3vw, 26px); text-transform: uppercase; }
.tb-invoice__head p { margin: 4px 0 0; color: var(--tb-muted); font-size: 13px; }
.tb-invoice__meta { display: grid; grid-template-columns: max-content max-content; gap: 4px 16px; margin: 0; font-size: 14px; }
.tb-invoice__meta div { display: contents; }
.tb-invoice__totals div { display: flex; justify-content: space-between; gap: 16px; }
.tb-invoice__meta dt { color: var(--tb-muted); font-weight: 400; }
.tb-invoice__meta dd { margin: 0; font-weight: 600; }
.tb-invoice__parties { display: flex; flex-wrap: wrap; gap: 16px 40px; }
.tb-invoice__parties section { flex: 1 1 260px; display: grid; align-content: start; gap: 4px; }
.tb-invoice__parties h2 { margin: 0 0 4px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--tb-muted); }
.tb-invoice__parties p { margin: 0; font-size: 14px; }
.tb-invoice__table { overflow-x: auto; }
.tb-invoice__table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 13.5px; }
.tb-invoice__table th,
.tb-invoice__table td { padding: 8px 6px; border-bottom: 1px solid var(--tb-line); text-align: left; vertical-align: top; }
.tb-invoice__table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-invoice__totals { display: grid; gap: 6px; width: min(100%, 380px); margin: 0 0 0 auto; font-size: 14px; }
.tb-invoice__totals dt { font-weight: 400; }
.tb-invoice__totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.tb-invoice__grand { padding-top: 8px; border-top: 1px solid var(--tb-ink); font-size: 16px; font-weight: 700; }
.tb-invoice__foot { margin: 0; }

/* In hóa đơn: chỉ còn tờ hóa đơn — bỏ đầu trang, chân trang, nút nổi, thanh công cụ. */
@media print {
    .tb-announce, .tb-header, .tb-footer, .tb-contact, .tb-toast, .tb-invoice__bar { display: none !important; }
    body.tb { background: #fff; }
    .tb-invoice { padding: 0; }
    .tb-invoice__paper { padding: 0; box-shadow: none; }
}

/* 14 — Tài khoản của khách: hồ sơ, sổ địa chỉ (Account/Profile, Account/Addresses), thanh _AccountNav */

.tb-account { display: grid; gap: 20px; padding-block: 24px 80px; }
.tb-account .tb-alert { margin: 0; }
.tb-account .tb-panel { margin: 0; }
.tb-account__form { display: grid; gap: 14px; min-width: 0; }
.tb-account__form > .tb-btn { justify-self: start; }
.tb-account__lead { margin: 0; color: var(--tb-ink-soft); font-size: 14px; }

/* Hồ sơ: thẻ danh tính bên trái, các hàng thông tin bên phải. Hai khối tự xuống dòng khi hẹp; thẻ đứng trước trong
   HTML nên trên điện thoại khách thấy "tài khoản của ai" trước rồi mới tới các hàng. */
.tb-profile { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.tb-profile__card { flex: 1 1 300px; min-width: 0; }
.tb-profile__rows { flex: 999 1 440px; min-width: 0; --row-pad: clamp(18px, 2.4vw, 26px); background: var(--tb-paper); }

.tb-profile__who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tb-profile__card .tb-profile__name { font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.tb-avatar { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--tb-ink); color: var(--tb-on-ink); font: 700 17px/1 var(--tb-f-display); letter-spacing: .02em; }

.tb-todo { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.tb-todo__item { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; }
.tb-todo__item.is-done { color: var(--tb-ink-soft); }
.tb-todo__item a { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto; padding-left: 12px; color: var(--tb-red); font-size: 13px; font-weight: 600; text-decoration: none; }
.tb-todo__item a:hover { text-decoration: underline; }
.tb-tick { position: relative; flex: none; width: 20px; height: 20px; border: 1.5px solid var(--tb-line); border-radius: 50%; }
.tb-todo__item.is-done .tb-tick { border-color: #2E7A4B; background: #2E7A4B; }
.tb-todo__item.is-done .tb-tick::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Mỗi hàng: nhãn | giá trị | nút. Nút là một span trong summary (button lồng trong summary thì trình duyệt không
   bấm được ổn định), cả hàng là vùng bấm. flex-wrap để hàng hẹp tự xếp nhãn lên trên, giá trị và nút xuống dưới. */
.tb-row { border-top: 1px solid var(--tb-line); }
.tb-row:first-child { border-top: 0; }
.tb-row__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 12px var(--row-pad); }
summary.tb-row__head { list-style: none; cursor: pointer; }
summary.tb-row__head::-webkit-details-marker { display: none; }
summary.tb-row__head:hover { background: var(--tb-ground); }
summary.tb-row__head:hover .tb-row__action { background: var(--tb-ink); color: var(--tb-on-ink); }
summary.tb-row__head:focus-visible { outline-offset: -2px; }
.tb-row__label { flex: 0 0 128px; font-size: 13px; font-weight: 600; color: var(--tb-ink-soft); }
/* Email dài không có chỗ ngắt tự nhiên: cho xuống dòng giữa chữ thay vì đẩy tràn khung ở 375px. */
.tb-row__value { display: flex; flex: 1 1 180px; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.tb-row__empty { color: var(--tb-muted); }
.tb-row__action { margin-left: auto; }
.tb-row__close { display: none; }
.tb-row[open] .tb-row__open { display: none; }
.tb-row[open] .tb-row__close { display: inline; }
.tb-row__body { display: grid; gap: 14px; padding: 4px var(--row-pad) 26px; animation: tb-row-in .18s ease-out; }
.tb-row__body .tb-account__form { max-width: 460px; }
.tb-row__note { padding: 0 var(--row-pad) 16px; }
@keyframes tb-row-in { from { opacity: 0; transform: translateY(-4px); } }

/* Điện thoại: thẻ danh tính đứng trên các hàng nên chỉ liệt kê việc còn thiếu cho thấp — việc đã xong đã nằm trong
   dòng "Còn N việc". Đủ cả thì không còn gì để liệt kê, ẩn luôn danh sách. */
@media (max-width: 767.98px) {
    .tb-todo__item.is-done, .tb-todo:not(:has(a)) { display: none; }
}

/* Chip đang chọn: trang tài khoản đang mở, địa chỉ đang điền ở trang đặt hàng. */
.tb-chip[aria-current] { border-color: var(--tb-ink); background: var(--tb-ink); color: var(--tb-on-ink); }
.tb-chip[aria-current]:hover { color: var(--tb-on-ink); }

.tb-address-book { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.tb-address-card { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 18px; background: var(--tb-paper); }
.tb-address-card .tb-address { overflow-wrap: anywhere; }
.tb-address-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tb-address-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-address-card__actions form { margin: 0; }
.tb-address-form[open] > summary { margin-bottom: 12px; }
.tb-address-form__default { justify-self: start; }

/* Trang huỷ nhận tin (/h/{token}) mở từ SMS trên điện thoại: nút xếp dọc, chiếm hết bề ngang thẻ, chữ được phép xuống dòng. */
.tb-optout p { margin: 0; color: var(--tb-ink-soft); }
.tb-optout form { display: grid; gap: 10px; margin: 0; }
.tb-optout .tb-btn { white-space: normal; text-align: center; }

@media (prefers-reduced-motion: reduce) {
    .tb *, .tb *::before, .tb *::after { transition: none !important; animation: none !important; }
}
