/* Contenedor flotante */
.mali-sede-container {
    position: fixed;
    bottom: 225px; /* Ajusta la posición vertical según sea necesario IMPORTANTE */
    right: 15px;
    transform: translateY(-50%);
    z-index: 99999;
}

.mali-sede-wrapper {
    position: relative;
    display: inline-block;
}

/* Fuentes BentonSansFB (si usas las fuentes propias dentro del plugin) */
@font-face {
    font-family: 'BentonSansFB';
    src: url('../fonts/BentonSansFB-Book.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BentonSansFB';
    src: url('../fonts/BentonSansFB-BookOblique.woff2') format('woff2');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'BentonSansFB';
    src: url('../fonts/BentonSansFB-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'BentonSansFB';
    src: url('../fonts/BentonSansFB-BoldOblique.woff2') format('woff2');
    font-weight: bold;
    font-style: italic;
}

/* Botón */
.mali-btn {
    position: relative;
    outline: 0;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    background: #702082;
    width: 100%;
    border: 0;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    color: #FFFFFF;
    font-family: 'BentonSansFB', sans-serif;
    font-size: 14px;
    letter-spacing: 1.2px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: visible;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Variante circular */
.mali-btn-circle {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
}

.mali-btn-circle .material-icons {
    font-size: 24px;
}

/* Ocultar visualmente el texto pero mantener accesibilidad */
.mali-btn-circle .mali-btn-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.mali-btn:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.mali-btn:active {
    transform: translateY(0);
}

.mali-btn-text {
    flex: 1;
    text-align: left;
}

/* Tooltip globo lateral */
.mali-tooltip-sede {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-110%, -50%);
    background: #FFFFFF;
    color: #702082;
    border: 0px solid #d9d9d9;
    padding: 8px 14px;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    font-family: 'BentonSansFB', sans-serif;
    white-space: nowrap;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 500;
}

.mali-tooltip-sede::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #FFFFFF;
    border: 0px solid #d9d9d9;
    border-left: none;
    border-bottom: none;
    transform: translateY(-50%) rotate(225deg);
    box-shadow: 0 0px 4px rgba(0,0,0,0.06);
}

.mali-tooltip-sede.mali-hidden {
    opacity: 0;
    transform: translate(-110%, -50%) scale(.95);
    pointer-events: none;
}

.mali-btn .material-icons {
    border-radius: 100%;
    animation: mali-ripple 0.6s linear infinite;
    font-size: 20px;
}

/* Dropdown */
.mali-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #FFFFFF;
    width: 100%;
    max-height: 250px; /* Altura máxima con scroll IMPORTANTE */
    overflow-y: auto;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 100000;
}

/* Dropdown específico para botón circular */
.mali-btn-circle .mali-dropdown {
    width: 280px;
    left: auto;
    right: 0;
    top: auto;
    bottom: calc(100% + 10px);
    transform: translateY(10px);
}

.mali-btn-circle.mali-active .mali-dropdown {
    transform: translateY(0);
}

.mali-dropdown::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #FFFFFF;
    transform: translateX(-50%) rotate(45deg);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.mali-btn-circle .mali-dropdown::before {
    left: auto;
    right: 20px;
    transform: translateX(0) rotate(45deg);
}

.mali-dropdown::-webkit-scrollbar {
    width: 6px;
}

.mali-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 4px 4px 0;
}

.mali-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.mali-dropdown::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.mali-btn.mali-active .mali-dropdown {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mali-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mali-dropdown li {
    background: #FFFFFF;
    transition: background 0.2s ease;
}

.mali-dropdown li:hover {
    background: #F5F5F5;
}

.mali-dropdown li.mali-active {
    background: rgba(83, 128, 247, 0.08);
}

.mali-dropdown li.mali-active a {
    color: #702082;
}

.mali-dropdown li:first-child {
    border-radius: 4px 4px 0 0;
}

.mali-dropdown li:last-child {
    border-radius: 0 0 4px 4px;
}

.mali-dropdown li:last-child a {
    border-bottom: 0;
}

.mali-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 16px 20px;
    color: #666;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mali-dropdown a:hover {
    color: #702082;
}

.mali-sede-icon {
    font-size: 18px;
}

/* Animación ripple */
@keyframes mali-ripple {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.1),
                    0 0 0 20px rgba(255, 255, 255, 0.1),
                    0 0 0 40px rgba(255, 255, 255, 0.1),
                    0 0 0 60px rgba(255, 255, 255, 0.1);
    }
    100% {
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0.1),
                    0 0 0 40px rgba(255, 255, 255, 0.1),
                    0 0 0 60px rgba(255, 255, 255, 0.1),
                    0 0 0 80px rgba(255, 255, 255, 0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .mali-sede-container {
        top: 50%;
        right: 10px;
        transform: translateY(-50%);
    }

    .mali-btn {
        font-size: 13px;
        padding: 14px 16px;
    }

    .mali-btn-circle .mali-dropdown {
        width: 90vw;
        max-width: 320px;
    }

    .mali-dropdown {
        max-height: 60vh;
    }

    .mali-dropdown a {
        padding: 14px 16px;
        font-size: 13px;
    }

    .mali-tooltip-sede {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* Mejoras táctiles para dispositivos móviles */
@media (hover: none) and (pointer: coarse) {
    .mali-btn:active {
        background: #5a1a6a;
    }

    .mali-dropdown li:active {
        background: #e8e8e8;
    }

    .mali-dropdown a:active {
        background: #f0f0f0;
    }
}
