/* ============================================================
 * Mana Solutions - enhancement layer (loaded after global.css)
 * Adds: region switcher, locale CTA ordering, extra motion,
 * cross-page View Transitions, sample-page polish.
 * Kept unlayered so these additions/overrides win predictably.
 * ============================================================ */

/* Cross-document View Transitions removed: the geo-redirect chain goes
   manasolutions.org → manasolutions.org/cr (same-origin VT starts) →
   301 → manasolutions-cr.com/cr (cross-origin, VT is "skipped").
   On mobile Chrome this skip freezes requestAnimationFrame on the landing
   page, which prevents the splash from ever completing. */

/* ---- Region switcher ---- */
.region-switch { position: relative; display: inline-flex; order: 0; }
@media (min-width: 921px) { .region-switch { order: 2; } }

.region-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--c-ink);
  background: transparent; border: 1.5px solid var(--c-line);
  border-radius: var(--r-sm); padding: 5px 9px; cursor: pointer; line-height: 1;
  transition: border-color .15s, box-shadow .15s;
}
.region-btn:hover, .region-btn:focus-visible {
  border-color: var(--c-accent); outline: none;
  box-shadow: 0 0 0 3px rgb(var(--c-accent-rgb) / 0.18);
}
.region-flag { display: inline-flex; line-height: 0; border-radius: 2px; overflow: hidden; }
.flag-svg { display: block; border-radius: 2px; }
.flag-svg.globe { color: var(--c-accent); border-radius: 0; }
.region-abbr { font-size: 11px; }
.region-caret { width: 12px; height: 12px; opacity: .7; transition: transform .2s ease; }
.region-btn[aria-expanded="true"] .region-caret { transform: rotate(180deg); }

/* Keep the sticky header pinned while the region menu is open (CSS safety net
   backing up the JS nav-lock), so the dropdown never slides away mid-use. */
html.nav-locked .topnav-wrap { transform: none !important; }

.region-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 196px;
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-md); padding: 6px;
  display: none; flex-direction: column; gap: 2px; z-index: 80;
  box-shadow: 0 24px 60px -24px rgb(0 0 0 / 0.55);
}
.region-menu.open { display: flex; animation: regionIn .16s ease; }
@keyframes regionIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.region-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  border-radius: var(--r-sm); font-size: 14px; color: var(--c-ink);
  transition: background-color .12s ease, color .12s ease;
}
.region-item:hover { background: var(--c-accent-soft); }
.region-item[aria-current="true"] { background: var(--c-accent-soft); color: var(--c-accent); font-weight: 600; }
.region-item .region-flag { flex: none; }

/* ---- Locale CTA ordering (WhatsApp-led for CR/SV) ---- */
.hero-actions.wa-first .btn.whatsapp,
.cta-final-actions.wa-first .btn.whatsapp { order: -1; }

/* ---- Sticky mobile CTA: support the WhatsApp-primary layout ---- */
@media (max-width: 920px) {
  .mobile-cta .btn.whatsapp:not(.mobile-cta-wa) { width: auto; flex: 1 1 auto; justify-content: center; }
  .mobile-cta .btn.mobile-cta-alt {
    flex: 0 0 auto; width: 56px; padding: 0; justify-content: center;
    box-shadow: 0 20px 50px -12px rgb(0 0 0 / 0.6);
  }
  .mobile-cta .btn.mobile-cta-alt svg { width: 24px; height: 24px; }
}

/* ---- Motion: hero aurora drift (transform on a pseudo, no JS conflict) ---- */
.hero-photo { overflow: hidden; }
.hero-photo::before {
  content: ''; position: absolute; left: 50%; top: 0;
  width: 90vw; height: 90vw; max-width: 1100px; max-height: 1100px;
  transform: translate(-52%, -34%);
  background: radial-gradient(circle, rgb(var(--c-accent-rgb) / 0.13), transparent 62%);
  filter: blur(8px); pointer-events: none;
  animation: heroAurora 20s ease-in-out infinite alternate;
}
@keyframes heroAurora {
  0%   { transform: translate(-56%, -36%) scale(1); }
  100% { transform: translate(-46%, -28%) scale(1.14); }
}

/* ---- Motion: primary-button sheen on hover ---- */
.btn.primary { position: relative; overflow: hidden; }
.btn.primary > * { position: relative; z-index: 1; }
.btn.primary::after {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 0.22) 50%, transparent 70%);
  transform: translateX(-130%);
}
.btn.primary:hover::after { animation: btnSheen .8s ease; }
@keyframes btnSheen { to { transform: translateX(130%); } }

/* ---- Sample (/docx, /pptx) page ---- */
.ej-page { padding-top: 24px; }
.ej-page h1 {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.02em;
  line-height: 1.1; margin: 0 0 14px; color: var(--c-ink);
}
.ej-back {
  display: inline-block; margin-top: 28px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--c-muted); transition: color .15s ease;
}
.ej-back:hover { color: var(--c-accent); }

/* ---- International (booking-led): WhatsApp is a quiet secondary, not a
   co-equal solid button. Global buyers are self-serve/booking-led per the
   research, so booking leads and WhatsApp is offered, not shouted. ---- */
.hero-actions:not(.wa-first) .btn.whatsapp,
.cta-final-actions:not(.wa-first) .btn.whatsapp {
  background: transparent;
  color: var(--wa-green);
  border-color: var(--c-line);
  font-weight: 500;
}
.hero-actions:not(.wa-first) .btn.whatsapp:hover,
.cta-final-actions:not(.wa-first) .btn.whatsapp:hover {
  background: transparent;
  border-color: var(--wa-green);
  box-shadow: none;
}

/* ---- Small phones: region pill shows flag + caret only, so the nav bar
   never crowds under ~400px. ---- */
@media (max-width: 400px) {
  .region-abbr { display: none; }
  .region-btn { padding: 5px 7px; gap: 4px; }
}

/* ---- Reduced motion: silence the new animations ---- */
@media (prefers-reduced-motion: reduce) {
  .hero-photo::before { animation: none; }
  .btn.primary:hover::after { animation: none; }
  .region-menu.open { animation: none; }
}
