/* =====================================================================
   China With Me — canonical shared chrome (nav / dropdown / lang / footer)
   Single source of truth. Linked LAST on every EN page so it overrides any
   drifted per-page inline copies, guaranteeing a byte-identical menu bar.
   Fixes baked in: B2 (dropdown hover-gap + bridge), M1 (nav consistency).
   ===================================================================== */

/* ===== STICKY NAV ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s;
}
.nav.scrolled { box-shadow: 0 1px 12px rgba(0, 0, 0, 0.08); }
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-logo {
  color: #1a1a2e; font-size: 1.05rem; font-weight: 700;
  letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.nav-logo .logo-accent { color: #b8863d; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  color: #4b5563; font-size: 0.85rem; font-weight: 500;
  transition: color 0.2s; letter-spacing: 0.01em; text-decoration: none;
}
.nav-links a:hover { color: #1a1a2e; }
.nav-links a.active { color: #1a1a2e; font-weight: 700; }
.nav-cta {
  padding: 9px 22px; background: #d4a055; color: #fff !important;
  font-size: 0.85rem; font-weight: 600; border-radius: 8px;
  transition: background 0.2s, transform 0.15s;
}
.nav-cta:hover { background: #b8863d; transform: translateY(-1px); color: #fff !important; }
.nav-toggle {
  display: none; background: none; border: none; color: #1a1a2e;
  font-size: 1.5rem; cursor: pointer; padding: 4px;
}

/* ===== SERVICES DROPDOWN (B2 fix: no dead gap + invisible hover bridge) ===== */
.svc-dd { position: relative; display: inline-block; }
.svc-dd-toggle { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.svc-dd .caret { font-size: 0.6rem; transition: transform .2s; }
.svc-dd:hover .caret { transform: rotate(180deg); }
/* menu sits flush against the nav (top:100%) — no 6px dead band */
.svc-dd-menu {
  position: absolute; top: 100%; left: 0; min-width: 248px; background: #fff;
  border: 1px solid rgba(0,0,0,.08); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.13); padding: 8px;
  display: none; flex-direction: column; gap: 2px; z-index: 1100; margin-top: 0;
}
/* transparent bridge so the cursor never crosses an un-hovered band */
.svc-dd::after {
  content: ''; position: absolute; top: 100%; left: 0;
  width: 100%; height: 12px; background: transparent;
}
.svc-dd:hover .svc-dd-menu, .svc-dd.open .svc-dd-menu, .svc-dd:focus-within .svc-dd-menu { display: flex; }
.svc-dd-menu a {
  padding: 10px 12px; border-radius: 8px; color: #374151; font-size: .85rem;
  font-weight: 500; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  white-space: nowrap;
}
.svc-dd-menu a:hover { background: #f9f5ef; color: #1a1a2e; }

/* ===== LANGUAGE DROPDOWN ===== */
.lang-switcher { position: relative; }
.lang-switcher-btn {
  background: none; border: 1px solid rgba(0,0,0,0.1); border-radius: 6px;
  padding: 5px 10px; font-size: 0.82rem; font-weight: 500; color: #6b7280;
  cursor: pointer; display: flex; align-items: center; gap: 4px;
  transition: border-color 0.2s, color 0.2s;
}
.lang-switcher-btn:hover { border-color: #d4a055; color: #1a1a2e; }
.lang-switcher-btn .arrow { font-size: 0.6rem; margin-left: 2px; }
.lang-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1); min-width: 140px;
  padding: 6px 0; z-index: 1001;
}
.lang-dropdown.open { display: block; }
.lang-dropdown a {
  display: block; padding: 8px 16px; font-size: 0.83rem; color: #4b5563;
  transition: background 0.15s, color 0.15s; text-decoration: none;
}
.lang-dropdown a:hover { background: #f9f5ef; color: #1a1a2e; }
.lang-dropdown a.active { color: #d4a055; font-weight: 600; }

/* ===== FOOTER ===== */
footer {
  background: #1a1a2e; color: rgba(255, 255, 255, 0.7);
  padding: 64px 0 40px; position: relative; overflow: hidden;
}
.footer-inner { position: relative; z-index: 2; }
.footer-grid {
  display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr 1.3fr;
  gap: 48px; margin-bottom: 48px;
}
.footer-brand .footer-logo {
  color: #d4a055; font-size: 1.05rem; font-weight: 700;
  margin-bottom: 12px; display: block;
}
.footer-brand p { font-size: 0.85rem; line-height: 1.6; max-width: 280px; }
.footer-col h4 {
  color: rgba(255, 255, 255, 0.8); font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: rgba(255, 255, 255, 0.7); font-size: 0.85rem; transition: color 0.2s; text-decoration: underline; }
.footer-col a:hover { color: #d4a055; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; flex-wrap: wrap; gap: 12px;
}
.footer-agent { color: rgba(255, 255, 255, 0.6); font-size: 0.75rem; }

/* ===== RESPONSIVE NAV (≤960px = flat indented list, dropdown expands inline) ===== */
@media (max-width: 960px) {
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    padding: 20px 24px; gap: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .svc-dd { display: block; width: 100%; }
  .svc-dd::after { display: none; } /* no bridge needed in the flat list */
  .svc-dd-menu {
    position: static; box-shadow: none; border: none;
    padding: 4px 0 4px 16px; display: flex; min-width: 0;
  }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ===== PRINT (clean, branded lead-magnet PDFs — drop fixed chrome) ===== */
@media print {
  .nav, .nav-toggle, footer { display: none !important; }
  body { padding-top: 0 !important; }
}
