/* ============================================
   Academy Shop - Global Design Tokens
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700&family=Oxanium:wght@400;600;700&display=swap');

/* Override WordPress block-gap margins on custom pages */
body.academy-custom-page > * {
  margin-block-start: 0;
  margin-block-end: 0;
}

/* ---- CSS Variables / Design Tokens ---- */
:root {
  /* Colors - Background */
  --color-bg-primary: #2c343b;
  --color-bg-secondary: #424d59;
  --color-bg-nav-dark: #1a1a2e;
  --color-bg-footer: #2d353d;
  --color-bg-card-header: #343434;
  --color-bg-card-body: #f0f0f0;

  /* Colors - Accent */
  --color-accent: #39fff5;
  --color-accent-80: rgba(57, 255, 245, 0.80);

  /* Colors - Text */
  --color-text-white: #ffffff;
  --color-text-secondary: #e9e8e9;
  --color-text-dark: #202020;
  --color-text-strike: #848484;
  --color-text-muted: #a0a0a0;
  --color-text-logo-sub: #8a8a8a;

  /* Colors - Misc */
  --color-hero-bg: #1a1a1a;
  --color-tag-bg: #0a0a0a;
  --color-card-footer: #ffffff;
  --color-divider: #c0c0c0;
  --color-accent-10: rgba(57, 255, 245, 0.10);
  --color-accent-15: rgba(57, 255, 245, 0.15);
  --color-inactive-tab: #00d9ce;
  --color-mobile-cta: #f8ee36;
  --color-bundle-card-bg: #3a4550;
  --color-savings-bg: #1a3a3a;

  /* Fonts */
  --font-primary: 'Oxanium', 'Noto Sans TC', sans-serif;
  --font-accent: 'Oxanium', sans-serif;

  /* Spacing */
  --page-width: 1230px;
  --content-width: 1170px;
  --page-padding-x: 30px;
  --section-gap: 60px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 20px;
  --radius-xl: 30px;

  /* Gradient */
  --gradient-body: linear-gradient(180deg, #89939D 18.19%, #424D59 47.34%, #2C343B 100%);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html:has(body.academy-custom-page) {
  background-color: #1a2028;
}
/* Lock horizontal scroll universally on academy pages — independent of :has() support */
html {
  overflow-x: clip;
  max-width: 100vw;
}
@media (max-width: 768px) {
  html, body.academy-custom-page {
    overflow-x: hidden;
    max-width: 100vw;
    touch-action: pan-y;
  }
}

body.academy-custom-page {
  font-family: var(--font-primary);
  color: var(--color-text-white);
  background: var(--gradient-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 60px; /* Compensate for fixed nav-course */
  overflow-x: clip;
}
.admin-bar.academy-custom-page {
  padding-top: 92px; /* 60px nav + 32px admin bar */
}
@media (max-width: 782px) {
  .admin-bar.academy-custom-page {
    padding-top: 106px; /* 60px nav + 46px mobile admin bar */
  }
}

/* 管理列永遠固定頂部（2026-07-03 user 要求，取代原「捲動時上推隱藏」設計）
   nav / section-tabs 沿用 .admin-bar 預設定位（管理列下方），捲動不再位移。
   body 的 is-scrolled class 仍由 nav-course.php JS toggle，目前無樣式使用。 */
@media screen and (max-width: 600px) {
  /* WP core 在 600px 以下把管理列設為 absolute（會捲走）→ 固定住，nav top:46px 才不會留縫 */
  .admin-bar #wpadminbar {
    position: fixed;
  }
}

/* Remove Elementor defaults */
body.academy-custom-page .site-header,
body.academy-custom-page .site-footer {
  display: none;
}

/* ---- Typography ---- */
body.academy-custom-page p {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-white);
  letter-spacing: 1.8px;
  line-height: 2.57;
}

body.academy-custom-page h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.4;
}

body.academy-custom-page h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
}

body.academy-custom-page h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

body.academy-custom-page a {
  color: var(--color-text-white);
  text-decoration: none;
  transition: color 0.3s ease;
}

body.academy-custom-page a:hover {
  color: var(--color-accent);
}

/* ---- Utility ---- */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--page-padding-x);
}

.text-accent {
  color: var(--color-accent);
}

.text-dark {
  color: var(--color-text-dark);
}

.text-strike {
  color: var(--color-text-strike);
  text-decoration: line-through;
}

