@charset "UTF-8";
/* ==========================================================================
   uistore — UniFi 授權代理 Joomla 6 template
   Visual language modelled on the Ubiquiti store: white surfaces, hairline
   borders, one saturated blue accent, product-card grids, light large headings.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Accent — overridden inline from the template style params */
  --ui-accent: #006fff;
  --ui-accent-hover: #0057cc;
  --ui-accent-soft: rgba(0, 111, 255, 0.08);
  --ui-accent-ring: rgba(0, 111, 255, 0.35);

  /* Surfaces */
  --ui-bg: #ffffff;
  --ui-surface: #ffffff;
  --ui-surface-2: #f6f7f8;
  --ui-surface-3: #eceef0;
  --ui-inverse: #1b1c1e;
  --ui-inverse-text: #ffffff;

  /* Text */
  --ui-ink: #1b1c1e;
  --ui-ink-2: #5c6166;
  --ui-ink-3: #868d94;

  /* Lines */
  --ui-line: #e4e7e9;
  --ui-line-strong: #cfd4d8;

  /* Status */
  --ui-green: #00a651;
  --ui-amber: #d97b00;
  --ui-red: #d0342c;

  /* Shape */
  --ui-radius-sm: 3px;
  --ui-radius: 6px;
  --ui-radius-lg: 10px;
  --ui-shadow-1: 0 1px 2px rgba(27, 28, 30, 0.06);
  --ui-shadow-2: 0 4px 16px rgba(27, 28, 30, 0.10);
  --ui-shadow-3: 0 12px 32px rgba(27, 28, 30, 0.14);

  /* Metrics */
  --ui-max: 1440px;
  --ui-gutter: 24px;
  --ui-header-h: 60px;   /* 2026-10-08 56→60，容納 40px 的 logo */

  /* Type */
  --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei",
    "Heiti TC", sans-serif;
  --ui-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* 深色代幣（2026-10-08 參照 tw.store.ui.com：底 #0f1113 近黑、卡片 #1a1d21、文字 #f9fafa／#b7bcc2）。
   生效與否只看 <html data-theme="dark">：index.php 依樣板參數（light／dark 固定、auto 跟隨系統、
   user 由頁首按鈕＋localStorage）在 <head> 最前面決定；CSS 不再自己看 prefers-color-scheme。 */
html[data-theme="dark"] {
  color-scheme: dark;
  --ui-bg: #0f1113;
  --ui-surface: #1a1d21;
  --ui-surface-2: #22262b;
  --ui-surface-3: #2b3036;
  --ui-inverse: #f3f4f5;
  --ui-inverse-text: #101113;
  --ui-ink: #f3f4f5;
  --ui-ink-2: #b7bcc2;
  --ui-ink-3: #868d94;
  --ui-line: #2a2e33;
  --ui-line-strong: #3f454c;
  --ui-accent: #4797ff;
  --ui-accent-hover: #6aacff;
  --ui-accent-soft: rgba(71, 151, 255, 0.14);
  --ui-accent-ring: rgba(71, 151, 255, 0.45);
  --ui-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --ui-shadow-2: 0 4px 16px rgba(0, 0, 0, 0.55);
  --ui-shadow-3: 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--ui-header-h) + 16px);
}

body {
  margin: 0;
  background: var(--ui-bg);
  color: var(--ui-ink);
  font-family: var(--ui-font);
  /* 2026-10-08 參照 tw.store.ui.com 放大：原廠 body 16px、UI 文字 14px；本站取 15px 折衷 */
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ui-accent);
  text-decoration: none;
}

a:hover {
  color: var(--ui-accent-hover);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  color: var(--ui-ink);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* 原廠商店的標題一律粗體（28–36px/700），不再用細字大標 */
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 600; }

p { margin: 0 0 1em; }

p:last-child { margin-bottom: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--ui-line);
  margin: 32px 0;
}

:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 2px;
}

.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--ui-accent);
  color: #fff;
  border-radius: var(--ui-radius);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.u-container {
  width: 100%;
  max-width: var(--ui-max);
  margin-inline: auto;
  padding-inline: var(--ui-gutter);
}

.u-container-narrow {
  width: 100%;
  max-width: 800px;
  margin-inline: auto;
  padding-inline: var(--ui-gutter);
}

.site-main {
  min-height: 40vh;
  padding-block: 8px 64px;
}

.site-main.is-home {
  padding-block: 0;
}

/* Home page component output supplies its own containers and tinted bands. */
.full-bleed {
  width: 100%;
}

.full-bleed > .layout-shell {
  gap: 0;
}

/* The home page ends on a tinted band, so the footer needs no extra gap. */
.site-main.is-home + .site-footer {
  margin-top: 0;
}

.layout-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

/* grid 子項預設 min-width:auto，內容含寬表格時會把整頁撐寬並產生水平捲軸；
   歸零後表格才會在自己的 overflow-x 容器內捲動 */
.layout-shell > * {
  min-width: 0;
}

.has-sidebar .layout-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.has-sidebar-right .layout-shell {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.has-sidebar.has-sidebar-right .layout-shell {
  grid-template-columns: 248px minmax(0, 1fr) 280px;
}

@media (max-width: 991px) {
  .has-sidebar .layout-shell,
  .has-sidebar-right .layout-shell,
  .has-sidebar.has-sidebar-right .layout-shell {
    grid-template-columns: 1fr;
  }
}

.stack > * + * {
  margin-top: 16px;
}

/* --------------------------------------------------------------------------
   4. Promo bar
   -------------------------------------------------------------------------- */
.site-promobar {
  background: var(--ui-inverse);
  color: var(--ui-inverse-text);
  font-size: 12px;
  letter-spacing: 0.01em;
}

/* 深色時反色會變成一條亮白橫幅，改成深灰 */
html[data-theme="dark"] .site-promobar {
  background: var(--ui-surface-2);
  color: var(--ui-ink-2);
}

.site-promobar .u-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  text-align: center;
}

.site-promobar a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-promobar a:hover {
  color: inherit;
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   5. Header + navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: relative;
  z-index: 60;
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-line);
}

.site-header.is-sticky {
  position: sticky;
  top: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--ui-header-h);
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--ui-ink);
}

.brand:hover {
  color: var(--ui-ink);
  text-decoration: none;
}

/* 2026-10-08 公司 logo 放大：原廠頁首 logo 高 40px；本站後台上傳的是 256px 圓形標誌，40px 在 2x 螢幕仍清晰。
   2026-10-13 標誌 SVG 化（media/.../images/logo.svg + logo-dark.svg，由 images/9A9LSRvD.png potrace 向量化）：
   高度照舊 40px／行動 34px，SVG 任縮放都清晰；後台 logoFile 仍可自己傳 SVG 或 PNG。 */
.brand-logo img,
.brand-logo svg {
  display: block;
  height: 40px;
  width: auto;
}

@media (max-width: 575px) {
  .brand-logo img,
  .brand-logo svg {
    height: 34px;
  }
}

/* 深色模式標誌：index.php 在有 logoFileDark（或 SVG fallback）時印兩張（.brand-logo--light／--dark），依模式只顯示一張。
   不用 filter 反相：反相會把紅色 S 變粉紅。白色版由 deploy/joomla/logo-dark.php 從 PNG 產生；SVG 內建 logo-dark.svg。 */
.brand-logo--dark,
html[data-theme="dark"] .brand-logo--light {
  display: none;
}

html[data-theme="dark"] .brand-logo--dark {
  display: inline-flex;
}

.brand-mark {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-badge {
  padding: 2px 7px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 999px;
  color: var(--ui-ink-2);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Primary nav */
.primary-nav {
  flex: 1 1 auto;
  min-width: 0;
}

.primary-nav .nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-nav .nav-item {
  position: relative;
}

.primary-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: var(--ui-header-h);
  padding-inline: 10px;
  color: var(--ui-ink-2);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.primary-nav .nav-link:hover,
.primary-nav .nav-item:focus-within > .nav-link {
  color: var(--ui-ink);
  text-decoration: none;
}

.primary-nav .nav-item.is-active > .nav-link,
.primary-nav .nav-item.current > .nav-link {
  color: var(--ui-ink);
  border-bottom-color: var(--ui-accent);
}

.primary-nav .nav-link .caret {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.55;
}

/* Mega panel */
.primary-nav .mega-panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 70;
  min-width: 260px;
  padding: 14px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 0 0 var(--ui-radius) var(--ui-radius);
  box-shadow: var(--ui-shadow-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
}

.primary-nav .nav-item.is-open > .mega-panel,
.primary-nav .nav-item:hover > .mega-panel,
.primary-nav .nav-item:focus-within > .mega-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.primary-nav .mega-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1px;
}

.primary-nav .mega-panel a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--ui-radius-sm);
  color: var(--ui-ink-2);
  font-size: 13px;
}

