/* public/css/footer.css */

.footer-custom {
    background-color: #2a2a2a; /* Fondo gris oscuro estilo militar */
    background-image: url('../images/textura_footer.png');
    background-repeat: repeat;
    color: #ffffff;
}

/* Cinta superior dorada */
.footer-nav {
    background-color: var(--cmfb-granate-dark);
    padding: 15px 0;
}

.footer-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #fff; /* Texto oscuro sobre el dorado */
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ffffff;
}

/* Botón flecha arriba */
.btn-up {
    background: #f3efe6; /* Color crema */
    color: #1a1a1a;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
}

.btn-up:hover {
    background: #ffffff;
    transform: translateY(-3px);
}

.footer-content {
    padding: 50px 0 20px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

/* Títulos blancos como en la imagen */
.footer-title,
.footer-html-content h5, 
.footer-html-content h4, 
.footer-html-content h3 {
    font-size: 1.1rem;
    font-weight: 900;
    margin-bottom: 25px;
    color: #ffffff !important; 
    text-transform: uppercase;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center; /* Alinea los iconos cuadrados con el texto */
    gap: 12px;
    color: #ddd9cf;
}

.footer-col ul a {
    color: #ddd9cf;
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.footer-col ul a:hover {
    color: var(--color-gold);
}

/* Sobrescribir el color dorado que viene del HTML para hacerlo blanco como la imagen */
.footer-col .text-gold {
    color: #ffffff !important;
}

/* Iconos de contacto (Ubicación, Teléfono, Correo) - Blancos y sin fondo */
.footer-col ul li i.fa-solid {
    color: #ffffff !important;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* Iconos de Redes Sociales - Cuadrados cremas con icono oscuro */
.footer-col ul li a i.fa-brands,
.social-circle-btn i.fa-brands {
    background-color: #e6dfd1 !important; /* Fondo crema */
    color: #2f3740 !important; /* Icono gris oscuro */
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px; /* Bordes redondeados sutiles */
    font-size: 1.1rem;
    margin-right: 8px;
    transition: all 0.3s;
}

.footer-col ul li a:hover i.fa-brands,
.social-circle-btn:hover i.fa-brands {
    background-color: #ffffff !important;
    transform: scale(1.05);
}

/* Limpiar estilos de botones sociales genéricos si están sueltos */
.social-circle-btn {
    background: transparent !important;
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    color: #ddd9cf;
}

.map-container {
    background: transparent;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
}

.map-container img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
}

.map-container iframe {
    width: 100% !important;
    height: 180px !important;
    border-radius: 8px;
    border: none;
}

.reclamaciones-icon {
    font-size: 4.5rem;
    color: #ffffff;
    display: block;
    text-align: center;
    margin-top: 10px;
    transition: transform 0.3s;
}

.reclamaciones-icon:hover {
    transform: scale(1.05);
}

/* Barra de Copyright con la delgada línea dorada encima */
.copyright-bar {
    border-top: 1px solid rgba(212, 175, 55, 0.4); 
    margin-top: 40px;
    padding-top: 20px;
    padding-bottom: 20px;
    font-size: 0.85rem;
    color: #ddd9cf;
    text-align: center;
}

.copyright-bar-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.copyright-links a {
    color: #ddd9cf;
    text-decoration: none;
    font-size: 0.85rem;
    margin-left: 15px;
    transition: color 0.2s;
}

.copyright-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Soporte para el texto/enlaces inyectados desde el Panel Admin (Columnas Dinámicas) */
.footer-html-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-html-content li {
    margin-bottom: 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.footer-html-content a, .footer-link-item {
    color: #ddd9cf;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-html-content a:hover, .footer-link-item:hover {
    color: var(--color-gold);
}

/* ========================================= */
/* --- RESPONSIVE FOOTER --- */
/* ========================================= */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .footer-nav .container {
        flex-direction: column;
        gap: 15px;
    }

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

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col ul li {
        justify-content: center;
    }
    
    .copyright-bar-flex {
        flex-direction: column;
        text-align: center;
    }
    
    .copyright-links a {
        margin: 0 10px;
    }
}

/* =========================================================
   CONVENIOS Y ASOCIADOS - BLOQUE GLOBAL
   Solo logos
   ========================================================= */

.global-convenios {
    width: 100%;
    box-sizing: border-box;
    background: #f3efe6;
    border-top: 3px solid #a8874a;
    border-bottom: 1px solid rgba(212, 175, 55, 0.45);
    padding: 25px 20px 28px;
    position: relative;
    z-index: 2;
}

.global-convenios-container {
    width: 100%;
    max-width: 1250px;
    margin: 0 auto;
}

.global-convenios-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 18px;
}

.global-convenios-line {
    height: 1px;
    flex: 1;
    max-width: 250px;
    background: #8f733e;
    opacity: 0.65;
}

.global-convenios-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #222222;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    white-space: nowrap;
}

.global-convenios-title i {
    color: #8f733e;
    font-size: 1.05rem;
}