.font-oxanium {
  font-family: var(--font-accent);
}

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

/* ---- Remove focus outline globally ---- */
*:focus,
*:focus-visible {
  outline: none;
}

/* ---- Button Base ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 6px;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
}

.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-text-dark);
}

.btn-accent:hover {
  background-color: #2de6dc;
  color: var(--color-text-dark);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
}

.btn-outline:hover {
  background-color: var(--color-accent);
  color: var(--color-text-dark);
}

.btn-dark {
  background-color: var(--color-text-dark);
  color: var(--color-text-white);
  border-radius: var(--radius-md);
}

.btn-dark:hover {
  background-color: #333;
}

/* ---- Elementor Style Isolation ---- */
/* Force reset ALL button/interactive elements on custom pages */
body.academy-custom-page button,
body.academy-custom-page a.btn,
body.academy-custom-page .btn {
  background-image: none !important;
  box-shadow: none !important;
  transition: all 0.3s ease !important;
}

/* -- btn-accent: cyan bg + dark text, hover darken -- */
body.academy-custom-page .btn-accent,
body.academy-custom-page .btn.btn-accent,
body.academy-custom-page a.btn.btn-accent {
  background-color: var(--color-accent) !important;
  color: var(--color-text-dark) !important;
  border: none !important;
}

body.academy-custom-page .btn-accent:hover,
body.academy-custom-page .btn.btn-accent:hover,
body.academy-custom-page a.btn.btn-accent:hover {
  background-color: #2de6dc !important;
  color: var(--color-text-dark) !important;
  opacity: 0.85;
}

/* -- btn-outline: transparent + cyan border, hover fill cyan -- */
body.academy-custom-page .btn-outline,
body.academy-custom-page .btn.btn-outline,
body.academy-custom-page a.btn.btn-outline {
  background-color: transparent !important;
  border: 1px solid var(--color-accent) !important;
  color: var(--color-accent) !important;
}

body.academy-custom-page .btn-outline:hover,
body.academy-custom-page .btn.btn-outline:hover,
body.academy-custom-page a.btn.btn-outline:hover {
  background-color: var(--color-accent) !important;
  color: var(--color-text-dark) !important;
  border-color: var(--color-accent) !important;
}

/* -- btn-dark: dark bg + white text -- */
body.academy-custom-page .btn-dark,
body.academy-custom-page a.btn-dark {
  background-color: var(--color-text-dark) !important;
  color: var(--color-text-white) !important;
}

body.academy-custom-page .btn-dark:hover,
body.academy-custom-page a.btn-dark:hover {
  background-color: #444 !important;
}

/* -- Course outline tab buttons -- */
body.academy-custom-page .course-outline__tab {
  background-color: transparent !important;
  border: 1px solid var(--color-accent) !important;
  color: var(--color-accent) !important;
}

body.academy-custom-page .course-outline__tab:hover {
  background-color: rgba(57, 255, 245, 0.15) !important;
}

body.academy-custom-page .course-outline__tab.is-active {
  background-color: var(--color-accent-80) !important;
  color: var(--color-text-dark) !important;
  border-color: var(--color-accent-80) !important;
}

/* -- Course outline expand button -- */
body.academy-custom-page .course-outline__expand {
  background-color: transparent !important;
  border: 1px solid var(--color-accent) !important;
  color: var(--color-accent) !important;
}

body.academy-custom-page .course-outline__expand:hover {
  background-color: var(--color-accent) !important;
  color: var(--color-text-dark) !important;
}

/* -- Pricing card CTA -- */
body.academy-custom-page .pricing-card__cta,
body.academy-custom-page a.pricing-card__cta {
  background-color: var(--color-bg-card-header) !important;
  color: var(--color-text-white) !important;
  border: none !important;
}

body.academy-custom-page .pricing-card__cta:hover,
body.academy-custom-page a.pricing-card__cta:hover {
  background-color: var(--color-accent) !important;
  color: #1a1a1a !important;
  transform: translateY(-10px);
}

/* -- FAQ question button -- */
body.academy-custom-page .course-faq__question {
  border: none;
}

/* -- Chapter header button -- */
body.academy-custom-page .course-chapter__header {
  background-color: transparent !important;
  border: none !important;
}

body.academy-custom-page .course-chapter__header:hover {
  background-color: rgba(255, 255, 255, 0.03) !important;
}

