/* Thanh Bình Technology — shared styles (tokens, layout, header, footer, floating buttons) */
:root {
  --primary: #0B6FE8;
  --primary-tint: #EAF3FF;
  --primary-border: #D6E6FB;
  --accent: #F28C00;
  --accent-tint: #FFF3E5;
  --accent-text: #B45F00;
  --accent-line: #FFE1BD;
  --ink: #111111;
  --text: #232529;
  --body: #4A5565;
  --muted: #697586;
  --line: #E5E7EB;
  --page-alt: #F3F7FF;
  --input-border: #C5C5C7;
}

html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; font-family: Inter, sans-serif; color: #4a4a4a; background: #fff; -webkit-font-smoothing: antialiased; }
*, *::before, *::after { box-sizing: border-box; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }
/* Home + product pages use ink link hover (set via @section('body_class', 'hover-ink')) */
:where(.hover-ink) a:hover { color: #111; }
h1, h2, h3, h4, p, ul { margin: 0; }
img { max-width: 100%; }
[x-cloak] { display: none !important; }

@keyframes shake-phone { 0% { transform: rotate(0) } 10% { transform: rotate(-15deg) } 20% { transform: rotate(15deg) } 30% { transform: rotate(-10deg) } 40% { transform: rotate(10deg) } 50%, 100% { transform: rotate(0) } }
@keyframes pulse-mail { 0% { box-shadow: 0 0 0 0 rgba(0,153,255,.7) } 70% { box-shadow: 0 0 0 12px rgba(0,153,255,0) } 100% { box-shadow: 0 0 0 0 rgba(0,153,255,0) } }
@keyframes hero-settle { from { transform: scale(1.07) } to { transform: scale(1) } }

.tb-page { min-height: 100vh; display: flex; flex-direction: column; }
.tb-container { width: 95vw; max-width: 1360px; margin: 0 auto; padding: 0 15px; }

/* ---------- Header ---------- */
.tb-header-wrap { position: sticky; top: 0; z-index: 50; }
@media (min-width: 1200px) { .tb-header-wrap { top: -36px; } }

.tb-header { background: #fff; transition: box-shadow .3s; }
.tb-header.is-scrolled { box-shadow: 0 4px 22px rgba(17,17,17,.13); }

.tb-topbar { background: var(--primary); height: 36px; overflow: hidden; display: none; }
.tb-topbar .tb-container { height: 36px; display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.tb-topbar a { color: #fff; display: flex; gap: 8px; align-items: center; font-size: 16px; font-weight: 600; }
.tb-topbar a:hover { color: #fff; opacity: .85; }

.tb-bar { height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 20px; transition: height .25s; }
.tb-header.is-scrolled .tb-bar { height: 70px; }
.tb-logo { display: flex; align-items: center; width: 200px; flex: none; }
.tb-logo img { width: 100%; height: auto; max-height: 76px; display: block; object-fit: contain; transition: max-height .25s; }
.tb-header.is-scrolled .tb-logo img { max-height: 60px; }

.tb-nav { display: none; align-items: center; height: 100%; }
.tb-nav-item { position: relative; height: 100%; display: flex; align-items: center; }
.tb-nav-link { margin: 0 12px; padding: 8px 0; font-size: 18px; font-weight: 400; color: var(--primary); border-bottom: 3px solid transparent; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.tb-nav-link:hover { color: #111; }
.tb-nav-link.is-active { font-weight: 700; border-bottom-color: var(--primary); }
.tb-nav-search { margin-left: 10px; padding: 8px; border: 0; background: transparent; color: var(--primary); display: flex; align-items: center; cursor: pointer; border-radius: 50%; }
.tb-nav-search:hover, .tb-nav-search[aria-expanded="true"] { color: var(--accent); background: var(--accent-tint); }
.tb-search-mobile { margin-left: auto; width: 44px; height: 44px; border: 0; background: transparent; color: var(--primary); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tb-search-mobile svg { width: 22px; height: 22px; }

/* Header search panel (opens under the bar) */
.tb-search-panel { border-top: 1px solid var(--line); background: #fff; box-shadow: 0 10px 20px rgba(17,17,17,.08); }
.tb-search-form { display: flex; align-items: center; gap: 10px; padding-top: 14px; padding-bottom: 14px; }
.tb-search-form input { flex: 1; min-width: 0; height: 46px; border: 1px solid var(--input-border); border-radius: 8px; padding: 0 16px; font: inherit; font-size: 16px; color: var(--text); outline: 0; }
.tb-search-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.tb-search-go { height: 46px; padding: 0 24px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.tb-search-go:hover { background: var(--primary); }
.tb-search-close { width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer; }
.tb-search-close:hover { color: var(--text); }

.tb-hamburger { white-space: nowrap; width: 44px; height: 44px; border: 0; background: transparent; color: var(--primary); font-size: 30px; cursor: pointer; line-height: 1; }

@media (min-width: 1200px) {
  .tb-topbar { display: block; }
  .tb-nav { display: flex; }
  .tb-hamburger { display: none; }
  .tb-search-mobile { display: none; }
}

/* Mega menus */
.tb-mega { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); max-width: 96vw; background: #fff; border: 2px solid #ddd; box-shadow: 1px 1px 15px rgba(0,0,0,.15); z-index: 5; }
.tb-mega-gp { width: 700px; padding: 20px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px 30px; }
.tb-mega-gp .tb-mega-title { font-size: 18px; font-weight: 700; color: #000; margin: 0 0 10px; }
.tb-mega-gp .col { display: flex; flex-direction: column; }
.tb-mega-gp a { font-size: 16px; font-weight: 500; color: var(--primary); padding: 5px 0; }
.tb-mega-gp a:hover { color: #111; }

.tb-mega-sp { width: 780px; display: grid; grid-template-columns: 280px minmax(0,1fr); }
.tb-mega-sp .parents { background: var(--page-alt); padding: 14px 0; display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.tb-mega-sp .parent { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 20px; font-size: 16px; font-weight: 500; color: var(--text); background: transparent; border-left: 3px solid transparent; }
.tb-mega-sp .parent.is-on { font-weight: 700; color: var(--primary); background: #fff; border-left-color: var(--accent); }
.tb-mega-sp .all { margin: 10px 20px 0; padding-top: 12px; border-top: 1px solid #DCE4EF; font-size: 14px; font-weight: 700; color: var(--primary); }
.tb-mega-sp .all:hover { color: #111; }
.tb-mega-sp .panel { padding: 22px 26px; display: flex; flex-direction: column; gap: 14px; }
.tb-mega-sp .panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 3px solid var(--accent); }
.tb-mega-sp .panel-head .tb-mega-title { font-size: 18px; font-weight: 700; color: #000; margin: 0; }
.tb-mega-sp .panel-head a { font-size: 13px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.tb-mega-sp .subs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px 18px; max-height: 340px; overflow-y: auto; align-content: start; }
.tb-mega-sp .sub { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 15px; font-weight: 500; color: var(--text); border: 1px solid transparent; }
.tb-mega-sp .sub:hover { background: var(--primary-tint); color: var(--primary); border-color: var(--primary-border); }
.tb-mega-sp .sub .count { font-size: 12px; color: var(--muted); flex: none; }

/* Mobile drawer */
.tb-drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.53); z-index: 90; }
.tb-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 300px; background: #fff; z-index: 91; padding: 65px 20px 20px; display: flex; flex-direction: column; overflow-y: auto; }
.tb-drawer-close { position: absolute; right: 15px; top: 12px; font-size: 28px; border: 0; background: transparent; cursor: pointer; color: var(--text); }
.tb-drawer a { padding: 15px 0; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .02em; color: var(--text); border-top: 1px solid #ececec; }
.tb-drawer a.is-active { color: var(--primary); }
.tb-drawer-search { display: flex; gap: 6px; margin-bottom: 14px; }
.tb-drawer-search input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--input-border); border-radius: 8px; padding: 0 12px; font: inherit; font-size: 15px; outline: 0; }
.tb-drawer-search input:focus { border-color: var(--primary); }
.tb-drawer-search button { width: 44px; height: 40px; flex: none; border: 0; border-radius: 8px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* Mobile bottom nav */
.tb-bottom-nav { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(17,17,17,.08); grid-template-columns: repeat(5, minmax(0,1fr)); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tb-bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; color: var(--body); font-size: 11px; font-weight: 500; text-align: center; line-height: 1.15; position: relative; }
.tb-bottom-nav .bar { position: absolute; top: -6px; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: transparent; }
.tb-bottom-nav .pill { width: 44px; height: 28px; border-radius: 14px; background: transparent; display: flex; align-items: center; justify-content: center; }
.tb-bottom-nav a.is-on { color: var(--primary); font-weight: 700; }
.tb-bottom-nav a.is-on .bar { background: var(--primary); }
.tb-bottom-nav a.is-on .pill { background: var(--primary-tint); }
.tb-bottom-nav a.is-call { color: var(--accent); font-weight: 700; }
.tb-bottom-nav a.is-call .pill { background: var(--accent-tint); }

/* Floating buttons */
.tb-to-top { white-space: nowrap; position: fixed; right: 24px; bottom: 145px; z-index: 80; width: 42px; height: 42px; border-radius: 50%; border: 2px solid #fff; background: var(--primary); color: #fff; font-size: 21px; cursor: pointer; box-shadow: 0 3px 14px rgba(17,17,17,.13); }
.tb-fabs { position: fixed; right: 24px; bottom: 24px; z-index: 99; display: flex; flex-direction: column; gap: 16px; align-items: flex-end; }
.tb-fab { white-space: nowrap; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; transition: transform .2s; }
.tb-fab:hover { transform: scale(1.1) translateY(-1px); }
.tb-fab img { width: 100%; height: 100%; }
.tb-fab-call { border-radius: 50%; background: #7AC943; padding: 10px; }
.tb-fab-call img { animation: shake-phone 1.2s infinite; transform-origin: 50% 80%; }
.tb-fab-mail { border-radius: 12px; overflow: hidden; }
.tb-fab-mail img { animation: pulse-mail 1.5s infinite; }

@media (max-width: 767px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .tb-bottom-nav { display: grid; }
  .tb-fabs { right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); gap: 10px; }
  .tb-fab { width: 46px; height: 46px; }
  .tb-to-top { bottom: calc(196px + env(safe-area-inset-bottom)); right: 16px; }
}

/* ---------- Footer ---------- */
.tb-footer { background: var(--ink); padding: 70px 0 30px; }
.tb-footer-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 30px; }
@media (min-width: 600px) { .tb-footer-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1000px) { .tb-footer-grid { grid-template-columns: 2fr 2fr 3fr 2fr 3fr; } }
.tb-footer-logo { background: #fff; border-radius: 12px; padding: 14px 18px; max-width: 220px; }
.tb-footer-logo img { width: 100%; height: auto; display: block; }
.tb-footer-col { display: flex; flex-direction: column; gap: 10px; }
.tb-footer-col .tb-footer-title { font-size: 15px; line-height: normal; font-weight: 500; color: #D4D4D4; margin: 0 0 6px; }
.tb-footer-col a, .tb-footer-col p { font-size: 14px; line-height: 1.5; color: rgba(255,255,255,.95); }
.tb-footer-col a:hover { color: var(--accent); }
.tb-newsletter { display: flex; gap: 16px; }
.tb-newsletter input { flex: 1; min-width: 0; height: 40px; border: 1px solid rgba(0,0,0,.1); border-radius: 8px; background: #fff; padding: 0 12px; font: inherit; font-size: 15px; color: var(--text); outline: 0; }
.tb-newsletter button { white-space: nowrap; width: 64px; height: 40px; flex: none; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: 18px; cursor: pointer; }
.tb-newsletter button:hover { background: var(--primary); }
.tb-footer-bottom { margin-top: 30px; padding-top: 47px; border-top: 1px solid #D3D3D3; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.tb-footer-bottom p { color: #fff; font-size: 16px; }
.tb-social { display: flex; gap: 10px; }
.tb-social a { white-space: nowrap; width: 36px; height: 36px; border: 2px solid #fff; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; }
.tb-social a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Shared form notice ---------- */
.tb-demo-note { font-size: 13px; }

/* ---------- Layout / header / footer helpers (formerly inline styles) ---------- */
.tb-main { flex: 1; }
.tb-mega-sp .parent .tb-mega-arrow { font-size: 14px; }
.tb-footer-col.tb-footer-news { gap: 12px; }
.tb-footer-col.tb-footer-news .tb-footer-title { margin-bottom: 4px; }
.tb-footer-col p.tb-footer-ok { color: #fff; }

/* ---------- Public forms (tbForm component, see public/js/site.js) ---------- */
.tb-honeypot { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.tb-form-fb { display: flex; flex-direction: column; gap: 6px; }
.tb-form-ok { font-size: 14px; color: var(--primary, #0B6FE8); }
.tb-form-err, .tb-form-errs { font-size: 13px; line-height: 1.5; color: #D92D20; }
.tb-form-errs { margin: 0; padding-left: 18px; list-style: disc; }
.tb-form-fb--dark .tb-form-ok { color: #fff; }
.tb-form-fb--dark .tb-form-err, .tb-form-fb--dark .tb-form-errs { color: #FFC9C2; }
form [type=submit][disabled] { opacity: .6; cursor: wait; }

/* Rich-text wrapper (<div class="tb-rt" x-ignore>): no box of its own, children keep the parent's layout */
.tb-rt { display: contents; }
/* Breadcrumb list (<nav aria-label="Breadcrumb"><ol class="tb-crumbs"><li>…): the <ol>/<li> boxes are
   dropped so links and separators stay flex items of the page's own crumb container */
.tb-crumbs, .tb-crumbs > li { display: contents; }
