/* =====================================================================
   QUẦN ÁO TỨ LAN - style.css
   Mobile-first, không framework, tối ưu Core Web Vitals.
   Hệ màu: trắng ngà / xám đậm / xanh navy (nhấn) / cam đất (phụ)
===================================================================== */
:root {
  --c-bg: #fdfdfb;
  --c-bg-alt: #f3f4f2;
  --c-text: #1f2937;
  --c-text-soft: #4b5563;
  --c-navy: #1e3a5f;
  --c-navy-dark: #16293f;
  --c-accent: #c2571b;
  --c-border: #e2e4e0;
  --c-white: #ffffff;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(30, 58, 95, 0.08);
  --container: 1180px;
  --font: 'Be Vietnam Pro', 'Inter', 'Roboto', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-navy); }
h1, h2, h3, h4 { line-height: 1.3; color: var(--c-navy-dark); margin: 0 0 .6em; }
h1 { font-size: 1.7rem; font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2rem; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1rem; }
.container-narrow { max-width: 760px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0;
}

/* ------------------------------ Buttons ------------------------------ */
.btn {
  display: inline-block;
  padding: .7rem 1.3rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: .95rem;
  font-family: var(--font);
  transition: background-color .15s, color .15s, border-color .15s;
  text-align: center;
}
.btn-primary { background: var(--c-navy); color: var(--c-white); }
.btn-primary:hover { background: var(--c-navy-dark); }
.btn-outline { background: transparent; color: var(--c-navy); border-color: var(--c-navy); }
.btn-outline:hover { background: var(--c-navy); color: var(--c-white); }
.btn-light { background: var(--c-white); color: var(--c-navy); }
.btn-light:hover { background: var(--c-bg-alt); }
.btn-ghost { background: transparent; color: var(--c-white); border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { border-color: var(--c-white); }
.btn-sm { padding: .5rem .9rem; font-size: .88rem; }
.text-link { font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ------------------------------ Header ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--c-text); }
.brand-mark {
  width: 42px; height: 42px; flex: none;
  background: var(--c-navy); color: var(--c-white);
  border-radius: 8px; display: grid; place-items: center;
  font-weight: 800; font-size: 1.05rem; letter-spacing: .5px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1rem; color: var(--c-navy-dark); }
.brand-text small { font-size: .7rem; color: var(--c-text-soft); }

.nav-toggle {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: 0; padding: .6rem; cursor: pointer;
}
.nav-toggle span { width: 24px; height: 3px; background: var(--c-navy); border-radius: 2px; }