.primary-nav .mega-panel a:hover {
  background: var(--ui-surface-2);
  color: var(--ui-ink);
  text-decoration: none;
}

.primary-nav .mega-panel .mega-heading {
  padding: 4px 10px 8px;
  color: var(--ui-ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  margin-inline-start: auto;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  min-width: 34px;
  padding-inline: 8px;
  border: 0;
  border-radius: var(--ui-radius);
  background: transparent;
  color: var(--ui-ink-2);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--ui-surface-2);
  color: var(--ui-ink);
  text-decoration: none;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.tray-count {
  position: absolute;
  top: 1px;
  inset-inline-end: 0;
  min-width: 16px;
  height: 16px;
  padding-inline: 4px;
  border-radius: 999px;
  background: var(--ui-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.tray-count[hidden] {
  display: none;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
}

@media (max-width: 1079px) {
  .primary-nav {
    position: fixed;
    inset: var(--ui-header-h) 0 0 0;
    z-index: 55;
    padding: 8px 0 32px;
    background: var(--ui-surface);
    border-top: 1px solid var(--ui-line);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .primary-nav.is-open {
    transform: translateX(0);
  }

  .primary-nav .nav-list {
    display: block;
    padding-inline: var(--ui-gutter);
  }

  .primary-nav .nav-link {
    height: auto;
    padding: 13px 0;
    font-size: 15px;
    color: var(--ui-ink);
    border-bottom: 1px solid var(--ui-line);
    justify-content: space-between;
    width: 100%;
  }

  .primary-nav .nav-item.is-active > .nav-link {
    border-bottom-color: var(--ui-line);
    color: var(--ui-accent);
  }

  .primary-nav .mega-panel {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    padding: 4px 0 12px 12px;
    display: none;
  }

  .primary-nav .nav-item.is-open > .mega-panel {
    display: block;
  }

  .primary-nav .nav-item:hover > .mega-panel,
.primary-nav .nav-item:focus-within > .mega-panel {
    display: none;
  }

  .primary-nav .nav-item.is-open:hover > .mega-panel,
.primary-nav .nav-item.is-open:focus-within > .mega-panel {
    display: block;
  }

  .nav-toggle {
    display: inline-flex;
    order: -1;
  }
}

/* Search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  padding-top: 12vh;
  background: rgba(27, 28, 30, 0.45);
  backdrop-filter: blur(2px);
}

.search-overlay.is-open {
  display: block;
}

.search-overlay-inner {
  max-width: 680px;
  margin-inline: auto;
  padding: 20px;
  background: var(--ui-surface);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-3);
}

.search-overlay-inner form {
  display: flex;
  gap: 8px;
}

.search-overlay-inner input[type="text"],
.search-overlay-inner input[type="search"] {
  flex: 1 1 auto;
}

/* --------------------------------------------------------------------------
   6. Buttons + form controls
   -------------------------------------------------------------------------- */
.btn,
button.btn,
a.btn,
.btn-primary,
.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--ui-radius);
  background: var(--ui-surface-3);
  color: var(--ui-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:hover {
  text-decoration: none;
  background: var(--ui-line);
  color: var(--ui-ink);
}

.btn-primary,
.btn.btn-primary,
button[type="submit"].btn:not(.btn-outline):not(.btn-ghost) {
  background: var(--ui-accent);
  border-color: var(--ui-accent);
  color: #fff;
}

.btn-primary:hover,
.btn.btn-primary:hover {
  background: var(--ui-accent-hover);
  border-color: var(--ui-accent-hover);
  color: #fff;
}

.btn-outline,
.btn.btn-outline {
  background: transparent;
  border-color: var(--ui-line-strong);
  color: var(--ui-ink);
}

.btn-outline:hover {
  background: var(--ui-surface-2);
  border-color: var(--ui-ink-3);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ui-accent);
}

.btn-ghost:hover {
  background: var(--ui-accent-soft);
  color: var(--ui-accent-hover);
}

.btn-inverse {
  background: var(--ui-inverse);
  border-color: var(--ui-inverse);
  color: var(--ui-inverse-text);
}

.btn-inverse:hover {
  background: var(--ui-inverse);
  color: var(--ui-inverse-text);
  opacity: 0.86;
}

.btn-sm {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-lg {
  min-height: 46px;
  padding: 0 26px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn.is-added {
  background: var(--ui-green);
  border-color: var(--ui-green);
  color: #fff;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
select,
textarea,
.form-control,
.form-select,
.inputbox {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: var(--ui-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
}

textarea,
textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ui-accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--ui-accent-ring);
}

input::placeholder,
textarea::placeholder {
  color: var(--ui-ink-3);
}

label,
.control-label label,
.form-label {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--ui-ink);
  font-size: 13px;
  font-weight: 500;
}

.form-check,
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.form-check input,
.checkbox input {
  width: auto;
  min-height: 0;
  margin-top: 4px;
}

.form-check label {
  margin: 0;
  font-weight: 400;
  color: var(--ui-ink-2);
}

/* --------------------------------------------------------------------------
   7. Badges, chips, notes
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ui-surface-3);
  color: var(--ui-ink-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-new {
  background: var(--ui-accent);
  color: #fff;
}

.badge-hot {
  background: color-mix(in srgb, var(--ui-amber) 14%, var(--ui-surface));
  color: var(--ui-amber);
}

.badge-stock {
  background: color-mix(in srgb, var(--ui-green) 14%, var(--ui-surface));
  color: var(--ui-green);
}

.badge-preorder {
  background: var(--ui-surface-3);
  color: var(--ui-ink-2);
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--ui-ink-3);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   8. Hero — deep blue AIoT band with an animated backdrop

   The backdrop markup comes from html/layouts/uistore/hero-fx.php (inlined so its
   animation actually runs). Only transform/opacity are animated, and every
   animation is switched off under prefers-reduced-motion at the end of this file.
   -------------------------------------------------------------------------- */
.hero {
  --hero-ink: #f2f7ff;
  --hero-ink-2: rgba(226, 239, 255, 0.76);
  --hero-ink-3: rgba(198, 220, 250, 0.62);
  --hero-accent: #67e8f9;
  --hero-line: rgba(160, 200, 255, 0.2);

  position: relative;
  display: flex;
  align-items: center;
  min-height: 540px;
  padding-block: 84px;
  background: #04122b;
  color: var(--hero-ink);
  overflow: hidden;
  isolation: isolate;
}

.hero > .u-container {
  position: relative;
  z-index: 2;
}

/* ---------- backdrop layers ---------- */
.hero-fx,
.hero-fx > *,
.hero-fx__net {
  position: absolute;
  inset: 0;
}

.hero-fx {
  z-index: 0;
  pointer-events: none;
}

.hero-fx__base {
  background:
    radial-gradient(1200px 620px at 68% 34%, #14508f 0%, rgba(20, 80, 143, 0) 62%),
    linear-gradient(135deg, #030d20 0%, #062043 46%, #0a2f6b 100%);
}

/* Slow-drifting aurora blobs give the band depth without a busy texture. */
.hero-fx__aurora {
  filter: blur(56px);
  opacity: 0.75;
}

.hero-fx__blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.hero-fx__blob--a {
  width: 46vw;
  height: 46vw;
  top: -14%;
  left: 44%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.34), transparent 68%);
  animation: heroDriftA 34s ease-in-out infinite alternate;
}

.hero-fx__blob--b {
  width: 40vw;
  height: 40vw;
  bottom: -20%;
  left: 58%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.42), transparent 70%);
  animation: heroDriftB 44s ease-in-out infinite alternate;
}

.hero-fx__blob--c {
  width: 32vw;
  height: 32vw;
  top: 24%;
  left: -8%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.26), transparent 70%);
  animation: heroDriftC 52s ease-in-out infinite alternate;
}

