/* =========================================================================
   VECTOR ENGINEERING — COMPONENTS (shared across every page)
   ========================================================================= */

/* ---------------------------------------------------------------------
   1. PAGE LOADER
   --------------------------------------------------------------------- */
.page-loader{
  position: fixed; inset: 0;
  z-index: var(--z-loader);
  background: var(--c-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 480ms var(--ease-out), visibility 480ms var(--ease-out);
}
.page-loader[aria-hidden="true"]{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-mark{
  width: 76px; height: 76px;
  position: relative;
}
.loader-mark svg{ width: 100%; height: 100%; }
.loader-mark .ring{
  fill: none;
  stroke: url(#loaderGradient);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 150;
  transform-origin: center;
  animation: loader-spin 1.1s linear infinite;
}
@keyframes loader-spin{ to{ transform: rotate(360deg); } }
.loader-word{
  position: absolute;
  top: calc(50% + 64px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  color: rgba(232,236,244,0.65);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------
   2. SCROLL PROGRESS BAR
   --------------------------------------------------------------------- */
.scroll-progress{
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  z-index: var(--z-progress);
  background: transparent;
  pointer-events: none;
}
.scroll-progress__bar{
  height: 100%;
  width: 0%;
  background: var(--gradient-brand);
  box-shadow: 0 0 12px rgba(80,168,224,0.55);
  transform-origin: left;
}

/* ---------------------------------------------------------------------
   3. NAVIGATION
   --------------------------------------------------------------------- */
.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  padding-block: var(--sp-4);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-out), padding-block var(--dur-base) var(--ease-out);
}
/* The frosted-glass backdrop lives on a ::before, not on .site-header itself.
   backdrop-filter/transform/perspective on an ancestor become the CONTAINING
   BLOCK for any position:fixed descendant — if applied directly to
   .site-header, the fixed, viewport-spanning mobile .nav-links overlay would
   be clipped to the header's own (short) box instead of filling the screen. */
.site-header::before{
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.site-header.is-scrolled{
  border-bottom-color: var(--border);
  padding-block: var(--sp-3);
  box-shadow: var(--shadow-sm);
}
.nav-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}
.brand{
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  z-index: 2;
}
.brand img{ height: 38px; width: auto; transition: height var(--dur-base) var(--ease-out); }
.site-header.is-scrolled .brand img{ height: 32px; }
.brand-word{ display: flex; flex-direction: column; line-height: 1; }
.brand-word b{ font-size: 1.05rem; font-weight: 800; letter-spacing: 0.01em; color: var(--heading); }
.brand-word span{ font-size: 0.62rem; font-weight: 700; letter-spacing: 0.22em; color: var(--accent); text-transform: uppercase; margin-top: 3px; }

.nav-links{
  display: flex;
  align-items: center;
  gap: var(--sp-7);
}
.nav-links a{
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  position: relative;
  padding-block: 4px;
}
.nav-links a::after{
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--gradient-brand);
  transition: width var(--dur-base) var(--ease-out);
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after{ width: 100%; }
.nav-links a[aria-current="page"]{ color: var(--accent); }

.nav-dropdown{ position: relative; }
.nav-dropdown-trigger{
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; font: inherit;
}
.nav-dropdown-trigger svg{ width: 13px; height: 13px; transition: transform var(--dur-fast) var(--ease-out); }
.nav-dropdown.is-open .nav-dropdown-trigger svg{ transform: rotate(180deg); }
.nav-dropdown-panel{
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  transform: translate(-50%, 8px);
  width: 320px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-3);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility var(--dur-base);
}
.nav-dropdown.is-open .nav-dropdown-panel{
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
}
.nav-dropdown-panel a{
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
}
.nav-dropdown-panel a:hover{ background: var(--bg-alt); }
.nav-dropdown-panel a::after{ display: none; }
.nav-dropdown-panel svg{ width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; }
.nav-dropdown-all{
  font-weight: 700 !important;
  border-bottom: 1px solid var(--border);
  border-radius: 0 !important;
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-3) !important;
}

.nav-actions{ display: flex; align-items: center; gap: var(--sp-3); position: relative; z-index: 2; }
@media (max-width: 480px){ .nav-cta{ display: none; } }

.icon-btn{
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--heading);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.icon-btn:hover{ transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.icon-btn svg{ width: 18px; height: 18px; }

/* theme toggle sun/moon swap */
.theme-toggle .icon-sun, .theme-toggle .icon-moon{ position: absolute; transition: opacity var(--dur-base), transform var(--dur-base); }
.theme-toggle{ position: relative; }
html:not([data-theme="dark"]) .theme-toggle .icon-moon{ opacity: 0; transform: rotate(-90deg) scale(0.5); }
html:not([data-theme="dark"]) .theme-toggle .icon-sun{ opacity: 1; transform: rotate(0) scale(1); }
html[data-theme="dark"] .theme-toggle .icon-sun{ opacity: 0; transform: rotate(90deg) scale(0.5); }
html[data-theme="dark"] .theme-toggle .icon-moon{ opacity: 1; transform: rotate(0) scale(1); }

.nav-toggle{
  display: none;
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  position: relative;
  flex-shrink: 0;
}
.nav-toggle span{
  position: absolute; left: 12px; right: 12px; height: 2px;
  background: var(--heading); border-radius: 2px;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out), top var(--dur-base) var(--ease-out);
}
.nav-toggle span:nth-child(1){ top: 15px; }
.nav-toggle span:nth-child(2){ top: 21px; }
.nav-toggle span:nth-child(3){ top: 27px; }
.nav-toggle.is-active span:nth-child(1){ top: 21px; transform: rotate(45deg); }
.nav-toggle.is-active span:nth-child(2){ opacity: 0; }
.nav-toggle.is-active span:nth-child(3){ top: 21px; transform: rotate(-45deg); }

@media (max-width: 980px){
  .nav-links{
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: var(--sp-7);
    background: var(--bg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--dur-slow) var(--ease-in-out), opacity var(--dur-base) var(--ease-out), visibility var(--dur-slow);
    z-index: 1;
  }
  .nav-links.is-open{ transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-links a{ font-size: 1.4rem; }
  .nav-dropdown{ display: flex; flex-direction: column; align-items: center; }
  .nav-dropdown-panel{
    position: static; transform: none; width: min(86vw, 360px);
    opacity: 1; visibility: visible; box-shadow: none; border: none; background: transparent;
    display: none; margin-top: var(--sp-3);
  }
  .nav-dropdown.is-open .nav-dropdown-panel{ display: block; transform: none; }
  .nav-toggle{ display: block; }
}

/* ---------------------------------------------------------------------
   4. FOOTER
   --------------------------------------------------------------------- */
.site-footer{
  background: var(--footer-bg);
  color: var(--footer-text);
  padding-block: var(--sp-10) var(--sp-6);
  position: relative;
  overflow: hidden;
}
.site-footer::before{
  content: '';
  position: absolute; inset: 0;
  background-image: linear-gradient(135deg, rgba(80,168,224,0.10), transparent 55%);
  pointer-events: none;
}
.footer-grid{
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: var(--sp-8);
  padding-bottom: var(--sp-9);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-brand .brand-word b{ color: #fff; }
.footer-brand img{ height: 36px; }
.footer-tagline{ margin-top: var(--sp-4); max-width: 32ch; font-size: 0.92rem; }
.footer-social{ display: flex; gap: var(--sp-3); margin-top: var(--sp-5); }
.footer-social a{
  width: 38px; height: 38px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08);
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.footer-social a:hover{ background: var(--c-sky); transform: translateY(-2px); }
.footer-social svg{ width: 16px; height: 16px; color: #fff; }

.footer-col h4{ color: #fff; font-size: 0.95rem; margin-bottom: var(--sp-4); }
.footer-col ul li{ margin-bottom: var(--sp-3); }
.footer-col a{ font-size: 0.9rem; transition: color var(--dur-fast); }
.footer-col a:hover{ color: #fff; }
.footer-contact li{ display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.9rem; }
.footer-contact svg{ width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; color: var(--c-sky); }

.footer-bottom{
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--sp-6);
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: 0.82rem;
}
.footer-credit a{ color: var(--c-sky); font-weight: 600; }
.footer-credit a:hover{ text-decoration: underline; }

@media (max-width: 900px){
  .footer-grid{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px){
  .footer-grid{ grid-template-columns: 1fr; }
  .footer-bottom{ flex-direction: column; align-items: flex-start; }
}

/* ---------------------------------------------------------------------
   5. FLOATING ACTION BUTTONS (WhatsApp bottom-left, Scroll-top bottom-right)
   --------------------------------------------------------------------- */
.fab{
  position: fixed;
  bottom: var(--sp-5);
  z-index: var(--z-fab);
  width: 56px; height: 56px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.7);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out), background var(--dur-fast);
}
.fab.is-visible{ transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.fab svg{ width: 26px; height: 26px; color: #fff; }

.fab--whatsapp{ left: var(--sp-5); background: var(--c-whatsapp); }
.fab--whatsapp:hover{ background: var(--c-whatsapp-hover); transform: translateY(-3px) scale(1.04); }
.fab--whatsapp::before{
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--radius-full);
  box-shadow: 0 0 0 0 rgba(var(--c-whatsapp-rgb),0.55);
  animation: fab-pulse 2.8s ease-out infinite;
}
@keyframes fab-pulse{
  0%{ box-shadow: 0 0 0 0 rgba(var(--c-whatsapp-rgb),0.45); }
  70%{ box-shadow: 0 0 0 16px rgba(var(--c-whatsapp-rgb),0); }
  100%{ box-shadow: 0 0 0 0 rgba(var(--c-whatsapp-rgb),0); }
}

.fab--top{ right: var(--sp-5); background: var(--gradient-brand); }
.fab--top:hover{ transform: translateY(-3px) scale(1.04); }
.fab--top svg{ width: 20px; height: 20px; }

@media (max-width: 600px){
  .fab{ width: 50px; height: 50px; bottom: var(--sp-4); }
  .fab--whatsapp{ left: var(--sp-4); }
  .fab--top{ right: var(--sp-4); }
}

/* ---------------------------------------------------------------------
   6. ACCESSIBILITY PANEL (Reduced motion toggle)
   --------------------------------------------------------------------- */
.a11y-panel{
  position: fixed;
  bottom: var(--sp-5);
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  z-index: var(--z-fab);
  background: var(--surface-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-full);
  padding: 0.55rem 0.6rem 0.55rem 1.1rem;
  display: flex; align-items: center; gap: 0.75rem;
  transition: transform var(--dur-base) var(--ease-out);
}
.a11y-panel.is-visible{ transform: translateX(-50%) translateY(0); }
.a11y-panel span{ font-size: 0.82rem; font-weight: 600; font-family: var(--font-display); color: var(--text); white-space: nowrap; }

.switch{
  position: relative;
  width: 42px; height: 24px;
  border-radius: var(--radius-full);
  background: var(--border);
  border: none;
  flex-shrink: 0;
}
.switch::after{
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out);
}
.switch[aria-checked="true"]{ background: var(--gradient-brand); }
.switch[aria-checked="true"]::after{ transform: translateX(18px); }

.a11y-panel-close{
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.a11y-panel-close svg{ width: 13px; height: 13px; }
.a11y-panel-close:hover{ color: var(--text); }

/* ---------------------------------------------------------------------
   7. CUSTOM CURSOR (desktop / fine-pointer only — see main.js)
   --------------------------------------------------------------------- */
.cursor-dot, .cursor-ring{
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor-dot{ width: 7px; height: 7px; background: var(--c-sky); }
.cursor-ring{
  width: 36px; height: 36px;
  border: 1.5px solid rgba(80,168,224,0.6);
  transition: width var(--dur-fast) var(--ease-out), height var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.cursor-ring.is-hover{
  width: 64px; height: 64px;
  background: rgba(80,168,224,0.12);
  border-color: var(--c-sky);
}
body.has-custom-cursor, body.has-custom-cursor a, body.has-custom-cursor button{ cursor: none; }

/* ---------------------------------------------------------------------
   8. PAGE / HERO offsets so fixed nav never overlaps content
   --------------------------------------------------------------------- */
main{ display: block; }
.page-hero{ padding-top: calc(var(--sp-12) + 64px); }

/* ---------------------------------------------------------------------
   9. PAGE-TRANSITION OVERLAY
   --------------------------------------------------------------------- */
.page-transition{
  position: fixed; inset: 0;
  z-index: 9500;
  background: var(--gradient-brand);
  transform: translateY(100%);
  pointer-events: none;
}
.page-transition.is-active{ pointer-events: auto; }

/* ---------------------------------------------------------------------
   10. JSON-LD / utility — visually hidden ARIA live regions
   --------------------------------------------------------------------- */
.aria-live-region{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
