/* FOOTER STYLES - VERSIÓN FINAL QUE SÍ FUNCIONA EN MÓVIL */

.site-footer {
    background: #2c2c2c !important;
    color: #f5f5f5 !important;
    padding: 10px 0 !important;
    font-family: 'Inter', 'Roboto', sans-serif !important;
    margin: 0 !important;
    position: relative !important;
    z-index: 999 !important;
    clear: both !important;
    width: 100% !important;
}

.footer-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 40px !important;
    box-sizing: border-box !important;
    width: auto !important;
}

.footer-links {
    margin: 6px 0 4px !important;
    padding: 4px 0 !important;
}

.footer-links-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    gap: 2px 10px !important;
    line-height: 1.05 !important;
    padding: 0 !important;
}

.footer-links-container a {
    color: #f89404 !important;
    text-decoration: none !important;
    font-size: 12px !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    display: block !important;
    text-align: center !important;
    line-height: 1.05 !important;
}

.footer-links-container a:hover {
    color: #fff !important;
    background: rgba(248, 148, 4, 0.15) !important;
    transform: translateY(-1px) !important;
}

.footer-bottom {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    gap: 15px !important;
    align-items: center !important;
    padding-top: 6px !important;
    margin-top: 4px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.footer-info {
    font-size: 12px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

.footer-info p {
    margin: 0 0 1px 0 !important;
    color: #ccc !important;
}

.footer-info a {
    color: #f89404 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.footer-info a:hover {
    color: #fff !important;
    text-decoration: underline !important;
}

.footer-map {
    justify-self: center !important;
    width: 100% !important;
    max-width: 400px !important;
    min-width: 200px !important;
    height: 80px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

.footer-map iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

.footer-right {
    justify-self: end !important;
    text-align: right !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 2px !important;
    white-space: nowrap !important;
}

.social-links {
    display: flex !important;
    gap: 6px !important;
    margin-bottom: 2px !important;
}

.social-links a {
    color: #f89404 !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.social-links a:hover {
    color: #fff !important;
    transform: scale(1.1) !important;
}

.copyright-text {
    color: #ccc !important;
    font-size: 9px !important;
    margin-bottom: 1px !important;
}

.copy-links {
    font-size: 9px !important;
}

.copy-links a {
    color: #f89404 !important;
    text-decoration: none !important;
    margin: 0 2px !important;
    transition: color 0.3s ease !important;
}

.copy-links a:hover {
    color: #fff !important;
}

.copy-links .separator {
    color: #555 !important;
    margin: 0 2px !important;
}

/* ========== TABLET ========== */
@media (max-width: 1024px) {
    .footer-container {
        padding: 0 25px !important;
    }
    
    .footer-links-container a {
        font-size: 11px !important;
    }
    
    .footer-bottom {
        gap: 12px !important;
    }
}

/* ========== MÓVIL 768px - AQUÍ ESTÁ EL FIX PRINCIPAL ========== */
@media (max-width: 768px) {
    .site-footer {
        padding: 6px 0 !important;
    }
    
    .footer-container {
        padding: 0 20px !important;
    }
    
    .footer-links {
        padding: 2px 0 !important;
        margin: 3px 0 2px !important;
    }
    
    /* 4 COLUMNAS en móvil */
    .footer-links-container {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1px 3px !important;
    }
    
    .footer-links-container a {
        font-size: 9px !important;
        padding: 2px 1px !important;
        line-height: 1.1 !important;
        min-height: 24px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* SECCIÓN INFERIOR EN COLUMNA */
    .footer-bottom {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        text-align: center !important;
        padding-top: 3px !important;
    }
    
    /* CONTACTO MÁS PEQUEÑO */
    .footer-info {
        text-align: center !important;
        white-space: normal !important;
        font-size: 9px !important;
        line-height: 1.2 !important;
    }
    
    .footer-info p {
        margin: 0 0 2px 0 !important;
    }
    
    /* MAPA MÁS PEQUEÑO */
    .footer-map {
        width: 160px !important;
        height: 40px !important;
        margin: 0 auto !important;
        justify-self: center !important;
    }
    
    /* REDES Y COPYRIGHT */
    .footer-right {
        text-align: center !important;
        align-items: center !important;
    }
    
    .social-links {
        justify-content: center !important;
        gap: 4px !important;
    }
    
    .social-links a {
        font-size: 11px !important;
        width: 14px !important;
        height: 14px !important;
    }
    
    .copyright-text {
        font-size: 7px !important;
    }
    
    .copy-links {
        font-size: 7px !important;
    }
}

/* ========== MÓVIL PEQUEÑO 480px ========== */
@media (max-width: 480px) {
    .footer-container {
        padding: 0 15px !important;
    }
    
    .footer-links {
        padding: 1px 0 !important;
        margin: 2px 0 1px !important;
    }
    
    /* 5 COLUMNAS para máxima compresión */
    .footer-links-container {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 1px 2px !important;
    }
    
    .footer-links-container a {
        font-size: 8px !important;
        padding: 1px !important;
        line-height: 1 !important;
        min-height: 20px !important;
    }
    
    .footer-bottom {
        gap: 6px !important;
    }
    
    /* CONTACTO EXTRA PEQUEÑO */
    .footer-info {
        font-size: 8px !important;
        line-height: 1.1 !important;
    }
    
    .footer-info p {
        margin: 0 0 1px 0 !important;
    }
    
    /* MAPA MUY PEQUEÑO */
    .footer-map {
        width: 140px !important;
        height: 35px !important;
    }
    
    .social-links {
        gap: 3px !important;
    }
    
    .social-links a {
        font-size: 9px !important;
        width: 12px !important;
        height: 12px !important;
    }
    
    .copyright-text {
        font-size: 6px !important;
    }
    
    .copy-links {
        font-size: 6px !important;
    }
}

/* ========== DESKTOP - MANTENER IGUAL ========== */
@media (min-width: 992px) {
    .footer-links {
        padding: 4px 0 !important;
        margin: 6px 0 4px !important;
    }
    
    .footer-links-container {
        display: grid !important;
        grid-template-rows: repeat(2, auto) !important;
        grid-auto-flow: column dense !important;
        grid-auto-columns: minmax(0, 1fr) !important;
        justify-content: stretch !important;
        align-content: start !important;
        column-gap: clamp(6px, 0.6vw, 12px) !important;
        row-gap: 4px !important;
        max-width: 100% !important;
    }
    
    .footer-links-container a {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        font-size: clamp(10px, 0.70vw, 11px) !important;
        line-height: 1.12 !important;
        padding: 2px 4px !important;
        text-align: center !important;
    }
    
    .footer-bottom {
        gap: clamp(6px, 0.6vw, 12px) !important;
        max-width: 100% !important;
    }
}

@media (min-width: 1400px) {
    .footer-container {
        padding: 0 40px !important;
        width: auto !important;
    }
    
    .footer-links-container {
        display: grid !important;
        grid-template-rows: repeat(2, auto) !important;
        grid-auto-flow: column dense !important;
        grid-auto-columns: max-content !important;
        justify-content: center !important;
        column-gap: clamp(3px, 0.4vw, 6px) !important;
        row-gap: 2px !important;
        max-width: 100% !important;
    }
    
    .footer-links-container a {
        white-space: nowrap !important;
        font-size: clamp(9px, 0.65vw, 11px) !important;
        line-height: 1.1 !important;
        padding: 0 !important;
        margin: 0 !important;
        text-overflow: clip !important;
        overflow: visible !important;
    }
}

@media (min-width: 992px) and (max-width: 1399px) {
    .footer-links-container {
        display: grid !important;
        grid-template-rows: repeat(3, auto) !important;
        grid-auto-flow: column dense !important;
        grid-auto-columns: max-content !important;
        justify-content: center !important;
        column-gap: clamp(3px, 0.35vw, 6px) !important;
        row-gap: 2px !important;
    }
    
    .footer-links-container a {
        white-space: nowrap !important;
        font-size: clamp(9px, 0.65vw, 11px) !important;
        line-height: 1.1 !important;
        padding: 0 !important;
        margin: 0 !important;
        text-overflow: clip !important;
        overflow: visible !important;
    }
}

/* ========== ASEGURAR VISIBILIDAD ========== */
.site-footer,
.footer-container,
.footer-links,
.footer-bottom {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.social-links {
    display: flex !important;
}

.footer-bottom {
    display: grid !important;
}

body.home .site-footer {
    margin-top: 0 !important;
}

body.home .site-footer * {
    box-sizing: border-box !important;
}

/* ========== NEUTRALIZAR CONFLICTOS ========== */
@media (min-width: 1400px),
       (max-width: 1200px),
       (max-width: 1024px),
       (max-width: 768px),
       (max-width: 480px) {
    .footer-container {
        width: auto !important;
    }
}

@media (min-width: 992px) {
    .footer-links-container {
        grid-template-columns: unset !important;
    }
}

@media (min-width: 1200px) {
    .footer-links-container {
        grid-template-columns: unset !important;
    }
}

@media (min-width: 1400px) {
    .footer-links-container {
        grid-template-columns: unset !important;
    }
}

/* ========== PREVENIR CONFLICTOS CON OTROS CSS ========== */
.footer-container,
.footer-links,
.footer-links-container,
.footer-bottom {
    overflow: hidden !important;
    max-width: 100% !important;
}

/* ========== MEJORAR EXPERIENCIA MÓVIL ========== */
@media (max-width: 768px) {
    .footer-links-container a {
        border: 1px solid transparent !important;
        transition: all 0.2s ease !important;
    }
    
    .footer-links-container a:hover,
    .footer-links-container a:focus {
        border-color: rgba(248, 148, 4, 0.3) !important;
        background: rgba(248, 148, 4, 0.1) !important;
    }
    
    .footer-info,
    .copyright-text,
    .copy-links {
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
    }
}

/* ========== FIX PARA CARACTERES ESPECIALES ========== */
.footer-links-container a {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}
/* ===== Contenedor para la franja inferior del footer ===== */
/* En desktop la limitamos a 1200 como la parte superior */
@media (min-width: 1200px){
  .site-footer .footer-bottom{
    max-width: 1200px !important;
    margin: 0 auto !important;      /* centra el bloque */
    padding-left: 40px !important;   /* mismo padding que .footer-container */
    padding-right: 40px !important;
    box-sizing: border-box !important;
  }
}

/* En pantallas menores se mantiene responsive a 100% (no tocamos nada) */
/* ===== Orden móvil pequeño (≤420px) ===== */
@media (max-width: 420px){

  /* Menú de enlaces: 2 columnas, alineado a la izquierda y más aire */
  .footer-links{ 
    border-top: 1px solid rgba(255,255,255,.08) !important;
    padding-top: 6px !important;
    margin-top: 6px !important;
  }
  .footer-links-container{
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 6px 10px !important;
    justify-items: start !important;
  }
  .footer-links-container a{
    text-align: left !important;
    white-space: normal !important;
    line-height: 1.25 !important;
    padding: 4px 6px !important;
    font-size: 11px !important;     /* un poco mayor para legibilidad */
  }

  /* Franja inferior: todo en columna y alineado a la izquierda */
  .footer-bottom{
    grid-template-columns: 1fr !important;
    row-gap: 10px !important;
    text-align: left !important;
    padding-top: 6px !important;
  }

  /* Bloque de contacto más legible y sin desbordes */
  .footer-info{
    font-size: 12px !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    text-align: left !important;
  }
  .footer-info p{ margin: 2px 0 !important; }

  /* Mapa centrado y más ancho/alto dentro del contenedor */
  .footer-map{
    width: 100% !important;
    max-width: 320px !important;
    height: 120px !important;
    margin: 6px auto !important;
  }

  /* Redes y copyright bajo el mapa, alineados a la izq. y táctiles */
  .footer-right{
    align-items: flex-start !important;
    text-align: left !important;
  }
  .social-links a{
    width: 24px !important;
    height: 24px !important;
    font-size: 14px !important;
  }
  .copyright-text{ font-size: 8.5px !important; }
  .copy-links{ font-size: 8.5px !important; }
}
/* ==== Redes sociales al fondo, centradas (todas las vistas) ==== */

/* MÓVIL / TABLET: el bloque de redes va el último y centrado */
@media (max-width: 768px){
  .footer-bottom{
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  /* Orden: contacto -> mapa -> copyright -> legal -> redes (al final) */
  .footer-info{ order: 1 !important; text-align: center !important; }
  .footer-map{ order: 2 !important; }
  .footer-right{ order: 3 !important; align-items: center !important; text-align: center !important; }
  .copyright-text{ order: 1 !important; }
  .copy-links{ order: 2 !important; }
  .social-links{
    order: 99 !important;                     /* SIEMPRE al final */
    align-self: center !important;
    justify-content: center !important;
    gap: 10px !important;
  }
}

/* DESKTOP: fila superior con contacto/mapa/copyright y
   SEGUNDA FILA solo para redes sociales centradas */
@media (min-width: 992px){
  .footer-bottom{
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    grid-template-areas:
      "info map copy"
      "social social social" !important;
    align-items: center !important;
    row-gap: 10px !important;
    column-gap: 24px !important;
  }

  /* Hacemos que los hijos de .footer-right participen en la grid del padre */
  .footer-right{ display: contents !important; }

  /* Asignación de áreas */
  .footer-info{ grid-area: info !important; justify-self: start !important; text-align: left !important; }
  .footer-map{  grid-area: map  !important; justify-self: center !important; }
  .copyright-text,
  .copy-links{  grid-area: copy !important; justify-self: end !important; text-align: right !important; }

  /* Redes sociales: fila inferior, centradas y en una sola línea */
  .social-links{
    grid-area: social !important;
    justify-self: center !important;
    margin-top: 6px !important;
  }
}

/* Ajuste de tamaños opcional (puedes tocarlo a tu gusto) */
@media (min-width: 992px){
  .footer-map{
    max-width: 460px !important;
    height: 110px !important;
  }
}
/* === Override: redes en la columna derecha (desktop) === */
@media (min-width: 992px){
  .footer-bottom{
    /* 3 columnas: info | mapa | derecha */
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    grid-template-areas: "info map right" !important;
    row-gap: 8px !important;
    column-gap: 24px !important;
  }

  /* Volvemos a tratar .footer-right como un bloque de la 3ª columna */
  .footer-right{
    grid-area: right !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    text-align: right !important;
    justify-self: end !important;
  }

  /* Asignación de las otras áreas */
  .footer-info{ grid-area: info !important; justify-self: start !important; text-align: left !important; }
  .footer-map{  grid-area: map  !important; justify-self: center !important; }

  /* Redes arriba dentro de la columna derecha */
  .social-links{
    order: 0 !important;
    justify-content: flex-end !important;
    margin: 0 0 6px 0 !important;
  }

  /* Copyright y enlaces legales debajo, a la derecha */
  .copyright-text,
  .copy-links{
    order: 1 !important;
    text-align: right !important;
    justify-self: end !important;
  }
}

/* Anula reglas anteriores que mandaban las redes a la fila 2 centradas */
@media (min-width: 992px){
  .footer-right{ display: flex !important; }   /* cancela display: contents */
  .social-links{ grid-area: unset !important; }
}
/* ========== SEO HÍBRIDO - AÑADIR AL FINAL DE footer-styles.css ========== */
/* Oculta visualmente el texto SEO pero Google lo lee */
.footer-links-container a .seo-hidden,
.site-footer .footer-links-container a .seo-hidden,
.site-footer .footer-container .footer-links-container a .seo-hidden,
span.seo-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    display: inline !important;
    font-size: 0 !important;
    line-height: 0 !important;
    visibility: visible !important; /* Importante: visible para Google */
}