/* ─────────────────────────────────────────────
   MIXAY MOTOR DESIGN TOKENS
   Ratio: White 70% · Red 20% · Black 10%
   Source: frontend/design-system/MASTER.md
   ───────────────────────────────────────────── */
:root {
  --bg: #FFFFFF;
  --surface: #F8F5F5;
  --surface-2: #F0EBEC;
  --text: #1C1418;
  --text-2: #71646A;
  --border: #E9E1E3;
  --red: #D9232E;
  --red-hover: #B4141F;
  --red-tint: #FCEBEC;
  --red-ink: #A81822;
  --ink: #171217;
  --on-ink: #F7F2F4;
  --on-red: #FFFFFF;
  --ok: #17804F;
  --ok-tint: #E3F4EB;
  --warn: #B36A00;
  --warn-tint: #FBF0DC;
  --blue: #1D3E9E;
  --shadow-sm: 0 1px 2px rgba(23,18,23,.06);
  --shadow-md: 0 6px 24px rgba(23,18,23,.09), 0 1px 2px rgba(23,18,23,.05);
  --shadow-lg: 0 16px 48px rgba(23,18,23,.14);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-full: 999px;
  --font: 'Kanit','Noto Sans Lao','Phetsarath OT','Noto Sans Thai','PingFang SC','Noto Sans SC',-apple-system,'Segoe UI',sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141014; --surface: #1D171B; --surface-2: #272026;
    --text: #F5EFF1; --text-2: #AB9EA5; --border: #342B32;
    --red: #F0505A; --red-hover: #F4747C; --red-tint: #3A1A20; --red-ink: #F0505A;
    --ink: #0D0A0D; --on-ink: #F5EFF1;
    --ok: #4CC98A; --ok-tint: #14301F; --warn: #E5A44C; --warn-tint: #33270F;
    --blue: #7C97E8;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 6px 24px rgba(0,0,0,.5);
    --shadow-lg: 0 16px 48px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --bg: #141014; --surface: #1D171B; --surface-2: #272026;
  --text: #F5EFF1; --text-2: #AB9EA5; --border: #342B32;
  --red: #F0505A; --red-hover: #F4747C; --red-tint: #3A1A20; --red-ink: #F0505A;
  --ink: #0D0A0D; --on-ink: #F5EFF1;
  --ok: #4CC98A; --ok-tint: #14301F; --warn: #E5A44C; --warn-tint: #33270F;
  --blue: #7C97E8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.6);
}
:root[data-theme="light"] {
  --bg: #FFFFFF; --surface: #F8F5F5; --surface-2: #F0EBEC;
  --text: #1C1418; --text-2: #71646A; --border: #E9E1E3;
  --red: #D9232E; --red-hover: #B4141F; --red-tint: #FCEBEC; --red-ink: #A81822;
  --ink: #171217; --on-ink: #F7F2F4; --on-red: #FFFFFF;
  --ok: #17804F; --ok-tint: #E3F4EB; --warn: #B36A00; --warn-tint: #FBF0DC;
  --blue: #1D3E9E;
  --shadow-sm: 0 1px 2px rgba(23,18,23,.06);
  --shadow-md: 0 6px 24px rgba(23,18,23,.09), 0 1px 2px rgba(23,18,23,.05);
  --shadow-lg: 0 16px 48px rgba(23,18,23,.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ── Header ─────────────────────────────── */
.topbar { background: var(--ink); color: var(--on-ink); font-size: 12.5px; padding: 6px 0; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topbar span { opacity: .85; }

header.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo { border-radius: 8px; object-fit: cover; background: #fff; display: block; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .3px; line-height: 1.1; }
.brand-name em { font-style: normal; color: var(--red); }
.brand-sub { font-size: 10px; letter-spacing: 2.2px; color: var(--text-2); text-transform: uppercase; }

nav.links { display: flex; gap: 4px; margin-left: 8px; }
nav.links a {
  padding: 8px 14px; border-radius: var(--r-full);
  font-size: 14.5px; font-weight: 500; color: var(--text-2);
  transition: color .2s, background .2s;
}
nav.links a:hover { color: var(--text); background: var(--surface); }
nav.links a.active { color: var(--red); background: var(--red-tint); font-weight: 600; }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-dashboard-link { min-height: 40px; padding: 9px 18px; font-size: 13.5px; }

.lang-switch { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-full); padding: 3px; gap: 2px; }
.lang-switch button { padding: 5px 11px; border-radius: var(--r-full); font-size: 12.5px; font-weight: 600; color: var(--text-2); transition: all .2s; min-width: 40px; }
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active { background: var(--red); color: var(--on-red); box-shadow: var(--shadow-sm); }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-full);
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  transition: all .2s; position: relative;
}
.icon-btn:hover { border-color: var(--red); color: var(--red); transform: translateY(-1px); }
.icon-btn .badge-dot {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: var(--on-red);
  font-size: 10px; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: var(--r-full); display: grid; place-items: center;
  border: 2px solid var(--bg);
}
.nav-user-dropdown { position: relative; }
.nav-user-dropdown__trigger {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 7px 14px 7px 12px;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: all .2s;
}
.nav-user-dropdown__trigger:hover { border-color: var(--red); color: var(--red); }
.nav-user-dropdown__chevron { transition: transform .18s ease; }
.nav-user-dropdown.is-open .nav-user-dropdown__chevron { transform: rotate(180deg); }
.nav-user-dropdown__menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-md);
  padding: 8px; display: none; flex-direction: column; gap: 2px; z-index: 120;
}
.nav-user-dropdown.is-open .nav-user-dropdown__menu { display: flex; }
.nav-user-dropdown__menu a {
  padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  color: var(--text-2); transition: background .15s, color .15s;
}
.nav-user-dropdown__menu a:hover { background: var(--red-tint); color: var(--red); }
.nav-user-dropdown__logout { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 12px !important; color: var(--text-2); }

