/*
 * Herramientas 1.0.0
 * Menú compartido de acciones para presentación flotante o integrada en paneles.
 */
.gmx-herramientas {
    --gmx-herramientas-azul: #12214a;
    --gmx-herramientas-verde: #1f8a5b;
    --gmx-herramientas-borde: #d8e0ec;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    font-family: inherit;
}

.gmx-herramientas--flotantes {
    position: absolute;
    right: 1rem;
    z-index: 1000;
}

.gmx-herramientas--integradas {
    position: relative;
    flex: 0 0 auto;
    margin-left: 2px;
}

.gmx-herramientas-desplegar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(18, 33, 74, .18);
    border-radius: 50%;
    outline: 0;
    color: #fff;
    background: var(--gmx-herramientas-azul);
    box-shadow: 0 3px 9px rgba(18, 33, 74, .24);
    transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.gmx-herramientas-desplegar:hover,
.gmx-herramientas-desplegar:focus,
.gmx-herramientas.open > .gmx-herramientas-desplegar {
    color: #fff;
    background: var(--gmx-herramientas-verde);
    border-color: #4ed89a;
    box-shadow: 0 0 0 3px rgba(31, 138, 91, .24), 0 8px 18px rgba(18, 33, 74, .34);
    transform: translateY(-2px) scale(1.08);
}

.gmx-herramientas-desplegar:focus-visible {
    outline: 3px solid rgba(31, 138, 91, .28);
    outline-offset: 3px;
}

.gmx-herramientas-desplegar .fa {
    font-size: 14px;
    line-height: 1;
    transition: transform .16s ease;
}

.gmx-herramientas-desplegar:hover .fa,
.gmx-herramientas-desplegar:focus .fa,
.gmx-herramientas.open > .gmx-herramientas-desplegar .fa {
    transform: rotate(90deg) scale(1.12);
}

.gmx-herramientas-menu.dropdown-menu {
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 270px;
    max-height: calc(100vh - 120px);
    margin: 0;
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--gmx-herramientas-borde);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(18, 33, 74, .14);
}

@media (hover: hover) and (pointer: fine) {
    .gmx-herramientas > .gmx-herramientas-menu.dropdown-menu {
        display: block;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-4px);
        transition: opacity .14s ease .18s, transform .14s ease .18s, visibility 0s linear .32s;
    }

    .gmx-herramientas::after {
        position: absolute;
        top: calc(100% - 4px);
        right: -8px;
        z-index: 999;
        width: 286px;
        height: 28px;
        content: "";
        pointer-events: none;
    }

    .gmx-herramientas:hover::after,
    .gmx-herramientas:focus-within::after {
        pointer-events: auto;
    }

    .gmx-herramientas:hover > .gmx-herramientas-desplegar {
        color: #fff;
        background: var(--gmx-herramientas-verde);
        border-color: #4ed89a;
        box-shadow: 0 0 0 3px rgba(31, 138, 91, .24), 0 8px 18px rgba(18, 33, 74, .34);
        transform: translateY(-2px) scale(1.08);
    }

    .gmx-herramientas:hover > .gmx-herramientas-desplegar .fa {
        transform: rotate(90deg) scale(1.12);
    }

    .gmx-herramientas:hover > .gmx-herramientas-menu.dropdown-menu,
    .gmx-herramientas:focus-within > .gmx-herramientas-menu.dropdown-menu,
    .gmx-herramientas.open > .gmx-herramientas-menu.dropdown-menu {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0s;
    }
}

.gmx-herramientas-menu > li {
    margin: 0;
    padding: 0;
}

.gmx-herramientas-menu > li > .gmx-herramientas-opcion {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    padding: 9px 10px;
    border-radius: 5px;
    color: var(--gmx-herramientas-azul);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;
    white-space: normal;
    transition: color .1s ease, background-color .1s ease, box-shadow .1s ease;
}

.gmx-herramientas-menu > li > .gmx-herramientas-opcion:hover,
.gmx-herramientas-menu > li > .gmx-herramientas-opcion:focus {
    color: var(--gmx-herramientas-azul);
    background: rgba(31, 138, 91, .09);
    box-shadow: inset 3px 0 0 var(--gmx-herramientas-verde);
    outline: 0;
    text-decoration: none;
}

.gmx-herramientas-icono {
    display: inline-flex;
    flex: 0 0 20px;
    align-items: center;
    justify-content: center;
    width: 20px;
    color: #51617f;
}

.gmx-herramientas-icono > i {
    width: auto;
    height: auto;
    font-size: 14px !important;
    line-height: 1 !important;
}

.gmx-herramientas-opcion:hover .gmx-herramientas-icono,
.gmx-herramientas-opcion:focus .gmx-herramientas-icono {
    color: var(--gmx-herramientas-verde);
}

.gmx-herramientas-descripcion {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    .gmx-herramientas-menu.dropdown-menu {
        min-width: min(270px, calc(100vw - 32px));
        max-width: calc(100vw - 32px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gmx-herramientas-desplegar,
    .gmx-herramientas-desplegar .fa,
    .gmx-herramientas-menu > li > .gmx-herramientas-opcion {
        transition: none;
    }
}
