/* ==========================================================================
   components/components.css
   GarantiaTech — Tokens globales, reset, header y footer
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #FFFFFF;
  color: #111827;
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main  { flex: 1; }
img   { display: block; max-width: 100%; }
a     { text-decoration: none; color: inherit; }
ul    { list-style: none; padding: 0; margin: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; }

/* Eliminar tap highlight azul en móvil */
*, button, a, [onclick] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* --------------------------------------------------------------------------
   CSS TOKENS — disponibles en toda la app
   -------------------------------------------------------------------------- */
:root {
  /* Paleta principal — verde GaN */
  --g1:            #00C974;
  --g2:            #00A85E;
  --accent:        #00B86A;
  --accent-dim:    rgba(0,184,106,.10);
  --accent-border: rgba(0,184,106,.25);

  /* Fondos */
  --bg-base:    #FFFFFF;
  --bg-surface: #F5F7FA;
  --bg-card:    #FFFFFF;
  --bg-card2:   #F0F3F7;

  /* Bordes */
  --border:     rgba(0,0,0,.08);
  --border-lit: rgba(0,0,0,.11);

  /* Texto */
  --text-1: #111827;
  --text-2: #4B5563;
  --text-3: #9CA3AF;

  /* Alertas */
  --red:   #E5304A;
  --amber: #D4881A;
  --blue:  #3B74D4;

  /* Forma */
  --r:    14px;
  --r-lg: 20px;

  /* Sombras */
  --sh:   0 1px 3px rgba(0,0,0,.07), 0 6px 24px rgba(0,0,0,.07);
  --sh-g: 0 4px 24px rgba(0,184,106,.18), 0 0 0 1px var(--accent-border);

  /* Layout */
  --container-max: 1160px;
}

/* --------------------------------------------------------------------------
   CONTAINER
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------------------
   BUTTONS — usados en navbar CTA, productos, CTAs
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  transition: all .2s;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, var(--g1), var(--g2));
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,184,106,.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,184,106,.45);
}
.btn-primary:active { transform: scale(.95) !important; transition: transform .08s !important; }

/* Shine sweep on hover */
.btn-primary::before {
  content: '';
  position: absolute; top: 0; left: -120%; width: 70%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  transform: skewX(-20deg);
  transition: left .5s ease;
  pointer-events: none;
}
.btn-primary:hover::before { left: 150%; }

.btn-ghost {
  background: #fff;
  color: var(--text-2);
  border: 1.5px solid var(--border-lit);
}
.btn-ghost:hover { border-color: var(--accent-border); color: var(--g2); }
.btn-ghost:active { background: var(--bg-surface) !important; transform: scale(.95) !important; transition: transform .08s !important; }

/* Ripple */
.ripple-circle {
  position: absolute; border-radius: 50%; pointer-events: none;
  transform: scale(0); background: rgba(255,255,255,.28);
  animation: rippleOut .55s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes rippleOut { to { transform: scale(4); opacity: 0; } }

/* --------------------------------------------------------------------------
   SCROLL PROGRESS BAR
   -------------------------------------------------------------------------- */
#scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 9999;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--g1), var(--g2), var(--g1));
  background-size: 200% 100%;
  animation: progressShimmer 2s linear infinite;
  transition: width .08s linear;
  pointer-events: none;
}
@keyframes progressShimmer {
  0%   { background-position: 200% 0 }
  100% { background-position: -200% 0 }
}

/* --------------------------------------------------------------------------
   PRELOADER
   -------------------------------------------------------------------------- */
#preloader {
  position: fixed; inset: 0; z-index: 10000; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  transition: opacity .6s, visibility .6s;
}
#preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }

.pl-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  animation: plbounce .7s ease-in-out infinite alternate;
}
@keyframes plbounce { to { transform: translateY(-8px); } }