/* ── Language dropdown ─────────────────── */
.lang-dropdown { position: relative; }
.lang-dropdown__trigger {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 0 12px; height: 40px;
  font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: all .2s;
}
.lang-dropdown__trigger:hover { border-color: var(--red); color: var(--red); }
.lang-dropdown__chevron { transition: transform .18s ease; flex-shrink: 0; }
.lang-dropdown.is-open .lang-dropdown__chevron { transform: rotate(180deg); }
.lang-dropdown__menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 140px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-md);
  padding: 8px; display: none; flex-direction: column; gap: 2px; z-index: 120;
}
.lang-dropdown.is-open .lang-dropdown__menu { display: flex; }
.lang-dropdown__menu button {
  padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  color: var(--text-2); text-align: left; transition: background .15s, color .15s;
}
.lang-dropdown__menu button:hover { background: var(--red-tint); color: var(--red); }
.lang-dropdown__menu button.active { background: var(--red-tint); color: var(--red); }

/* ── Guest auth buttons (navbar) ────────── */
.nav-auth-buttons { display: inline-flex; align-items: center; gap: 10px; }
.nav-auth-login { font-size: 13.5px; font-weight: 600; color: var(--text); padding: 8px 6px; }
.nav-auth-login:hover { color: var(--red); }
.nav-auth-register { font-size: 13.5px; padding: 9px 18px; min-height: 38px; }

/* ── Mobile nav: hamburger + slide-down panel ── */
.nav-actions__desktop-only { display: inline-flex; align-items: center; gap: 10px; }
.nav-mobile-toggle { display: none; position: relative; }
.nav-mobile-toggle__close { display: none; }
.nav-mobile-toggle.is-open .nav-mobile-toggle__open { display: none; }
.nav-mobile-toggle.is-open .nav-mobile-toggle__close { display: block; }

.mobile-menu-panel {
  display: none; flex-direction: column; gap: 4px;
  max-height: 0; overflow: hidden;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 0 20px; box-shadow: var(--shadow-md);
  transition: max-height .25s ease, padding .25s ease;
}
.mobile-menu-panel.is-open { max-height: 80vh; overflow-y: auto; padding: 10px 20px 18px; }
.mobile-menu-panel__links { display: flex; flex-direction: column; gap: 2px; }
.mobile-menu-panel__links a {
  padding: 13px 10px; border-radius: 8px; font-size: 15px; font-weight: 600;
  color: var(--text); transition: background .15s;
}
.mobile-menu-panel__links a:hover { background: var(--surface); }
.mobile-menu-panel__lang { padding: 12px 10px 4px; }
.mobile-menu-panel__lang-label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--text-2); margin-bottom: 10px; }
.mobile-menu-panel__lang-options { display: flex; flex-wrap: wrap; gap: 8px; }
.mobile-menu-panel__lang-options button {
  padding: 8px 16px; border-radius: var(--r-full); border: 1px solid var(--border);
  background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: all .2s;
}
.mobile-menu-panel__lang-options button:hover { color: var(--text); border-color: var(--text-2); }
.mobile-menu-panel__lang-options button.active { background: var(--red); border-color: var(--red); color: var(--on-red); }
.mobile-menu-panel__divider { height: 1px; background: var(--border); margin: 8px 0; }
.mobile-menu-panel__auth { display: flex; gap: 10px; padding: 6px 10px 8px; }
.mobile-menu-panel__auth .btn { flex: 1; justify-content: center; }
.mobile-menu-panel__logout { color: var(--text-2) !important; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 15px !important; }