/* -- Related section arrows -- */
body.academy-custom-page .related-courses__arrow,
body.academy-custom-page .related-articles__arrow {
  background-color: transparent !important;
  border: none !important;
}

/* -- Live section arrows -- */
body.academy-custom-page .course-live__page-arrow {
  background-color: transparent !important;
  border: none !important;
  color: var(--color-text-white) !important;
}

body.academy-custom-page .course-live__page-arrow:hover {
  color: var(--color-accent) !important;
}

/* Prevent Elementor global font overrides */
body.academy-custom-page,
body.academy-custom-page * {
  font-family: var(--font-primary);
}

body.academy-custom-page .font-oxanium,
body.academy-custom-page .font-oxanium * {
  font-family: var(--font-accent);
}

/* ============================================
   Side Cart (Slide-in from right)
   ============================================ */
.side-cart {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  visibility: hidden;
}
.side-cart.is-open {
  pointer-events: auto;
  visibility: visible;
}
.side-cart__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.3s;
}
.side-cart.is-open .side-cart__overlay {
  background: rgba(0,0,0,0.5);
}
.side-cart__panel {
  position: absolute;
  top: calc(50% - (min(calc(100vh - 120px), 800px)) / 2);
  right: 10px;
  width: 420px;
  max-width: calc(90vw - 20px);
  height: calc(100vh - 120px);
  max-height: 800px;
  background: #2c343b;
  color: #e0e0e0;
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + 10px));
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,0.4);
  border-radius: 12px;
}
.side-cart.is-open .side-cart__panel {
  transform: translateX(0);
}

/* sidecart loading 狀態（刪除商品 / 數量更新中時顯示） */
.side-cart.is-loading .side-cart__body {
  filter: blur(2px);
  pointer-events: none;
  transition: filter 0.2s ease;
}
.side-cart.is-loading .side-cart__panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 5;
  border-radius: inherit;
  pointer-events: none;
}
.side-cart.is-loading .side-cart__panel::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -22px 0 0 -22px;
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--color-accent, #39fff5);
  border-radius: 50%;
  animation: acadCartSpin 0.8s linear infinite;
  z-index: 6;
  pointer-events: none;
}
@keyframes acadCartSpin {
  to { transform: rotate(360deg); }
}
.side-cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.side-cart__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: #fff;
}
.side-cart__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent, #39fff5);
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  padding: 0 6px;
  margin-left: 8px;
}
.side-cart__close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  line-height: 1;
  padding: 0;
}
.side-cart__close:hover { color: #fff; }
.side-cart__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}
.side-cart__footer {
  padding: 16px 24px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.side-cart__total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}
