/* Phụ tùng ô tô Anh Dũng – giao diện chung
   Đổi màu thương hiệu: sửa các biến trong :root */
:root {
  --navy: #0F2D4A;
  --navy-2: #1B4470;
  --accent: #F5A000;      /* cam công nghiệp – nền nút chính, chữ đen */
  --accent-ink: #1A1A1A;
  --call: #15803D;        /* xanh lá – nút gọi */
  --zalo: #0068FF;        /* xanh Zalo */
  --bg: #F3F5F7;
  --card: #FFFFFF;
  --ink: #1C2430;
  --muted: #4A5565;
  --line: #D6DCE3;
  --ok: #DCFCE7; --ok-ink: #14532D;
  --out: #FEE2E2; --out-ink: #7F1D1D;
  --unk: #FEF3C7; --unk-ink: #713F12;
  --radius: 10px;
  --max: 1180px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: 76px; /* chừa chỗ cho thanh liên hệ dưới đáy trên điện thoại */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-2); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; color: var(--navy); margin: 0 0 .6em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .9em; }
svg { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.2em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 10px 18px; border-radius: var(--radius); border: 2px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn.sm { min-height: 44px; padding: 8px 14px; font-size: .95rem; }
.btn.lg { min-height: 56px; font-size: 1.08rem; padding: 12px 22px; }
.btn.full { width: 100%; }
.btn-call { background: var(--call); color: #fff; }
.btn-zalo { background: var(--zalo); color: #fff; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-light { background: #fff; color: var(--navy); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn:hover { filter: brightness(.94); }

/* ---------- đầu trang ---------- */
.topbar { background: var(--navy); color: #DCE6F0; font-size: .9rem; }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 4px 18px; padding-top: 6px; padding-bottom: 6px; }
.topbar span { display: inline-flex; align-items: center; gap: 6px; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); min-width: 0; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 10px; background: var(--navy); color: var(--accent);
  display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; letter-spacing: .5px; flex: none;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-size: 1.1rem; line-height: 1.2; }
.brand-text small { color: var(--muted); font-size: .85rem; line-height: 1.3; }
.head-actions { display: none; gap: 8px; }
.search { display: flex; margin: 4px 0 10px; }
.search input {
  flex: 1; min-width: 0; min-height: 52px; padding: 10px 14px; font: inherit; font-size: 1rem;
  border: 2px solid var(--navy); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: #fff; color: var(--ink);
}
.search button {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 18px; min-height: 52px; border: 0;
  background: var(--navy); color: #fff; font: inherit; font-weight: 700; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer;
}
.search.inline input { border-right: 2px solid var(--navy); border-radius: var(--radius); }
.main-nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.main-nav a {
  white-space: nowrap; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--navy);
  font-weight: 600; min-height: 44px; display: inline-flex; align-items: center;
}
.main-nav a[aria-current="page"] { background: var(--navy); color: #fff; }

/* ---------- hero ---------- */
.hero { background: var(--navy); color: #fff; padding: 36px 0 32px; }
.hero h1 { color: #fff; font-size: 1.9rem; max-width: 22ch; }
.hero .lead { font-size: 1.1rem; color: #DCE6F0; max-width: 60ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.hero-cta .btn { flex: 1 1 220px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.hero-points li { display: flex; gap: 8px; align-items: flex-start; }
.hero-points svg { color: var(--accent); margin-top: .2em; }

/* ---------- khối chung ---------- */
.section { padding: 32px 0; }
.section.tight { padding-top: 12px; }
.section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sec-head a { font-weight: 700; }
.lead-dark { color: var(--muted); max-width: 70ch; }
.notice { background: var(--unk); color: var(--unk-ink); border-left: 4px solid #D97706; padding: 10px 12px; border-radius: 6px; font-size: .95rem; }

.cat-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.cat {
  display: flex; flex-direction: column; gap: 2px; padding: 16px; background: #fff; border: 1px solid var(--line);
  border-left: 5px solid var(--accent); border-radius: var(--radius); text-decoration: none; color: var(--ink);
}
.cat b { font-size: 1.1rem; color: var(--navy); }
.cat span { color: var(--muted); font-size: .95rem; }
.cat em { font-style: normal; font-weight: 700; color: var(--navy-2); margin-top: 4px; }

/* ---------- thẻ sản phẩm ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card[hidden] { display: none; }
.card-img { position: relative; display: block; aspect-ratio: 4/3; background: #E7ECF1; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.tag-demo { position: absolute; left: 8px; top: 8px; background: var(--unk); color: var(--unk-ink); font-size: .8rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 1.08rem; margin-bottom: 4px; }
.card h3 a { color: var(--navy); text-decoration: none; }
.code { margin: 0 0 6px; color: var(--muted); }
.code b { color: var(--ink); letter-spacing: .3px; }
.code.big { font-size: 1.1rem; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.pill { font-size: .85rem; padding: 2px 8px; border-radius: 999px; background: #E7ECF1; color: var(--navy); font-weight: 600; }
.pill.ok { background: var(--ok); color: var(--ok-ink); }
.pill.out { background: var(--out); color: var(--out-ink); }
.pill.unk { background: var(--unk); color: var(--unk-ink); }
.price { font-weight: 800; color: #9A3412; margin: auto 0 10px; }
.price.big { font-size: 1.35rem; margin: 6px 0 14px; }
.card-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 100%; min-height: 160px; color: #7A8796; background: #E7ECF1; font-size: .9rem; text-align: center; padding: 10px; }
.ph svg { width: 56px; height: 56px; }

/* ---------- danh sách, lọc ---------- */
.list-tools { margin-bottom: 14px; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; margin: 10px 0; }
.filters summary { font-weight: 700; color: var(--navy); min-height: 48px; display: flex; align-items: center; cursor: pointer; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.filter-grid label { display: flex; flex-direction: column; font-weight: 600; font-size: .95rem; gap: 4px; }
select, input, textarea { font: inherit; color: var(--ink); }
select { min-height: 48px; padding: 6px 10px; border: 1.5px solid #9AA6B2; border-radius: 8px; background: #fff; }
.filters .btn { margin-bottom: 12px; }
.result-count { color: var(--muted); font-weight: 600; }
.empty { background: #fff; border: 1px dashed #9AA6B2; border-radius: var(--radius); padding: 22px; text-align: center; }
.empty .band-cta { justify-content: center; }

/* ---------- các bước, tin cậy ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.steps .num { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; font-size: 1.1rem; }
.steps p { margin: 2px 0 0; color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks svg { color: var(--call); margin-top: .2em; }
.trust { display: grid; gap: 24px; }
.trust-box { background: var(--bg); border-radius: var(--radius); padding: 18px; }
.social { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.band { background: var(--navy-2); color: #fff; padding: 26px 0; }
.band h2 { color: #fff; }
.band p { color: #E3EBF3; }
.band-inner { display: grid; gap: 14px; }
.band-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.band-cta .btn { flex: 1 1 220px; }

/* ---------- chi tiết sản phẩm ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 0 0; margin: 0; font-size: .92rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.product { display: grid; gap: 20px; }
.gallery { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.gallery .ph { aspect-ratio: 4/3; }
.thumbs { display: flex; gap: 6px; padding: 6px; overflow-x: auto; }
.thumbs button { border: 2px solid var(--line); padding: 0; border-radius: 6px; background: none; cursor: pointer; width: 84px; flex: none; }
.video { margin: 12px 0; }
.video-btn { position: relative; padding: 0; border: 0; width: 100%; cursor: pointer; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-btn span { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.72); color: #fff; padding: 12px; font-weight: 700; display: flex; gap: 8px; justify-content: center; font-size: 1.05rem; }
.video iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--radius); }
.p-cta { display: grid; gap: 10px; margin-bottom: 18px; }
.specs { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.specs th, .specs td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs th { width: 40%; color: var(--muted); font-weight: 600; background: #F8FAFB; }

/* ---------- biểu mẫu ---------- */
.two-col { display: grid; gap: 24px; }
.ways { display: grid; gap: 10px; margin-bottom: 18px; }
.way { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); }
.way svg { width: 28px; height: 28px; color: var(--navy-2); }
.way b { display: block; color: var(--navy); }
.way span { color: var(--muted); }
a.way b { text-decoration: underline; text-underline-offset: 3px; }
.tips { padding-left: 1.3em; }
.tips li { margin-bottom: 6px; }
.quote-form { background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--accent); border-radius: var(--radius); padding: 18px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; flex: 1; }
.field label { font-weight: 700; }
.req { color: #B91C1C; font-weight: 600; font-size: .9rem; }
.field input, .field textarea { min-height: 50px; padding: 10px 12px; border: 1.5px solid #9AA6B2; border-radius: 8px; font-size: 1rem; background: #fff; }
.field input:focus, .field textarea:focus { border-color: var(--navy); }
.field input[aria-invalid="true"] { border-color: #B91C1C; background: #FFF5F5; }
.field-row { display: flex; flex-direction: column; gap: 0; }
.hint { color: var(--muted); font-size: .95rem; }
.privacy { color: var(--muted); font-size: .88rem; margin-top: 10px; }
.form-msg { font-weight: 700; margin: 10px 0 0; }
.form-msg.ok { color: var(--ok-ink); }
.form-msg.err { color: #B91C1C; }
.hp { position: absolute; left: -5000px; }
.map { width: 100%; aspect-ratio: 4/3; border: 0; border-radius: var(--radius); margin-bottom: 10px; }
.prose { max-width: 780px; }
.ph-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.ph-row .ph { border-radius: var(--radius); aspect-ratio: 4/3; }

/* ---------- chân trang ---------- */
.site-footer { background: var(--navy); color: #DCE6F0; padding: 30px 0 10px; margin-top: 0; }
.site-footer a { color: #fff; }
.foot-grid { display: grid; gap: 18px; }
.foot-title { font-weight: 800; color: #fff; font-size: 1.05rem; }
.copy { font-size: .85rem; color: #A9B8C8; padding-top: 14px; border-top: 1px solid #24476B; margin-top: 10px; }

/* ---------- thanh liên hệ cố định (điện thoại) ---------- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: 1fr 1fr 1fr;
  background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(0,0,0,.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.action-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; text-decoration: none; font-weight: 700; font-size: .95rem; }
.action-bar svg { width: 24px; height: 24px; }
.ab-call { background: var(--call); color: #fff; }
.ab-zalo { background: var(--zalo); color: #fff; }
.ab-quote { background: var(--accent); color: var(--accent-ink); }

/* ---------- màn hình lớn ---------- */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .field-row { flex-direction: row; gap: 12px; }
  .foot-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  body { padding-bottom: 0; font-size: 17px; }
  .action-bar { display: none; }
  .head-actions { display: flex; }
  .head-row { padding-top: 14px; }
  .site-header > .wrap:last-child { display: flex; align-items: center; gap: 20px; }
  .search { flex: 1; margin: 0 0 12px; }
  .main-nav { padding-bottom: 12px; }
  h1 { font-size: 2rem; }
  .hero { padding: 56px 0 48px; }
  .hero h1 { font-size: 2.5rem; }
  .hero-cta .btn { flex: 0 1 auto; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-grid { grid-template-columns: repeat(5, 1fr); }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .steps li { flex-direction: column; }
  .trust { grid-template-columns: 1.2fr 1fr; }
  .band-inner { grid-template-columns: 1.3fr 1fr; align-items: center; }
  .product { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .two-col { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* chống tràn ngang trên điện thoại */
.two-col > *, .product > *, .trust > *, .band-inner > *, .grid > *, .cat-grid > * { min-width: 0; }
.ph-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ph span { overflow-wrap: anywhere; }
.card-img, .card-img .ph { text-decoration: none; }
.card-cta .btn { white-space: nowrap; padding-left: 8px; padding-right: 8px; }
@media (max-width: 959px) {
  .main-nav { flex-wrap: wrap; overflow: visible; }
  .main-nav a { padding: 6px 10px; }
  .gallery .ph { aspect-ratio: 16/9; min-height: 0; }
}