@media (max-width: 1080px) {
  .nav-actions__desktop-only { display: none; }
  .nav-mobile-toggle { display: grid; }
  .mobile-menu-panel { display: flex; }
}
@media (max-width: 520px) {
  .nav-theme-toggle { display: none; }
}
@media (max-width: 400px) {
  /* Phone-width nav: brand + (wishlist, cart, hamburger) icons no
     longer fit at full 40px/10px-gap sizing without pushing the page
     into horizontal scroll — tighten both. */
  .nav-actions { gap: 6px; }
  .icon-btn,
  .nav-mobile-toggle { width: 36px; height: 36px; }
  .brand-sub { display: none; }
}

.site-messages { position: fixed; z-index: 140; top: 82px; right: clamp(14px, 3vw, 32px); width: min(390px, calc(100% - 28px)); display: grid; gap: 8px; pointer-events: none; }
.site-message { padding: 13px 16px; border: 1px solid var(--border); border-left: 4px solid var(--red); border-radius: 6px; background: color-mix(in srgb, var(--bg) 94%, transparent); color: var(--text); box-shadow: var(--shadow-md); backdrop-filter: blur(12px); font-size: 13px; font-weight: 600; animation: site-message-in .25s ease both; }
.site-message--success { border-left-color: var(--ok); }
.site-message--error { border-left-color: var(--red); }
@keyframes site-message-in { from { opacity: 0; transform: translateY(-8px); } }
#themeIcon-moon { display: none; }
:root[data-theme="dark"] #themeIcon-sun { display: none; }
:root[data-theme="dark"] #themeIcon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #themeIcon-sun { display: none; }
  :root:not([data-theme="light"]) #themeIcon-moon { display: block; }
}

/* ປຸ່ມສະຫຼັບໂໝດແບບໃໝ່ (partials/theme_toggle.html) — ໃຊ້ class ບໍ່ແມ່ນ id
   ຈຶ່ງໃສ່ໄດ້ຫຼາຍອັນໃນໜ້າດຽວ. ສະແດງໄອຄອນ “ສິ່ງທີ່ຈະໄດ້ເມື່ອກົດ”. */
.mx-theme-toggle {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--bg); color: var(--text-2); cursor: pointer;
  transition: color .18s, border-color .18s, background .18s;
}
.mx-theme-toggle:hover { color: var(--red); border-color: var(--red); }
.mx-theme-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--red) 45%, transparent);
  outline-offset: 2px;
}
.mx-theme-toggle__moon { display: none; }
:root[data-theme="dark"] .mx-theme-toggle__sun { display: none; }
:root[data-theme="dark"] .mx-theme-toggle__moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mx-theme-toggle__sun { display: none; }
  :root:not([data-theme="light"]) .mx-theme-toggle__moon { display: block; }
}

/* ປຸ່ມ “ກັບຄືນ” ຢູ່ເທິງສຸດຂອງທຸກໜ້າ (base_dashboard.html) — ໃຊ້ history.back()
   ຈຶ່ງບໍ່ຕ້ອງຮູ້ວ່າໜ້າກ່ອນໜ້າແມ່ນໜ້າໃດ ໃຊ້ໄດ້ທຸກໜ້າໂດຍບໍ່ຕ້ອງແກ້ໂຄ້ດແຕ່ລະ view. */
.mx-page-topbar { padding: 10px 20px 0; }
.mx-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px 0 10px;
  border: 1px solid var(--border); border-radius: var(--r-full);
  background: var(--bg); color: var(--text-2);
  font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: color .18s, border-color .18s;
}
.mx-back-btn:hover { color: var(--red); border-color: var(--red); }
.mx-back-btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--red) 45%, transparent);
  outline-offset: 2px;
}
.mx-back-btn svg { width: 15px; flex: none; }

