/* ═══════════════════════════════════════════════════════════════════════════
   aquamx SHARED LAYER — มาตรฐานกลางของทุกหน้า · แก้ที่ไฟล์นี้ที่เดียว มีผลทั้งเว็บ
   ─────────────────────────────────────────────────────────────────────────
   กติกา:
   · ไฟล์นี้เก็บเฉพาะของที่ "ต้องเหมือนกันทุกหน้า": โทเคนแบรนด์ · ขนาดโลโก้/แถบ header
     · ปุ่มบัญชี (avatar) · ชิปสลับร้าน · a11y (focus ring / reduced motion)
   · ของเฉพาะหน้า อยู่ใน <style> ของหน้านั้นตามเดิม
   · โหลดไฟล์นี้ "หลัง" style ของหน้า (<link> อยู่ใต้ </style>) — กฎมาตรฐานจึงชนะ
     ค่าเก่าที่เคยตั้งกันคนละทิศ (ใช้ !important เฉพาะจุดที่เป็นมาตรฐานตายตัว)
   · จะเปลี่ยนขนาดโลโก้ทั้งเว็บ → แก้ตัวเลขใน :root ข้างล่างนี้จุดเดียว
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* โทเคนแบรนด์ (อ้างอิง DESIGN.md — navy โครงสร้าง · bronze จุดเน้น ≤10%) */
  --aq-navy: #0E3361;
  --aq-navy-deep: #072147;
  --aq-orange: #C9864C;
  --aq-orange-strong: #A36738;
  --aq-ink: #0B1B33;
  --aq-muted: #5C6B82;
  --aq-green: #2E9E5B;
  --aq-line-cool: #E6E9F1;   /* หน้า product (ฟอร์ม/แดชบอร์ด) */
  --aq-line-warm: #EADFC9;   /* หน้า brand (landing/เอกสาร) */

  /* มาตรฐาน header — จุดเดียวที่ต้องแก้เมื่ออยากเปลี่ยนขนาดโลโก้ทั้งเว็บ */
  --aq-logo: 84px;
  --aq-nav-h: 92px;
  --aq-logo-m: 56px;
  --aq-nav-h-m: 68px;
}

/* ── HEADER: โลโก้ + ความสูงแถบ เท่ากันทุกหน้า ──
   ครอบทั้งโครง .nav (landing/เอกสาร/แดชบอร์ด) และ .appbar (ฟอร์ม) */
.nav { height: var(--aq-nav-h) !important; }
.nav .brand img,
.appbar .brand-img { height: var(--aq-logo) !important; width: auto !important; }
@media (max-width: 767px) {
  .nav { height: var(--aq-nav-h-m) !important; }
  .nav .brand img,
  .appbar .brand-img { height: var(--aq-logo-m) !important; }
}

/* ── NAV LINKS + LANG BUTTON: มาตรฐานเดียว (อิงหน้าแรก = หน้าบ้านแบรนด์) ──
   ครอบทั้งสองตระกูล class: landing/เอกสาร ใช้ .nav-links/.lang-btn · ฟอร์ม ใช้ .site-links/.lang-b
   โหลดหลัง <style> ของหน้า → ชนะค่าเก่าที่ตั้งกันคนละทิศ (ปุ่มภาษาเทา/ลิงก์เล็ก) */