.main-nav {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--c-white); border-bottom: 1px solid var(--c-border);
  padding: .5rem 1rem 1rem;
  max-height: calc(100vh - 64px); overflow-y: auto;
}
.main-nav.open { display: block; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul > li { border-bottom: 1px solid var(--c-border); }
.main-nav a {
  display: block; padding: .75rem .25rem;
  text-decoration: none; color: var(--c-text); font-weight: 600;
}
.main-nav a.active { color: var(--c-accent); }
.sub-nav { padding-left: 1rem !important; }
.sub-nav a { font-weight: 400; font-size: .92rem; padding: .45rem .25rem; color: var(--c-text-soft); }
.nav-cta { margin-top: 1rem; display: block; }

/* ------------------------------ Hero ------------------------------ */
.hero { background: linear-gradient(160deg, #eef2f6 0%, var(--c-bg) 70%); padding: 2.2rem 0 2.6rem; }
.hero-inner { display: grid; gap: 1.6rem; }
.hero-eyebrow {
  color: var(--c-accent); font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; font-size: .85rem; margin-bottom: .4rem;
}
.hero h1 { font-size: 1.75rem; margin-bottom: .7rem; }
.hero-desc { color: var(--c-text-soft); font-size: 1.02rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.1rem 0; }
.hero-badges { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.hero-badges li {
  background: var(--c-white); border: 1px solid var(--c-border);
  padding: .3rem .8rem; border-radius: 99px; font-size: .82rem; font-weight: 600; color: var(--c-navy);
}
.hero-media img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }

/* ------------------------------ Sections ------------------------------ */
.section { padding: 2.6rem 0; }
.section-alt { background: var(--c-bg-alt); }
.section-intro { color: var(--c-text-soft); max-width: 780px; margin-bottom: 1.6rem; }
.section-cta { margin-top: 1.6rem; text-align: center; }
.placeholder-note {
  background: #fff8e6; border: 1px dashed #d9b23c; border-radius: var(--radius);
  padding: .7rem 1rem; font-size: .88rem; color: #7a5c00; display: inline-block;
}

/* ------------------------------ Grids & Cards ------------------------------ */
.grid { display: grid; gap: 1.2rem; }
.grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

.category-card, .product-card, .post-card {
  background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
}
.card-image-link { display: block; }
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-title { margin: 0; font-size: 1.05rem; }
.card-title a { text-decoration: none; color: var(--c-navy-dark); }
.card-title a:hover { color: var(--c-accent); }
.card-desc { color: var(--c-text-soft); font-size: .93rem; margin: 0; flex: 1; }
.card-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.benefit-card, .support-card, .stat-card {
  background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1.2rem;
}
.benefit-icon, .support-icon { font-size: 1.7rem; display: block; margin-bottom: .5rem; }
.benefit-card h3, .support-card h3 { font-size: 1rem; margin-bottom: .4rem; }
.benefit-card p, .support-card p { font-size: .92rem; color: var(--c-text-soft); margin: 0 0 .4rem; }

.stat-card { text-align: center; }
.stat-card strong { display: block; color: var(--c-navy); font-size: .95rem; margin-bottom: .3rem; }
.stat-card span { color: var(--c-text-soft); font-size: .88rem; }

/* Product card details */
.product-sku { font-size: .82rem; color: var(--c-text-soft); margin: 0; }
.stock { font-weight: 600; }
.stock-ready { color: #157347; }
.stock-order { color: var(--c-accent); }
.stock-oem { color: var(--c-navy); }
.product-meta { list-style: none; padding: 0; margin: 0; font-size: .88rem; color: var(--c-text-soft); }
.product-meta li { padding: .15rem 0; }
.product-details summary {
  cursor: pointer; font-weight: 600; color: var(--c-navy); font-size: .9rem; padding: .3rem 0;
}
.product-details p { font-size: .9rem; color: var(--c-text-soft); }
.spec-table { width: 100%; border-collapse: collapse; font-size: .86rem; margin: .5rem 0; }
.spec-table th, .spec-table td { border: 1px solid var(--c-border); padding: .4rem .6rem; text-align: left; }
.spec-table th { background: var(--c-bg-alt); font-weight: 600; white-space: nowrap; }

/* ------------------------------ Process steps / timeline ------------------------------ */
.process-steps {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1rem;
}
.process-steps li {
  background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1.1rem; position: relative;
}
.step-num {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--c-navy); color: var(--c-white); font-weight: 800;
  margin-bottom: .5rem;
}
.process-steps h3 { font-size: .98rem; margin-bottom: .3rem; }
.process-steps p { font-size: .88rem; color: var(--c-text-soft); margin: 0; }

.timeline { list-style: none; padding: 0; margin: 0; counter-reset: tl; }
.timeline li {
  counter-increment: tl;
  position: relative; padding: 0 0 1.4rem 3rem;
  border-left: 2px solid var(--c-border); margin-left: 1.1rem;
}
.timeline li::before {
  content: counter(tl);
  position: absolute; left: -1.15rem; top: 0;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--c-navy); color: var(--c-white);
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
}
.timeline h3 { font-size: 1rem; margin-bottom: .2rem; }
.timeline p { font-size: .92rem; color: var(--c-text-soft); margin: 0; }

/* ------------------------------ Chips / lists ------------------------------ */
.capacity-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1.2rem; }
.capacity-chips li {
  background: var(--c-white); border: 1px solid var(--c-border);
  padding: .45rem 1rem; border-radius: 99px; font-weight: 600; font-size: .9rem; color: var(--c-navy);
}
.check-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.check-list li { padding: .35rem 0 .35rem 1.7rem; position: relative; }
.check-list li::before { content: '✓'; position: absolute; left: 0; color: #157347; font-weight: 800; }
.subcategory-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.3rem; }
.subcategory-list li {
  background: var(--c-bg-alt); border-radius: 99px;
  padding: .25rem .75rem; font-size: .82rem; color: var(--c-text-soft);
}
.catalogue-card .subcategory-list { margin-bottom: .8rem; }

/* ------------------------------ Policy table ------------------------------ */
.policy-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.policy-table th, .policy-table td { border: 1px solid var(--c-border); padding: .6rem .8rem; text-align: left; }
.policy-table thead th { background: var(--c-navy); color: var(--c-white); }
.policy-table tbody tr:nth-child(even) { background: var(--c-bg-alt); }

/* ------------------------------ Category anchor nav ------------------------------ */
.category-anchor-nav { background: var(--c-white); border-bottom: 1px solid var(--c-border); position: sticky; top: 64px; z-index: 40; }
.category-anchor-nav ul {
  list-style: none; margin: 0; padding: .5rem 0;
  display: flex; gap: .4rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.category-anchor-nav a {
  display: block; white-space: nowrap;
  padding: .35rem .85rem; border-radius: 99px;
  background: var(--c-bg-alt); color: var(--c-navy);
  text-decoration: none; font-size: .86rem; font-weight: 600;
}
.category-anchor-nav a:hover { background: var(--c-navy); color: var(--c-white); }

/* ------------------------------ CTA section ------------------------------ */
.cta-section {
  background: var(--c-navy); color: var(--c-white);
  padding: 2.6rem 0; text-align: center;
}
.cta-section h2 { color: var(--c-white); }
.cta-section p { color: rgba(255,255,255,.85); max-width: 640px; margin: 0 auto 1.4rem; }
.cta-buttons { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }

/* ------------------------------ FAQ ------------------------------ */
.faq-section { padding: 2.6rem 0; }
.faq-list { display: grid; gap: .7rem; max-width: 820px; }
.faq-item {
  background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: .2rem 1.1rem;
}
.faq-item summary { cursor: pointer; font-weight: 600; padding: .8rem 0; color: var(--c-navy-dark); }
.faq-item p { color: var(--c-text-soft); padding-bottom: .9rem; margin: 0; }

/* ------------------------------ Gallery ------------------------------ */
.gallery-group { margin-bottom: 1.8rem; }
.gallery-group h3 { margin-bottom: .8rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.gallery-item { margin: 0; }
.gallery-item img { border-radius: var(--radius); width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gallery-item figcaption { font-size: .78rem; color: var(--c-text-soft); padding-top: .3rem; }

/* ------------------------------ Forms ------------------------------ */
.contact-form {
  background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1.4rem; max-width: 880px;
}
.contact-form h3 { margin-bottom: 1rem; }
.form-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; margin-bottom: 1.1rem; }
.form-field { display: flex; flex-direction: column; gap: .3rem; }
.form-field label { font-weight: 600; font-size: .88rem; }
.form-field input, .form-field select, .form-field textarea {
  font-family: var(--font); font-size: .95rem;
  padding: .6rem .8rem; border: 1px solid var(--c-border); border-radius: 8px;
  background: var(--c-bg); color: var(--c-text); width: 100%;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 2px solid var(--c-navy); outline-offset: 1px; border-color: var(--c-navy);
}
.form-status { margin: .8rem 0 0; font-weight: 600; font-size: .92rem; }
.form-status.ok { color: #157347; }
.form-status.err { color: #b02a37; }

/* ------------------------------ Contact page ------------------------------ */
.contact-layout { display: grid; gap: 1.6rem; }
.contact-list { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.contact-list li {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .55rem 0; border-bottom: 1px solid var(--c-border);
}
.contact-list strong { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--c-text-soft); }
.contact-quick { display: flex; gap: .7rem; flex-wrap: wrap; }

/* ------------------------------ Breadcrumb ------------------------------ */
.breadcrumb { background: var(--c-bg-alt); border-bottom: 1px solid var(--c-border); font-size: .84rem; }
.breadcrumb ol { list-style: none; margin: 0; padding: .55rem 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.breadcrumb li + li::before { content: '›'; margin-right: .3rem; color: var(--c-text-soft); }
.breadcrumb a { text-decoration: none; color: var(--c-text-soft); }
.breadcrumb a:hover { color: var(--c-navy); }
.breadcrumb [aria-current='page'] span, .breadcrumb [aria-current='page'] { color: var(--c-navy-dark); font-weight: 600; }

/* ------------------------------ Page hero ------------------------------ */
.page-hero { background: linear-gradient(160deg, #eef2f6 0%, var(--c-bg) 80%); padding: 2rem 0 1.6rem; }
.page-intro { color: var(--c-text-soft); max-width: 780px; margin: 0; }

/* ------------------------------ Posts ------------------------------ */
.post-date { font-size: .82rem; color: var(--c-text-soft); margin: 0; }
.post-cover { border-radius: var(--radius); margin-bottom: 1.2rem; }
.post-article h1 { font-size: 1.55rem; }

/* ------------------------------ Footer ------------------------------ */
.site-footer { background: var(--c-navy-dark); color: rgba(255,255,255,.85); margin-top: 0; }
.footer-grid { display: grid; gap: 1.6rem; padding: 2.4rem 1rem; grid-template-columns: 1fr; }
.footer-heading { color: var(--c-white); font-size: 1rem; margin-bottom: .7rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { padding: .2rem 0; font-size: .92rem; }
.footer-col a { color: rgba(255,255,255,.85); text-decoration: none; }
.footer-col a:hover { color: var(--c-white); text-decoration: underline; }
.footer-col p { font-size: .92rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); padding: 1rem 0; font-size: .82rem; }
.footer-bottom p { margin: 0; }

/* ------------------------------ Mobile action bar ------------------------------ */
.mobile-action-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr 1fr 1.3fr;
  background: var(--c-white); border-top: 1px solid var(--c-border);
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
}
.mab-item {
  text-align: center; padding: .8rem .4rem;
  text-decoration: none; font-weight: 700; font-size: .9rem;
}
.mab-call { color: var(--c-navy); }
.mab-zalo { color: #0068ff; }
.mab-quote { background: var(--c-accent); color: var(--c-white); }
body { padding-bottom: 52px; } /* chừa chỗ cho action bar, tránh che nội dung */

/* =====================================================================
   TABLET ≥ 640px
===================================================================== */
@media (min-width: 640px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.65rem; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .form-field-full { grid-column: 1 / -1; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .process-steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================================
   DESKTOP ≥ 1024px
===================================================================== */
@media (min-width: 1024px) {
  .hero h1 { font-size: 2.3rem; }
  .hero-inner { grid-template-columns: 1.1fr 1fr; align-items: center; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
  .process-steps { grid-template-columns: repeat(5, 1fr); }
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1.2fr; }
  .contact-layout { grid-template-columns: 1fr 1.4fr; align-items: start; }

  /* Desktop nav */
  .nav-toggle { display: none; }
  .main-nav {
    display: block; position: static; background: none; border: 0;
    padding: 0; max-height: none; overflow: visible;
    display: flex; align-items: center; gap: .6rem;
  }
  .main-nav > ul { display: flex; align-items: center; }
  .main-nav > ul > li { border: 0; position: relative; }
  .main-nav a { padding: .5rem .55rem; font-size: .88rem; white-space: nowrap; }
  .main-nav a:hover { color: var(--c-accent); }
  .sub-nav {
    display: none; position: absolute; top: 100%; left: 0;
    background: var(--c-white); border: 1px solid var(--c-border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    min-width: 220px; padding: .4rem !important; z-index: 60;
  }
  .has-sub:hover .sub-nav, .has-sub:focus-within .sub-nav { display: block; }
  .sub-nav a { padding: .5rem .7rem; border-radius: 6px; }
  .sub-nav a:hover { background: var(--c-bg-alt); }
  .nav-cta { margin: 0; display: inline-block; padding: .55rem 1rem; font-size: .86rem; }

  /* Ẩn action bar trên desktop */
  .mobile-action-bar { display: none; }
  body { padding-bottom: 0; }
  .category-anchor-nav { top: 64px; }
}

/* Giảm chuyển động cho người dùng nhạy cảm */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ============ Honeypot (anti-spam, invisible pour humains) ============ */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ============ Page détail produit ============ */
.product-detail-grid { display: grid; gap: 2rem; }
@media (min-width: 768px) { .product-detail-grid { grid-template-columns: 1fr 1fr; } }
.product-detail-media img { width: 100%; height: auto; border-radius: 12px; }
.product-gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.product-gallery-thumbs img { width: 90px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--c-border); }
.product-detail-info h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.product-detail-info .product-sku, .product-detail-info .product-category { color: var(--c-muted); font-size: 0.9rem; }
.product-price-note { font-size: 1.15rem; color: var(--c-accent); margin: 0.75rem 0 0.25rem; }
.product-stock { font-size: 0.9rem; color: var(--c-muted); margin-bottom: 0.75rem; }
.product-short-desc { margin-bottom: 1rem; }
.specs-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.92rem; }
.specs-table th, .specs-table td { text-align: left; padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--c-border); }
.specs-table th { width: 130px; color: var(--c-muted); font-weight: 600; }
.product-detail-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.product-detail-desc { margin-top: 2.5rem; max-width: 800px; }
.product-detail-desc h2 { margin-bottom: 0.75rem; }
.product-detail-desc p { margin-bottom: 0.75rem; line-height: 1.7; }
.product-detail-policies { display: grid; gap: 1.5rem; margin-top: 2rem; }
@media (min-width: 768px) { .product-detail-policies { grid-template-columns: 1fr 1fr; } }
.category-heading-link { color: inherit; text-decoration: none; }
.category-heading-link:hover { color: var(--c-accent); }
.card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Security: utility classes thay inline style (CSP strict, no unsafe-inline) */
.page-404 { text-align: center; padding: 4rem 1rem; }
