/* ===================== Design tokens ===================== */
:root {
  --navy: #172b4d;
  --navy-dark: #101d38;
  --primary: #d8292f;
  --primary-dark: #b31f24;
  --primary-light: #fdecec;
  --accent: #ffd54a;
  --text: #17202a;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --danger: #d8292f;
  --success: #117a55;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
ul { padding-left: 1.1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.container.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.text-accent { color: var(--primary); }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(216,41,47,.25); }
.btn--ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn--accent { background: var(--accent); color: var(--navy-dark); }
.btn--accent:hover { background: #ffc61e; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(255,213,74,.35); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn--sm { padding: 7px 14px; font-size: .85rem; }
.btn--lg { padding: 13px 26px; font-size: 1.02rem; }
.btn--block { width: 100%; }

/* ===================== Header ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 3px 14px rgba(16,24,40,.18);
  transition: box-shadow .25s ease;
}
.site-header.is-scrolled { box-shadow: 0 6px 20px rgba(16,24,40,.3); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: #fff; }
.brand__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent);
  color: var(--navy-dark); font-weight: 800; font-size: .9rem;
}
.main-nav { display: flex; gap: 28px; }
.main-nav a { font-weight: 600; color: rgba(255,255,255,.78); padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: #fff; border-color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-phone { color: #fff; border-color: rgba(255,255,255,.3); background: transparent; }
.header-phone:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 22px; height: 2px; background: #fff; border-radius: 2px; }

/* category quick-nav pills (under header) */
.category-pills {
  background: var(--navy-dark);
  overflow-x: auto;
  scrollbar-width: none;
}
.category-pills::-webkit-scrollbar { display: none; }
.category-pills__inner {
  display: flex; gap: 6px; padding: 9px 20px;
  max-width: var(--max-width); margin: 0 auto;
}
.category-pills a {
  white-space: nowrap; padding: 7px 14px; border-radius: 999px;
  font-size: .85rem; font-weight: 700; color: rgba(255,255,255,.85);
  transition: all .15s ease;
}
.category-pills a:hover, .category-pills a.active { background: #fff; color: var(--navy); }

/* ===================== Flash ===================== */
.flash-wrap { max-width: var(--max-width); margin: 12px auto 0; padding: 0 20px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 10px; font-size: .92rem; font-weight: 500; }
.flash--success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.flash--error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ===================== Banner carousel ===================== */
.banner-carousel { position: relative; width: 100%; overflow: hidden; background: var(--bg-alt); }
.banner-carousel__track { position: relative; width: 100%; aspect-ratio: 16 / 5; }
.banner-slide {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  transition: opacity .5s ease;
}
.banner-slide.is-active { opacity: 1; pointer-events: auto; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1); }
.banner-slide.is-active img { animation: bannerKenBurns 6s ease-in-out forwards; }
@keyframes bannerKenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  .banner-slide.is-active img { animation: none; }
}
.banner-slide__caption {
  position: absolute; left: 6%; bottom: 10%; max-width: 480px; color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.banner-slide__caption h2 { font-size: 1.8rem; font-weight: 800; margin: 0 0 8px; }
.banner-slide__caption p { margin: 0 0 14px; font-size: 1rem; }
.banner-carousel__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(23, 43, 77, .55); color: #fff; font-size: 1.4rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.banner-carousel__nav:hover { background: rgba(23, 43, 77, .8); }
.banner-carousel__nav--prev { left: 16px; }
.banner-carousel__nav--next { right: 16px; }
.banner-carousel__dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.banner-carousel__dots button {
  width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,.55); cursor: pointer; padding: 0;
}
.banner-carousel__dots button.is-active { background: var(--accent); width: 22px; border-radius: 5px; }

/* ===================== Hero ===================== */
.hero { background: linear-gradient(180deg, var(--primary-light), #fff 70%); padding: 56px 0 40px; }
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-block; background: #fff; color: var(--primary); border: 1px solid var(--border); padding: 6px 14px; border-radius: 999px; font-size: .82rem; font-weight: 700; margin-bottom: 16px; }
.hero h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.01em; }
.hero__desc { color: var(--muted); font-size: 1.05rem; max-width: 520px; margin: 14px 0 24px; }
.hero__search { display: flex; gap: 10px; max-width: 520px; margin-bottom: 28px; }
.hero__search input {
  flex: 1; padding: 13px 16px; border-radius: 999px; border: 1px solid var(--border); font-size: .95rem;
}
.hero__search input:focus { outline: none; border-color: var(--primary); }
.hero__stats { display: flex; gap: 32px; }
.hero__stats strong { display: block; font-size: 1.4rem; color: var(--primary); font-weight: 800; }
.hero__stats span { color: var(--muted); font-size: .85rem; }
.hero__art img { filter: drop-shadow(0 20px 40px rgba(23,43,77,.2)); }

/* ===================== Sections ===================== */
.section { padding: 48px 0; }
.section--alt { background: var(--bg-alt); }
.section-title { font-size: 1.5rem; font-weight: 800; border-left: 4px solid var(--primary); padding-left: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.section-head .section-title { margin-bottom: 0; }
.link-more { color: var(--primary); font-weight: 600; font-size: .92rem; }
.page-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 24px; border-left: 4px solid var(--primary); padding-left: 12px; }

/* category grid */
.category-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.category-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 12px; text-align: center; font-weight: 700; transition: all .15s ease;
}
.category-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-4px); }
.category-card__icon { display: block; font-size: 1.8rem; margin-bottom: 8px; transition: transform .25s ease; }
.category-card:hover .category-card__icon { transform: scale(1.15) rotate(-4deg); }