/* ── Hero ───────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: 72px 0 84px; }
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: .35;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, black 30%, transparent 75%);
}
.slash-group { position: absolute; right: -60px; top: -40px; width: 480px; height: 560px; pointer-events: none; }
.slash { position: absolute; transform: skewX(-18deg); border-radius: 8px; }
.slash-1 { width: 90px; height: 130%; right: 90px; top: -10%; background: var(--red); opacity: .10; }
.slash-2 { width: 42px; height: 130%; right: 10px; top: -10%; background: var(--red); opacity: .16; }
.slash-3 { width: 16px; height: 130%; right: 210px; top: -10%; background: var(--ink); opacity: .10; }

.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red-tint); color: var(--red-ink);
  font-size: 13px; font-weight: 600; letter-spacing: .4px;
  padding: 6px 14px; border-radius: var(--r-full); margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 14px; height: 8px; background: var(--red); transform: skewX(-18deg); border-radius: 2px; }
h1.hero-title { font-size: clamp(34px, 5vw, 54px); line-height: 1.15; font-weight: 800; letter-spacing: -.5px; text-wrap: balance; margin-bottom: 18px; }
h1.hero-title .red { color: var(--red); }
.hero-sub { font-size: 17px; color: var(--text-2); max-width: 46ch; margin-bottom: 30px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 26px; border-radius: var(--r-md);
  font-size: 15.5px; font-weight: 600; letter-spacing: .2px;
  transition: all .2s ease; border: 1.5px solid transparent;
  min-height: 48px;
}
.btn-primary { background: var(--red); color: var(--on-red); box-shadow: 0 6px 18px color-mix(in srgb, var(--red) 35%, transparent); }
.btn-primary:hover { background: var(--red-hover); transform: translateY(-2px); box-shadow: 0 10px 26px color-mix(in srgb, var(--red) 45%, transparent); }
.btn-secondary { background: var(--bg); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--red); color: var(--red); transform: translateY(-2px); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { color: var(--red); background: var(--red-tint); }
.btn-dark { background: var(--ink); color: var(--on-ink); }
.btn-dark:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible, .icon-btn:focus-visible, .lang-switch button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--red) 45%, transparent); outline-offset: 2px;
}

.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 42px; }
.hero-stats { display: flex; gap: 36px; flex-wrap: wrap; }
.stat b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; display: block; line-height: 1.2; }
.stat b i { font-style: normal; color: var(--red); }
.stat span { font-size: 13.5px; color: var(--text-2); }

.hero-card-zone { position: relative; display: grid; place-items: center; min-height: 380px; }
.hero-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 22px; width: min(320px, 100%); position: relative; z-index: 2;
}
.hero-card .p-img { border-radius: var(--r-md); background: var(--surface); height: 180px; display: grid; place-items: center; margin-bottom: 16px; position: relative; overflow: hidden; }
.hero-card .p-img::after { content: ""; position: absolute; width: 60px; height: 200%; background: var(--red); opacity: .07; transform: skewX(-18deg); right: 18px; top: -50%; }
.float-chip {
  position: absolute; z-index: 3;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-md);
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.float-chip.tl { top: 22px; left: 0; }
.float-chip.br { bottom: 30px; right: 0; }
.float-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.float-chip .dot.red { background: var(--red); }

/* ── Sections ───────────────────────────── */
/* ໃຊ້ສະເພາະໜ້າເວັບສາທາລະນະ (base.html) — ໜ້າ Dashboard/POS (body.admin-shell)
   ໃຊ້ <section> ເປັນຄໍລຳ layout ຈຶ່ງບໍ່ຄວນມີ padding ນີ້.
   :where() ບໍ່ເພີ່ມ specificity ຈຶ່ງບໍ່ໄປທັບ class ອື່ນ (.hero, .bo-page ...) */
:where(body:not(.admin-shell)) section { padding: 72px 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 36px; flex-wrap: wrap; }
.sec-title { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.3px; display: flex; align-items: center; gap: 14px; text-wrap: balance; }
.sec-title::before { content: ""; width: 20px; height: 30px; background: var(--red); transform: skewX(-18deg); border-radius: 4px; flex-shrink: 0; }
.sec-sub { color: var(--text-2); font-size: 15px; margin-top: 6px; }

