/**
 * DIBA 2025 - HEADER LOGOS
 * 
 * Arquitectura: Selectores específicos para evitar !important
 * Base → Tablet → Mobile (mobile-first approach)
 */

/* ========================================
   BASE - DESKTOP
   ======================================== */

#top_logo {
    padding: 30px 0;
}

#top_logo .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
    align-items: center;
}

#top_logo .col-6,
#top_logo .col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-left: 15px;
    padding-right: 15px;
    display: flex;
    align-items: center;
}

#top_logo .col-6:first-child,
#top_logo .col-sm-6:first-child {
    justify-content: flex-start;
}

#top_logo .col-6:last-child,
#top_logo .col-sm-6:last-child {
    justify-content: flex-end;
}

#top_logo a {
    display: inline-block;
    line-height: 0;
}

#top_logo img {
    height: auto;
    width: auto;
    vertical-align: middle;
}

/* Alturas específicas por logo */
#top_logo .col-6:first-child img,
#top_logo .col-sm-6:first-child img {
    height: 50px;
}

#top_logo .col-6:last-child img,
#top_logo .col-sm-6:last-child img {
    height: 35px;
}

/* ========================================
   TABLET (768px - 991px)
   ======================================== */

@media (max-width: 991px) and (min-width: 768px) {
    #top_logo {
        padding: 20px 0;
    }
    
    #top_logo .col-6:first-child img,
    #top_logo .col-sm-6:first-child img {
        height: 45px;
    }
    
    #top_logo .col-6:last-child img,
    #top_logo .col-sm-6:last-child img {
        height: 32px;
    }
}

/* ========================================
   MOBILE (<768px)
   Arquitectura: body.diba #top_logo para especificidad
   ======================================== */

@media (max-width: 767px) {
    body.diba #top_logo {
        padding: 24px 15px;
        text-align: center;
    }
    
    body.diba #top_logo .row {
        display: block;
        text-align: center;
        margin: 0;
    }
    
    /* Columnas full-width y centradas */
    body.diba #top_logo .col-6,
    body.diba #top_logo .col-sm-6,
    body.diba #top_logo .logo,
    body.diba #top_logo .alright {
        flex: none;
        max-width: 100%;
        width: 100%;
        display: block;
        text-align: center;
        justify-content: center;
        float: none;
        padding: 0;
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Espacio entre logos */
    body.diba #top_logo .col-6:first-child,
    body.diba #top_logo .col-sm-6:first-child,
    body.diba #top_logo .logo {
        margin-bottom: 16px;
    }
    
    /* Enlaces centrados sin float */
    body.diba #top_logo a.float-left,
    body.diba #top_logo a.float-right,
    body.diba #top_logo a {
        float: none;
        display: inline-block;
        text-align: center;
        margin: 0 auto;
    }
    
    /* Alturas mobile - Imágenes centradas */
    body.diba #top_logo img {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 0 auto;
    }
    
    body.diba #top_logo .col-6:first-child img,
    body.diba #top_logo .col-sm-6:first-child img,
    body.diba #top_logo .logo img {
        height: 50px;
        max-height: 50px;
    }
    
    body.diba #top_logo .col-6:last-child img,
    body.diba #top_logo .col-sm-6:last-child img,
    body.diba #top_logo .alright img {
        height: 35px;
        max-height: 35px;
    }
    
    /* Centrado específico en mobile */
    body.diba #top_logo .logo,
    body.diba #top_logo .alright {
        text-align: center;
        justify-content: center;
    }
    
    body.diba #top_logo .logo img,
    body.diba #top_logo .alright img {
        float: none;
    }
    
    body.diba #top_logo .alright {
        margin-top: 16px;
    }
}

/* ========================================
   MOBILE EXTRA SMALL (<576px)
   ======================================== */

@media (max-width: 575px) {
    body.diba #top_logo .col-6:first-child img,
    body.diba #top_logo .col-sm-6:first-child img,
    body.diba #top_logo .logo img {
        height: 45px;
        max-height: 45px;
    }
    
    body.diba #top_logo .col-6:last-child img,
    body.diba #top_logo .col-sm-6:last-child img,
    body.diba #top_logo .alright img {
        height: 30px;
        max-height: 30px;
    }
}
