/* Container to group the button halves together */
.split-button-wrapper {
    display: inline-flex;
    position: relative;
}

    /* Override margins for elements inside the wrapper so they sit flush */
    .split-button-wrapper .button {
        margin-right: 0 !important;
    }

    /* The left side (Main action button) */
    .split-button-wrapper .main-action {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        border-right: none; /* Prevents double-border overlapping */
        width: 150px; /* Reduced slightly from 190px to make room for the arrow */
    }

    /* The right side (Dropdown arrow trigger) */
    .split-button-wrapper .dropdown-trigger {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        width: 40px !important;
        padding: 0;
        height: 50px !important;
    }

    .split-button-wrapper [data-title]:hover::after {
        position: absolute;
        display: block;
        width: auto;
        max-width: 20rem;
        content: attr(data-title);
        color: black;
        overflow: visible;
        background: #fff;
        border: 1px solid #eaebec;
        left: auto;
        right: auto;
        top: -25px;
        bottom: auto;
        box-shadow: 0 2px 4px 0 rgba(0,0,0,.28);
        white-space: normal;
        word-wrap: break-word;
    }

.button.white [data-title]:hover {
    color: white;
}

/* CSS pure-drawn down arrow */
.arrow-down {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #66A0E4; /* Matches your theme color */
    transition: transform 0.2s;
}

.split-button-wrapper .dropdown-trigger:hover {
    background: #f4f8fd;
}

.split-button-wrapper .button.mail,
.split-button-wrapper .button.save,
.split-button-wrapper .button.print {
    height: 50px !important;
    width: 240px !important;
}

.split-button-wrapper .button.mail::before,
.split-button-wrapper .button.save::before,
.split-button-wrapper .button.print::before {
    margin-right: 5px !important;
    margin-left: 10px !important;
}

/* The actual dropdown flyout menu options */
.split-dropdown-menu {
    display: none; /* Hidden by default */
    position: absolute;
    top: 52px; /* Places it exactly below the 50px height button + 2px border */
    right: 0;
    background-color: #ffffff;
    min-width: 240px;
    border: 2px solid #66A0E4;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

    /* Individual dropdown options */
    .split-dropdown-menu .menu-item {
        padding: 12px 16px;
        font-size: 14px;
        font-weight: bold;
        color: #66A0E4;
        cursor: pointer;
        text-align: left;
        transition: background 0.2s;
    }

        .split-dropdown-menu .menu-item:hover {
            background-color: #66A0E4;
            color: #ffffff;
        }

    /* Helper utility class to show the menu via JS */
    .split-dropdown-menu.show {
        display: block;
    }