.side-cart__total-price {
  color: var(--color-accent, #39fff5);
  font-size: 20px;
}
.side-cart__btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  margin-bottom: 8px;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.side-cart .side-cart__panel a.side-cart__btn.side-cart__btn--cart {
  background-color: transparent;
  color: #39fff5;
  border: 1px solid #39fff5;
}
.side-cart .side-cart__panel a.side-cart__btn.side-cart__btn--cart:hover,
.side-cart .side-cart__panel a.side-cart__btn.side-cart__btn--cart:active {
  background-color: #39fff5;
  color: #1a1a1a;
  border-color: #39fff5;
}
.side-cart .side-cart__panel a.side-cart__btn.side-cart__btn--checkout {
  background-color: transparent;
  color: #39fff5;
  border: 1px solid #39fff5;
}
.side-cart .side-cart__panel a.side-cart__btn.side-cart__btn--checkout:hover,
.side-cart .side-cart__panel a.side-cart__btn.side-cart__btn--checkout:active {
  background-color: #39fff5;
  color: #1a1a1a;
  border-color: #39fff5;
}

/* Mini cart items inside side cart */
.mini-cart__empty {
  text-align: center;
  color: rgba(255,255,255,0.4);
  padding: 40px 0;
}
.mini-cart__items { display: flex; flex-direction: column; gap: 0; }
.mini-cart__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mini-cart__item-thumb { width: 60px; height: 60px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,0.06); }
.mini-cart__item-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* cart-client.js 直接 render 的 <img class="mini-cart__item-img">（無 thumb 容器） */
.mini-cart__item-img-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}
.mini-cart__item-img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  display: block;
}
.mini-cart__item-addon-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #fff;
  background: transparent;
  border: 1px solid #fff;
  border-radius: 999px;
  line-height: 1.4;
  pointer-events: none;
}
/* 商品名上方優惠標籤（DREX學員優惠 / 課程優惠價） */
.mini-cart__item-benefit {
  display: inline-block;
  align-self: flex-start;
  padding: 1px 6px;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #39fff5;
  background: transparent;
  border: 1px solid #39fff5;
  border-radius: 999px;
  line-height: 1.4;
}
/* 原價（劃線、灰色，跟 sale 同排不換行） */
.mini-cart__item-price-orig {
  color: rgba(255,255,255,0.4);
  text-decoration: line-through;
  font-weight: 400;
  font-size: 13px;
  white-space: nowrap;
}
/* 優惠價（重點色，跟 orig 同排） */
.mini-cart__item-price-sale {
  color: #39fff5;
  font-weight: 700;
  white-space: nowrap;
}
.mini-cart__item-price { color: rgba(255,255,255,0.85); }
.mini-cart__item-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini-cart__item-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
  max-width: 100%;
  line-height: 2.4;
}
.mini-cart__item-qty {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  font-weight: 400;
  white-space: nowrap;
}
.mini-cart__item-price {
  font-size: 14px;
  font-weight: 700;
  color: #e0e0e0;
  white-space: nowrap;
  display: flex;
  align-items: baseline;
  gap: 6px;
  letter-spacing: -0.2px;
  line-height: 2.4;
}
.mini-cart__item-remove {
  font-size: 20px;
  color: rgba(255,255,255,0.5);
  background: transparent;
  border: none;
  text-decoration: none;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.mini-cart__item-remove:hover { color: #e74c3c; background: transparent; }

/* Recommended products */
.mini-cart__recommend {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.mini-cart__recommend-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--color-accent, #39fff5);
}
.mini-cart__recommend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.mini-cart__recommend-name { flex: 1; font-size: 13px; color: #e0e0e0; }
.mini-cart__recommend-price { font-size: 13px; font-weight: 600; color: #fff; }
.mini-cart__recommend-add {
  background: var(--color-accent, #39fff5);
  color: #1a1a1a;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.mini-cart__recommend-add:hover { opacity: 0.8; }

/* Loading state for pricing card CTA */
.pricing-card__cta.is-loading {
  pointer-events: none;
  opacity: 0.6;
}

/* ============================================
   Navigation — shared across all pages
   ============================================ */
.nav-course {
  background-color: #2D353D;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}
/* WordPress admin bar: nav adjusts dynamically via JS */
.admin-bar .nav-course {
  top: 32px;
  transition: top 0.15s;
}
@media (max-width: 782px) {
  .admin-bar .nav-course {
    top: 46px;
  }
}
/* Legacy (unused) */
.nav-course__inner { display: none; }
.nav-course__top { display: none; }
.nav-course__bottom { display: none; }

/* Single bar: logo left, nav center, user+cart right — max-width 1170px */
.nav-course__bar {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1170px;
  margin: 0 auto;
  padding: 10px 20px;
  gap: 24px;
  box-sizing: border-box;
}
.nav-course__logo {
  flex-shrink: 0;
}
/* Admin-only 項目的橘色 badge（新站課程頁）*/
.menu-item--admin > a {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
.menu-item__admin-badge {
  display: inline-block;
  padding: 1px 5px;
  background: #ff9800;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 2px;
  letter-spacing: 0.5px;
  line-height: 1.3;
}
.nav-course__logo-img {
  height: auto !important;
  width: 180px !important;
  display: block;
}
.nav-course__bar .nav-course__links {
  flex: 1;
  justify-content: center;
}

/* Vertical dropdown (course + user) */
.nav-course__dropdown--vertical {
  flex-direction: column;
  min-width: 180px;
  padding: 8px 0;
  background: #515C65;
  border-radius: 4px;
  box-shadow: 0 6px 10px rgba(0,0,0,0.1);
  margin-top: 14px;
}
.nav-course__dropdown--vertical .nav-course__dropdown-item {
  display: block;
  padding: 16px 19px;
  color: #A2FFFA;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nav-course__dropdown--vertical .nav-course__dropdown-item:hover {
  background: #3B464F;
  color: #39FFF5;
}

/* Sub-level 2 (實體課程 ▶ / 線上課程 ▶) */
.nav-course__has-sub2 {
  position: relative;
  cursor: pointer;
}
.nav-course__has-sub2 > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 19px;
  color: #A2FFFA;
  font-family: Arial, sans-serif;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nav-course__has-sub2:hover > span,
.nav-course__has-sub2.is-sub2-open > span {
  background: #3B464F;
  color: #39FFF5;
}
.nav-course__dropdown.nav-course__dropdown--sub2 {
  display: none !important;
  position: absolute;
  left: 100% !important;
  top: 0 !important;
  transform: none !important;
  margin-top: 0 !important;
  flex-direction: column;
  min-width: 280px;
  padding: 8px 0;
  background: #515C65;
  border-radius: 4px;
  box-shadow: 0 6px 10px rgba(0,0,0,0.1);
  z-index: 210;
}
.nav-course__has-sub2:hover > .nav-course__dropdown--sub2,
.nav-course__has-sub2.is-sub2-open > .nav-course__dropdown--sub2 {
  display: flex !important;
  flex-direction: column;
}
/* All screens: sub2 always opens to the right */
.nav-course__dropdown--sub2 a {
  display: block;
  padding: 16px 19px;
  color: #A2FFFA;
  font-family: Arial, sans-serif;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nav-course__dropdown--sub2 a:hover {
  background: #3B464F;
  color: #39FFF5;
}
.nav-course__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
/* logo-img: see nav-course__bar rules above */
/* 對齊 A 站：nav 緊鄰 logo（不置中），右側 user/cart 用 margin-left:auto 推到最右 */
.nav-course__links {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0 0 0 48px;
  padding: 0;
  flex: 0 1 auto;
  justify-content: flex-start;
  align-items: center;
}
.nav-course__right {
  margin-left: auto;
}
/* WP menu: sub-menu as dropdown */
.nav-course__links .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #515C65;
  border-radius: 4px;
  box-shadow: 0 6px 10px rgba(0,0,0,0.1);
  margin-top: 14px;
  padding: 8px 0;
  list-style: none;
  z-index: 200;
  overflow: visible;
}
.nav-course__links .menu-item-has-children {
  position: relative;
}
.nav-course__links .menu-item-has-children:hover > .sub-menu {
  display: block;
}
.nav-course__links .menu-item-has-children::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
}
/* Sub-menu level 2 (sub-sub) */
.nav-course__links .sub-menu .sub-menu {
  top: 0;
  left: 100%;
  margin-top: 0;
}
/* Sub-menu items */
.nav-course__links .sub-menu a {
  display: block;
  padding: 16px 19px;
  color: #A2FFFA;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nav-course__links .sub-menu a:hover {
  background: #3B464F;
  color: #39FFF5;
}
/* Sub-menu arrow for has-children */
.nav-course__links .sub-menu .menu-item-has-children > a::after {
  content: '▸';
  float: right;
  margin-left: 10px;
}
.nav-course__links > li > a {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #39FFF5;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 2px;
  transition: color 0.3s;
  white-space: nowrap;
  position: relative;
}
.nav-course__links > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #39FFF5;
  transition: width 0.3s;
}
.nav-course__links > li > a:hover::after {
  width: 100%;
}
.nav-course__links > li > a:hover {
  color: #39FFF5;
}
.nav-course__links a {
  text-decoration: none;
  white-space: nowrap;
}
.nav-course__links > li {
  position: relative;
}
.nav-course__caret {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  transition: transform 0.2s;
}
.nav-course__has-sub:hover .nav-course__caret {
  transform: rotate(180deg);
}
.nav-course__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  transform: none;
  min-width: 200px;
  background: #515C65;
  border: none;
  overflow: visible;
  border-radius: 8px;
  padding: 12px 0;
  margin-top: 12px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.nav-course__has-sub:hover > .nav-course__dropdown {
  display: flex;
  flex-direction: column;
}
.nav-course__has-sub::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
}
.nav-course__dropdown-item,
.nav-course__sub-group a {
  display: block;
  padding: 8px 20px;
  font-size: 13px;
  color: #e0e0e0;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
  white-space: nowrap;
}
.nav-course__dropdown-item:hover,
.nav-course__sub-group a:hover {
  color: var(--color-accent);
  background: rgba(57,255,245,0.08);
}
.nav-course__sub-label {
  display: block;
  padding: 10px 20px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 4px;
}
.nav-course__user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--color-text-white);
  flex-shrink: 0;
}
.nav-course__greeting {
  white-space: nowrap;
}
.nav-course__auth-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  color: var(--color-accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}
body.academy-custom-page .nav-course__auth-btn:hover {
  background-color: var(--color-accent);
  color: #1a1a1a;
}

/* Right side: user + cart */
.nav-course__right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.nav-course__user-wrap {
  position: relative;
}
.nav-course__user-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #39FFF5;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  padding: 8px 2px;
  position: relative;
}
.nav-course__user-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #39FFF5;
  transition: width 0.3s;
}
.nav-course__user-link:hover::after {
  width: 100%;
}
.nav-course__login-link {
  color: #39FFF5;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.nav-course__user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 160px;
  background: #515C65;
  border-radius: 4px;
  box-shadow: 0 6px 10px rgba(0,0,0,0.1);
  margin-top: 14px;
  padding: 8px 0;
  z-index: 200;
}
.nav-course__user-wrap:hover .nav-course__user-dropdown {
  display: block;
}
.nav-course__user-wrap::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
}
.nav-course__user-dropdown a {
  display: block;
  padding: 16px 19px;
  color: #A2FFFA;
  font-family: Arial, sans-serif;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.nav-course__user-dropdown a:hover {
  background: #3B464F;
  color: #39FFF5;
}

/* Cart button */
.nav-course__cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--color-text-white, #fff);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-course__cart-btn:hover {
  color: var(--color-accent, #39fff5);
}
.nav-course__cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #f8ee36;
  color: #1a1a1a;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Actions wrapper (user + burger) */
.nav-course__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Hamburger — hidden on desktop */
.nav-course__burger {
  display: none;
  background: none;
  border: none;
  color: var(--color-text-white);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
}
.nav-course__burger-close { display: none; }
.nav-course.is-open .nav-course__burger-open { display: none; }
.nav-course.is-open .nav-course__burger-close { display: block; }

/* Mobile menu — hidden on desktop */
.nav-course__mobile-menu {
  display: none;
}


/* ============================================
   Footer — shared across all pages (mirrors A-site)
   ============================================ */
.footer-site {
  background-color: #1a2028;
  padding: 60px 20px 0;
  margin-bottom: 0;
}
body.academy-custom-page {
  padding-bottom: 0;
  margin-bottom: 0;
}
.footer-site__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
  max-width: 1170px;
  margin: 0 auto;
  box-sizing: border-box;
}
.footer-site__bottom {
  max-width: 1170px;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.footer-site__bottom p { margin: 0; }
/* Brand column */
.footer-site__brand {
  flex-shrink: 0;
  max-width: 280px;
}
.footer-site__logo-img {
  height: auto !important;
  width: 200px !important;
  display: block;
  margin-bottom: 12px;
}
.footer-site__tagline {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-white);
  margin-bottom: 16px;
  letter-spacing: 1px;
}
.footer-site__contact {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 2;
  margin-bottom: 16px;
}
.footer-site__contact a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-site__contact a:hover {
  color: var(--color-accent);
}
.footer-site__social {
  display: flex;
  gap: 12px;
}
.footer-site__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--color-accent);
  transition: opacity 0.3s;
}
.footer-site__social a:hover {
  opacity: 0.7;
}
/* Link columns */
.footer-site__col {
  flex-shrink: 0;
}
.footer-site__col-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-white);
  margin-bottom: 16px;
}
.footer-site__col-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-site__col-links li {
  margin-bottom: 10px;
}
.footer-site__col-links a {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}
.footer-site__col-links a:hover {
  color: var(--color-accent);
}
/* Bottom bar */
.footer-site__bottom {
  max-width: var(--content-width);
  margin: 40px auto 0;
  padding-bottom: 24px;
  text-align: center;
}
.footer-site__divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin-bottom: 20px;
}
.footer-site__bottom p {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.footer-site__company {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

/* ---- Nav + Footer RWD (mobile) ---- */
@media (max-width: 768px) {
  /* Global: prevent horizontal overflow + bottom padding for fixed buy bar */
  body.academy-custom-page {
    overflow-x: hidden;
    padding-bottom: 60px;
    padding-top: 56px; /* Compensate for fixed nav */
  }
  .admin-bar.academy-custom-page {
    padding-top: 102px; /* 56px nav + 46px mobile admin bar */
  }

  /* Mobile header: fixed at top */
  .nav-course {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }
  .admin-bar .nav-course {
    top: var(--wp-admin--admin-bar--height, 46px);
  }
  .nav-course__inner {
    height: 56px;
    padding: 0 20px;
  }
  /* Mobile bar layout: logo 左 + 購物車/漢堡 右，space-between 撐開 */
  .nav-course__bar {
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
  }
  .nav-course__logo {
    width: auto;
  }
  .nav-course__logo-img {
    width: 130px !important;
  }
  /* Hide desktop nav links on mobile */
  .nav-course__links {
    display: none;
  }
  /* Mobile: 隱藏 user dropdown（漢堡選單有替代），保留購物車 */
  .nav-course__user-wrap,
  .nav-course__login-link {
    display: none;
  }
  .nav-course__right {
    margin-left: auto;
    gap: 10px;
  }
  /* Show hamburger */
  .nav-course__burger {
    display: block;
  }

  /* Mobile dropdown menu */
  .nav-course.is-open .nav-course__mobile-menu {
    display: block;
  }
  .nav-course__mobile-menu {
    background: #2D353D;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 16px 20px 24px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
  }
  .nav-course__mobile-links {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .nav-course__mobile-links > li {
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .nav-course__mobile-links > li > a,
  .nav-course__mobile-sub-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 0;
    font-size: 15px;
    font-weight: 400;
    color: var(--color-text-white);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
  }
  .nav-course__mobile-sub-toggle .nav-course__caret {
    transition: transform 0.2s;
  }
  .nav-course__mobile-sub-toggle.is-open .nav-course__caret {
    transform: rotate(180deg);
  }
  .nav-course__mobile-sub {
    display: none;
    padding: 0 0 12px 12px;
  }
  .nav-course__mobile-sub.is-open {
    display: block;
  }
  .nav-course__mobile-sub a {
    display: block;
    padding: 10px 0;
    font-size: 14px;
    color: #ccc;
    text-decoration: none;
  }
  .nav-course__mobile-sub a:hover {
    color: var(--color-accent);
  }
  .nav-course__mobile-sub .nav-course__sub-label {
    padding: 12px 0 4px;
    border-top: none;
    margin-top: 0;
  }
  /* Section header in flat mobile menu (e.g. 實體課程 / 線上課程 / 更多) */
  .nav-course__mobile-section {
    padding: 14px 0 6px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(57, 255, 245, 0.75);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: none !important;
    border-top: 1px solid rgba(57, 255, 245, 0.15);
    margin-top: 8px;
    list-style: none;
  }
  .nav-course__mobile-section:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
  }
  .nav-course__mobile-section--admin {
    color: #ff9800 !important;
    border-top-color: rgba(255, 152, 0, 0.35) !important;
  }
  .nav-course__mobile-user {
    margin-top: 0;
    text-align: left;
  }
  .nav-course__mobile-user .nav-course__auth-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }
  .footer-site {
    padding: 32px 20px 0;
  }
  .footer-site__inner {
    flex-direction: column;
    gap: 32px;
  }
  .footer-site__brand {
    max-width: 100%;
  }

  /* Side cart — full-screen on mobile */
  .side-cart__panel {
    top: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    transform: translateX(100%);
  }
  .side-cart.is-open .side-cart__panel {
    transform: translateX(0);
  }
  .side-cart__header {
    padding: 16px 20px;
  }
  .side-cart__body {
    padding: 12px 20px;
  }
  .side-cart__footer {
    padding: 12px 20px 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

/* ── 2026-07-16: 主選單樣式對齊 A 站（容器寬 ~1320、選單靠右、項目間距 35、logo 160px）── */
@media (min-width: 769px) {
  .nav-course__bar {
    max-width: 1360px; /* 內容寬 1320，同 A 站主選單 */
  }
  .nav-course__bar .nav-course__links {
    justify-content: flex-end; /* A 站選單靠右，logo 與選單間留大空 */
  }
  .nav-course__links {
    gap: 31px; /* A 站項目視覺間距 35px（扣掉 a 的左右 padding 2+2）*/
  }
  .nav-course__logo-img {
    width: 160px !important; /* A 站 logo 寬 */
  }
}
/* ── 2026-07-16: 右上用戶名稱預設重點色（同 A 站）。某未知來源會蓋成白色，比照本站按鈕慣例用 !important ── */
.nav-course__user-wrap .nav-course__user-link {
  color: #39FFF5 !important;
}