/* Categories */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.cat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 22px 14px 18px; text-align: center; transition: all .22s ease; cursor: pointer; }
.cat:hover { background: var(--bg); border-color: var(--red); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cat:hover .cat-ic { background: var(--red); color: var(--on-red); }
.cat-ic { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: var(--r-md); background: var(--red-tint); color: var(--red-ink); display: grid; place-items: center; transition: all .22s ease; }
.cat b { font-size: 13.5px; font-weight: 600; display: block; line-height: 1.35; }
.cat span { font-size: 11.5px; color: var(--text-2); }

/* Products */
.prod-section { background: var(--surface); }
.prod-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.prod { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; transition: all .22s ease; display: flex; flex-direction: column; }
.prod:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
.prod-img { height: 168px; background: var(--surface-2); display: grid; place-items: center; position: relative; }
.prod-img svg { opacity: .85; }
.p-badge { position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 4px 11px; border-radius: 6px; transform: skewX(-10deg); }
.p-badge.hot { background: var(--red); color: var(--on-red); }
.p-badge.new { background: var(--ink); color: var(--on-ink); }
.prod-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.prod-cat { font-size: 11.5px; color: var(--text-2); letter-spacing: 1px; text-transform: uppercase; font-weight: 600; }
.prod-name { font-size: 15px; font-weight: 600; line-height: 1.4; }
.prod-fit { font-size: 12.5px; color: var(--text-2); }
.prod-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.price { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.price small { font-size: 12px; color: var(--text-2); font-weight: 500; }
.add-btn { width: 38px; height: 38px; border-radius: var(--r-sm); background: var(--red-tint); color: var(--red-ink); display: grid; place-items: center; transition: all .2s; }
.add-btn:hover { background: var(--red); color: var(--on-red); transform: scale(1.08); }

/* ── Dark system section (10% black) ────── */
.system-sec { background: var(--ink); color: var(--on-ink); position: relative; overflow: hidden; }
.system-sec .slash-deco { position: absolute; right: -40px; top: 0; height: 100%; width: 300px; pointer-events: none; }
.system-sec .slash-deco i { position: absolute; transform: skewX(-18deg); background: var(--red); display: block; }
.system-sec .sec-title { color: var(--on-ink); }
.system-sec .sec-sub { color: color-mix(in srgb, var(--on-ink) 60%, transparent); }
.mod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; position: relative; }
.mod { background: color-mix(in srgb, var(--on-ink) 6%, transparent); border: 1px solid color-mix(in srgb, var(--on-ink) 14%, transparent); border-radius: var(--r-lg); padding: 26px; transition: all .25s ease; }
.mod:hover { background: color-mix(in srgb, var(--on-ink) 10%, transparent); transform: translateY(-4px); border-color: color-mix(in srgb, #F0505A 55%, transparent); }
.mod-ic { width: 48px; height: 48px; border-radius: var(--r-md); background: #D9232E; color: #fff; display: grid; place-items: center; margin-bottom: 18px; }
.mod h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.mod p { font-size: 14px; color: color-mix(in srgb, var(--on-ink) 62%, transparent); line-height: 1.65; }
.mod ul { list-style: none; margin-top: 14px; display: grid; gap: 8px; }
.mod li { font-size: 13.5px; display: flex; gap: 9px; align-items: center; color: color-mix(in srgb, var(--on-ink) 78%, transparent); }
.mod li::before { content: ""; width: 10px; height: 6px; background: #F0505A; transform: skewX(-18deg); border-radius: 2px; flex-shrink: 0; }

/* ── Features strip ─────────────────────── */
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feat { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; background: var(--bg); transition: all .22s ease; }
.feat:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: color-mix(in srgb, var(--red) 35%, var(--border)); }
.feat-ic { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--red-tint); color: var(--red-ink); display: grid; place-items: center; margin-bottom: 14px; }
.feat b { font-size: 15.5px; font-weight: 700; display: block; margin-bottom: 5px; }
.feat span { font-size: 13.5px; color: var(--text-2); line-height: 1.55; }

/* ── Footer ─────────────────────────────── */
footer { background: var(--ink); color: var(--on-ink); padding: 56px 0 28px; position: relative; overflow: hidden; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.foot-grid p { font-size: 14px; color: color-mix(in srgb, var(--on-ink) 60%, transparent); max-width: 40ch; margin-top: 14px; }
.foot-grid h5 { font-size: 12.5px; letter-spacing: 1.8px; text-transform: uppercase; margin-bottom: 16px; color: color-mix(in srgb, var(--on-ink) 55%, transparent); }
.foot-grid ul { list-style: none; display: grid; gap: 10px; font-size: 14.5px; }
.foot-grid ul a { color: color-mix(in srgb, var(--on-ink) 82%, transparent); transition: color .2s; }
.foot-grid ul a:hover { color: #F0505A; }
.foot-bottom { border-top: 1px solid color-mix(in srgb, var(--on-ink) 12%, transparent); padding-top: 22px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: color-mix(in srgb, var(--on-ink) 50%, transparent); }

/* ── Dashboard shell (POS / Warehouse / Reports / Back-office) ── */
/* ໝາຍເຫດ: .dash-shell ເປັນ layout ເກົ່າທີ່ບໍ່ໄດ້ໃຊ້ໃນ template ໃດແລ້ວ (ໜ້າຫຼັງບ້ານ
   ປັດຈຸບັນໃຊ້ base_dashboard.html + #dashboardSidebar). ກົດລຸ່ມນີ້ຖືກຈຳກັດຂອບເຂດໄວ້ໃຕ້
   .dash-shell ເພື່ອບໍ່ໃຫ້ຕີກັນກັບ Tailwind (fixed/h-screen/w-64) ຂອງແຖບຂ້າງປັດຈຸບັນ,
   ເຊິ່ງໃຊ້ຊື່ class ດຽວກັນ (.dash-sidebar, .dash-nav, ...). */
.dash-shell { display: flex; min-height: 100vh; }
.dash-shell .dash-sidebar {
  width: 240px; flex-shrink: 0; background: var(--ink); color: var(--on-ink);
  display: flex; flex-direction: column; padding: 18px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  transition: width .25s cubic-bezier(.22,.9,.3,1), padding .25s cubic-bezier(.22,.9,.3,1);
}
.dash-shell .dash-sidebar-head { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.dash-shell .dash-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; padding: 6px 8px; overflow: hidden; }
.dash-shell .dash-brand .brand-logo { flex-shrink: 0; }
.dash-shell .dash-brand-copy { display: block; white-space: nowrap; }
.dash-shell .dash-brand-name { font-weight: 800; font-size: 13.5px; letter-spacing: .3px; }
.dash-shell .dash-brand-sub { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: color-mix(in srgb, var(--on-ink) 55%, transparent); }
.dash-shell .dash-sidebar-toggle {
  width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--on-ink) 18%, transparent);
  border-radius: var(--r-sm); background: color-mix(in srgb, var(--on-ink) 8%, transparent);
  color: var(--on-ink); cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.dash-shell .dash-sidebar-toggle:hover { background: color-mix(in srgb, var(--on-ink) 14%, transparent); border-color: var(--red); color: #F0505A; }
.dash-shell .dash-sidebar-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--red) 45%, transparent); outline-offset: 2px; }
.dash-shell .dash-sidebar-toggle svg { transition: transform .25s ease; }

.dash-shell .dash-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.dash-shell .dash-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; color: color-mix(in srgb, var(--on-ink) 72%, transparent);
  transition: all .18s ease;
}
.dash-shell .dash-nav a:hover { background: color-mix(in srgb, var(--on-ink) 8%, transparent); color: var(--on-ink); }
.dash-shell .dash-nav a.active { background: var(--red); color: var(--on-red); }

.dash-shell .dash-sidebar-foot { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--on-ink) 14%, transparent); }
.dash-shell .dash-sidebar-foot .icon-btn { background: color-mix(in srgb, var(--on-ink) 8%, transparent); border-color: color-mix(in srgb, var(--on-ink) 16%, transparent); color: var(--on-ink); align-self: flex-start; }
.dash-shell .dash-sidebar-foot .icon-btn:hover { border-color: var(--red); color: var(--red); }
.dash-shell .dash-back-link { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--on-ink) 65%, transparent); padding: 4px 2px; }
.dash-shell .dash-back-link:hover { color: var(--on-ink); }

