/* =============================
   css/template/pie.css
   Footer ANFECA - Diseño Atelier
   Colores planos · Sin degradados
   ============================= */

/* ═══════════ CORRECCIÓN PARA FOOTER AL FINAL ═══════════ */
/* Esta es la solución más limpia: solo afecta al footer */
html {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* El contenedor que envuelve TODO el contenido de la página */
/* Debe ser el primer elemento dentro de body y contener todo excepto el footer */
/* Si tu estructura es diferente, ajusta este selector */
#page-wrapper,
.page-wrapper,
.contenido-principal,
main:first-of-type {
    flex: 1 0 auto;
}

/* El footer se mantiene abajo */
.anfeca-footer-a,
.anfeca-footer-b {
    flex-shrink: 0;
}

/* ═══════════ BOTÓN VOLVER ARRIBA ═══════════ */
#btnTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--color-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .25s cubic-bezier(.4,0,.2,1),
              transform .25s cubic-bezier(.4,0,.2,1),
              background .25s cubic-bezier(.4,0,.2,1),
              color .25s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  margin: 0;
  padding: 0;
}

#btnTop.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#btnTop:hover {
  background: var(--color-primary-dark);
  color: #ffffff;
}

#btnTop i { font-size: 1.1rem; line-height: 1; }

@media (max-width: 768px) {
  #btnTop {
    position: fixed !important;
    bottom: 16px !important;
    right: 16px !important;
    left: auto !important;
    top: auto !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: var(--color-primary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(10px) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
    z-index: 9999 !important;
    float: none !important;
  }

  #btnTop.visible {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  #btnTop i {
    font-size: 1rem !important;
    line-height: 1 !important;
    display: block !important;
  }
}

/* ═══════════════════════════════════════
   BANDA A — Rojo medio, color plano
   ═══════════════════════════════════════ */
.anfeca-footer-a {
  background: var(--color-primary);
  padding: 22px 0;
  font-family: var(--font-body);
}

.anfeca-footer-a__in {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 60px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
}

/* ─── Stats (izquierda) ─── */
.anfeca-footer-a__stats {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.anfeca-footer-a__stat,
.anfeca-footer-a__link {
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 400;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1.5;
}

.anfeca-footer-a__stat::before,
.anfeca-footer-a__link::before {
  content: '→';
  color: #ffffff;
  font-size: .9rem;
  flex-shrink: 0;
}

.anfeca-footer-a__stat strong {
  color: #ffffff;
  font-weight: 700;
}

.anfeca-footer-a__link {
  /* Mantenemos la transición solo para el transform si decides dejarlo */
  transition: transform .2s ease;
}

.anfeca-footer-a__link:hover {
  transform: translateX(3px); 
  color: #ffffff; /* Fuerza a que el texto siga siendo blanco sólido */
  text-decoration: none; /* Opcional: evita que aparezca un subrayado si hay estilos globales */
}

/* ─── Social (centro) ─── */
.anfeca-footer-a__social {
  text-align: center;
  justify-self: center;
}

.anfeca-footer-a__social-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 10px;
  display: block;
}

.anfeca-footer-a__social-icons {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.anfeca-footer-a__social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
  transition: background .3s ease, transform .3s ease, border-color .3s ease, color .3s ease;
}

.anfeca-footer-a__social-icon:hover {
  background: #ffffff;
  border-color: #ffffff;
  transform: scale(1.08);
  color: var(--color-primary);
}

.anfeca-footer-a__social-icon i { font-size: 1.05rem; line-height: 1; }

/* ─── Logo (derecha) ─── */
.anfeca-footer-a__logo {
  text-align: right;
  justify-self: end;
}

.anfeca-footer-a__logo-img {
  height: 76px;
  width: 76px;
  display: inline-block;
  object-fit: contain;
  background: #ffffff;
  padding: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: transform .3s ease, border-color .3s ease;
}

.anfeca-footer-a__logo-img:hover {
  transform: scale(1.05);
  border-color: #ffffff;
}

/* ═══════════════════════════════════════
   BANDA B — Rojo oscuro plano, compacta
   ═══════════════════════════════════════ */
.anfeca-footer-b {
  background: var(--color-red-wine);
  padding: 18px 0 16px;
  font-family: var(--font-body);
  margin-bottom: 0;
}

.anfeca-footer-b__in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 48px;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 40px;
  align-items: start;
}

.anfeca-footer-b__left p {
  font-size: .78rem;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.8;
  margin: 0;
}

.anfeca-footer-b__right p {
  font-size: .72rem;
  font-weight: 400;
  color: #ffffff;
  line-height: 1.7;
  text-align: justify;
  text-justify: inter-word;
  margin: 0;
}

.anfeca-footer-b__right a {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
  text-underline-offset: 3px;
  transition: text-decoration-color .25s ease;
}

.anfeca-footer-b__right a:hover {
  text-decoration-color: #ffffff;
}

.anfeca-footer-b__sep {
  color: rgba(255, 255, 255, 0.45);
  margin: 0 4px;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 992px) {
  .anfeca-footer-a__in {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
    padding: 0 32px;
  }

  .anfeca-footer-a__stats { align-items: center; justify-self: center; }

  .anfeca-footer-a__stat,
  .anfeca-footer-a__link { justify-content: center; }

  .anfeca-footer-a__logo { text-align: center; justify-self: center; }

  .anfeca-footer-b__in {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 28px;
  }

  .anfeca-footer-b__left { text-align: center; }
  .anfeca-footer-b__right p { text-align: left; }
}

@media (max-width: 768px) {
  .anfeca-footer-a { padding: 20px 0; }
  .anfeca-footer-a__in { padding: 0 24px; }
  .anfeca-footer-a__logo-img { height: 66px; width: 66px; }
  
  .anfeca-footer-b {
    padding-bottom: 20px;
  }
}

@media (max-width: 600px) {
  .anfeca-footer-a__in { padding: 0 18px; }
  .anfeca-footer-b__in { padding: 0 18px; }
  .anfeca-footer-b__sep { display: none; }
  .anfeca-footer-b__right p { text-align: center; }
  .anfeca-footer-b__right a { display: inline-block; margin: 4px 2px; }
  .anfeca-footer-a__logo-img { height: 60px; width: 60px; }
}