/*
 * CAPEMVeL - Cabecera compacta global
 * Divi Theme Builder - Encabezado 873
 *
 * Se aplica exclusivamente cuando el body
 * contiene la clase capemvel-header-compacto.
 */

/* ==========================================
   ESCRITORIO
   ========================================== */

@media screen and (min-width: 981px) {

    body.capemvel-header-compacto .et-l--header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 70px !important;
        z-index: 99999 !important;
        background: #ffffff !important;
        box-shadow: 0 2px 8px rgba(0,0,0,.08);
    }

    body.admin-bar.capemvel-header-compacto .et-l--header {
        top: 32px !important;
    }

    body.capemvel-header-compacto
    .et-l--header .et_pb_section_0_tb_header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        width: 80% !important;
        max-width: 960px !important;
        height: 70px !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        padding: 5px 0 5px 44px !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    /* Logotipo */

    body.capemvel-header-compacto
    .et-l--header .et_pb_row_0_tb_header {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 55px !important;
        width: 55px !important;
        max-width: 55px !important;
        height: 55px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.capemvel-header-compacto
    .et-l--header .et_pb_image_0_tb_header {
        width: 50px !important;
        max-width: 50px !important;
        margin: 0 !important;
    }

    body.capemvel-header-compacto
    .et-l--header .et_pb_image_0_tb_header img {
        display: block !important;
        width: 50px !important;
        height: 50px !important;
        object-fit: contain !important;
    }

    /* Nombre institucional */

    body.capemvel-header-compacto
    .et-l--header .et_pb_row_1_tb_header {
        display: flex !important;
        align-items: center !important;
        flex: 0 0 115px !important;
        width: 115px !important;
        min-width: 115px !important;
        height: 55px !important;
        margin: 0 0 0 12px !important;
        padding: 0 !important;
    }

    body.capemvel-header-compacto
    .et-l--header .et_pb_row_1_tb_header .et_pb_text {
        display: none !important;
    }

    body.capemvel-header-compacto
    .et-l--header .et_pb_row_1_tb_header::before {
        content: "CAPEMVeL";
        display: block !important;
        color: #288b4a !important;
        font-size: 17px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
    }

    /* Navegación */

    body.capemvel-header-compacto
    .et-l--header .et_pb_row_2_tb_header {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        height: auto !important;
        margin: 0 0 0 auto !important;
        padding: 0 !important;
    }

    body.capemvel-header-compacto
    .et-l--header .et_pb_menu_0_tb_header {
        width: 100% !important;
        margin: 0 !important;
    }
}

/* ==========================================
   MÓVILES Y TABLETAS
   ========================================== */

@media screen and (max-width: 980px) {

    body.capemvel-header-compacto .et-l--header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 60px !important;
        z-index: 99999 !important;
        background: #ffffff !important;
        box-shadow: 0 2px 8px rgba(0,0,0,.08);
    }

    body.admin-bar.capemvel-header-compacto .et-l--header {
        top: 32px !important;
    }

    body.capemvel-header-compacto
    .et-l--header .et_pb_section_0_tb_header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        width: 94% !important;
        max-width: none !important;
        height: 60px !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* Logotipo */

    body.capemvel-header-compacto
    .et-l--header .et_pb_row_0_tb_header {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 46px !important;
        width: 46px !important;
        max-width: 46px !important;
        height: 50px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.capemvel-header-compacto
    .et-l--header .et_pb_image_0_tb_header {
        width: 42px !important;
        max-width: 42px !important;
        margin: 0 !important;
    }

    body.capemvel-header-compacto
    .et-l--header .et_pb_image_0_tb_header img {
        display: block !important;
        width: 42px !important;
        height: 42px !important;
        object-fit: contain !important;
    }

    /* Nombre institucional */

    body.capemvel-header-compacto
    .et-l--header .et_pb_row_1_tb_header {
        display: flex !important;
        align-items: center !important;
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 0 !important;
        height: 50px !important;
        margin: 0 0 0 8px !important;
        padding: 0 !important;
    }

    body.capemvel-header-compacto
    .et-l--header .et_pb_row_1_tb_header .et_pb_text {
        display: none !important;
    }

    body.capemvel-header-compacto
    .et-l--header .et_pb_row_1_tb_header::before {
        content: "CAPEMVeL";
        display: block !important;
        color: #288b4a !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
    }

    /* Menú hamburguesa */

    body.capemvel-header-compacto
    .et-l--header .et_pb_row_2_tb_header {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        height: 50px !important;
        margin: 0 0 0 auto !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    body.capemvel-header-compacto
    .et-l--header .et_pb_menu_0_tb_header {
        width: auto !important;
        margin: 0 !important;
    }

    /* Alinear hamburguesa a la derecha */

    body.capemvel-header-compacto
    .et-l--header .et_pb_menu_0_tb_header
    .et_mobile_nav_menu {
        display: flex !important;
        justify-content: flex-end !important;
        width: 100% !important;
    }

    body.capemvel-header-compacto
    .et-l--header .et_mobile_menu {
        position: absolute !important;
        top: 100% !important;
        left: auto !important;
        right: 0 !important;
        width: min(90vw, 360px) !important;
        max-height: calc(100dvh - 70px) !important;
        overflow-y: auto !important;
        background: #ffffff !important;
        z-index: 100000 !important;
    }
}

/* Barra de administración en teléfonos */

@media screen and (max-width: 782px) {

    body.admin-bar.capemvel-header-compacto .et-l--header {
        top: 46px !important;
    }
}


/* CAPEMVeL - Cabecera original siempre visible */

body:not(.capemvel-header-compacto) .et-l--header {
    position: sticky !important;
    top: 0 !important;
    z-index: 99999 !important;
}

body.admin-bar:not(.capemvel-header-compacto) .et-l--header {
    top: 32px !important;
}

@media screen and (max-width: 782px) {
    body.admin-bar:not(.capemvel-header-compacto) .et-l--header {
        top: 46px !important;
    }
}


/* CAPEMVeL - Ventanas exclusivas de consulta documental */

@media screen {

    body.capemvel-ventana-documental
    .et-l--header .et_pb_menu_0_tb_header {
        display: none !important;
    }

    body.capemvel-ventana-documental
    .et-l--header .et_pb_row_0_tb_header a {
        cursor: default !important;
        pointer-events: none !important;
    }

    body.capemvel-ventana-documental
    .et-l--header .et_pb_row_2_tb_header {
        justify-content: flex-end !important;
        align-items: center !important;
    }

    body.capemvel-ventana-documental
    .capemvel-cerrar-documento {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 15px;
        border: 1px solid #288b4a;
        border-radius: 4px;
        background: #ffffff;
        color: #288b4a;
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;
        transition: background-color .2s, color .2s;
    }

    body.capemvel-ventana-documental
    .capemvel-cerrar-documento:hover {
        background: #288b4a;
        color: #ffffff;
    }

    body.capemvel-ventana-documental
    .capemvel-ficha-encabezado {
        padding-top: 15px;
    }

}


/* CAPEMVeL - Ocultar navegacion inferior en ventanas documentales */

@media screen {

    body.single-documento.capemvel-ventana-documental
    .capemvel-ficha-navegacion {
        display: none !important;
    }

}