.dash-shell .dash-main { flex: 1; min-width: 0; background: var(--bg); }

.dash-shell .dash-sidebar.is-collapsed { width: 76px; padding-inline: 10px; }
.dash-shell .dash-sidebar.is-collapsed .dash-sidebar-head { flex-direction: column; }
.dash-shell .dash-sidebar.is-collapsed .dash-brand { flex: none; padding-inline: 0; }
.dash-shell .dash-sidebar.is-collapsed .dash-brand-copy,
.dash-shell .dash-sidebar.is-collapsed .dash-nav a span,
.dash-shell .dash-sidebar.is-collapsed .dash-back-link span { display: none; }
.dash-shell .dash-sidebar.is-collapsed .dash-nav a { justify-content: center; padding-inline: 10px; }
.dash-shell .dash-sidebar.is-collapsed .dash-sidebar-foot { align-items: center; }
.dash-shell .dash-sidebar.is-collapsed .dash-sidebar-foot .icon-btn { align-self: center; }
.dash-shell .dash-sidebar.is-collapsed .dash-back-link { justify-content: center; padding: 6px; }
.dash-shell .dash-sidebar.is-collapsed .dash-sidebar-toggle svg { transform: rotate(180deg); }

.dash-coming-soon { max-width: 640px; margin: 100px auto; padding: 0 8px; text-align: center; }
.dash-coming-soon-strike { display: inline-block; width: 56px; height: 10px; background: var(--red); transform: skewX(-18deg); margin-bottom: 24px; }
.dash-coming-soon h1 { font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.dash-coming-soon p { color: var(--text-2); font-size: 15px; }

/* ຈໍນ້ອຍຂອງ shell ເກົ່າ (.dash-shell) — ແຖບຂ້າງພັບລົງມາເປັນແຖບແນວນອນ.
   ຈຳກັດຂອບເຂດໄວ້ໃຕ້ .dash-shell ຢ່າງດຽວ: ໜ້າຫຼັງບ້ານປັດຈຸບັນໃຊ້ base_dashboard.html
   ເຊິ່ງເຮັດ ".dash-sidebar" ເປັນລິ້ນຊັກເລື່ອນອອກມາທັບໜ້າແທນ — ສອງແບບນີ້ຕີກັນ. */
@media (max-width: 860px) {
  .dash-shell { flex-direction: column; }
  .dash-shell .dash-sidebar,
  .dash-shell .dash-sidebar.is-collapsed { width: 100%; height: auto; position: sticky; z-index: 50; flex-direction: column; align-items: stretch; padding: 10px 16px; gap: 10px; }
  .dash-shell .dash-sidebar-head,
  .dash-shell .dash-sidebar.is-collapsed .dash-sidebar-head { width: 100%; flex-direction: row; margin-bottom: 0; }
  .dash-shell .dash-brand,
  .dash-shell .dash-sidebar.is-collapsed .dash-brand { flex: 1; padding: 0; }
  .dash-shell .dash-sidebar.is-collapsed .dash-brand-copy { display: block; }
  .dash-shell .dash-nav { flex-direction: row; overflow-x: auto; flex: 1; gap: 4px; }
  .dash-shell .dash-nav a span { display: none; }
  .dash-shell .dash-nav a { padding: 10px; }
  .dash-shell .dash-sidebar-foot { flex-direction: row; align-items: center; border-top: none; padding-top: 0; }
  .dash-shell .dash-back-link span { display: none; }
  .dash-shell .dash-sidebar.is-collapsed .dash-nav,
  .dash-shell .dash-sidebar.is-collapsed .dash-sidebar-foot { display: none; }
  .dash-shell .dash-sidebar.is-collapsed .dash-sidebar-toggle svg { transform: rotate(180deg); }
}

/* ── Animations ─────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
.anim { animation: fadeUp .7s cubic-bezier(.22,.9,.3,1) both; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .16s; } .d3 { animation-delay: .26s; } .d4 { animation-delay: .38s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ── Back-office: system selection ──────── */
.bo-page { padding: 8px 0; }
.bo-page .wrap { padding: 0 8px; }
/* ຫົວຂໍ້ຢູ່ຊ້າຍ ປຸ່ມສະຫຼັບໂໝດຢູ່ຂວາ — ຫໍ່ຂໍ້ຄວາມໄວ້ໃນ <div> ຈຶ່ງບໍ່ຖືກຢືດ */
.bo-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 40px;
}
.bo-header .eyebrow { margin-bottom: 18px; }
.bo-header h1 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.3px; margin-bottom: 8px; }
.bo-header p { color: var(--text-2); font-size: 15.5px; }

