/* ======================================
   🎯 PIE DE PÁGINA - CLOUDTHINK v4.0
   Estilos optimizados del módulo Footer
   ====================================== */

/* ===== ESTRUCTURA PRINCIPAL ===== */
.footer {
  position: relative;
  padding: 3rem 1rem 1.5rem;
  background-color: var(--fondo-claro);
  color: var(--texto-claro);
  transition: background-color var(--transicion), color var(--transicion);
  overflow: hidden;
}

body.oscuro .footer {
  background-color: var(--fondo-oscuro);
  color: var(--texto-oscuro);
}

/* Fondo decorativo */
.footer-fondo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("../img/pie/fondo-nubes.svg");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  opacity: 0.2;
  z-index: 0;
  pointer-events: none;
}

/* Contenedores */
.footer-contenido,
.footer-secundario {
  position: relative;
  z-index: 1;
}

.footer-contenido {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-columna {
  flex: 0 0 33.3333%;
  max-width: 33.3333%;
  box-sizing: border-box;
  padding: 0 1rem;
}

/* Branding */
.footer-logo {
  max-width: 150px;
  margin-bottom: 0.5rem;
}

.footer-lema {
  font-weight: 300;
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* Redes sociales */
.columna-redes .footer-redes {
  display: flex;
  gap: 1.2rem;
  padding: 0;
  margin: 0;
  list-style: none;
  flex-wrap: wrap;
}

.footer-redes a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1;
  text-decoration: none;
  color: inherit;
  transition: color var(--transicion);
}

.footer-redes a:hover {
  color: var(--color-apoyo);
}

.footer-redes img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
  transition: transform 0.3s ease;
}

.footer-redes a:hover img {
  transform: scale(1.15);
}

/* Información de contacto */
.footer-info p {
  margin: 0.8rem 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.footer-info img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.footer-info p:hover img {
  transform: scale(1.1);
}

.footer-info a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  transition: color var(--transicion);
}

.footer-info a:hover {
  color: var(--color-apoyo);
}

.columna-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 5rem;
}

/* Botón scroll-top */
.boton-inicio {
  position: fixed;
  bottom: 7rem;
  right: 2rem;
  z-index: 999;
  background-color: transparent;
  border-radius: 50%;
  padding: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
}

.boton-inicio img {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.boton-inicio:hover img {
  transform: scale(1.1);
  filter: drop-shadow(0 0 6px var(--color-apoyo));
}

body .boton-inicio,
body.oscuro .boton-inicio {
  background-color: transparent !important;
  box-shadow: none;
}

/* ===== FILA LEGAL Y COLCHÓN FINAL ===== */
.footer-secundario {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  border-top: 1px solid var(--borde-transparente);
  padding-top: 1.5rem;
  font-size: 0.85rem;
  opacity: 0.8;
}

.footer-tercio {
  flex: 1;
  min-width: 120px;
  padding: 0.3rem 0;
}

.footer-tercio.izquierda {
  text-align: left;
}

.footer-tercio.centro {
  text-align: center;
}

.footer-tercio.derecha {
  text-align: right;
}

.footer-tercio a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transicion);
}

.footer-tercio a:hover {
  color: var(--color-apoyo);
}

.colchon-final {
  background-color: var(--color-principal);
  padding-block: 0.3rem 0.4rem;
  padding-inline: 1rem;
  text-align: center;
  user-select: none;
  pointer-events: auto;
  font-size: 0.85rem;
  color: white;
}

.colchon-final .footer-tercio p,
.colchon-final .footer-tercio a {
  margin: 0 !important;
  padding: 0;
  line-height: 1.4;
  display: inline-block;
  color: white;
}

.colchon-final .footer-tercio a:hover {
  color: var(--color-apoyo);
}

.colchon-final > .footer-secundario {
  padding-top: 0.3rem !important;
}

/* ===== BOTÓN HOME MÓVIL ===== */
.footer-movil-home {
  display: none;
}

.footer-home-movil {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.footer-home-movil img {
  width: 64px;
  height: 64px;
  transition: transform 0.3s ease;
}

.footer-home-movil:hover img {
  transform: scale(1.15);
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 768px) {
  .footer {
    padding: 2rem 1rem 1rem;
  }

  .footer-contenido {
    flex-direction: column;
    gap: 2.5rem;
    margin-bottom: 1.5rem;
  }

  .footer-columna {
    flex: 1 1 100%;
    max-width: 100%;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .columna-info {
    align-items: center;
    padding-right: 0;
  }

  .footer-info p,
  .footer-redes {
    justify-content: center;
  }

  .footer-secundario,
  .colchon-final .footer-secundario {
    flex-direction: column;
    gap: 0.8rem;
    padding-top: 1.2rem;
  }

  .footer-tercio,
  .colchon-final .footer-tercio {
    text-align: center !important;
  }

  .footer-fondo {
    opacity: 0.15;
  }

  .boton-inicio {
    display: none;
  }

  .footer-movil-home {
    display: block;
    width: 100%;
    text-align: center;
    background-color: var(--fondo-claro);
    border-top: 1px solid #ccc;
  }

  body.oscuro .footer-movil-home {
    background-color: var(--fondo-oscuro);
    border-top: 1px solid #444;
  }
}

@media (max-width: 480px) {
  .footer-logo {
    max-width: 130px;
  }

  .footer-lema {
    font-size: 0.95rem;
  }

  .footer-redes img {
    width: 26px;
    height: 26px;
  }

  .footer-info img {
    width: 18px;
    height: 18px;
  }
}