@keyframes heroDriftA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-7%, 8%, 0) scale(1.16); }
}

@keyframes heroDriftB {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to   { transform: translate3d(9%, -10%, 0) scale(0.94); }
}

@keyframes heroDriftC {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(10%, -6%, 0); }
}

/* Panning coordinate plane */
.hero-fx__grid {
  background-image:
    linear-gradient(to right, rgba(150, 200, 255, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(150, 200, 255, 0.09) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(90% 80% at 60% 45%, #000 25%, transparent 78%);
  animation: heroGridPan 26s linear infinite;
  will-change: background-position;
}

@keyframes heroGridPan {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 64px -64px, 64px -64px; }
}

/* Topology */
.hero-fx__net {
  width: 100%;
  height: 100%;
  opacity: 0.92;
}

.hfx-glow {
  animation: heroTracer 5s ease-in-out infinite;
}

@keyframes heroTracer {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

.hfx-ring {
  transform-box: fill-box;
  transform-origin: center;
  stroke-width: 1.6;
  opacity: 0;
  animation: heroRing 5.6s ease-out infinite;
}

.hfx-ring--d2 { animation-delay: 1.85s; }
.hfx-ring--d3 { animation-delay: 3.7s; }
.hfx-ring--slow { animation-duration: 7.4s; }
.hfx-ring--fast { animation-duration: 4.4s; }

@keyframes heroRing {
  0%   { transform: scale(0.35); opacity: 0; }
  12%  { opacity: 0.65; }
  100% { transform: scale(2.9); opacity: 0; }
}

.hfx-node {
  transform-box: fill-box;
  transform-origin: center;
  animation: heroNodePulse 3.4s ease-in-out infinite;
}

.hfx-node--d2 { animation-delay: 1.1s; }
.hfx-node--d3 { animation-delay: 2.2s; }

@keyframes heroNodePulse {
  0%, 100% { opacity: 0.62; transform: scale(0.96); }
  50%      { opacity: 1;    transform: scale(1.06); }
}

.hfx-packet {
  filter: drop-shadow(0 0 5px rgba(103, 232, 249, 0.9));
}

.hfx-hex {
  animation: heroTracer 9s ease-in-out infinite reverse;
}

/* A light sweep crossing the band */
.hero-fx__scan {
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(125, 211, 252, 0.06) 42%,
    rgba(186, 230, 253, 0.14) 50%,
    rgba(125, 211, 252, 0.06) 58%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: heroScan 11s ease-in-out infinite;
  will-change: transform;
}

@keyframes heroScan {
  0%        { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

/* Keeps the copy side calm and darkens the edges */
.hero-fx__vignette {
  background:
    linear-gradient(to right, rgba(3, 13, 32, 0.92) 0%, rgba(3, 13, 32, 0.55) 34%, rgba(3, 13, 32, 0) 62%),
    radial-gradient(120% 120% at 50% 50%, transparent 52%, rgba(3, 10, 26, 0.6) 100%);
}

/* ---------- copy ---------- */
.hero-body {
  max-width: 660px;
}

.hero .eyebrow {
  color: var(--hero-accent);
  opacity: 0.95;
}

.hero-title {
  margin: 0 0 18px;
  color: var(--hero-ink);
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.14;
  text-wrap: balance;
}

.hero-sub {
  margin: 0 0 30px;
  color: var(--hero-ink-2);
  font-size: clamp(0.95rem, 1.4vw, 1.125rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/*
 * Scoped under .hero on purpose. The base button rule includes `a.btn`, whose
 * specificity (0,1,1) beats a lone `.btn-hero` (0,1,0) and would keep overriding
 * background and colour. `.hero .btn-hero` is (0,2,0) and wins cleanly.
 */
.hero .btn-hero,
.hero .btn-hero-ghost {
  min-height: 46px;
  padding: 0 26px;
  font-size: 15px;
}

/* Solid white reads far better than the blue accent on a blue field. */
.hero .btn-hero {
  background: #ffffff;
  border-color: #ffffff;
  color: #062043;
}

.hero .btn-hero:hover {
  background: #d8e9ff;
  border-color: #d8e9ff;
  color: #041229;
}

.hero .btn-hero-ghost {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.45);
  color: var(--hero-ink);
  backdrop-filter: blur(2px);
}

.hero .btn-hero-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.75);
  color: #ffffff;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--hero-line);
}

.hero-meta div {
  min-width: 110px;
}

.hero-meta dt {
  color: var(--hero-ink-3);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hero-meta dd {
  margin: 6px 0 0;
  color: var(--hero-ink);
  font-size: 22px;
  font-weight: 400;
}

/* ---------- narrow screens ---------- */
@media (max-width: 991px) {
  .hero {
    min-height: 480px;
    padding-block: 64px;
  }

  /* Copy spans the width, so lean harder on the vignette instead of hiding the art. */
  .hero-fx__vignette {
    background:
      linear-gradient(to bottom, rgba(3, 13, 32, 0.9) 0%, rgba(3, 13, 32, 0.62) 58%, rgba(3, 13, 32, 0.42) 100%);
  }

  .hero-fx__net {
    opacity: 0.55;
  }
}

@media (max-width: 575px) {
  .hero {
    min-height: 420px;
    padding-block: 48px;
  }

  .hero-fx__grid {
    background-size: 44px 44px;
  }

  .hero-meta {
    gap: 18px 28px;
    margin-top: 32px;
  }

  .hero-meta dd {
    font-size: 19px;
  }
}

/* --------------------------------------------------------------------------
   9. Sections
   -------------------------------------------------------------------------- */
.section {
  padding-block: 56px;
}

.section + .section {
  padding-top: 0;
}

.section-tinted {
  background: var(--ui-surface-2);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

/* 原廠首頁區塊標題 28–36px/700 */
.section-title {
  margin: 0;
  font-size: clamp(1.625rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-sub {
  margin: 6px 0 0;
  color: var(--ui-ink-2);
  font-size: 15px;
}

.section-link {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.section-link::after {
  content: " →";
}

/* --------------------------------------------------------------------------
   10. Product grid + cards
   -------------------------------------------------------------------------- */
/* 原廠列表 1280px 寬一列 4 張、圖 180px；minmax 270 在 1232px 容器剛好 4 欄 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-grid.cols-3 {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

@media (max-width: 575px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  overflow: hidden;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.product-card:hover {
  border-color: var(--ui-line-strong);
  box-shadow: var(--ui-shadow-2);
  transform: translateY(-2px);
}

.pc-media {
  position: relative;
  /* flex: 0 0 auto keeps the square aspect when the grid stretches the card to
     the row height — otherwise the image box absorbs the slack and titles in a
     row stop lining up. */
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 24px;
  background: var(--ui-surface-2);
}

/* No mix-blend-mode here. The manufacturer's product assets are transparent PNGs
   of largely white hardware; multiplying them against the light grey stage made
   white products nearly invisible. Transparent art needs no blending. */
.pc-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pc-flags {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  inset-inline-end: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px;
}

.pc-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 4px;
  padding: 14px;
  border-top: 1px solid var(--ui-line);
}

.pc-cat {
  color: var(--ui-ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* 原廠卡片：名稱 18px/700、型號 14px 灰、說明 12–13px、價格 18px */
.pc-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.pc-title a {
  color: var(--ui-ink);
}

.pc-title a:hover {
  color: var(--ui-accent);
  text-decoration: none;
}

.pc-sku {
  color: var(--ui-ink-2);
  font-size: 14px;
}

.pc-desc {
  margin: 4px 0 0;
  color: var(--ui-ink-2);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.pc-price {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.pc-price .currency {
  margin-inline-end: 2px;
  color: var(--ui-ink-2);
  font-size: 13px;
  font-weight: 500;
}

.pc-price-note {
  color: var(--ui-ink-3);
  font-size: 13px;
  font-weight: 400;
}

/* Card link overlay keeps the whole card clickable without nesting anchors */
.pc-stretch {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.pc-foot .btn {
  position: relative;
  z-index: 2;
}

/* Flags are already absolutely positioned above — they need the stacking order
   raised, but NOT position:relative, which would turn them back into a flex item
   and push the image box down on cards that have a badge. */
.pc-flags {
  z-index: 2;
}

/* --------------------------------------------------------------------------
   11. Category / list page furniture
   -------------------------------------------------------------------------- */
.page-head {
  padding-block: 20px 24px;
  border-bottom: 1px solid var(--ui-line);
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 300;
}

.page-head .page-intro {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--ui-ink-2);
  font-size: 15px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 14px 0;
  list-style: none;
  color: var(--ui-ink-3);
  font-size: 12px;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb li + li::before {
  content: "/";
  color: var(--ui-line-strong);
}

.breadcrumb a {
  color: var(--ui-ink-2);
}

.breadcrumb .active {
  color: var(--ui-ink);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 0 20px;
}

.filter-bar .result-count {
  margin-inline-end: auto;
  color: var(--ui-ink-2);
  font-size: 13px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding-inline: 14px;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: var(--ui-surface);
  color: var(--ui-ink-2);
  font-size: 13px;
}

.chip:hover {
  border-color: var(--ui-line-strong);
  color: var(--ui-ink);
  text-decoration: none;
}

.chip.is-active {
  background: var(--ui-inverse);
  border-color: var(--ui-inverse);
  color: var(--ui-inverse-text);
}

/* Sidebar category nav */
.side-nav {
  position: sticky;
  top: calc(var(--ui-header-h) + 24px);
}

.side-nav h3 {
  margin: 0 0 10px;
  color: var(--ui-ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-nav ul {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.side-nav li a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--ui-radius-sm);
  color: var(--ui-ink-2);
  font-size: 13.5px;
}

.side-nav li a:hover {
  background: var(--ui-surface-2);
  color: var(--ui-ink);
  text-decoration: none;
}

.side-nav li.is-active > a,
.side-nav li.current > a {
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  font-weight: 500;
}

/* Pagination */
.pagination-wrap {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination li > a,
.pagination li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding-inline: 10px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  color: var(--ui-ink-2);
  font-size: 13px;
}

.pagination li > a:hover {
  border-color: var(--ui-line-strong);
  color: var(--ui-ink);
  text-decoration: none;
}

.pagination li.active > a,
.pagination li.active > span {
  background: var(--ui-inverse);
  border-color: var(--ui-inverse);
  color: var(--ui-inverse-text);
}

.counter {
  color: var(--ui-ink-3);
  font-size: 12px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   12. Product detail page
   -------------------------------------------------------------------------- */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: start;
  padding-block: 16px 32px;
}

@media (max-width: 991px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Single column: a 4/3 stage at full width would be absurdly tall. */
  .pd-gallery {
    position: static;
  }

  .pd-stage {
    aspect-ratio: auto;
    height: min(52vh, 380px);
    padding: 24px;
  }
}

.pd-gallery {
  position: sticky;
  top: calc(var(--ui-header-h) + 24px);
}

.pd-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  padding: 40px;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-lg);
}

.pd-stage img {
  max-height: 100%;
  object-fit: contain;
}

.pd-info h1 {
  margin: 8px 0 6px;
  font-size: clamp(1.5rem, 2.6vw, 2.125rem);
  font-weight: 300;
}

.pd-sku {
  color: var(--ui-ink-3);
  font-family: var(--ui-font-mono);
  font-size: 12.5px;
}

.pd-tagline {
  margin: 14px 0 0;
  color: var(--ui-ink-2);
  font-size: 15px;
  line-height: 1.6;
}

.pd-pricebox {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 24px 0;
  padding: 18px 0;
  border-top: 1px solid var(--ui-line);
  border-bottom: 1px solid var(--ui-line);
}

.pd-price {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.pd-price .currency {
  margin-inline-end: 3px;
  color: var(--ui-ink-2);
  font-size: 15px;
  font-weight: 500;
}

.pd-price-note {
  color: var(--ui-ink-3);
  font-size: 12.5px;
}

.pd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.pd-assurance {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 16px;
  background: var(--ui-surface-2);
  border-radius: var(--ui-radius);
  list-style: none;
  color: var(--ui-ink-2);
  font-size: 13px;
}

.pd-assurance li {
  display: flex;
  gap: 8px;
}

.pd-assurance li::before {
  content: "✓";
  color: var(--ui-green);
  font-weight: 700;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.spec-table th,
.spec-table td {
  padding: 11px 0;
  border-bottom: 1px solid var(--ui-line);
  text-align: start;
  vertical-align: top;
}

.spec-table th {
  width: 34%;
  color: var(--ui-ink-3);
  font-weight: 500;
}

.spec-table td {
  color: var(--ui-ink);
}

.pd-section {
  padding-block: 40px;
  border-top: 1px solid var(--ui-line);
}

.pd-section > h2 {
  margin: 0 0 20px;
  font-size: 1.375rem;
  font-weight: 400;
}

.pd-body {
  max-width: 760px;
  color: var(--ui-ink-2);
  font-size: 15px;
  line-height: 1.7;
}

/* 內文是載入模組（表單、表格）時不限寬，760px 的閱讀寬度只適用純文字 */
.pd-body--wide {
  max-width: none;
}

.pd-body h2,
.pd-body h3 {
  color: var(--ui-ink);
  margin-top: 1.6em;
}

.pd-body ul,
.pd-body ol {
  padding-inline-start: 1.3em;
}

.pd-body li {
  margin-bottom: 0.4em;
}

/* --------------------------------------------------------------------------
   13. Inquiry tray (drawer)
   -------------------------------------------------------------------------- */
.tray {
  position: fixed;
  top: 0;
  inset-inline-end: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  width: min(400px, 100vw);
  height: 100%;
  background: var(--ui-surface);
  border-inline-start: 1px solid var(--ui-line);
  box-shadow: var(--ui-shadow-3);
  transform: translateX(105%);
  transition: transform 0.22s ease;
}

.tray.is-open {
  transform: translateX(0);
}

.tray-backdrop {
  position: fixed;
  inset: 0;
  z-index: 94;
  background: rgba(27, 28, 30, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.tray-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.tray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ui-line);
}

.tray-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.tray-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 18px;
}

.tray-empty {
  padding: 48px 0;
  color: var(--ui-ink-3);
  font-size: 13.5px;
  text-align: center;
}

.tray-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tray-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--ui-line);
}

.tray-item img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: var(--ui-surface-2);
  border-radius: var(--ui-radius-sm);
}

.tray-item .ti-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.tray-item .ti-sku {
  color: var(--ui-ink-3);
  font-family: var(--ui-font-mono);
  font-size: 11px;
}

.tray-qty {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tray-qty button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  color: var(--ui-ink-2);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.tray-qty button:hover {
  border-color: var(--ui-line-strong);
  color: var(--ui-ink);
}

.tray-qty output {
  min-width: 28px;
  font-size: 13px;
  text-align: center;
}

.ti-remove {
  border: 0;
  background: transparent;
  color: var(--ui-ink-3);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
}

.ti-remove:hover {
  color: var(--ui-red);
}

.tray-foot {
  padding: 16px 18px;
  border-top: 1px solid var(--ui-line);
  background: var(--ui-surface-2);
}

.tray-foot .tray-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ui-ink-2);
}

.tray-foot .tray-total strong {
  color: var(--ui-ink);
  font-size: 16px;
}

/* Prefilled inquiry summary injected into the contact form */
.inquiry-prefill {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface-2);
}

.inquiry-prefill h2 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}

.inquiry-prefill ul {
  margin: 0;
  padding-inline-start: 1.2em;
  color: var(--ui-ink-2);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   14. Feature strips / editorial blocks
   -------------------------------------------------------------------------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.feature-card {
  padding: 24px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
}

.feature-card p {
  margin: 0;
  color: var(--ui-ink-2);
  font-size: 13.5px;
}

.feature-card .fc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: var(--ui-radius);
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

.feature-card .fc-icon svg {
  width: 20px;
  height: 20px;
}

.cat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cat-tiles > li {
  display: flex;
}

.cat-tile {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 6px;
  padding: 20px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  color: var(--ui-ink);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.cat-tile:hover {
  border-color: var(--ui-line-strong);
  box-shadow: var(--ui-shadow-1);
  color: var(--ui-ink);
  text-decoration: none;
}

.cat-tile strong {
  font-size: 15px;
  font-weight: 500;
}

.cat-tile span {
  color: var(--ui-ink-2);
  font-size: 12.5px;
}

.cat-tile em {
  margin-top: auto;
  padding-top: 12px;
  color: var(--ui-accent);
  font-size: 12.5px;
  font-style: normal;
}

/* --------------------------------------------------------------------------
   15. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 64px;
  padding-top: 48px;
  background: var(--ui-surface);
  border-top: 1px solid var(--ui-line);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  padding-bottom: 40px;
}

.site-footer h3,
.site-footer .mod-title,
.site-footer .card-header {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ui-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  margin-bottom: 7px;
}

.site-footer li a,
.footer-contact a {
  color: var(--ui-ink-2);
  font-size: 13px;
}

.site-footer li a:hover {
  color: var(--ui-ink);
  text-decoration: none;
}

.footer-contact {
  display: grid;
  gap: 6px;
  color: var(--ui-ink-2);
  font-size: 13px;
}

.footer-contact strong {
  color: var(--ui-ink);
  font-weight: 500;
}

.footer-bottom {
  padding-block: 20px 28px;
  border-top: 1px solid var(--ui-line);
}

.footer-bottom .u-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-legal a {
  color: var(--ui-ink-3);
  font-size: 12px;
}

.copyright {
  margin: 0;
  color: var(--ui-ink-3);
  font-size: 12px;
}

.footer-disclaimer {
  flex: 1 1 100%;
  margin: 4px 0 0;
  color: var(--ui-ink-3);
  font-size: 11.5px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   16. Back to top
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  inset-inline-end: 20px;
  bottom: 20px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ui-line);
  border-radius: 50%;
  background: var(--ui-surface);
  color: var(--ui-ink-2);
  box-shadow: var(--ui-shadow-1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  color: var(--ui-ink);
  text-decoration: none;
  border-color: var(--ui-line-strong);
}

/* --------------------------------------------------------------------------
   17. Joomla core / Bootstrap compatibility shims
   Joomla's core component layouts and form fields emit Bootstrap 5 classes.
   These keep them presentable without shipping the whole framework.
   -------------------------------------------------------------------------- */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-inline: -8px;
}

.row > [class*="col-"],
.row > .col {
  padding-inline: 8px;
  width: 100%;
}

@media (min-width: 768px) {
  .col-md-6 { width: 50%; }
  .col-md-4 { width: 33.3333%; }
  .col-md-8 { width: 66.6667%; }
  .col-md-3 { width: 25%; }
  .col-md-9 { width: 75%; }
  .col-md-12 { width: 100%; }
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }
.mb-5 { margin-bottom: 40px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.me-2 { margin-inline-end: 8px !important; }
.ms-2 { margin-inline-start: 8px !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.w-100 { width: 100% !important; }
.float-end { float: right; }
.clearfix::after { content: ""; display: table; clear: both; }
.small, small { font-size: 12.5px; }

/* Hide a label on narrow viewports while keeping its icon visible. Kept up to
   1279px so the horizontal nav has room for all product lines. */
@media (max-width: 1279px) {
  .d-none-sm { display: none; }
}
.text-muted { color: var(--ui-ink-3) !important; }
.fw-bold { font-weight: 600 !important; }

/* mod_finder and other input+button pairings */
.input-group,
.mod-finder__search {
  display: flex;
  gap: 8px;
}

.input-group > input,
.mod-finder__search > input {
  flex: 1 1 auto;
}

.mod-finder label.finder {
  margin-bottom: 6px;
}

.control-group {
  margin-bottom: 16px;
}

.control-group .control-label {
  display: block;
}

.form-text,
.form-description {
  display: block;
  margin-top: 4px;
  color: var(--ui-ink-3);
  font-size: 12px;
}

.required .star,
.star {
  color: var(--ui-red);
}

.alert,
.joomla-alert {
  display: block;
  margin-bottom: 20px;
  padding: 12px 16px;
  border: 1px solid var(--ui-line);
  border-inline-start: 3px solid var(--ui-accent);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface-2);
  color: var(--ui-ink);
  font-size: 13.5px;
}

.alert-success,
.joomla-alert[type="success"] {
  border-inline-start-color: var(--ui-green);
}

.alert-danger,
.alert-error,
.joomla-alert[type="danger"] {
  border-inline-start-color: var(--ui-red);
}

.alert-warning,
.joomla-alert[type="warning"] {
  border-inline-start-color: var(--ui-amber);
}

.alert h4,
.alert-heading {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}

table:not(.spec-table) {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table:not(.spec-table) th,
table:not(.spec-table) td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ui-line);
  text-align: start;
}

table:not(.spec-table) thead th {
  color: var(--ui-ink-3);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

fieldset {
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  margin-bottom: 12px;
  font-size: 1.125rem;
  font-weight: 500;
}

/* Module chrome */
.moduletable,
.mod-card {
  margin-bottom: 24px;
}

.moduletable > h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ui-ink-3);
}

.card {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  margin-bottom: 24px;
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ui-line);
  font-size: 13px;
  font-weight: 600;
}

.card-body {
  padding: 16px;
}

/* System messages container */
#system-message-container {
  padding-top: 16px;
}

/* --------------------------------------------------------------------------
   18. Offline / error pages
   -------------------------------------------------------------------------- */
.error-page {
  display: flex;
  align-items: center;
  min-height: 70vh;
  padding-block: 64px;
}

.error-code {
  display: block;
  color: var(--ui-ink-3);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.error-page h1 {
  margin: 8px 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 300;
}

.error-page .error-msg {
  max-width: 560px;
  color: var(--ui-ink-2);
  font-size: 15px;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* --------------------------------------------------------------------------
   19. Print
   -------------------------------------------------------------------------- */
@media print {
  .site-promobar,
  .site-header,
  .site-footer,
  .back-to-top,
  .tray,
  .tray-backdrop,
  .search-overlay,
  .pd-actions {
    display: none !important;
  }

  body {
    font-size: 11pt;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  /*
   * The rule above only reaches CSS animations. The hero's data packets move via
   * SVG <animateMotion>, which CSS cannot pause, so hide them outright. The scan
   * sweep is also removed rather than frozen mid-pass, and the rings are pinned
   * to a visible resting state instead of collapsing to scale(0.35).
   */
  .hfx-packet,
  .hero-fx__scan {
    display: none !important;
  }

  .hfx-ring {
    opacity: 0.18 !important;
    transform: scale(1.4) !important;
  }

  .hfx-ring--d2,
  .hfx-ring--d3 {
    display: none !important;
  }

  .hfx-glow,
  .hfx-hex,
  .hfx-node {
    opacity: 0.8 !important;
  }
}

/* --------------------------------------------------------------------------
   20. Smart Search results
   -------------------------------------------------------------------------- */
.com-finder__explained {
  margin-bottom: 20px;
  color: var(--ui-ink-2);
  font-size: 13.5px;
}

.com-finder__empty {
  padding: 40px 0;
}

.com-finder__empty h2 {
  font-size: 1.25rem;
  font-weight: 400;
}

.com-finder__empty p {
  color: var(--ui-ink-2);
}

#search-result-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ui-line);
}

.result__item {
  display: grid;
  gap: 4px;
  padding: 18px 0;
  border-bottom: 1px solid var(--ui-line);
}

.result__title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.result__title-link {
  display: grid;
  gap: 2px;
}

.result__title-link:hover {
  text-decoration: none;
}

.result__title-text {
  color: var(--ui-ink);
}

.result__title-link:hover .result__title-text {
  color: var(--ui-accent);
}

.result__title-url {
  color: var(--ui-ink-3);
  font-size: 11.5px;
  font-style: normal;
  word-break: break-all;
}

.result__description {
  margin: 2px 0 0;
  color: var(--ui-ink-2);
  font-size: 13.5px;
  line-height: 1.6;
}

.result__date {
  margin-inline-end: 8px;
  color: var(--ui-ink-3);
}

.result__taxonomy {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ui-ink-3);
  font-size: 12px;
}

.result__taxonomy-item span {
  font-weight: 500;
}

/* Search-term highlighting injected by the core highlighter */
.highlight,
mark.highlight {
  padding: 0 2px;
  background: var(--ui-accent-soft);
  color: inherit;
  border-radius: 2px;
}

.search-pagination {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 32px;
}

.search-pages-counter {
  color: var(--ui-ink-3);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   12. HikaShop 商品列表：套用 product-card（詢價磚）視覺
   HikaShop 的 CSS（hikashop.css / frontend_default.css）在本檔之後載入，
   故所有 selector 以 .hikashop_products_listing 起手拉高特異度；
   只有 HikaShop 明確寫死的屬性（圖片尺寸、按鈕底色、欄位寬度）才用 !important。
   結構未動，純以 CSS 重繪，商品的「放入購物車」功能不受影響。
   -------------------------------------------------------------------------- */

/* 讓欄位/容器撐滿各自的 grid cell，卡片才不會被壓窄。 */
.hikashop_products_listing .hikashop_product,
.hikashop_products_listing .hikashop_container {
  width: 100%;
  display: flex;
}

/* 2026-10-08 參照 tw.store.ui.com：1280px 寬一列 4 張卡、圖 180px。
   後台選單/模組的「每列欄數」（hkc-md-N）改以 CSS 的 auto-fill 取代，
   不再依賴後台設定；minmax 270 在 1232px 容器剛好 4 欄，窄螢幕自動減欄。 */
.hikashop_products_listing .hk-row-fluid {
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
  margin: 0 0 16px;
}

.hikashop_products_listing .hk-row-fluid > [class*="hkc-"] {
  grid-column: auto !important;
  padding: 0;
}

@media (max-width: 575px) {
  .hikashop_products_listing .hk-row-fluid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  /* 手機兩欄時卡片只有 ~160px 寬，名稱／價格縮回 16px */
  .hikashop_products_listing .hikashop_product_name,
  .hikashop_products_listing .hikashop_product_price,
  .pc-title,
  .pc-price {
    font-size: 16px;
  }
}

/* 卡片外框（對應 .product-card） */
.hikashop_products_listing .hikashop_subcontainer.thumbnail {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left !important;
  /* !important：HikaShop 會依模組「背景顏色」參數在頁面 inline 印出
     #hikashop_..._module_N div.hikashop_subcontainer { background-color:#fff }，深色模式要蓋掉它 */
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-line) !important;
  border-radius: var(--ui-radius);
  overflow: hidden;
  padding: 0 !important;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.hikashop_products_listing .hikashop_subcontainer.thumbnail:hover {
  border-color: var(--ui-line-strong) !important;
  box-shadow: var(--ui-shadow-2);
  transform: translateY(-2px);
}

/* 內容包裝：flex column，撐滿卡片高度 */
.hikashop_products_listing .hikashop_listing_img_titledesc {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 4px;
  padding: 14px;
  text-align: left !important;
}

/* 圖區排到最上並滿版灰底（對應 .pc-media） */
.hikashop_products_listing .hikashop_product_image {
  order: -1;
  flex: 0 0 auto;
  margin: -14px -14px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 縮圖已由 deploy/joomla/catalog-images.php 調成 400px，圖區改 1/1 正方，
     減掉 padding 後圖約 220px（原廠 180px）。 */
  aspect-ratio: 1 / 1;
  padding: 24px;
  background: var(--ui-surface-2);
}

.hikashop_products_listing .hikashop_product_image_subdiv,
.hikashop_products_listing .hikashop_product_image_subdiv > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* HikaShop 縮圖帶 width/height 屬性，改由容器等比縮放置中 */
.hikashop_products_listing img.hikashop_product_listing_image {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain;
}

/* 分類列表（如 UniFi 頁）的卡片：HikaShop 預設白底 .thumbnail，改用代幣；
   分類圖是黑色線稿 SVG，深色時反相成白線 */
.hikashop_subcategories .hikashop_subcontainer.thumbnail {
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-line) !important;
  box-shadow: none;
}

.hikashop_subcategories .hikashop_subcontainer.thumbnail:hover {
  border-color: var(--ui-line-strong) !important;
  box-shadow: var(--ui-shadow-2);
}

html[data-theme="dark"] .hikashop_subcategories .hikashop_category_image img {
  filter: invert(1);
}

/* 分類列表（如 UniFi 頁）：名稱下方的分類描述，比照首頁產品線卡片的灰色說明 */
.hikashop_subcategories .hikashop_category_desc {
  display: block;
  max-width: 220px;
  margin: 6px auto 0;
  color: var(--ui-ink-3);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

/* 標題（對應 .pc-title）：蓋掉 HikaShop 預設藍色連結 */
/* HikaShop 對名稱/價格/庫存各自設了置中，需逐一改回靠左（對齊詢價磚） */
.hikashop_products_listing .hikashop_product_name,
.hikashop_products_listing .hikashop_product_price_full,
.hikashop_products_listing .hikashop_product_stock_count {
  text-align: left !important;
}

/* 原廠卡片：名稱 18px/700、型號 14px 灰、說明 12–13px、價格 18px */
.hikashop_products_listing .hikashop_product_name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

/* SKU（產品型號）：名稱正下方，灰字 14px（原廠 USW-Pro-Max-48-PoE 那行） */
.hikashop_products_listing .hikashop_product_sku {
  display: block;
  margin: 2px 0 0;
  color: var(--ui-ink-2);
  font-size: 14px;
  font-weight: 400;
  text-align: left !important;
}

.hikashop_products_listing .hikashop_product_name a {
  color: var(--ui-ink) !important;
  text-decoration: none;
}

.hikashop_products_listing .hikashop_product_name a:hover {
  color: var(--ui-accent) !important;
}

/* 描述（對應 .pc-desc）：兩行截斷 */
.hikashop_products_listing .hikashop_product_desc {
  margin: 4px 0 0;
  color: var(--ui-ink-2);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 價格（對應 .pc-price） */
.hikashop_products_listing .hikashop_product_price_full {
  display: block;
  margin-top: 6px;
}

.hikashop_products_listing .hikashop_product_price {
  font-size: 18px;
  font-weight: 500;
  color: var(--ui-ink);
  letter-spacing: -0.01em;
}

.hikashop_products_listing .hikashop_product_price_per_unit {
  color: var(--ui-ink-3);
  font-size: 13px;
  font-weight: 500;
}

/* 庫存 */
.hikashop_products_listing .hikashop_product_stock_count {
  color: var(--ui-ink-3);
  font-size: 13px;
}

/* 加入購物車表單貼卡片底部（對應 .pc-foot 的 margin-top:auto） */
.hikashop_products_listing form.hikashop_aligned_btn {
  margin-top: auto;
  padding-top: 12px;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 數量選擇器：整理成與站台一致的細框樣式 */
.hikashop_products_listing .hikashop_quantity_form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hikashop_products_listing .hikashop_product_quantity_field {
  width: 52px !important;
  text-align: center;
  border: 1px solid var(--ui-line) !important;
  border-radius: 8px;
  padding: 6px !important;
  color: var(--ui-ink);
}

.hikashop_products_listing a.hikashop_product_quantity_field_change {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 32px;
  border: 1px solid var(--ui-line) !important;
  border-radius: 8px !important;
  background: var(--ui-surface) !important;
  color: var(--ui-ink-2) !important;
  text-decoration: none;
}

.hikashop_products_listing a.hikashop_product_quantity_field_change:hover {
  border-color: var(--ui-line-strong) !important;
  color: var(--ui-ink) !important;
}

/* 加入購物車表單改為橫列：數量選擇器在左、按鈕在同一列右側。
   form 無 class，用 :has(.hikacart) 精準限定只作用在加入購物車表單，
   不影響列表頂端的排序／篩選表單。庫存文字不在此 form 內（在價格下方），不受影響。 */
.hikashop_products_listing form:has(.hikacart) {
  display: flex;
  /* 必須明確 row：某些選單的 form 會帶 .hikashop_aligned_btn（見上方規則），
     其 flex-direction:column 會讓按鈕直排到數量選擇器下方，故在此覆蓋為橫排。 */
  flex-direction: row;
  align-items: center;   /* 按鈕與數量選擇器垂直置中 */
  gap: 12px;
  /* nowrap：確保按鈕永遠與數量選擇器同一列，不因卡片略窄就掉到下一行 */
  flex-wrap: nowrap;
}

/* 「放入購物車」按鈕：比照「加入詢價」改為白底外框次要按鈕（對應 .btn-outline），
   並縮成小按鈕（width:fit-content）。父層 form 為 flex 橫列，按鈕緊鄰數量
   選擇器右側（間距由 form 的 gap 控制，不用 margin-left:auto 貼到最右）。與詢價磚視覺一致。
   HikaShop 的加入按鈕實際是 <button class="hikabtn hikacart">，故用 .hikacart 選取
   （不含數量 +/- 的 .hikabtn），並補上 button 的 reset。 */
.hikashop_products_listing .hikacart {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;        /* 卡片極窄時允許按鈕縮小，避免撐破卡片 */
  width: fit-content;
  padding: 9px 16px;
  margin: 0 !important;
  white-space: nowrap;
  background: transparent !important;
  border: 1px solid var(--ui-line-strong) !important;
  border-radius: var(--ui-radius-sm);
  color: var(--ui-ink) !important;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

/* --------------------------------------------------------------------------
   12b. HikaShop 商品頁（templates/uistore/html/com_hikashop/product/show_default.php）
   2026-10-08 參照 tw.store.ui.com 商品頁：名稱 22px/700、型號 12–14px 灰、
   價格 18px、主圖舞台約 620px 寬；主圖尺寸由 deploy/joomla/catalog-images.php
   把 product_image_x/y 調成 640，這裡只做舞台與字級。
   -------------------------------------------------------------------------- */
.hikashop_product_page .hikashop_product_top_part h1 {
  margin: 8px 0 4px;
  font-size: clamp(1.5rem, 2.4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hikashop_product_page .hikashop_product_code_main {
  margin: 0 0 20px;
  color: var(--ui-ink-2);
  font-size: 14px;
}

.hikashop_product_page > .hk-row-fluid {
  gap: 40px;
  margin: 0;
}

.hikashop_product_page > .hk-row-fluid > [class*="hkc-"] {
  padding: 0;
}

/* 主圖舞台：淺灰底、細框、圖片置中等比縮放（對應 com_content 的 .pd-stage） */
.hikashop_product_page .hikashop_main_image_div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 32px;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-lg);
}

.hikashop_product_page .hikashop_product_main_image {
  height: auto !important;
}

.hikashop_product_page .hikashop_product_main_image_subdiv img {
  max-width: 100%;
  height: auto;
  margin: 0 !important;
}

.hikashop_product_page .hikashop_small_image_div img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  padding: 6px;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
}

.hikashop_product_page .hikashop_product_price_main .hikashop_product_price {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hikashop_product_page .hikashop_product_price_per_unit {
  color: var(--ui-ink-3);
  font-size: 13px;
}

.hikashop_product_page .hikashop_product_stock_count {
  color: var(--ui-ink-2);
  font-size: 14px;
}

.hikashop_product_page .hikashop_product_right_part .hikacart {
  padding: 12px 28px;
  font-size: 15px;
}

/* 數量欄與 +/-：HikaShop 寫死白底深字，改用代幣（深色模式才看得到） */
.hikashop_product_page .hikashop_product_quantity_field {
  background: var(--ui-surface) !important;
  color: var(--ui-ink) !important;
  border: 1px solid var(--ui-line-strong) !important;
  border-radius: var(--ui-radius-sm);
}

.hikashop_product_page a.hikashop_product_quantity_field_change,
.hikashop_products_listing a.hikashop_product_quantity_field_change {
  color: var(--ui-ink-2) !important;
}

.hikashop_product_page .hikashop_product_description_main {
  max-width: 820px;
  font-size: 15px;
  line-height: 1.7;
}

.hikashop_products_listing .hikacart:hover {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-ink-3) !important;
  color: var(--ui-ink) !important;
}

/* --------------------------------------------------------------------------
   13. Header 迷你購物車（HikaShop cart 模組，drawer 模式）
   模組在 header 只顯示圖示；HikaShop 預設會在主連結印出總額/「購物車是空的」
   文字，這裡收成一顆 40x40 圖示按鈕。點擊由 HikaShop drawer JS 右側滑出購物車。
   注意：只作用在 .header-cart 內，抽屜內容(.hikashop_drawer__*)不受影響。
   -------------------------------------------------------------------------- */
.header-cart {
  display: flex;
  align-items: center;
}

.header-cart .hikashop_cart_module,
.header-cart .hikashop_cart {
  margin: 0;
  padding: 0;
}

/* 隱藏 header 內不需要的 loading 佔位 */
.header-cart .hikashop_checkout_loading_elem,
.header-cart .hikashop_checkout_loading_spinner {
  display: none;
}

/* 主連結收成 icon 按鈕（比照 .icon-btn）
   position:relative 作為數量徽章(.cart-badge)的定位基準 */
.header-cart .hikashop_cart > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--ui-ink);
  text-decoration: none;
}

.header-cart .hikashop_cart > a:hover {
  background: var(--ui-surface-2);
}

/* 收掉 HikaShop 在主連結印出的文字（總額/「購物車是空的」），只留圖示 */
.header-cart .hikashop_small_cart_total_title {
  display: inline-flex;
  align-items: center;
  font-size: 0;
  line-height: 0;
}

.header-cart .hikashop_cart_module_product_icon_title {
  display: block;
  width: 24px;
  height: 24px;
}

/* 圖示是 <img src="cart.svg">（HikaShop 模組參數指定的檔），線條寫死深灰、吃不到 currentColor，深色模式反相成白線 */
html[data-theme="dark"] .header-cart .hikashop_cart_module_product_icon_title {
  filter: invert(1);
}

/* 購物車數量徽章：由 template.js 依抽屜品項列數注入/更新。
   貼在圖示右上角的紅色圓點數字；0 筆時 JS 會移除元素故不顯示。 */
.header-cart .cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--ui-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-family: var(--ui-font-mono, inherit);
  pointer-events: none;
}

/* HikaShop 地址表單（新帳單/送貨地址）改雙欄，減少縱向佔用。
   直接對「欄位列」本身設寬度做 inline-block 換行，不依賴 #hikashop_address_form
   與欄位列之間是否隔了一層容器（grid 設在 form 上時，若中間有 wrapper 會失效）。
   欄位列 class 形如 hkform-group control-group hikashop_address_<fieldname>，
   以 hikashop_address_ 前綴限定只作用於地址表單欄位。 */
.hkform-group.control-group[class*="hikashop_address_"] {
  display: inline-block;
  vertical-align: top;
  width: 48%;
  box-sizing: border-box;
}

/* 街道較長，跨整列 */
.hkform-group.control-group.hikashop_address_address_street {
  width: 100%;
}

/* 窄螢幕收回單欄 */
@media (max-width: 782px) {
  .hkform-group.control-group[class*="hikashop_address_"] {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   14. 深色／淺色切換鈕（index.php 只在配色模式=讓訪客切換時印出）
   淺色顯示月亮、深色顯示太陽；代幣切換見第 1 節 html[data-theme="dark"]。
   -------------------------------------------------------------------------- */
.theme-toggle__sun,
html[data-theme="dark"] .theme-toggle__moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle__sun {
  display: block;
}

/* --------------------------------------------------------------------------
   15. 深色模式：HikaShop／Joomla 元件覆寫（第二步，2026-10-08）
   HikaShop 的 frontend_default.css、drawer.css 與 Joomla 系統訊息都寫死淺色，
   這裡只在 html[data-theme="dark"] 下改成代幣；淺色模式完全不受影響。
   寫死在元件 CSS 裡且有 !important／id 特異度的才跟著用 !important。
   -------------------------------------------------------------------------- */

/* 表單欄位（HikaShop hkform-control、Joomla form-control、舊式 inputbox） */
html[data-theme="dark"] input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .hkform-control,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  background-color: var(--ui-surface) !important;
  color: var(--ui-ink) !important;
  border-color: var(--ui-line-strong) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--ui-ink-3);
}

/* HikaShop 一般按鈕（.hikabtn 預設淺灰底深字；.hikacart 與主要動作鈕另有樣式） */
html[data-theme="dark"] .hikabtn:not(.hikacart):not(.hikabtn-primary):not(.hikabtn-success):not(.hikabtn-danger):not(.hikabtn-info):not(.hikabtn-warning) {
  background-color: var(--ui-surface-3) !important;
  background-image: none !important;
  color: var(--ui-ink) !important;
  border-color: var(--ui-line-strong) !important;
}

html[data-theme="dark"] .hikabtn:not(.hikacart):not(.hikabtn-primary):not(.hikabtn-success):not(.hikabtn-danger):not(.hikabtn-info):not(.hikabtn-warning):hover {
  background-color: var(--ui-line-strong) !important;
}

/* 系統訊息（Joomla joomla-alert 與 HikaShop/notify.js 的加入購物車提示） */
html[data-theme="dark"] joomla-alert,
html[data-theme="dark"] .alert,
html[data-theme="dark"] .alert-message,
html[data-theme="dark"] .notifyjs-metro-base {
  background-color: var(--ui-surface-2) !important;
  color: var(--ui-ink) !important;
  border-color: var(--ui-line) !important;
}

html[data-theme="dark"] joomla-alert .alert-heading,
html[data-theme="dark"] .notifyjs-metro-base .title,
html[data-theme="dark"] .notifyjs-metro-base .text {
  color: var(--ui-ink) !important;
}

/* 購物車抽屜（drawer.css 寫死 #fff） */
html[data-theme="dark"] .hikashop_drawer__wrapper,
html[data-theme="dark"] .hikashop_drawer__content,
html[data-theme="dark"] .hikashop_drawer__header,
html[data-theme="dark"] .hikashop_drawer__footer {
  background-color: var(--ui-surface) !important;
  color: var(--ui-ink);
  border-color: var(--ui-line) !important;
}

html[data-theme="dark"] .hikashop_drawer__close {
  filter: invert(1);
}

/* 購物車／結帳／訂單／地址表格：HikaShop 用 #ccc／#ddd 畫格線 */
html[data-theme="dark"] .hikashop_checkout_cart table tr,
html[data-theme="dark"] .hikashop_show_cart_form table tr,
html[data-theme="dark"] #hikashop_show_cart_form .table thead tr th,
html[data-theme="dark"] #hikashop_order_listing table#hikashop_order_listing tbody > tr,
html[data-theme="dark"] #hikashop_address_listing tr.hikashop_address_listing_item,
html[data-theme="dark"] table#hikashop_downloads tbody > tr,
html[data-theme="dark"] table.hikashop_no_border td,
html[data-theme="dark"] #hikashop_checkout_page table td,
html[data-theme="dark"] #hikashop_checkout_page table th,
html[data-theme="dark"] .hikashop_user_page table td,
html[data-theme="dark"] .hikashop_user_page table th,
html[data-theme="dark"] #hikashop_order_main table td,
html[data-theme="dark"] #hikashop_order_main table th,
html[data-theme="dark"] #hikashop_order_main fieldset,
html[data-theme="dark"] #hikashop_checkout_page fieldset,
html[data-theme="dark"] .hikashop_user_page fieldset {
  border-color: var(--ui-line) !important;
}

html[data-theme="dark"] #hikashop_show_cart_form table.hikashop_cart_products td:before,
html[data-theme="dark"] #hikashop_show_cart_form table.hikashop_cart_products th:before,
html[data-theme="dark"] #hikashop_order_listing table td:before,
html[data-theme="dark"] #hikashop_address_listing table td:before,
html[data-theme="dark"] #hikashop_order_main fieldset#htmlfieldset_products table tbody tr td:before,
html[data-theme="dark"] table#hikashop_downloads td:before,
html[data-theme="dark"] #hikashop_checkout_page .hikashop_cart_step,
html[data-theme="dark"] #hikashop_checkout_page .hikashop_cart_step span a,
html[data-theme="dark"] .hikashop_tabs_ul li a,
html[data-theme="dark"] .hika_toolbar a {
  color: var(--ui-ink) !important;
}

/* 會員中心圖示列、頁籤、篩選、評論、下拉購物車等淺灰面板 */
html[data-theme="dark"] .hika_cpanel_icons > a,
html[data-theme="dark"] .hikashop_tabs_content,
html[data-theme="dark"] .hikashop_tabs_li_selected,
html[data-theme="dark"] div.hikashop_cart_dropdown_content,
html[data-theme="dark"] #hikashop_cart_module div.hikashop_cart_dropdown_content,
html[data-theme="dark"] .hikashop_filter_suggestions,
html[data-theme="dark"] .hikashop_filter_collapsable_title_always + .hikashop_filter_main_div,
html[data-theme="dark"] .hikashop_filter_collapsable_title_mobile + .hikashop_filter_main_div {
  background-color: var(--ui-surface) !important;
  border-color: var(--ui-line) !important;
  color: var(--ui-ink) !important;
}

html[data-theme="dark"] .hika_cpanel_icons > a:hover,
html[data-theme="dark"] .hika_cpanel_icons > a:focus,
html[data-theme="dark"] .hika_edit,
html[data-theme="dark"] .hikashop_vote_answer,
html[data-theme="dark"] .hikashop_datepicker_range_cell,
html[data-theme="dark"] .hikashop_filter_collapsable_title_always,
html[data-theme="dark"] .hikashop_filter_collapsable_title_mobile,
html[data-theme="dark"] .hikashop_products .hikashop_switcher_list,
html[data-theme="dark"] .hikashop_products .hikashop_switcher_grid {
  background-color: var(--ui-surface-2) !important;
  border-color: var(--ui-line) !important;
  color: var(--ui-ink) !important;
}

/* 數量 +/-（結帳頁與購物車抽屜；商品頁的在 12b 節） */
html[data-theme="dark"] div.hikashop_product_quantity_change_div_leftright span:hover,
html[data-theme="dark"] .hika_j4 div.hikashop_product_quantity_change_div_leftright span:hover a {
  background-color: var(--ui-line-strong) !important;
}

html[data-theme="dark"] .hikashop_product_quantity_change_div_leftright span.add-on a,
html[data-theme="dark"] #hikashop_vote_listing div.hika_comment_listing_content,
html[data-theme="dark"] #hikashop_vote_listing span.hika_vote_listing_username,
html[data-theme="dark"] div.hikashop_carousel_parent_div div.owl-controls div.owl-dot {
  color: var(--ui-ink) !important;
}

/* 訂單狀態標籤 HikaShop 用純黑底，深色下看不出來 */
html[data-theme="dark"] span.hk-label-black,
html[data-theme="dark"] span.order-label-all {
  background-color: var(--ui-surface-3) !important;
}

/* 會員中心／訂單列表的卡片（hikashop.css 的 .hk-card 白底、表頭 #f5f5f5）與地址選擇區 #fdfdfd */
html[data-theme="dark"] .hk-card,
html[data-theme="dark"] .hk-list-group-item,
html[data-theme="dark"] .hikashop_user_address,
html[data-theme="dark"] .hk-panel,
html[data-theme="dark"] .hk-well {
  background-color: var(--ui-surface) !important;
  border-color: var(--ui-line) !important;
  color: var(--ui-ink);
}

html[data-theme="dark"] .hk-card-header,
html[data-theme="dark"] .hk-card-footer,
html[data-theme="dark"] .hk-panel-heading,
html[data-theme="dark"] .hk-table thead th,
html[data-theme="dark"] .hk-table-striped tbody tr:nth-of-type(odd) {
  background-color: var(--ui-surface-2) !important;
  border-color: var(--ui-line) !important;
  color: var(--ui-ink);
}

html[data-theme="dark"] .hk-table td,
html[data-theme="dark"] .hk-table th,
html[data-theme="dark"] .hk-table {
  border-color: var(--ui-line) !important;
}

/* 品牌頁的 Ubiquiti／UniFi 核准標誌（deploy/joomla/ui-brand-page.php）：文章裡同時放 dark（黑圖案）與 light（白圖案）
   兩個原廠版本，依模式只顯示一個；不用 filter 反相，指南要求不得修改標誌 */
.ui-brand-logo--light,
html[data-theme="dark"] .ui-brand-logo--dark {
  display: none;
}

html[data-theme="dark"] .ui-brand-logo--light {
  display: inline-block;
}

/* 搜尋結果的關鍵字標記：瀏覽器預設黃底黑字 */
html[data-theme="dark"] mark {
  background: color-mix(in srgb, var(--ui-amber) 35%, transparent);
  color: var(--ui-ink);
}