.bo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; }
.bo-card {
  position: relative; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  transition: all .25s cubic-bezier(.22,.9,.3,1);
}
.bo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.bo-card::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 4px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
  z-index: 2;
}
.bo-card:hover::after { transform: scaleX(1); }

.bo-card-banner {
  position: relative; height: 180px; width: 100%; display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-bottom: 1px solid var(--border); padding: 18px;
}
.bo-card-banner--motor {
  background: radial-gradient(circle at center, #ffffff 0%, #f4eff1 100%);
}
:root[data-theme="dark"] .bo-card-banner--motor {
  background: radial-gradient(circle at center, #251e23 0%, #151114 100%);
}
.bo-card-banner--parts {
  background: radial-gradient(circle at center, #1b171c 0%, #0d090d 100%);
}
.bo-card-banner .bo-card-img {
  max-height: 140px; max-width: 85%; width: auto; height: auto; object-fit: contain;
  transition: transform .35s cubic-bezier(.22,.9,.3,1);
}
.bo-card-banner--motor .bo-card-img {
  border-radius: var(--r-md);
  box-shadow: 0 4px 14px rgba(23,18,23,.08);
}
.bo-card-banner--parts .bo-card-img {
  border-radius: var(--r-sm);
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.5));
}
.bo-card:hover .bo-card-img {
  transform: scale(1.04);
}
.bo-card-banner .bo-tag {
  position: absolute; top: 12px; right: 12px;
  background: rgba(23, 18, 23, 0.75); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff; padding: 4px 12px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
:root[data-theme="dark"] .bo-card-banner .bo-tag {
  background: rgba(0, 0, 0, 0.75);
  border-color: rgba(255, 255, 255, 0.2);
}

.bo-card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.bo-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.bo-ic { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--red-tint); color: var(--red-ink); display: grid; place-items: center; }
.bo-category-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--text-2); background: var(--surface); padding: 4px 10px; border-radius: var(--r-full);
  border: 1px solid var(--border);
}
.bo-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.bo-card p { font-size: 14px; color: var(--text-2); line-height: 1.6; max-width: 42ch; margin-bottom: 24px; flex: 1; }
.bo-enter {
  display: inline-flex; align-items: center; gap: 8px; justify-content: space-between; width: 100%;
  background: var(--ink); color: var(--on-ink); border-radius: var(--r-md); padding: 13px 18px;
  font-size: 14.5px; font-weight: 700; letter-spacing: .3px; transition: all .2s ease; margin-top: auto;
}
.bo-enter svg { transition: transform .2s ease; flex-shrink: 0; }
.bo-card:hover .bo-enter { background: var(--red); color: var(--on-red); }
.bo-card:hover .bo-enter svg { transform: translateX(4px); }