.pl-bar-wrap { width: 160px; height: 3px; background: var(--bg-surface); border-radius: 3px; overflow: hidden; }
.pl-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--g1), var(--g2));
  border-radius: 3px;
  animation: plprog 1.5s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes plprog { to { width: 100%; } }

/* ==========================================================================
   TOP BAR
   ========================================================================== */
.topbar {
  background: var(--g2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.tb-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 22px;
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.2);
}
.tb-item:last-child { border-right: none; }
.tb-item svg { width: 14px; height: 14px; flex-shrink: 0; opacity: .9; }

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  transition: box-shadow .25s, background .25s;
}
.navbar.scrolled { box-shadow: 0 2px 24px rgba(0,0,0,.1); }

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 20px;
}

/* ── Logo ── */
.logo { display: flex; align-items: center; flex-shrink: 0; }

.logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: opacity .2s, transform .25s cubic-bezier(.34,1.56,.64,1);
}
.logo:hover .logo-img { opacity: .88; transform: scale(1.04); }

/* ── Nav links ── */
.nav-links { display: flex; gap: 2px; }

.nav-links a {
  position: relative;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-2);
  transition: background .2s, color .2s;
}
.nav-links a:hover { background: var(--bg-surface); color: var(--text-1); }
.nav-links a.active { color: var(--text-1); }

/* Sliding underline */
.nav-links a::after {
  content: '';
  position: absolute; bottom: 4px; left: 10px; right: 10px;
  height: 2px; background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: center;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* ── Right actions ── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Auth button */
.nav-auth-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1.5px solid var(--border-lit);
  color: var(--text-2);
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
}
.nav-auth-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--g2);
}
.nav-auth-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Cart button */
.nav-cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 8px;
  background: transparent;
  border: 1.5px solid var(--border-lit);
  color: var(--text-2);
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
  font-family: inherit;
}
.nav-cart-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--g2);
}
.nav-cart-btn svg { width: 18px; height: 18px; }

.nav-cart-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--g2); color: #fff;
  font-size: .6rem; font-weight: 800; border-radius: 9px;
  display: none; align-items: center; justify-content: center;
  line-height: 1; border: 2px solid #fff;
}
.nav-cart-badge.visible { display: flex; }