.global-convenios-slider {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.global-convenios-track {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.global-convenio-item {
    display: none;
    min-width: 0;
    height: 105px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid rgba(31, 41, 55, 0.10);
    border-radius: 8px;
    padding: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.global-convenio-item.global-convenio-visible {
    display: flex;
}

.global-convenio-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.10);
}

.global-convenio-item a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.global-convenio-item img {
    display: block;
    width: 100%;
    height: 75px;
    object-fit: contain;
}

.global-convenio-no-image {
    color: #8f733e;
    font-size: 1.5rem;
}

.global-convenio-arrow {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(31, 41, 55, 0.14);
    border-radius: 50%;
    background: #ffffff;
    color: #222222;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
    transition: all 0.25s ease;
}

.global-convenio-arrow:hover {
    background: #a8874a;
    color: #ffffff;
    border-color: #a8874a;
    transform: scale(1.05);
}

.global-convenios-empty {
    width: 100%;
    min-height: 80px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid rgba(31, 41, 55, 0.10);
    border-radius: 8px;
    color: #625f59666;
    text-align: center;
}

.global-convenios-empty i {
    color: #8f733e;
}

/* =========================================================
   RESPONSIVE - CONVENIOS
   PC: 6
   MÓVIL: 3
   ========================================================= */

@media (max-width: 768px) {

    .global-convenios {
        padding: 20px 12px 22px;
    }

    .global-convenios-header {
        gap: 9px;
        margin-bottom: 14px;
    }

    .global-convenios-line {
        max-width: 70px;
    }

    .global-convenios-title {
        font-size: 0.82rem;
        gap: 6px;
        letter-spacing: 0.2px;
    }

    .global-convenios-title i {
        font-size: 0.9rem;
    }

    .global-convenios-slider {
        gap: 6px;
    }

    .global-convenios-track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    .global-convenio-item {
        height: 82px;
        padding: 8px;
        border-radius: 7px;
    }

    .global-convenio-item img {
        height: 60px;
    }

    .global-convenio-arrow {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {

    .global-convenios {
        padding-left: 8px;
        padding-right: 8px;
    }

    .global-convenios-line {
        display: none;
    }

    .global-convenios-title {
        font-size: 0.78rem;
    }

    .global-convenios-track {
        gap: 5px;
    }

    .global-convenio-item {
        height: 75px;
        padding: 6px;
    }

    .global-convenio-item img {
        height: 52px;
    }

    .global-convenio-arrow {
        flex-basis: 30px;
        width: 30px;
        height: 30px;
    }
}

/* =========================================================
   CORRECCIÓN FINAL DEL FOOTER
   - 4 columnas alineadas
   - El mapa existe SOLO en la columna 4
   - Libro de Reclamaciones arriba
   - Ubicación + mapa debajo
   - Si se oculta el libro, Ubicación sube automáticamente
   ========================================================= */

.footer-content {
    width: 100%;
    box-sizing: border-box;
}

.footer-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
    align-items: start;
}

.footer-col {
    min-width: 0;
    width: 140%;
    box-sizing: border-box;
}

.footer-col > * {
    max-width: 100%;
    box-sizing: border-box;
}

.footer-title {
    line-height: 1.25;
}

.footer-col ul {
    width: 100%;
}

.footer-col ul li {
    min-width: 0;
}

.footer-col ul li span,
.footer-col ul li a {
    min-width: 0;
}

.footer-col-location {
    text-align: center;
}

.footer-claims-block {
    width: 100%;
    margin: 0 0 26px;
    text-align: center;
}

.footer-claims-block .footer-title {
    margin: 0 0 12px !important;
}

.footer-claims-block .reclamaciones-icon {
    margin: 0 auto;
}

.footer-location-block {
    width: 100%;
    margin: 0;
    text-align: center;
}

.footer-location-title {
    margin: 0 0 14px !important;
}

.footer-location-map,
.map-container.footer-location-map {
    width: 100% !important;
    height: var(--footer-map-height, 180px);
    min-height: 0;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    background: transparent;
    box-sizing: border-box;
}

.footer-location-map iframe,
.footer-location-map img,
.map-container.footer-location-map iframe,
.map-container.footer-location-map img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-width: 100%;
    object-fit: cover;
    border: 0 !important;
    border-radius: 8px;
}

.footer-location-map iframe {
    object-fit: initial;
}

.reclamaciones-icon {
    font-size: 3.6rem;
    line-height: 1;
    color: #ffffff;
    display: flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.reclamaciones-icon:hover {
    transform: scale(1.05);
}

.copyright-bar {
    clear: both;
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px 26px;
    }

    .footer-location-map,
    .map-container.footer-location-map {
        height: var(--footer-map-height, 190px);
    }
}

@media (max-width: 768px) {
    .footer-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .footer-col,
    .footer-col-location {
        width: 100%;
        text-align: center;
    }

    .footer-col ul li {
        justify-content: center;
    }

    .footer-location-map,
    .map-container.footer-location-map {
        height: var(--footer-map-height, 220px);
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .footer-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .footer-grid {
        gap: 30px;
    }

    .footer-location-map,
    .map-container.footer-location-map {
        height: var(--footer-map-height, 210px);
    }

    .reclamaciones-icon {
        font-size: 3.2rem;
    }
}



/* =========================================================
   MENÚ SECUNDARIO INFERIOR
   Se muestra entre Convenios y Asociados y el footer principal.
   ========================================================= */

.footer-secondary-menu {
    width: 100%;
    background: #000000;
    color: #ffffff;
    margin: 0;
    padding: 0;
    border: 0;
    position: relative;
    z-index: 3;
}

.footer-secondary-menu-inner {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.footer-secondary-menu-inner a {
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    min-height: 24px;
    padding: 0 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,.85);
    transition: background-color .2s ease, color .2s ease;
}

.footer-secondary-menu-inner a:last-child {
    border-right: 0;
}

.footer-secondary-menu-inner a:hover {
    background: #111111;
    color: #ffffff !important;
}

@media (max-width: 900px) {
    .footer-secondary-menu-inner {
        justify-content: flex-start;
    }

    .footer-secondary-menu-inner a {
        padding: 0 28px;
    }
}

@media (max-width: 600px) {
    .footer-secondary-menu-inner {
        min-height: 52px;
    }

    .footer-secondary-menu-inner a {
        font-size: 13px;
        padding: 0 22px;
    }
}
