/* Shared site nav + footer (Wayto new design) */
:root {
  --navy: #1a2b5e;
  --navy-dark: #111e45;
  --blue: #2563eb;
  --sky: #e8f0fe;
  --text: #1e293b;
  --border: #e2e8f0;
}

body.wayto-has-shared-nav {
  padding-top: 64px;
  overflow-x: hidden;
}

/* Fixed wrapper avoids legacy page overflow/transform breaking position:fixed */
#shared-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  height: 64px;
  pointer-events: none;
}

/* NAV */
#mainNav {
  position: relative;
  width: 100%;
  height: 64px;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  transition: box-shadow 0.3s;
}

#mainNav.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  height: 64px;
}

.nav-links > li {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-links > li > a {
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.nav-links > li > a:hover {
  color: var(--blue);
}

.nav-links > li.current > a {
  color: var(--blue);
  position: relative;
  font-weight: 600;
}

.nav-links > li.current > a::before {
  content: "";
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--blue);
}

.nav-links .has-sub > a::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  margin-left: 4px;
  transition: transform 0.25s;
}

.nav-links .has-sub:hover > a::after {
  transform: rotate(225deg) translateY(0);
}

.sub-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 0;
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  list-style: none;
}

.nav-links > li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.sub-menu li a {
  display: block;
  padding: 9px 22px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.sub-menu li a:hover {
  color: var(--blue);
  background: var(--sky);
}

.nav-cta {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.nav-cta:hover {
  background: var(--blue);
}

/* ── HAMBURGER (mobile only) ── */
.nav-hamburger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-right: -8px;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 11;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

#mainNav.menu-open .nav-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#mainNav.menu-open .nav-hamburger span:nth-child(2) {
  opacity: 0;
}
#mainNav.menu-open .nav-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── BACKDROP (mobile only) ── */
.nav-mobile-backdrop {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9998;
}

#mainNav.menu-open ~ .nav-mobile-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.nav-locked {
  overflow: hidden;
}

/* FOOTER */
footer {
  background: linear-gradient(135deg, #0a1635 0%, #061026 60%, #0a1635 100%);
  color: rgba(255, 255, 255, 0.65);
  padding: 72px 24px 28px;
  font-size: 13px;
  position: relative;
  overflow: hidden;
}

footer::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 320px;
  height: 200px;
  background-image: radial-gradient(circle, rgba(96, 165, 250, 0.25) 1px, transparent 1.5px);
  background-size: 14px 14px;
  mask-image: radial-gradient(ellipse at bottom right, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at bottom right, #000 0%, transparent 75%);
  pointer-events: none;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.7fr 0.88fr 0.88fr 0.88fr 0.88fr 1.5fr;
  gap: 14px;
  margin-bottom: 40px;
}

.footer-brand-logo {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.footer-brand-logo img {
  height: 58px;
  width: auto !important;
  max-width: none;
  object-fit: contain;
  display: block;
  margin-left: -12ch;
  filter: brightness(0) invert(1);
}

.footer-brand {
  margin-left: -10px;
}

.footer-brand h3 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.footer-brand-en {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12.5px;
  margin-top: 6px;
  letter-spacing: 0.2px;
}

.footer-brand-divider {
  width: 36px;
  height: 2px;
  background: #60a5fa;
  margin: 12px 0 18px;
}

.footer-brand p {
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  max-width: 280px;
}

.footer-socials {
  display: flex;
  gap: 12px;
  margin-top: 26px;
}

.footer-socials a {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.2s;
}

.footer-socials a:hover {
  background: rgba(96, 165, 250, 0.2);
  border-color: #60a5fa;
}

.footer-socials svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.footer-col h4 {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.2s;
  font-size: 13px;
}

.footer-col a:hover {
  color: #60a5fa;
}

.footer-contact h4 {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 22px;
  letter-spacing: 0.5px;
}

.footer-contact ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.footer-contact li svg {
  width: 16px;
  height: 16px;
  stroke: rgba(255, 255, 255, 0.7);
  fill: none;
  stroke-width: 1.6;
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding: 14px 22px;
  border: 1px solid rgba(96, 165, 250, 0.6);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  width: 100%;
  max-width: 240px;
  transition: all 0.2s;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

.footer-cta-btn:hover {
  background: rgba(96, 165, 250, 0.15);
  border-color: #60a5fa;
}

.footer-cta-btn svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.6;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
}

.footer-bottom span + span {
  margin-left: 16px;
}

/* ── NAV: tablet/laptop compaction ── */
@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .nav-links { gap: 22px; }
  .nav-links > li > a { font-size: 13.5px; }
  .nav-inner { padding: 0 20px; }
}

/* ── NAV: switch to mobile menu ── */
@media (max-width: 900px) {
  .nav-hamburger { display: flex; }

  .nav-cta {
    display: none;
  }

  /* Turn nav-links into a slide-down drawer */
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    height: auto;
    max-height: calc(100vh - 64px);
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    overflow-y: auto;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s ease, opacity 0.2s ease;
    z-index: 10;
  }

  #mainNav.menu-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links > li {
    height: auto;
    display: block;
    border-bottom: 1px solid #f1f5f9;
  }
  .nav-links > li:last-child { border-bottom: none; }

  .nav-links > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    height: auto;
    font-size: 15px;
    font-weight: 500;
  }

  .nav-links > li.current > a::before { display: none; }
  .nav-links > li.current > a { color: var(--blue); font-weight: 600; }

  .nav-links .has-sub > a::after { margin-left: auto; }
  .nav-links .has-sub:hover > a::after { transform: rotate(45deg) translateY(-2px); }

  /* Sub-menu in mobile: always-visible indented list (no hover dropdown) */
  .sub-menu {
    position: static;
    transform: none;
    background: #fafafa;
    border: none;
    border-radius: 0;
    padding: 4px 0 10px;
    min-width: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transition: none;
  }

  .nav-links > li:hover > .sub-menu {
    transform: none;
  }

  .sub-menu li a {
    padding: 10px 24px 10px 40px;
    font-size: 13.5px;
    color: #475569;
  }

  .sub-menu li a:hover {
    background: transparent;
    color: var(--blue);
  }

  /* Inline CTA inside drawer */
  .nav-links::after {
    content: "預約諮詢 →";
    display: block;
    margin: 16px 24px 0;
    padding: 13px 22px;
    background: var(--navy);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
  }

  .nav-mobile-backdrop { display: block; }
}

@media (max-width: 640px) {
  .footer-top {
    grid-template-columns: 1fr;
  }

  .nav-inner { padding: 0 16px; }
}