/* CTA button (pequeño para nav) */
.nav-cta {
  padding: 9px 18px;
  font-size: .88rem;
  border-radius: 9px;
}
.nav-cta svg { width: 14px; height: 14px; }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px; height: 38px;
  border-radius: 8px;
  background: transparent;
  border: 1.5px solid var(--border-lit);
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}
.nav-hamburger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: transform .28s ease, opacity .28s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile drawer ── */
.nav-mobile {
  max-height: 0;
  overflow: hidden;
  transition: max-height .32s cubic-bezier(.4,0,.2,1);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.navbar.mobile-open .nav-mobile {
  max-height: 420px;
  border-top: 1px solid var(--border);
}

.nav-mobile a {
  display: block;
  padding: 14px 24px;
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  transition: background .15s, color .15s;
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover,
.nav-mobile a.active { background: var(--accent-dim); color: var(--g2); }

.nav-mobile-auth {
  display: flex !important;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface) !important;
  font-weight: 600 !important;
  color: var(--text-1) !important;
}
.nav-mobile-auth:hover { color: var(--g2) !important; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: #111827;
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 60px 0 28px;
  margin-top: auto;
}

.fgrid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

/* Logo footer */
.flogo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.flogo-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.flogo-mark svg { width: 18px; height: 18px; }

.flogo-name {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #fff;
}
.flogo-name em { font-style: normal; color: var(--g1); }

.fdesc {
  font-size: .84rem;
  color: #6B7280;
  line-height: 1.78;
  max-width: 280px;
  margin-bottom: 18px;
}

/* Arcadian pill */
.f-arcadian {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: .74rem;
  color: #6B7280;
}
.f-arcadian svg { width: 12px; height: 12px; flex-shrink: 0; opacity: .5; }
.f-arcadian strong { color: #9CA3AF; }

/* Columnas de links */
.fcol h4 {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #4B5563;
  margin-bottom: 16px;
}
.fcol ul { display: flex; flex-direction: column; gap: 10px; }
.fcol ul li a {
  font-size: .86rem;
  color: #6B7280;
  transition: color .2s;
}
.fcol ul li a:hover { color: #fff; }

/* Bottom bar */
.fbottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.fcopy { font-size: .78rem; color: #6B7280; }
.fcopy strong { color: var(--g1); }

.fbadges { display: flex; gap: 7px; flex-wrap: wrap; }
.fbadge {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 6px;
  padding: 5px 11px;
  font-size: .7rem;
  font-weight: 600;
  color: #6B7280;
  display: flex;
  align-items: center;
  gap: 5px;
}
.fbadge svg { width: 10px; height: 10px; opacity: .7; }

/* ==========================================================================
   WHATSAPP FAB
   ========================================================================== */
.wa-fab-wrap {
  position: fixed;
  bottom: 26px; right: 26px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wa-fab {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 28px rgba(37,211,102,.5);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
}
.wa-fab:hover  { transform: scale(1.12); box-shadow: 0 10px 36px rgba(37,211,102,.65); }
.wa-fab:active { transform: scale(.92) !important; }
.wa-fab svg    { width: 28px; height: 28px; }

/* Pulse rings */
.wa-fab::before {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2.5px solid rgba(37,211,102,.4);
  animation: waring 2.2s ease-out infinite;
}
.wa-fab::after {
  content: ''; position: absolute; inset: -12px; border-radius: 50%;
  border: 2px solid rgba(37,211,102,.18);
  animation: waring 2.2s ease-out .5s infinite;
}
@keyframes waring {
  0%   { transform: scale(.85); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}
.wa-fab:hover::before,
.wa-fab:hover::after { animation-play-state: paused; }

.wa-tip {
  background: #111827; color: #fff;
  font-size: .77rem; font-weight: 600;
  font-family: 'Inter', sans-serif;
  padding: 8px 14px; border-radius: 100px;
  white-space: nowrap;
  opacity: 0; transform: translateX(10px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
}
.wa-fab-wrap:hover .wa-tip { opacity: 1; transform: none; }

/* ==========================================================================
   STICKY CTA BAR (solo mobile)
   ========================================================================== */
.sticky-cta-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 12px 20px 14px;
  display: flex; align-items: center; gap: 10px;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -4px 24px rgba(0,0,0,.09);
}
.sticky-cta-bar.show { transform: translateY(0); }
.scb-text { flex: 1; min-width: 0; }
.scb-text strong {
  font-size: .88rem; font-weight: 800; color: var(--text-1);
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scb-text span { font-size: .72rem; color: var(--text-3); }
.scb-btn { flex-shrink: 0; padding: 11px 18px; font-size: .85rem; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
  .fgrid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* Mobile */
@media (max-width: 768px) {
  /* Navbar: ocultar links y mostrar hamburger */
  .nav-links            { display: none; }
  .nav-auth-label       { display: none; }                  /* solo ícono en el botón auth */
  .nav-auth-btn         { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .nav-cta              { display: none; }
  .nav-hamburger        { display: flex; }

  /* Topbar: quitar bordes entre ítems */
  .tb-item { border-right: none; padding: 8px 14px; }

  /* Footer */
  .fgrid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .fbottom { flex-direction: column; align-items: flex-start; }
  .fdesc { max-width: 100%; }

  /* FAB sube por encima del sticky bar */
  .wa-fab-wrap { bottom: 86px; }

  /* Ocultar sticky bar en desktop */
}
@media (min-width: 769px) {
  .sticky-cta-bar { display: none; }
  .nav-mobile     { display: none !important; }
}

@media (max-width: 520px) {
  .fgrid   { grid-template-columns: 1fr; }
  .fbottom { align-items: flex-start; }
  .fbadges { flex-wrap: wrap; }
}