/* ===================== Product grid / card ===================== */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  display: block; transition: all .18s ease;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-5px); border-color: transparent; }
.product-card__img { position: relative; aspect-ratio: 4/3; background: var(--bg-alt); overflow: hidden; }
.product-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.product-card:hover .product-card__img img { transform: scale(1.08); }
.badge { position: absolute; top: 10px; padding: 4px 9px; border-radius: 6px; font-size: .72rem; font-weight: 800; color: #fff; }
.badge--sale { left: 10px; background: var(--primary); animation: badgePulse 2.4s ease-in-out infinite; }
.badge--out { right: 10px; background: #64748b; }
.badge--custom { left: 10px; background: var(--navy); animation: badgePulse 2.4s ease-in-out infinite; }
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .badge--sale, .badge--custom { animation: none; }
}
.product-card__body { padding: 14px 16px 16px; }
.product-card__brand { margin: 0; font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.product-card__name { font-size: 1rem; font-weight: 700; margin: 4px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.product-card__specs { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.product-card__specs li { background: var(--bg-alt); border-radius: 6px; padding: 3px 8px; font-size: .74rem; color: var(--muted); font-weight: 600; }
.product-card__price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price { color: var(--primary); font-weight: 800; font-size: 1.1rem; }
.price--old { color: var(--muted); font-weight: 500; font-size: .85rem; text-decoration: line-through; }
.price--lg { font-size: 1.8rem; }

.section--cta .cta-box {
  background: linear-gradient(135deg, var(--navy), var(--primary));
  color: #fff; border-radius: var(--radius); padding: 40px; display: flex;
  align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.section--cta .cta-box h2 { margin: 0 0 6px; }
.section--cta .cta-box p { margin: 0; opacity: .92; }
.section--cta .btn--primary { background: var(--accent); color: var(--navy-dark); }
.section--cta .btn--primary:hover { background: #ffc61e; box-shadow: 0 10px 20px rgba(255,213,74,.3); }

/* ===================== Products listing / filters ===================== */
.products-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.filters { background: var(--bg-alt); border-radius: var(--radius); padding: 20px; position: sticky; top: 90px; }
.filter-form { display: flex; flex-direction: column; gap: 18px; }
.filter-group h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: 10px; }
.radio { display: flex; align-items: center; gap: 8px; font-size: .92rem; margin-bottom: 6px; cursor: pointer; }
.price-range { display: flex; gap: 8px; }
.price-range input { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; }

/* quick price-range filter chips */
.quick-price { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-price--top { margin-bottom: 18px; }
.quick-price__chip {
  display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); font-size: .85rem; font-weight: 600; color: var(--text);
  background: #fff; cursor: pointer; transition: all .15s ease;
}
.quick-price__chip:hover { border-color: var(--primary); color: var(--primary); }
.quick-price__chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.products-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.sort-form select { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; }
.pagination a { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); font-weight: 600; }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.empty-state { text-align: center; padding: 60px 0; }

/* ===================== Breadcrumb ===================== */
.breadcrumb { color: var(--muted); font-size: .88rem; margin-bottom: 20px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

/* ===================== Product detail ===================== */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.gallery-main { border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); aspect-ratio: 1/1; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 10px; }
.gallery-thumbs img { width: 68px; height: 68px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img.active { border-color: var(--primary); }
.product-detail__info h1 { font-size: 1.7rem; font-weight: 800; margin: 6px 0 16px; }
.product-detail__price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.stock-status { font-weight: 700; margin-bottom: 20px; }
.stock-status.in-stock { color: var(--success); }
.stock-status.out-stock { color: var(--danger); }
.spec-table { width: 100%; border-collapse: collapse; margin-bottom: 28px; }
.spec-table tr { border-bottom: 1px solid var(--border); }
.spec-table th, .spec-table td { text-align: left; padding: 10px 0; font-size: .95rem; }
.spec-table th { width: 160px; color: var(--muted); font-weight: 600; }
.product-detail__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.product-description { margin-top: 48px; border-top: 1px solid var(--border); padding-top: 32px; }
.description-content { color: var(--text); line-height: 1.7; }

/* ===================== Modal (native dialog) ===================== */
.modal { border: none; border-radius: var(--radius); padding: 0; box-shadow: var(--shadow-lg); max-width: 420px; width: 90%; }
.modal::backdrop { background: rgba(15, 23, 42, .5); }
.modal-content { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.modal-content label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.modal-content input, .modal-content textarea { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: .95rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ===================== Contact page ===================== */
.contact-layout { display: grid; grid-template-columns: 1.3fr .9fr; gap: 32px; margin-top: 24px; align-items: start; }
.contact-form, .contact-info { background: var(--bg-alt); border-radius: var(--radius); padding: 24px; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form label, .contact-info h3 { font-weight: 700; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
.contact-form input, .contact-form textarea { padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: .95rem; }
.contact-info p { margin: 10px 0; }
.contact-info .btn { margin-top: 16px; }

/* ===================== Prose (about page) ===================== */
.prose h2 { margin-top: 28px; font-size: 1.25rem; }
.prose li { margin-bottom: 6px; }

/* ===================== Footer ===================== */
.site-footer { background: var(--navy-dark); color: #cbd5e1; padding: 48px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-bottom: 32px; }
.footer-col h4 { color: #fff; margin-bottom: 14px; font-size: .95rem; position: relative; padding-bottom: 8px; }
.footer-col h4::after { content: ''; position: absolute; left: 0; bottom: 0; width: 28px; height: 3px; background: var(--accent); border-radius: 2px; }
.footer-col a { display: block; color: #9aa7bd; margin-bottom: 8px; font-size: .9rem; }
.footer-col a:hover { color: var(--accent); }
.brand--footer { color: #fff; margin-bottom: 12px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; text-align: center; font-size: .82rem; color: #7c8aa3; }
.footer-legal { margin: 6px 0 0; }
.footer-legal a { color: #7c8aa3; }
.footer-legal a:hover { color: var(--accent); }
.footer-legal span { margin: 0 6px; }

.floating-zalo {
  position: fixed; bottom: 24px; right: 24px; z-index: 60;
  background: #0068ff; color: #fff; font-weight: 800; font-size: .82rem;
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(0,104,255,.4);
  animation: floatBounce 2.6s ease-in-out infinite;
}
@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* back-to-top button */
.back-to-top {
  position: fixed; bottom: 24px; left: 24px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; color: var(--primary); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); cursor: pointer;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background .2s ease, color .2s ease;
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--primary); color: #fff; }

/* scroll-reveal utility */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .floating-zalo { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===================== Responsive ===================== */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { display: none; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .products-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .product-detail { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .site-header__inner { gap: 10px; }
  .brand { gap: 8px; min-width: 0; }
  .brand__text { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
  .header-actions { gap: 8px; }
  .header-actions .btn--sm.btn--primary { padding: 9px 12px; font-size: .82rem; }
  .main-nav { position: fixed; top: 72px; left: 0; right: 0; background: var(--navy); flex-direction: column; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.1); display: none; gap: 14px; }
  .main-nav.open { display: flex; }
  .main-nav a { color: rgba(255,255,255,.85); }
  .main-nav a:hover, .main-nav a.active { color: var(--accent); }
  .nav-toggle { display: flex; }
  .header-phone { display: none; }
  .category-pills__inner { padding: 8px 12px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2rem; }
  .banner-carousel__track { aspect-ratio: 4 / 3; }
  .banner-slide__caption { left: 5%; right: 5%; bottom: 8%; max-width: none; }
  .banner-slide__caption h2 { font-size: 1.3rem; }
  .banner-carousel__nav { width: 32px; height: 32px; font-size: 1.1rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .section--cta .cta-box { flex-direction: column; text-align: center; }
}