.bo-bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bento-card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px; transition: all .2s ease;
}
.bento-card:hover { background: var(--bg); border-color: var(--red); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.bento-card .bento-ic { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--red-tint); color: var(--red-ink); display: grid; place-items: center; margin-bottom: 12px; }
.bento-card b { font-size: 14px; font-weight: 700; display: block; margin-bottom: 4px; }
.bento-card span { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }

@media (max-width: 1000px) {
  .bo-grid { grid-template-columns: 1fr; }
  .bo-bento { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .bo-bento { grid-template-columns: 1fr; }
}

/* ── Responsive ─────────────────────────── */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .prod-grid { grid-template-columns: repeat(2, 1fr); }
  .mod-grid { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  nav.links { display: none; }
}
@media (max-width: 560px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .prod-grid { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .topbar .wrap { justify-content: center; }
  :where(body:not(.admin-shell)) section { padding: 52px 0; }
  .hero { padding: 48px 0 60px; }
}

/* ---- ປ້າຍກຳກັບ ແລະ ລາຄາໂປຣ ------------------------------------------------ */
/* ຢູ່ຂວາເທິງ — ຊ້າຍເທິງເປັນປ້າຍສະຕັອກຢູ່ແລ້ວ ບໍ່ໃຫ້ທັບກັນ */
.product-tags { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.product-tag { padding: 4px 8px; border-radius: 2px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: rgba(25,25,27,.9); }
.product-tag--promo { background: var(--red); }
.product-tag--new { background: #0F7B4F; }
.product-tag--bestseller { background: #B8590B; }

/* ລາຄາເກົ່າຂີດຖິ້ມ — ຢູ່ກ່ອນລາຄາໃໝ່ ໃຫ້ເຫັນວ່າຖືກລົງເທົ່າໃດ */
.price-was { display: block; color: var(--text-2); font-size: .72em; font-weight: 600; text-decoration: line-through; }