.nav-links a, .site-links a {
  font-family: 'IBM Plex Sans Thai', 'Nunito', sans-serif;
  font-size: 15.5px; font-weight: 500; color: var(--aq-ink); text-decoration: none;
  transition: color .15s;
}
.nav-links a:hover, .site-links a:hover { color: var(--aq-orange-strong); }
.nav-links, .site-links { gap: 32px; }
.lang-btn, .lang-b {
  background: none; border: 1.5px solid var(--aq-navy); border-radius: 8px;
  padding: 6px 14px; font-family: 'Nunito', 'IBM Plex Sans Thai', sans-serif;
  font-size: 13px; font-weight: 700; color: var(--aq-navy); cursor: pointer; line-height: 1;
}
.lang-btn:hover, .lang-b:hover { background: #F4F6FA; }

/* ── ปุ่มบัญชี (avatar) — สถานะล็อกอิน + เมนูดรอปดาวน์ ใช้ทุกหน้า ── */
.acct { position: relative; display: inline-flex; }
.acct-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--aq-line-cool); background: #fff; color: var(--aq-navy);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  font-family: 'Nunito', 'IBM Plex Sans Thai', sans-serif; font-weight: 800; font-size: 15px;
  position: relative; transition: box-shadow .15s ease;
}
.acct-btn:hover { box-shadow: 0 0 0 3px rgba(14, 51, 97, .12); }
.acct-btn svg { width: 18px; height: 18px; }
.acct-btn.in { background: linear-gradient(135deg, var(--aq-navy), var(--aq-navy-deep)); color: #fff; border: none; }
.acct-btn.in::after,
.acct-btn.dot::after {
  content: ''; position: absolute; right: 0; bottom: 0; width: 11px; height: 11px;
  border-radius: 50%; background: var(--aq-green); border: 2px solid #fff;
}
.acct-menu {
  position: absolute; right: 0; top: 46px; width: 240px; background: #fff;
  border: 1px solid var(--aq-line-cool); border-radius: 14px;
  box-shadow: 0 18px 50px -12px rgba(14, 51, 97, .35); padding: 6px; z-index: 85;
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right;
  pointer-events: none; transition: opacity .15s ease, transform .15s ease;
}
.acct-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.acct-id { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-bottom: 1px solid var(--aq-line-cool); margin-bottom: 5px; }
.acct-id .av {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--aq-navy), var(--aq-navy-deep));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; flex: 0 0 auto;
}
.acct-id .av svg { width: 15px; height: 15px; }
.acct-id .who { min-width: 0; }
.acct-id .who b { display: block; font-size: 13px; color: var(--aq-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 155px; }
.acct-id .who small { font-size: 10px; color: var(--aq-muted); font-weight: 800; letter-spacing: .06em; }
.acct-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: none; border: none; border-radius: 9px; padding: 10px;
  font-family: inherit; font-weight: 700; font-size: 13.5px; color: var(--aq-ink);
  cursor: pointer; text-align: left; text-decoration: none; box-sizing: border-box;
}
.acct-item:hover { background: #F4F6FA; text-decoration: none; }
.acct-item svg { width: 16px; height: 16px; flex: 0 0 auto; }
.acct-item.out { color: #B23B2E; }

/* ── ชิปสลับร้าน (เอเจนต์หลายร้าน) — dashboard และหน้าที่ต้องเลือกร้าน ── */
.store-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.store-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--aq-line-cool); background: #fff; border-radius: 999px;
  padding: 6px 13px 6px 6px; font-weight: 700; font-size: 13.5px; color: var(--aq-ink);
  cursor: pointer; font-family: inherit; text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.store-chip:hover { border-color: var(--aq-navy); text-decoration: none; }
.store-chip.on { border-color: var(--aq-navy); box-shadow: 0 0 0 2.5px rgba(14, 51, 97, .14); }
.store-chip .sc-av {
  width: 27px; height: 27px; border-radius: 50%;
  background: linear-gradient(135deg, var(--aq-navy), var(--aq-navy-deep)) center/cover no-repeat;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex: 0 0 auto;
}
.store-chip .sc-n { background: #F4F6FA; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; color: var(--aq-muted); font-weight: 800; }
.store-chip.add { border-style: dashed; border-color: var(--aq-orange); color: var(--aq-orange-strong); background: #fffdf8; padding: 6px 14px; }

/* ── A11Y: focus ring + reduced motion — มาตรฐานเดียวทุกหน้า ── */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, [tabindex]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--aq-orange-strong); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
