/* ==========================================================================
   FOOTER.CSS
   Estilos globales para el pie de página (Widgets, contacto, mapa y copyright).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CONTENEDOR PRINCIPAL Y GRID (Escritorio Base)
   -------------------------------------------------------------------------- */
.site-footer {
    background-color: var(--color-dark);
    color: #cccccc;
    padding-top: 80px;
}

/* Sistema de 3 columnas (Marca, Contacto, Mapa) */
.footer-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

/* --------------------------------------------------------------------------
   2. WIDGETS: TÍTULOS E IMÁGENES (LOGO)
   -------------------------------------------------------------------------- */
.footer-widget h4 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Línea roja decorativa debajo de los títulos de los widgets */
.footer-widget h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--color-red);
}

/* Logo inyectado en el footer */
.site-footer .footer-widget img,
.site-footer .brand-widget img,
.site-footer .footer-logo {
    max-width: 180px;
    height: auto;
    display: block;
    margin-bottom: 20px;
    /* Filtro para convertir cualquier logo a color/negro en blanco puro */
    filter: brightness(0) invert(1);
}

/* --------------------------------------------------------------------------
   3. LISTAS DE CONTACTO E ICONOS SVG
   -------------------------------------------------------------------------- */
.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

/* Contenedor del ícono SVG */
.contact-list .icon {
    flex: 0 0 22px;
    color: var(--color-red);
    padding-top: 2px;
}

.contact-list .icon svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --------------------------------------------------------------------------
   4. TIPOGRAFÍA Y ENLACES
   -------------------------------------------------------------------------- */
.site-footer p,
.contact-list span,
.contact-list a {
    color: #a0a0a0;
    font-size: 0.95rem;
    line-height: 1.6;
    text-decoration: none;
    transition: color 0.3s ease;
    margin: 0;
}

/* Efecto Hover solo para los enlaces interactivos */
.contact-list a:hover {
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   5. BARRA INFERIOR (COPYRIGHT Y REDES SOCIALES)
   -------------------------------------------------------------------------- */
.footer-bottom {
    background-color: #0d0d0d;
    padding: 20px 4vw;
    border-top: 1px solid rgba(255, 255, 255, 0.05);

    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-bottom p {
    margin: 0;
    color: #a0a0a0;
    font-size: 0.85rem;
}

/* Transformamos el módulo de redes para que sea horizontal en esta barra */
.footer-bottom .global-social-module {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Quitamos el margen inferior que traía el texto del módulo por defecto */
.footer-bottom .global-social-module span {
    margin-bottom: 0;
    font-size: 0.75rem;
}

/* ==========================================================================
   6. MEDIA QUERIES (Responsividad Escalonada en Cascada)
   ========================================================================== */

/* TABLETS Y NOTEBOOKS PEQUEÑOS (De 1024px hacia abajo) */
@media (max-width: 1024px) {
    .site-footer {
        padding-top: 60px;
    }

    .footer-container {
        /* Pasamos a 2 columnas */
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 30px;
    }

    /* Forzamos al mapa a ocupar todo el ancho en la parte inferior */
    .map-widget {
        grid-column: 1 / -1; 
    }

    /* Convertimos el contenedor en una fila (row) usando CLASE, no ID */
    .brand-widget {
        display: flex;
        flex-direction: row;
        align-items: center; 
        gap: 40px; 
    }

    .brand-widget .footer-logo {
        flex: 0 0 auto; 
        max-width: 220px; 
        margin-bottom: 0; /* Anulamos el margen porque ahora el texto está al lado */
    }

    .brand-widget p {
        flex: 1;
        margin: 0;
        text-align: left;
    }
}

/* DISPOSITIVOS MÓVILES (De 768px hacia abajo) */
@media (max-width: 768px) {
    .site-footer {
        padding-top: 50px;
    }

    .footer-container {
        /* Todo apilado en 1 sola columna vertical */
        grid-template-columns: 1fr;
        gap: 40px;
        margin-bottom: 30px;
    }

    /* Apagamos la fila de la tablet y volvemos a apilar el logo y texto */
    .brand-widget {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }

    .brand-widget .footer-logo {
        max-width: 180px; 
        margin-bottom: 5px;
    }

    .footer-widget h4 {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }

    .footer-bottom {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 20px;
        padding: 25px 5vw;
    }

    .footer-bottom .global-social-module {
        justify-content: center;
    }
}