/* ======================================
   FOOTER ROOT — Fijo al fondo, glassmorphism
   Patron consistente con system-footer
====================================== */

.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed, 1000);
  min-height: var(--footer-height);
  background: rgb(255 255 255 / 30%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid rgb(25 118 210 / 12%);
  box-shadow: 0 -10px 30px rgb(15 23 42 / 8%);
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
}

.footer-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 0 var(--spacing-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-4);
}

.footer-copyright {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: 600;
  transition: color var(--animation-duration) var(--animation-timing);
}

.footer-link:hover {
  color: var(--text-strong);
}

.footer-link-brand {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.footer-link-brand:hover {
  color: #fff;
  opacity: 0.92;
}

/* ---- Dark ---- */

[data-theme="dark"] .app-footer {
  background: rgb(8 17 29 / 36%);
  border-color: rgb(134 185 236 / 18%);
  box-shadow: 0 -10px 30px rgb(0 0 0 / 24%);
}

/* ---- Contrast ---- */

[data-theme="contrast"] .app-footer {
  background: rgb(0 0 0 / 48%);
  border-color: rgb(255 255 255 / 22%);
  box-shadow: 0 -10px 30px rgb(0 0 0 / 28%);
}

[data-theme="contrast"] .footer-link:hover {
  color: #fff;
}

[data-theme="contrast"] .footer-link-brand {
  background: #fff;
  color: #000;
  box-shadow: none;
}

/* ---- Responsive ---- */

@media (width <= 640px) {
  .app-footer {
    padding: 0.65rem 0 max(env(safe-area-inset-bottom, 0px), 0.4rem);
  }

  .footer-shell {
    padding: 0 var(--spacing-3);
    gap: var(--spacing-2);
  }

  .footer-copyright {
    font-size: var(--font-size-xs);
    white-space: normal;
  }
}

@media (width <= 720px) {
  .footer-shell {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

@media (width <= 480px) {
  .app-footer {
    padding-top: 0.7rem;
  }

  .footer-links {
    gap: 0.4rem;
  }

  .footer-link {
    padding: 0.35rem 0.7rem;
    font-size: var(--font-size-xs);
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer-link {
    transition: none;
  }
}
